diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java index d064db79e4..ea2e753ec8 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java @@ -403,12 +403,12 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre ArrayList boluses = dataMap.getDataMapArrayList("boluses"); if (boluses != null) { bolusWatchDataList = new ArrayList<>(); - for (DataMap basal : basals) { + for (DataMap bolus : boluses) { BolusWatchData bwd = new BolusWatchData(); - bwd.date = basal.getLong("date"); - bwd.bolus = basal.getDouble("bolus"); - bwd.carbs = basal.getDouble("carbs"); - bwd.isSMB = basal.getBoolean("isSMB"); + bwd.date = bolus.getLong("date"); + bwd.bolus = bolus.getDouble("bolus"); + bwd.carbs = bolus.getDouble("carbs"); + bwd.isSMB = bolus.getBoolean("isSMB"); bolusWatchDataList.add(bwd); } } diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BgGraphBuilder.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BgGraphBuilder.java index 4cec10fec6..87d5f39184 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BgGraphBuilder.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BgGraphBuilder.java @@ -158,6 +158,7 @@ public class BgGraphBuilder { } lines.add(basalLine((float) minChart, factor, highlight)); + lines.add(bolusLine((float) minChart, factor)); return lines; } @@ -184,6 +185,31 @@ public class BgGraphBuilder { } + private Line bolusLine(float offset, double factor) { + + List pointValues = new ArrayList(); + + for (BolusWatchData bwd: bolusWatchDataList) { + if(bwd.date > start_time) { + pointValues.add(new PointValue(fuzz(bwd.date), (float) offset+2)); + } + } + + + Line line = new Line(pointValues); + line.setColor(basalCenterColor); + line.setHasLines(false); + line.setPointRadius(pointSize); + line.setHasPoints(true); + + return line; + + + } + + + + public Line highValuesLine() { Line highValuesLine = new Line(highValues); highValuesLine.setColor(highColor);