Search in sources :

Example 1 with CustomTextView

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);
}
Also used : IMultiQuestionView(org.eyeseetea.malariacare.views.question.IMultiQuestionView) ImageView(android.widget.ImageView) CustomTextView(org.eyeseetea.sdk.presentation.views.CustomTextView) AOptionQuestionView(org.eyeseetea.malariacare.views.question.AOptionQuestionView) View(android.view.View) IImageQuestionView(org.eyeseetea.malariacare.views.question.IImageQuestionView) IQuestionView(org.eyeseetea.malariacare.views.question.IQuestionView)

Example 2 with CustomTextView

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());
    }
}
Also used : INavigationQuestionView(org.eyeseetea.malariacare.views.question.INavigationQuestionView) CustomTextView(org.eyeseetea.sdk.presentation.views.CustomTextView)

Example 3 with CustomTextView

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));
}
Also used : CustomTextView(org.eyeseetea.sdk.presentation.views.CustomTextView)

Example 4 with CustomTextView

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);
}
Also used : CustomTextView(org.eyeseetea.sdk.presentation.views.CustomTextView)

Example 5 with CustomTextView

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;
}
Also used : CustomTextView(org.eyeseetea.sdk.presentation.views.CustomTextView) Typeface(android.graphics.Typeface) ArrayList(java.util.ArrayList) Question(org.eyeseetea.malariacare.data.database.model.Question) ImageView(android.widget.ImageView) AKeyboardQuestionView(org.eyeseetea.malariacare.views.question.AKeyboardQuestionView) ImageView(android.widget.ImageView) AOptionQuestionView(org.eyeseetea.malariacare.views.question.AOptionQuestionView) View(android.view.View) INavigationQuestionView(org.eyeseetea.malariacare.views.question.INavigationQuestionView) IQuestionView(org.eyeseetea.malariacare.views.question.IQuestionView) ImageRadioButtonSingleQuestionView(org.eyeseetea.malariacare.views.question.singlequestion.ImageRadioButtonSingleQuestionView) CustomTextView(org.eyeseetea.sdk.presentation.views.CustomTextView) ListView(android.widget.ListView) CommonQuestionView(org.eyeseetea.malariacare.views.question.CommonQuestionView) YearSelectorQuestionView(org.eyeseetea.malariacare.views.question.multiquestion.YearSelectorQuestionView) IMultiQuestionView(org.eyeseetea.malariacare.views.question.IMultiQuestionView) IImageQuestionView(org.eyeseetea.malariacare.views.question.IImageQuestionView) ScrollView(android.widget.ScrollView)

Aggregations

CustomTextView (org.eyeseetea.sdk.presentation.views.CustomTextView)13 View (android.view.View)6 ImageView (android.widget.ImageView)5 Option (org.eyeseetea.malariacare.data.database.model.Option)3 AOptionQuestionView (org.eyeseetea.malariacare.views.question.AOptionQuestionView)3 IImageQuestionView (org.eyeseetea.malariacare.views.question.IImageQuestionView)3 IMultiQuestionView (org.eyeseetea.malariacare.views.question.IMultiQuestionView)3 IQuestionView (org.eyeseetea.malariacare.views.question.IQuestionView)3 Typeface (android.graphics.Typeface)2 TextView (android.widget.TextView)2 AKeyboardQuestionView (org.eyeseetea.malariacare.views.question.AKeyboardQuestionView)2 CommonQuestionView (org.eyeseetea.malariacare.views.question.CommonQuestionView)2 INavigationQuestionView (org.eyeseetea.malariacare.views.question.INavigationQuestionView)2 ImageButton (android.widget.ImageButton)1 LinearLayout (android.widget.LinearLayout)1 ListView (android.widget.ListView)1 ScrollView (android.widget.ScrollView)1 DateFormat (java.text.DateFormat)1 ArrayList (java.util.ArrayList)1 Question (org.eyeseetea.malariacare.data.database.model.Question)1