From acf7e36d6103012b6a714f16922873a1dabae8c3 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Sun, 4 Mar 2018 13:56:17 +0100 Subject: [PATCH] wear bgGraphbuilder switch to non-deprecated methods --- .../nightscout/androidaps/watchfaces/BgGraphBuilder.java | 7 +++---- 1 file changed, 3 insertions(+), 4 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 aa78e41856..d4a46d7f3a 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BgGraphBuilder.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BgGraphBuilder.java @@ -54,7 +54,6 @@ public class BgGraphBuilder { private int bolusColor; public boolean singleLine = false; - private long endHour; private List inRangeValues = new ArrayList(); private List highValues = new ArrayList(); private List lowValues = new ArrayList(); @@ -407,17 +406,17 @@ public class BgGraphBuilder { //Display current time on the graph SimpleDateFormat longTimeFormat = new SimpleDateFormat(is24? "HH:mm" : "h:mm a"); - xAxisValues.add(new AxisValue(fuzz(timeNow), (longTimeFormat.format(timeNow)).toCharArray())); + xAxisValues.add(new AxisValue(fuzz(timeNow)).setLabel((longTimeFormat.format(timeNow)))); long hourTick = start_hour; // add all full hours within the timeframe while (hourTick < end_time){ if(Math.abs(hourTick - timeNow) > (1000 * 60 * 8 * timespan)){ - xAxisValues.add(new AxisValue(fuzz(hourTick), (timeFormat.format(hourTick)).toCharArray())); + xAxisValues.add(new AxisValue(fuzz(hourTick)).setLabel(timeFormat.format(hourTick))); } else { //don't print hour label if too close to now to avoid overlaps - xAxisValues.add(new AxisValue(fuzz(hourTick), "".toCharArray())); + xAxisValues.add(new AxisValue(fuzz(hourTick))); } //increment by one hour