diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java index 3697bbd1a0..d393b6f5ab 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java @@ -586,36 +586,36 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, pvd.show(manager, "ProfileViewDialog"); } else if (item.getTitle().equals(MainApp.gs(R.string.eatingsoon))) { DefaultValueHelper defHelper = new DefaultValueHelper(); - double target = defHelper.determineEatingSoonTT(Constants.MGDL); + double target = defHelper.determineEatingSoonTT(profile.getUnits()); TempTarget tempTarget = new TempTarget() .date(System.currentTimeMillis()) .duration(defHelper.determineEatingSoonTTDuration()) .reason(MainApp.gs(R.string.eatingsoon)) .source(Source.USER) - .low(target) - .high(target); + .low(Profile.toMgdl(target, profile.getUnits())) + .high(Profile.toMgdl(target, profile.getUnits())); TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget); } else if (item.getTitle().equals(MainApp.gs(R.string.activity))) { DefaultValueHelper defHelper = new DefaultValueHelper(); - double target = defHelper.determineActivityTT(Constants.MGDL); + double target = defHelper.determineActivityTT(profile.getUnits()); TempTarget tempTarget = new TempTarget() .date(now()) .duration(defHelper.determineActivityTTDuration()) .reason(MainApp.gs(R.string.activity)) .source(Source.USER) - .low(target) - .high(target); + .low(Profile.toMgdl(target, profile.getUnits())) + .high(Profile.toMgdl(target, profile.getUnits())); TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget); } else if (item.getTitle().equals(MainApp.gs(R.string.hypo))) { DefaultValueHelper defHelper = new DefaultValueHelper(); - double target = defHelper.determineHypoTT(Constants.MGDL); + double target = defHelper.determineHypoTT(profile.getUnits()); TempTarget tempTarget = new TempTarget() .date(now()) .duration(defHelper.determineHypoTTDuration()) - .reason(MainApp.gs(R.string.activity)) + .reason(MainApp.gs(R.string.hypo)) .source(Source.USER) - .low(target) - .high(target); + .low(Profile.toMgdl(target, profile.getUnits())) + .high(Profile.toMgdl(target, profile.getUnits())); TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget); } else if (item.getTitle().equals(MainApp.gs(R.string.custom))) { NewNSTreatmentDialog newTTDialog = new NewNSTreatmentDialog();