1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-18 14:31:23 +02:00

change color depending on if you are going towards or away from your weight goal, see issue #395

This commit is contained in:
oliexdev
2019-02-10 19:10:40 +01:00
parent 16ee6efafc
commit 56cd6004ec

View File

@@ -445,6 +445,15 @@ public abstract class FloatMeasurementView extends MeasurementView {
color = Color.GRAY;
}
// change color depending on if you are going towards or away from your weight goal
if (this instanceof WeightMeasurementView) {
if (diff> 0.0f) {
color = (value > getScaleUser().getGoalWeight()) ? Color.RED : Color.GREEN;
} else if (diff < 0.0f) {
color = (value < getScaleUser().getGoalWeight()) ? Color.RED : Color.GREEN;
}
}
if (newLine) {
text.append('\n');
}