mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-20 07:21:40 +02:00
Convert bone to scale unit
This commit is contained in:
@@ -23,6 +23,7 @@ import com.health.openscale.R;
|
||||
import com.health.openscale.core.datatypes.ScaleMeasurement;
|
||||
import com.health.openscale.core.evaluation.EvaluationResult;
|
||||
import com.health.openscale.core.evaluation.EvaluationSheet;
|
||||
import com.health.openscale.core.utils.Converters;
|
||||
|
||||
public class BoneMeasurementView extends FloatMeasurementView {
|
||||
// Don't change key value, it may be stored persistent in preferences
|
||||
@@ -39,22 +40,22 @@ public class BoneMeasurementView extends FloatMeasurementView {
|
||||
|
||||
@Override
|
||||
protected float getMeasurementValue(ScaleMeasurement measurement) {
|
||||
return measurement.getBone();
|
||||
return Converters.fromKilogram(measurement.getBone(), getScaleUser().getScaleUnit());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setMeasurementValue(float value, ScaleMeasurement measurement) {
|
||||
measurement.setBone(value);
|
||||
measurement.setBone(Converters.toKilogram(value, getScaleUser().getScaleUnit()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnit() {
|
||||
return "kg";
|
||||
return getScaleUser().getScaleUnit().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getMaxValue() {
|
||||
return 50;
|
||||
return Converters.fromKilogram(50, getScaleUser().getScaleUnit());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user