fix different colors BG vs target range

This commit is contained in:
Milos Kozak 2018-10-13 14:27:09 +02:00
parent 9ee329b7db
commit 5c9baa31f3

View file

@ -220,14 +220,8 @@ public class BgReading implements DataPointWithLabelInterface {
@Override @Override
public int getColor() { public int getColor() {
String units = ProfileFunctions.getInstance().getProfileUnits(); String units = ProfileFunctions.getInstance().getProfileUnits();
Double lowLine = SP.getDouble("low_mark", 0d); Double lowLine = OverviewPlugin.getPlugin().determineLowLine(units);
Double highLine = SP.getDouble("high_mark", 0d); Double highLine = OverviewPlugin.getPlugin().determineHighLine(units);
if (lowLine < 1) {
lowLine = Profile.fromMgdlToUnits(OverviewPlugin.bgTargetLow, units);
}
if (highLine < 1) {
highLine = Profile.fromMgdlToUnits(OverviewPlugin.bgTargetHigh, units);
}
int color = MainApp.gc(R.color.inrange); int color = MainApp.gc(R.color.inrange);
if (isPrediction()) if (isPrediction())
return getPredectionColor(); return getPredectionColor();