use of com.faltenreich.diaguard.feature.entry.edit.input.MeasurementInputView in project Diaguard by Faltenreich.
the class MeasurementView method init.
private void init() {
binding = ListItemMeasurementBinding.inflate(LayoutInflater.from(getContext()), this);
View inputView;
Category category = measurement.getCategory();
switch(category) {
case INSULIN:
inputView = new InsulinInputView(getContext(), (Insulin) measurement);
break;
case MEAL:
inputView = new MealInputView(getContext(), (Meal) measurement);
break;
case PRESSURE:
inputView = new PressureInputView(getContext(), (Pressure) measurement);
break;
default:
inputView = new GenericInputView<>(getContext(), category.toClass(), measurement);
}
// noinspection unchecked
this.inputView = (MeasurementInputView<?, T>) inputView;
}
Aggregations