Small fixes

This commit is contained in:
Bart Sopers 2020-11-19 18:21:29 +01:00
parent a2de14a44a
commit 084c8fd02f
2 changed files with 13 additions and 4 deletions

View file

@ -249,11 +249,10 @@ public class OmnipodManager {
}
try {
podStateManager.setTempBasal(DateTime.now().minus(OmnipodConstants.AVERAGE_TEMP_BASAL_COMMAND_COMMUNICATION_DURATION), rate, duration);
podStateManager.setTempBasal(DateTime.now().plus(OmnipodConstants.AVERAGE_TEMP_BASAL_COMMAND_COMMUNICATION_DURATION), rate, duration);
podStateManager.setTempBasalCertain(false);
executeAndVerify(() -> communicationService.executeAction(new SetTempBasalAction(
podStateManager, rate, duration, acknowledgementBeep, completionBeep)));
podStateManager.setTempBasal(DateTime.now().minus(OmnipodConstants.AVERAGE_TEMP_BASAL_COMMAND_COMMUNICATION_DURATION), rate, duration);
} catch (OmnipodException ex) {
if (ex.isCertainFailure()) {
podStateManager.clearTempBasal();

View file

@ -438,8 +438,18 @@ class OmnipodOverviewFragment : DaggerFragment() {
omnipod_overview_temp_basal.setTextColor(textColor)
}
} else {
omnipod_overview_temp_basal.text = PLACEHOLDER
omnipod_overview_temp_basal.setTextColor(Color.WHITE)
var text = PLACEHOLDER
val textColor: Int
if (podStateManager.isTempBasalCertain) {
textColor = Color.WHITE
} else {
textColor = Color.RED
text += " (" + resourceHelper.gs(R.string.omnipod_uncertain) + ")"
}
omnipod_overview_temp_basal.text = text
omnipod_overview_temp_basal.setTextColor(textColor)
}
}