use of com.faltenreich.diaguard.shared.view.picker.NumberPickerDialog in project Diaguard by Faltenreich.
the class FoodInputViewHolder method showNumberPicker.
private void showNumberPicker() {
if (getContext() instanceof AppCompatActivity) {
AppCompatActivity activity = (AppCompatActivity) getContext();
new NumberPickerDialog(getContext(), R.string.grams_milliliters_acronym, getAmountFromButton(), 1, 10000, (number) -> {
FoodEaten foodEaten = getItem();
foodEaten.setAmountInGrams(number.floatValue());
Events.post(new FoodEatenUpdatedEvent(foodEaten, getAdapterPosition()));
}).show(activity.getSupportFragmentManager());
}
}
Aggregations