Simplify total delivered insulin display as suggested by Bart

This commit is contained in:
Steffen Müthing 2020-08-23 19:27:34 +02:00
parent 633767ad3d
commit 85048c9a02
2 changed files with 4 additions and 7 deletions

View file

@ -281,12 +281,10 @@ class OmnipodFragment : DaggerFragment() {
.getTempBasalFromHistory(System.currentTimeMillis())?.toStringFull() ?: "-"
// total delivered
omnipod_total_delivered.text = podStateManager.totalInsulinDelivered.let {
when {
it == null -> "-"
it < OmnipodConst.POD_SETUP_UNITS -> resourceHelper.gs(R.string.omnipod_total_delivered_pod_preparing)
else -> resourceHelper.gs(R.string.omnipod_total_delivered, it - OmnipodConst.POD_SETUP_UNITS);
}
omnipod_total_delivered.text = if (podStateManager.isPodActivationCompleted) {
resourceHelper.gs(R.string.omnipod_total_delivered, podStateManager.totalInsulinDelivered - OmnipodConst.POD_SETUP_UNITS);
} else {
"-"
}
// reservoir

View file

@ -27,7 +27,6 @@
<string name="omnipod_pod_mgmt">Pod Mgmt</string>
<string name="omnipod_pod_status">Pod Status</string>
<string name="omnipod_total_delivered_label">Total Delivered</string>
<string name="omnipod_total_delivered_pod_preparing">Pod Preparing</string>
<string name="omnipod_total_delivered">%1$.2f U</string>
<string name="omnipod_reservoir_left">%1$.2f U left</string>
<string name="omnipod_reservoir_over50">Over 50 U</string>