Search in sources :

Example 1 with PositiveNumberSingleQuestionView

use of org.eyeseetea.malariacare.views.question.singlequestion.PositiveNumberSingleQuestionView in project pictureapp by EyeSeeTea.

the class SingleQuestionViewFactory method getView.

public IQuestionView getView(Context context, int typeQuestion) {
    switch(typeQuestion) {
        case Constants.PHONE:
            return new PhoneSingleQuestionView(context);
        case Constants.POSITIVE_INT:
            return new PositiveNumberSingleQuestionView(context);
        case Constants.POSITIVE_OR_ZERO_INT:
            return new PositiveOrZeroNumberMultiQuestionView(context);
        case Constants.IMAGE_RADIO_GROUP_NO_DATAELEMENT:
            return new ImageRadioButtonSingleQuestionView(context);
        case Constants.IMAGE_RADIO_GROUP:
            return new ImageRadioButtonSingleQuestionView(context);
        case Constants.DYNAMIC_STOCK_IMAGE_RADIO_BUTTON:
            return new DynamicStockImageRadioButtonSingleQuestionView(context);
        case Constants.REMINDER:
        case Constants.WARNING:
            return new ReminderSingleQuestionView(context);
        case Constants.IMAGES_2:
        case Constants.IMAGES_4:
        case Constants.IMAGES_6:
        case Constants.IMAGES_5:
            ImageOptionSingleQuestionView twoColumnsImageOptionSingleQuestionView = new ImageOptionSingleQuestionView(context);
            twoColumnsImageOptionSingleQuestionView.setColumnsCount(2);
            return twoColumnsImageOptionSingleQuestionView;
        case Constants.IMAGES_3:
        case Constants.IMAGE_3_NO_DATAELEMENT:
            ImageOptionSingleQuestionView imageOptionSingleQuestionView = new ImageOptionSingleQuestionView(context);
            imageOptionSingleQuestionView.setColumnsCount(1);
            return imageOptionSingleQuestionView;
    }
    return null;
}
Also used : ReminderSingleQuestionView(org.eyeseetea.malariacare.views.question.singlequestion.ReminderSingleQuestionView) PhoneSingleQuestionView(org.eyeseetea.malariacare.views.question.singlequestion.PhoneSingleQuestionView) PositiveNumberSingleQuestionView(org.eyeseetea.malariacare.views.question.singlequestion.PositiveNumberSingleQuestionView) DynamicStockImageRadioButtonSingleQuestionView(org.eyeseetea.malariacare.views.question.singlequestion.DynamicStockImageRadioButtonSingleQuestionView) PositiveOrZeroNumberMultiQuestionView(org.eyeseetea.malariacare.views.question.multiquestion.PositiveOrZeroNumberMultiQuestionView) ImageOptionSingleQuestionView(org.eyeseetea.malariacare.views.question.singlequestion.ImageOptionSingleQuestionView) DynamicStockImageRadioButtonSingleQuestionView(org.eyeseetea.malariacare.views.question.singlequestion.DynamicStockImageRadioButtonSingleQuestionView) ImageRadioButtonSingleQuestionView(org.eyeseetea.malariacare.views.question.singlequestion.ImageRadioButtonSingleQuestionView)

Aggregations

PositiveOrZeroNumberMultiQuestionView (org.eyeseetea.malariacare.views.question.multiquestion.PositiveOrZeroNumberMultiQuestionView)1 DynamicStockImageRadioButtonSingleQuestionView (org.eyeseetea.malariacare.views.question.singlequestion.DynamicStockImageRadioButtonSingleQuestionView)1 ImageOptionSingleQuestionView (org.eyeseetea.malariacare.views.question.singlequestion.ImageOptionSingleQuestionView)1 ImageRadioButtonSingleQuestionView (org.eyeseetea.malariacare.views.question.singlequestion.ImageRadioButtonSingleQuestionView)1 PhoneSingleQuestionView (org.eyeseetea.malariacare.views.question.singlequestion.PhoneSingleQuestionView)1 PositiveNumberSingleQuestionView (org.eyeseetea.malariacare.views.question.singlequestion.PositiveNumberSingleQuestionView)1 ReminderSingleQuestionView (org.eyeseetea.malariacare.views.question.singlequestion.ReminderSingleQuestionView)1