use of org.eyeseetea.sdk.presentation.views.CustomTextView in project pictureapp by EyeSeeTea.
the class RadioButtonMultiQuestionView method init.
private void init(final Context context) {
View view = inflate(context, R.layout.multi_question_radio_button_row, this);
header = (CustomTextView) view.findViewById(R.id.row_header_text);
image = (ImageView) view.findViewById(R.id.question_image_row);
radioGroup = (RadioGroup) view.findViewById(R.id.answer);
}
use of org.eyeseetea.sdk.presentation.views.CustomTextView in project pictureapp by EyeSeeTea.
the class DynamicTabAdapter method setupNavigationByQuestionView.
private void setupNavigationByQuestionView(View rootView, IQuestionView questionView) {
if (questionView instanceof INavigationQuestionView) {
INavigationQuestionView navigationQuestionView = (INavigationQuestionView) questionView;
CustomTextView textNextButton = (CustomTextView) rootView.findViewById(R.id.next_txt);
textNextButton.setText(navigationQuestionView.nextText());
textNextButton.setTextSize(navigationQuestionView.nextTextSize());
}
}
use of org.eyeseetea.sdk.presentation.views.CustomTextView in project pictureapp by EyeSeeTea.
the class DashboardHeaderStrategy method setTitle.
private static void setTitle(View view, int keyId, int titleString) {
CustomTextView title = (CustomTextView) view.findViewById(keyId);
title.setText(view.getContext().getString(titleString));
}
use of org.eyeseetea.sdk.presentation.views.CustomTextView in project pictureapp by EyeSeeTea.
the class AssessmentAdapter method showRDT.
public void showRDT(View rowView, int viewId, String RDTValue) {
CustomTextView rdt = (CustomTextView) rowView.findViewById(viewId);
rdt.setText(RDTValue);
}
use of org.eyeseetea.sdk.presentation.views.CustomTextView in project pictureapp by EyeSeeTea.
the class DynamicTabAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
mMultiQuestionViews.clear();
Validation.init();
// init validation control(used only in multiquestions tabs)
failedValidations = 0;
// Inflate the layout
View rowView = lInflater.inflate(R.layout.dynamic_tab_grid_question, parent, false);
rowView.getLayoutParams().height = parent.getHeight();
rowView.requestLayout();
Question questionItem = (Question) this.getItem(position);
// We get values from DB and put them in Session
if (getMalariaSurvey() != null) {
if (Session.getStockSurvey() != null) {
Session.getStockSurvey().getValuesFromDB();
}
getMalariaSurvey().getValuesFromDB();
} else {
// getView is called.
return convertView;
}
// Question
CustomTextView headerView = (CustomTextView) rowView.findViewById(question);
// Load a font which support Khmer character
Typeface tf = Typeface.createFromAsset(context.getAssets(), "fonts/" + context.getString(R.string.specific_language_font));
headerView.setTypeface(tf);
int tabType = questionItem.getHeader().getTab().getType();
if (Tab.isMultiQuestionTab(tabType) || mDynamicTabAdapterStrategy.isMultiQuestionByVariant(tabType)) {
headerView.setText(questionItem.getHeader().getTab().getInternationalizedName());
} else {
headerView.setText(questionItem.getInternationalizedForm_name());
}
// question image
if (questionItem.getPath() != null && !questionItem.getPath().equals("") && mDynamicTabAdapterStrategy.HasQuestionImageVisibleInHeader(questionItem.getOutput())) {
ImageView imageView = (ImageView) rowView.findViewById(R.id.questionImage);
BaseLayoutUtils.putImageInImageView(questionItem.getInternationalizedPath(), imageView);
imageView.setVisibility(View.VISIBLE);
}
// Progress
ProgressUtils.updateProgressBarStatus(rowView, navigationController.getCurrentPage(), navigationController.getCurrentTotalPages());
List<Question> screenQuestions = new ArrayList<>();
if (isTabScrollable(questionItem, tabType)) {
tableLayout = (TableLayout) rowView.findViewById(R.id.multi_question_options_table);
(rowView.findViewById(R.id.scrolled_table)).setVisibility(View.VISIBLE);
(rowView.findViewById(R.id.no_scrolled_table)).setVisibility(View.GONE);
screenQuestions = mDynamicTabAdapterStrategy.addAdditionalQuestions(tabType, screenQuestions);
if (Tab.isMultiQuestionTab(tabType)) {
screenQuestions = questionItem.getQuestionsByTab(questionItem.getHeader().getTab());
} else if (screenQuestions.size() == 0) {
// not have additionalQuestions(variant dependent) and is not multi question tab
screenQuestions.add(questionItem);
}
mDynamicTabAdapterStrategy.addScrollToSwipeTouchListener(rowView);
} else {
tableLayout = (TableLayout) rowView.findViewById(R.id.dynamic_tab_options_table);
(rowView.findViewById(R.id.no_scrolled_table)).setVisibility(View.VISIBLE);
(rowView.findViewById(R.id.scrolled_table)).setVisibility(View.GONE);
screenQuestions.add(questionItem);
}
navigationButtonHolder = rowView.findViewById(R.id.snackbar);
if (GradleVariantConfig.isButtonNavigationActive()) {
initializeNavigationButtons(navigationButtonHolder);
if (navigationController.getCurrentPage() == 0) {
navigationButtonHolder.findViewById(R.id.back_btn_container).setVisibility(View.GONE);
}
isClicked = false;
}
Log.d(TAG, "Questions in actual tab: " + screenQuestions.size());
swipeTouchListener.clearClickableViews();
for (Question screenQuestion : screenQuestions) {
renderQuestion(rowView, tabType, screenQuestion);
}
rowView.requestLayout();
reloadingQuestionFromInvalidOption = false;
return rowView;
}
Aggregations