This commit is contained in:
Milos Kozak 2018-08-07 21:45:56 +02:00
commit 8e83ff2390

View file

@ -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();