mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-23 16:53:04 +02:00
Make incValue and decValue handle edge case better
Instead of blocking a dec when the value is 0.01, set it to 0. Similar for incValue.
This commit is contained in:
@@ -219,20 +219,14 @@ public abstract class MeasurementView extends TableLayout {
|
||||
}
|
||||
|
||||
public void incValue() {
|
||||
float incValue = getValue() + 0.1f;
|
||||
|
||||
if (incValue <= getMaxValue()) {
|
||||
float incValue = Math.min(getMaxValue(), getValue() + 0.1f);
|
||||
setValueOnView(dateTime, incValue);
|
||||
}
|
||||
}
|
||||
|
||||
public void decValue() {
|
||||
float decValue = getValue() - 0.1f;
|
||||
|
||||
if (decValue >= 0) {
|
||||
float decValue = Math.max(0.0f, getValue() - 0.1f);
|
||||
setValueOnView(dateTime, decValue);
|
||||
}
|
||||
}
|
||||
|
||||
public String getValueAsString() {
|
||||
return value;
|
||||
|
Reference in New Issue
Block a user