use of org.eyeseetea.malariacare.views.option.ImageOptionView in project pictureapp by EyeSeeTea.
the class ImageOptionSingleQuestionView method setValue.
@Override
public void setValue(Value value) {
if (value == null || value.getValue() == null) {
return;
}
for (int i = 0; i < mImageOptionViews.size(); i++) {
ImageOptionView imageOptionView = mImageOptionViews.get(i);
boolean selected = imageOptionView.getOption().equals(value.getOption());
imageOptionView.setSelectedOption(selected);
}
}
use of org.eyeseetea.malariacare.views.option.ImageOptionView in project pictureapp by EyeSeeTea.
the class ImageOptionSingleQuestionView method createOptionView.
@NonNull
private ImageOptionView createOptionView(Option option) {
ImageOptionView imageOptionView = new ImageOptionView(getContext());
imageOptionView.setOption(option, mQuestion);
imageOptionView.setOnOptionSelectedListener(this);
imageOptionView.setEnabled(isEnabled());
imageOptionView.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.MATCH_PARENT, 1));
return imageOptionView;
}
use of org.eyeseetea.malariacare.views.option.ImageOptionView in project pictureapp by EyeSeeTea.
the class ImageOptionSingleQuestionView method setOptions.
@Override
public void setOptions(List<Option> options) {
TableRow tableRow = null;
for (int i = 0; i < options.size(); i++) {
Option option = options.get(i);
if (isNewRow(i)) {
tableRow = new TableRow(getContext());
tableRow.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.MATCH_PARENT, 1));
mImageOptionsContainer.addView(tableRow);
}
ImageOptionView imageOptionView = createOptionView(option);
tableRow.addView(imageOptionView);
mImageOptionViews.add(imageOptionView);
}
}
use of org.eyeseetea.malariacare.views.option.ImageOptionView in project pictureapp by EyeSeeTea.
the class ImageOptionSingleQuestionView method setEnabled.
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
for (int i = 0; i < mImageOptionViews.size(); i++) {
ImageOptionView imageOptionView = mImageOptionViews.get(i);
imageOptionView.setEnabled(enabled);
}
}
Aggregations