wear bgGraphbuilder switch to non-deprecated methods

This commit is contained in:
AdrianLxM 2018-03-04 13:56:17 +01:00
parent 5a80215578
commit acf7e36d61

View file

@ -54,7 +54,6 @@ public class BgGraphBuilder {
private int bolusColor; private int bolusColor;
public boolean singleLine = false; public boolean singleLine = false;
private long endHour;
private List<PointValue> inRangeValues = new ArrayList<PointValue>(); private List<PointValue> inRangeValues = new ArrayList<PointValue>();
private List<PointValue> highValues = new ArrayList<PointValue>(); private List<PointValue> highValues = new ArrayList<PointValue>();
private List<PointValue> lowValues = new ArrayList<PointValue>(); private List<PointValue> lowValues = new ArrayList<PointValue>();
@ -407,17 +406,17 @@ public class BgGraphBuilder {
//Display current time on the graph //Display current time on the graph
SimpleDateFormat longTimeFormat = new SimpleDateFormat(is24? "HH:mm" : "h:mm a"); 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; long hourTick = start_hour;
// add all full hours within the timeframe // add all full hours within the timeframe
while (hourTick < end_time){ while (hourTick < end_time){
if(Math.abs(hourTick - timeNow) > (1000 * 60 * 8 * timespan)){ 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 { } else {
//don't print hour label if too close to now to avoid overlaps //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 //increment by one hour