Small fixes
This commit is contained in:
parent
a2de14a44a
commit
084c8fd02f
2 changed files with 13 additions and 4 deletions
|
@ -249,11 +249,10 @@ public class OmnipodManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
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);
|
podStateManager.setTempBasalCertain(false);
|
||||||
executeAndVerify(() -> communicationService.executeAction(new SetTempBasalAction(
|
executeAndVerify(() -> communicationService.executeAction(new SetTempBasalAction(
|
||||||
podStateManager, rate, duration, acknowledgementBeep, completionBeep)));
|
podStateManager, rate, duration, acknowledgementBeep, completionBeep)));
|
||||||
podStateManager.setTempBasal(DateTime.now().minus(OmnipodConstants.AVERAGE_TEMP_BASAL_COMMAND_COMMUNICATION_DURATION), rate, duration);
|
|
||||||
} catch (OmnipodException ex) {
|
} catch (OmnipodException ex) {
|
||||||
if (ex.isCertainFailure()) {
|
if (ex.isCertainFailure()) {
|
||||||
podStateManager.clearTempBasal();
|
podStateManager.clearTempBasal();
|
||||||
|
|
|
@ -438,8 +438,18 @@ class OmnipodOverviewFragment : DaggerFragment() {
|
||||||
omnipod_overview_temp_basal.setTextColor(textColor)
|
omnipod_overview_temp_basal.setTextColor(textColor)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
omnipod_overview_temp_basal.text = PLACEHOLDER
|
var text = PLACEHOLDER
|
||||||
omnipod_overview_temp_basal.setTextColor(Color.WHITE)
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue