From cd385a321751e96d9860d3d555912852ec70673a Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Sun, 28 Jan 2018 15:38:54 +0100 Subject: [PATCH] ComboFragment: deal with resevoir levels being available or not. --- .../plugins/PumpCombo/ComboFragment.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java index e1b5bdd92f..e5989e4ecd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java @@ -168,9 +168,20 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis // reservoir int reservoirLevel = plugin.getPump().reservoirLevel; - reservoirView.setText(reservoirLevel == -1 ? "" : "" + reservoirLevel + " " - + MainApp.sResources.getString(R.string.treatments_wizard_unit_label)); - if (ps.insulinState == PumpState.LOW) { + if (reservoirLevel != -1) { + reservoirView.setText(reservoirLevel + " " + MainApp.sResources.getString(R.string.treatments_wizard_unit_label)); + } else if (ps.insulinState == PumpState.LOW) { + reservoirView.setText(MainApp.gs(R.string.combo_reservoir_low)); + } else if (ps.insulinState == PumpState.EMPTY) { + reservoirView.setText(MainApp.gs(R.string.combo_reservoir_empty)); + } else { + reservoirView.setText(MainApp.gs(R.string.combo_reservoir_normal)); + } + + if (ps.insulinState == PumpState.UNKNOWN) { + reservoirView.setTextColor(Color.WHITE); + reservoirView.setTypeface(null, Typeface.NORMAL); + } else if (ps.insulinState == PumpState.LOW) { reservoirView.setTextColor(Color.YELLOW); reservoirView.setTypeface(null, Typeface.BOLD); } else if (ps.insulinState == PumpState.EMPTY) {