From 5ef7506e5fd6282c99943382f91dda101a5823c2 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Tue, 1 May 2018 19:16:28 +0200 Subject: [PATCH] Clean up prediction colors. --- .../main/java/info/nightscout/androidaps/db/BgReading.java | 5 ++--- .../java/info/nightscout/androidaps/db/CareportalEvent.java | 5 ----- .../java/info/nightscout/androidaps/db/ExtendedBolus.java | 4 ---- .../java/info/nightscout/androidaps/db/ProfileSwitch.java | 5 ----- .../androidaps/plugins/IobCobCalculator/AutosensData.java | 5 ----- .../graphExtensions/DataPointWithLabelInterface.java | 1 - .../Overview/graphExtensions/PointsWithLabelGraphSeries.java | 1 - .../nightscout/androidaps/plugins/Treatments/Treatment.java | 5 ----- app/src/main/res/values/colors.xml | 2 +- 9 files changed, 3 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/db/BgReading.java b/app/src/main/java/info/nightscout/androidaps/db/BgReading.java index 20b9040065..17a6d7d8e2 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/BgReading.java +++ b/app/src/main/java/info/nightscout/androidaps/db/BgReading.java @@ -211,7 +211,7 @@ public class BgReading implements DataPointWithLabelInterface { } int color = MainApp.sResources.getColor(R.color.inrange); if (isPrediction()) - color = MainApp.sResources.getColor(R.color.prediction); + return getPredectionColor(); else if (valueToUnits(units) < lowLine) color = MainApp.sResources.getColor(R.color.low); else if (valueToUnits(units) > highLine) @@ -219,8 +219,7 @@ public class BgReading implements DataPointWithLabelInterface { return color; } - @Override - public int getSecondColor() { + private int getPredectionColor() { if (isIOBPrediction) return MainApp.sResources.getColor(R.color.iob); if (isCOBPrediction) diff --git a/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java b/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java index b0f69144c5..33fee529bc 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java @@ -263,9 +263,4 @@ public class CareportalEvent implements DataPointWithLabelInterface { return Color.GRAY; } - @Override - public int getSecondColor() { - return 0; - } - } diff --git a/app/src/main/java/info/nightscout/androidaps/db/ExtendedBolus.java b/app/src/main/java/info/nightscout/androidaps/db/ExtendedBolus.java index 418de86c6c..1123cb58df 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/ExtendedBolus.java +++ b/app/src/main/java/info/nightscout/androidaps/db/ExtendedBolus.java @@ -297,8 +297,4 @@ public class ExtendedBolus implements Interval, DataPointWithLabelInterface { return Color.CYAN; } - @Override - public int getSecondColor() { - return 0; - } } diff --git a/app/src/main/java/info/nightscout/androidaps/db/ProfileSwitch.java b/app/src/main/java/info/nightscout/androidaps/db/ProfileSwitch.java index 9dca91c595..40c8e50c6d 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/ProfileSwitch.java +++ b/app/src/main/java/info/nightscout/androidaps/db/ProfileSwitch.java @@ -263,11 +263,6 @@ public class ProfileSwitch implements Interval, DataPointWithLabelInterface { return Color.CYAN; } - @Override - public int getSecondColor() { - return 0; - } - public String toString() { return "ProfileSwitch{" + "date=" + date + diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/AutosensData.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/AutosensData.java index 693a6fad55..79ab63e2ac 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/AutosensData.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/AutosensData.java @@ -164,9 +164,4 @@ public class AutosensData implements DataPointWithLabelInterface { return MainApp.gc(R.color.cob); } - @Override - public int getSecondColor() { - return 0; - } - } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/DataPointWithLabelInterface.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/DataPointWithLabelInterface.java index 3f6280431c..20d478692a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/DataPointWithLabelInterface.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/DataPointWithLabelInterface.java @@ -55,5 +55,4 @@ public interface DataPointWithLabelInterface extends DataPointInterface{ PointsWithLabelGraphSeries.Shape getShape(); float getSize(); int getColor(); - int getSecondColor(); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java index 8ac3be0ad8..5f39cedafe 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphExtensions/PointsWithLabelGraphSeries.java @@ -211,7 +211,6 @@ public class PointsWithLabelGraphSeries e mPaint.setStyle(Paint.Style.FILL); mPaint.setStrokeWidth(0); canvas.drawCircle(endX, endY, scaledPxSize, mPaint); - mPaint.setColor(value.getSecondColor()); mPaint.setStyle(Paint.Style.FILL); mPaint.setStrokeWidth(0); canvas.drawCircle(endX, endY, scaledPxSize / 3, mPaint); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/Treatment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/Treatment.java index 31d44a3e30..1983c38242 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/Treatment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/Treatment.java @@ -193,11 +193,6 @@ public class Treatment implements DataPointWithLabelInterface { return MainApp.instance().getResources().getColor(android.R.color.holo_red_light); } - @Override - public int getSecondColor() { - return 0; - } - @Override public void setY(double y) { yValue = y; diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index e5b645dcc6..58982405c0 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -6,7 +6,7 @@ #FFFFCC03 #FFFB8C00 #ffea00 - #ff9500 + #00ffff #FFFFFF #FFFFFF00 #FFFF00FF