renaming ESMCheckbox to startEsTTCheckbox
This commit is contained in:
parent
9dd129bbe6
commit
f3a12be0be
1 changed files with 7 additions and 7 deletions
|
@ -73,7 +73,7 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, D
|
||||||
private static final double FAV3_DEFAULT = 20;
|
private static final double FAV3_DEFAULT = 20;
|
||||||
private CheckBox suspendLoopCheckbox;
|
private CheckBox suspendLoopCheckbox;
|
||||||
private CheckBox startActivityTTCheckbox;
|
private CheckBox startActivityTTCheckbox;
|
||||||
private CheckBox ESMCheckbox;
|
private CheckBox startEsTTCheckbox;
|
||||||
|
|
||||||
private Integer maxCarbs;
|
private Integer maxCarbs;
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, D
|
||||||
editCarbs.setParams(0d, 0d, (double) maxCarbs, 1d, new DecimalFormat("0"), false, textWatcher);
|
editCarbs.setParams(0d, 0d, (double) maxCarbs, 1d, new DecimalFormat("0"), false, textWatcher);
|
||||||
|
|
||||||
startActivityTTCheckbox = view.findViewById(R.id.newcarbs_activity_tt);
|
startActivityTTCheckbox = view.findViewById(R.id.newcarbs_activity_tt);
|
||||||
ESMCheckbox = view.findViewById(R.id.carbs_eating_soon_tt);
|
startEsTTCheckbox = view.findViewById(R.id.carbs_eating_soon_tt);
|
||||||
|
|
||||||
dateButton = view.findViewById(R.id.newcarbs_eventdate);
|
dateButton = view.findViewById(R.id.newcarbs_eventdate);
|
||||||
timeButton = view.findViewById(R.id.newcarb_eventtime);
|
timeButton = view.findViewById(R.id.newcarb_eventtime);
|
||||||
|
@ -142,7 +142,7 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, D
|
||||||
timeButton.setOnClickListener(this);
|
timeButton.setOnClickListener(this);
|
||||||
|
|
||||||
//To be able to select only one TT at a time
|
//To be able to select only one TT at a time
|
||||||
ESMCheckbox.setOnClickListener(this);
|
startEsTTCheckbox.setOnClickListener(this);
|
||||||
startActivityTTCheckbox.setOnClickListener(this);
|
startActivityTTCheckbox.setOnClickListener(this);
|
||||||
|
|
||||||
// TODO prefilling carbs, maybe
|
// TODO prefilling carbs, maybe
|
||||||
|
@ -218,7 +218,7 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, D
|
||||||
validateInputs();
|
validateInputs();
|
||||||
break;
|
break;
|
||||||
case R.id.newcarbs_activity_tt:
|
case R.id.newcarbs_activity_tt:
|
||||||
ESMCheckbox.setChecked(false);
|
startEsTTCheckbox.setChecked(false);
|
||||||
break;
|
break;
|
||||||
case R.id.carbs_eating_soon_tt:
|
case R.id.carbs_eating_soon_tt:
|
||||||
startActivityTTCheckbox.setChecked(false);
|
startActivityTTCheckbox.setChecked(false);
|
||||||
|
@ -275,7 +275,7 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, D
|
||||||
confirmMessage += "<br/>" + "TT: " + "<font color='" + MainApp.sResources.getColor(R.color.high) + "'>" + ((int) tt) + " mg/dl for " + ((int) ttDuration) + " min </font>";
|
confirmMessage += "<br/>" + "TT: " + "<font color='" + MainApp.sResources.getColor(R.color.high) + "'>" + ((int) tt) + " mg/dl for " + ((int) ttDuration) + " min </font>";
|
||||||
|
|
||||||
}
|
}
|
||||||
if (ESMCheckbox.isChecked() && !startActivityTTCheckbox.isChecked()) {
|
if (startEsTTCheckbox.isChecked() && !startActivityTTCheckbox.isChecked()) {
|
||||||
if(currentProfile.getUnits().equals(Constants.MMOL)) {
|
if(currentProfile.getUnits().equals(Constants.MMOL)) {
|
||||||
confirmMessage += "<br/>" + "TT: " + "<font color='" + MainApp.sResources.getColor(R.color.low) + "'>" + Profile.toMmol(esTT,Constants.MGDL) + " mmol/l for " + ((int) esDuration) + " min </font>";
|
confirmMessage += "<br/>" + "TT: " + "<font color='" + MainApp.sResources.getColor(R.color.low) + "'>" + Profile.toMmol(esTT,Constants.MGDL) + " mmol/l for " + ((int) esDuration) + " min </font>";
|
||||||
} else
|
} else
|
||||||
|
@ -324,7 +324,7 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, D
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startActivityTTCheckbox.isChecked() || (startActivityTTCheckbox.isChecked() && ESMCheckbox.isChecked())) {
|
if (startActivityTTCheckbox.isChecked() || (startActivityTTCheckbox.isChecked() && startEsTTCheckbox.isChecked())) {
|
||||||
TempTarget tempTarget = new TempTarget();
|
TempTarget tempTarget = new TempTarget();
|
||||||
tempTarget.date = System.currentTimeMillis();
|
tempTarget.date = System.currentTimeMillis();
|
||||||
tempTarget.durationInMinutes = (int) ttDuration;
|
tempTarget.durationInMinutes = (int) ttDuration;
|
||||||
|
@ -333,7 +333,7 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, D
|
||||||
tempTarget.low = (double) finalTT;
|
tempTarget.low = (double) finalTT;
|
||||||
tempTarget.high = (double) finalTT;
|
tempTarget.high = (double) finalTT;
|
||||||
MainApp.getDbHelper().createOrUpdate(tempTarget);
|
MainApp.getDbHelper().createOrUpdate(tempTarget);
|
||||||
} else if (ESMCheckbox.isChecked()) {
|
} else if (startEsTTCheckbox.isChecked()) {
|
||||||
TempTarget tempTarget = new TempTarget();
|
TempTarget tempTarget = new TempTarget();
|
||||||
tempTarget.date = System.currentTimeMillis();
|
tempTarget.date = System.currentTimeMillis();
|
||||||
tempTarget.durationInMinutes = (int) esDuration;
|
tempTarget.durationInMinutes = (int) esDuration;
|
||||||
|
|
Loading…
Reference in a new issue