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) if (bgGraph == null)
return; return;
// **** BG value ****
if (profile != null && lastBG != null && bgView != null) { if (profile != null && lastBG != null && bgView != null) {
bgView.setText(lastBG.valueToUnitsToString(profile.getUnits())); bgView.setText(lastBG.valueToUnitsToString(profile.getUnits()));
DatabaseHelper.GlucoseStatus glucoseStatus = MainApp.getDbHelper().getGlucoseStatusData(); 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(); BgReading.units = profile.getUnits();
} else } else
return; return;
// **** BG value ****
Integer flag = bgView.getPaintFlags(); Integer flag = bgView.getPaintFlags();
if (actualBG == null) { if (actualBG == null) {
flag |= Paint.STRIKE_THRU_TEXT_FLAG; flag |= Paint.STRIKE_THRU_TEXT_FLAG;
@ -118,7 +118,7 @@ public class OverviewFragment extends Fragment implements PluginBase {
bgView.setPaintFlags(flag); bgView.setPaintFlags(flag);
Long agoMsec = new Date().getTime() - lastBG.timestamp; 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)); timeAgoView.setText(agoMin + " " + getString(R.string.minago));
// **** BG graph **** // **** BG graph ****