fix delta and minago

This commit is contained in:
Milos Kozak 2016-06-12 13:59:09 +02:00
parent b310310511
commit f15fdf613f

View file

@ -101,15 +101,15 @@ public class OverviewFragment extends Fragment implements PluginBase {
if (bgGraph == null)
return;
// **** BG value ****
if (profile != null && lastBG != null && bgView != null) {
bgView.setText(lastBG.valueToUnitsToString(profile.getUnits()));
DatabaseHelper.GlucoseStatus glucoseStatus = MainApp.getDbHelper().getGlucoseStatusData();
deltaView.setText(NSProfile.toUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units) + " " + units);
deltaView.setText("Δ " + NSProfile.toUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units) + " " + units);
BgReading.units = profile.getUnits();
} else
return;
// **** BG value ****
Integer flag = bgView.getPaintFlags();
if (actualBG == null) {
flag |= Paint.STRIKE_THRU_TEXT_FLAG;
@ -118,7 +118,7 @@ public class OverviewFragment extends Fragment implements PluginBase {
bgView.setPaintFlags(flag);
Long agoMsec = new Date().getTime() - lastBG.timestamp;
int agoMin = (int) (agoMsec / 60d / 60d / 1000d);
int agoMin = (int) (agoMsec / 60d / 1000d);
timeAgoView.setText(agoMin + " " + getString(R.string.minago));
// **** BG graph ****