Search in sources :

Example 11 with CustomTextView

use of org.eyeseetea.sdk.presentation.views.CustomTextView in project pictureapp by EyeSeeTea.

the class ConfirmCounterSingleCustomViewStrategy method showQuestionText.

public void showQuestionText(Question questionCounter, View rootView) {
    List<Option> questionOptions = questionCounter.getAnswer().getOptions();
    if (questionOptions.get(0) != null) {
        CustomTextView textCard = (CustomTextView) rootView.findViewById(R.id.questionTextRow);
        textCard.setText(getInternationalizedName(questionOptions.get(0).getCode()));
        textCard.setTextSize(questionOptions.get(0).getOptionAttribute().getText_size());
        TextView subTitle = (TextView) rootView.findViewById(R.id.questionSubText);
        subTitle.setText(getInternationalizedName(questionOptions.get(0).getName()));
        subTitle.setTextSize(questionOptions.get(0).getOptionAttribute().getText_size());
    }
}
Also used : CustomTextView(org.eyeseetea.sdk.presentation.views.CustomTextView) Option(org.eyeseetea.malariacare.data.database.model.Option) CustomTextView(org.eyeseetea.sdk.presentation.views.CustomTextView) TextView(android.widget.TextView)

Example 12 with CustomTextView

use of org.eyeseetea.sdk.presentation.views.CustomTextView in project pictureapp by EyeSeeTea.

the class ConfirmCounterSingleCustomViewStrategy method configureNavigationButtons.

public void configureNavigationButtons(final View view, final Option selectedOption, final Question question, Question questionCounter, View rootView) {
    //cancel
    ImageButton previousButton = (ImageButton) rootView.findViewById(R.id.back_btn);
    ((LinearLayout) previousButton.getParent()).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (DynamicTabAdapter.isClicked) {
                Log.d(TAG, "onClick ignored to avoid double click");
                return;
            } else {
                Log.d(TAG, "onClick ignored to avoid double click NOT");
            }
            removeConfirmCounter(v);
            mDynamicTabAdapter.notifyDataSetChanged();
            DynamicTabAdapter.isClicked = false;
        }
    });
    //confirm
    ImageButton nextButton = (ImageButton) rootView.findViewById(R.id.next_btn);
    ((LinearLayout) nextButton.getParent()).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mDynamicTabAdapter.reloadingQuestionFromInvalidOption) {
                Log.d(TAG, "onClick ignored to avoid double click");
                return;
            } else {
                Log.d(TAG, "onClick");
            }
            mDynamicTabAdapter.navigationController.increaseCounterRepetitions(selectedOption);
            removeConfirmCounter(v);
            mDynamicTabAdapter.reloadingQuestionFromInvalidOption = true;
            mDynamicTabAdapter.saveOptionValue(view, selectedOption, question, true);
            if (selectedOption.getFactor() == Float.parseFloat(currentCounterValue)) {
                ReviewFragment.mLoadingReviewOfSurveyWithMaxCounter = true;
            }
        }
    });
    List<Option> questionOptions = questionCounter.getAnswer().getOptions();
    if (questionOptions.get(2) != null) {
        CustomTextView textNextButton = (CustomTextView) rootView.findViewById(R.id.next_txt);
        textNextButton.setText(getInternationalizedName(questionOptions.get(2).getCode()));
        textNextButton.setTextSize(questionOptions.get(2).getOptionAttribute().getText_size());
    }
}
Also used : ImageButton(android.widget.ImageButton) CustomTextView(org.eyeseetea.sdk.presentation.views.CustomTextView) Option(org.eyeseetea.malariacare.data.database.model.Option) ImageView(android.widget.ImageView) CustomTextView(org.eyeseetea.sdk.presentation.views.CustomTextView) TextView(android.widget.TextView) View(android.view.View) LinearLayout(android.widget.LinearLayout)

Example 13 with CustomTextView

use of org.eyeseetea.sdk.presentation.views.CustomTextView in project pictureapp by EyeSeeTea.

the class ConfirmCounterSingleCustomViewStrategy method showQuestionHeader.

private void showQuestionHeader(Question questionCounter, View rootView) {
    final CustomTextView questionView = (CustomTextView) rootView.findViewById(question);
    questionView.setText(getInternationalizedName(questionCounter.getForm_name()));
}
Also used : CustomTextView(org.eyeseetea.sdk.presentation.views.CustomTextView)

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 Question (org.eyeseetea.malariacare.data.database.model.Question)2 AKeyboardQuestionView (org.eyeseetea.malariacare.views.question.AKeyboardQuestionView)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 Treatment (org.eyeseetea.malariacare.domain.entity.Treatment)1