From 313e98b6b4a8a23c20242fd11c945304202e91ac Mon Sep 17 00:00:00 2001 From: Kevin Lee Date: Tue, 9 Dec 2014 21:00:54 -0600 Subject: [PATCH] Time ago reported incorrectly if watch face under certain conditions. --- .../main/java/com/nightscout/android/MainActivity.java | 3 ++- .../java/com/nightscout/android/wearables/Pebble.java | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/nightscout/android/MainActivity.java b/app/src/main/java/com/nightscout/android/MainActivity.java index e7fdd29a..b1394e47 100644 --- a/app/src/main/java/com/nightscout/android/MainActivity.java +++ b/app/src/main/java/com/nightscout/android/MainActivity.java @@ -240,7 +240,8 @@ private String getSGVStringByUnit(int sgv, TrendArrow trend){ else sgvStr=String.valueOf(sgv); return (sgv!=-1)? - (SpecialValue.isSpecialValue(sgv))?SpecialValue.getEGVSpecialValue(sgv).toString():sgvStr+" "+trend.symbol():"---"; + (SpecialValue.isSpecialValue(sgv))? + SpecialValue.getEGVSpecialValue(sgv).toString():sgvStr+" "+trend.symbol():"---"; } @Override diff --git a/app/src/main/java/com/nightscout/android/wearables/Pebble.java b/app/src/main/java/com/nightscout/android/wearables/Pebble.java index dd2b9690..c3487c35 100644 --- a/app/src/main/java/com/nightscout/android/wearables/Pebble.java +++ b/app/src/main/java/com/nightscout/android/wearables/Pebble.java @@ -75,15 +75,15 @@ public void sendDownload(int bgMgdl, TrendArrow trend, long recordTime){ String bgStr = (units == GlucoseUnits.MGDL) ? String.valueOf(bgMgdl) : String.format("%.1f", bgMgdl * Constants.MG_DL_TO_MMOL_L); + lastRecordTime = recordTime; + lastBgInMgdl = bgMgdl; + lastTrend = trend; recordTime = DateTimeZone.getDefault().convertUTCToLocal(recordTime); PebbleDictionary dictionary = buildDictionary(trend, bgStr, (int) (recordTime/1000), (int) (DateTimeZone.getDefault().convertUTCToLocal(new DateTime().getMillis())/1000), deltaStr, String.valueOf(MainActivity.batLevel), pwdName); - sendDownload(dictionary); currentReading = dictionary; - lastBgInMgdl = bgMgdl; - lastTrend = trend; - lastRecordTime = recordTime; + sendDownload(dictionary); } public void resendDownload(){