From a503bfaeefbc1ff52231d66db24c85a6a0532b47 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Sun, 4 Mar 2018 12:50:06 +0100 Subject: [PATCH] wear endtime in lowres --- .../nightscout/androidaps/watchfaces/BgGraphBuilder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 588437902b..6f00f42d3b 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BgGraphBuilder.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BgGraphBuilder.java @@ -63,7 +63,7 @@ public class BgGraphBuilder { //used for low resolution screen. public BgGraphBuilder(Context context, List aBgList, List predictionsList, List tempWatchDataList, ArrayList basalWatchDataList, ArrayList bolusWatchDataList, int aPointSize, int aMidColor, int gridColour, int basalBackgroundColor, int basalCenterColor, int bolusColor, int timespan) { - start_time = System.currentTimeMillis() - (1000 * 60 * 60 * timespan); //timespan hours ago + this.start_time = System.currentTimeMillis() - (1000 * 60 * 60 * timespan); //timespan hours ago this.bgDataList = aBgList; this.predictionsList = predictionsList; this.context = context; @@ -83,11 +83,12 @@ public class BgGraphBuilder { this.basalBackgroundColor = basalBackgroundColor; this.bolusColor = bolusColor; this.end_time = System.currentTimeMillis() + (1000 * 60 * 6 * timespan); //Now plus 30 minutes padding (for 5 hours. Less if less.) + this.predictionEndTime = getPredictionEndTime(); + this.end_time = (predictionEndTime>end_time)?predictionEndTime:end_time; } public BgGraphBuilder(Context context, List aBgList, List predictionsList, List tempWatchDataList, ArrayList basalWatchDataList, ArrayList bolusWatchDataList, int aPointSize, int aHighColor, int aLowColor, int aMidColor, int gridColour, int basalBackgroundColor, int basalCenterColor, int bolusColor, int timespan) { - end_time = System.currentTimeMillis() + (1000 * 60 * 6 * timespan); //Now plus 30 minutes padding (for 5 hours. Less if less.) - start_time = System.currentTimeMillis() - (1000 * 60 * 60 * timespan); //timespan hours ago + this.start_time = System.currentTimeMillis() - (1000 * 60 * 60 * timespan); //timespan hours ago this.bgDataList = aBgList; this.predictionsList = predictionsList; this.context = context;