diff --git a/android_app/app/src/main/java/com/health/openscale/core/evaluation/EvaluationSheet.java b/android_app/app/src/main/java/com/health/openscale/core/evaluation/EvaluationSheet.java index fe538e3c..3c74825c 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/evaluation/EvaluationSheet.java +++ b/android_app/app/src/main/java/com/health/openscale/core/evaluation/EvaluationSheet.java @@ -16,6 +16,7 @@ package com.health.openscale.core.evaluation; import com.health.openscale.core.datatypes.ScaleUser; +import com.health.openscale.core.utils.Converters; import java.util.ArrayList; import java.util.Date; @@ -179,11 +180,11 @@ public class EvaluationSheet { } if (weight < lowLimit) { // low - return new EvaluationResult(weight, Math.round(lowLimit), Math.round(highLimit), EvaluationResult.EVAL_STATE.LOW); + return new EvaluationResult(weight, Converters.fromKilogram(Math.round(lowLimit), evalUser.getScaleUnit()), Converters.fromKilogram(Math.round(highLimit), evalUser.getScaleUnit()), EvaluationResult.EVAL_STATE.LOW); } else if (weight >= lowLimit && weight <= highLimit) { // normal - return new EvaluationResult(weight, Math.round(lowLimit), Math.round(highLimit), EvaluationResult.EVAL_STATE.NORMAL); + return new EvaluationResult(weight, Converters.fromKilogram(Math.round(lowLimit), evalUser.getScaleUnit()), Converters.fromKilogram(Math.round(highLimit), evalUser.getScaleUnit()), EvaluationResult.EVAL_STATE.NORMAL); } else if (weight > highLimit) { //high - return new EvaluationResult(weight, Math.round(lowLimit), Math.round(highLimit), EvaluationResult.EVAL_STATE.HIGH); + return new EvaluationResult(weight, Converters.fromKilogram(Math.round(lowLimit), evalUser.getScaleUnit()), Converters.fromKilogram(Math.round(highLimit), evalUser.getScaleUnit()), EvaluationResult.EVAL_STATE.HIGH); } return new EvaluationResult(0, -1, -1, EvaluationResult.EVAL_STATE.UNDEFINED); diff --git a/android_app/app/src/main/java/com/health/openscale/gui/views/WeightMeasurementView.java b/android_app/app/src/main/java/com/health/openscale/gui/views/WeightMeasurementView.java index 9975b972..ebf19a6f 100644 --- a/android_app/app/src/main/java/com/health/openscale/gui/views/WeightMeasurementView.java +++ b/android_app/app/src/main/java/com/health/openscale/gui/views/WeightMeasurementView.java @@ -21,9 +21,9 @@ import android.support.v4.content.ContextCompat; import com.health.openscale.R; import com.health.openscale.core.datatypes.ScaleMeasurement; -import com.health.openscale.core.datatypes.ScaleUser; import com.health.openscale.core.evaluation.EvaluationResult; import com.health.openscale.core.evaluation.EvaluationSheet; +import com.health.openscale.core.utils.Converters; public class WeightMeasurementView extends FloatMeasurementView { @@ -53,7 +53,7 @@ public class WeightMeasurementView extends FloatMeasurementView { @Override protected float getMaxValue() { - return 300; + return Converters.fromKilogram(300.0f, getScaleUser().getScaleUnit()); } @Override