set defaults for display range

This commit is contained in:
Milos Kozak 2018-01-04 21:33:18 +01:00
parent d7200d1e8e
commit 955ecc6d64
2 changed files with 12 additions and 3 deletions

View file

@ -940,8 +940,16 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
return; return;
} }
final double lowLine = SP.getDouble("low_mark", Profile.fromMgdlToUnits(OverviewPlugin.bgTargetLow, units)); double lowLineSetting = SP.getDouble("low_mark", Profile.fromMgdlToUnits(OverviewPlugin.bgTargetLow, units));
final double highLine = SP.getDouble("high_mark", Profile.fromMgdlToUnits(OverviewPlugin.bgTargetHigh, units)); double highLineSetting = SP.getDouble("high_mark", Profile.fromMgdlToUnits(OverviewPlugin.bgTargetHigh, units));
if (lowLineSetting < 1)
lowLineSetting = Profile.fromMgdlToUnits(76d, units);
if (highLineSetting < 1)
highLineSetting = Profile.fromMgdlToUnits(180d, units);
final double lowLine = lowLineSetting;
final double highLine = highLineSetting;
//Start with updating the BG as it is unaffected by loop. //Start with updating the BG as it is unaffected by loop.
// **** BG value **** // **** BG value ****

View file

@ -149,12 +149,13 @@ public class BGSourceFragment extends SubscriberFragment {
builder.setMessage(MainApp.sResources.getString(R.string.removerecord) + "\n" + DateUtil.dateAndTimeString(bgReading.date) + "\n" + bgReading.valueToUnitsToString(profile.getUnits())); builder.setMessage(MainApp.sResources.getString(R.string.removerecord) + "\n" + DateUtil.dateAndTimeString(bgReading.date) + "\n" + bgReading.valueToUnitsToString(profile.getUnits()));
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), new DialogInterface.OnClickListener() { builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) { public void onClick(DialogInterface dialog, int id) {
final String _id = bgReading._id; /* final String _id = bgReading._id;
if (NSUpload.isIdValid(_id)) { if (NSUpload.isIdValid(_id)) {
NSUpload.removeFoodFromNS(_id); NSUpload.removeFoodFromNS(_id);
} else { } else {
UploadQueue.removeID("dbAdd", _id); UploadQueue.removeID("dbAdd", _id);
} }
*/
bgReading.isValid = false; bgReading.isValid = false;
MainApp.getDbHelper().update(bgReading); MainApp.getDbHelper().update(bgReading);
updateGUI(); updateGUI();