use of org.eyeseetea.malariacare.domain.entity.PositiveNumber in project pictureapp by EyeSeeTea.
the class PositiveNumberSingleQuestionView method validateAnswer.
private void validateAnswer(Context context) {
try {
PositiveNumber positiveNumber = PositiveNumber.parse(numberPicker.getText().toString());
hideKeyboard(numberPicker);
notifyAnswerChanged(String.valueOf(positiveNumber.getValue()));
Validation.getInstance().removeInputError(numberPicker);
} catch (InvalidPositiveNumberException e) {
Validation.getInstance().addinvalidInput(numberPicker, context.getString(R.string.dynamic_error_age));
numberPicker.setError(context.getString(R.string.dynamic_error_age));
}
}
Aggregations