From e79dc4fb669f87db3dc16dc875e6928c2d8bfce8 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Thu, 27 Jul 2017 16:31:09 +0200 Subject: [PATCH] only set icons when initialized --- .../plugins/PumpCombo/ComboFragment.java | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 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 b8dcb1a777..403bbaf6e2 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 @@ -161,6 +161,24 @@ public class ComboFragment extends Fragment implements View.OnClickListener { tbrRateText.setText(""); } pumpErrorText.setText(ps.errorMsg != null ? ps.errorMsg : ""); + if(ps.lowBattery){ + pumpstateBatteryText.setText("{fa-battery-empty}"); + pumpstateBatteryText.setTextColor(Color.RED); + } else { + pumpstateBatteryText.setText("{fa-battery-three-quarters}"); + pumpstateBatteryText.setTextColor(Color.WHITE); + } + switch (ps.insulinState){ + case 0: insulinstateText.setText("ok"); + insulinstateText.setTextColor(Color.WHITE); + break; + case 1: insulinstateText.setText("low"); + insulinstateText.setTextColor(Color.YELLOW); + break; + case 2: insulinstateText.setText("empty"); + insulinstateText.setTextColor(Color.RED); + break; + } } Command lastCmd = getPlugin().lastCmd; @@ -178,26 +196,6 @@ public class ComboFragment extends Fragment implements View.OnClickListener { } else { lastCmdResultText.setText(""); } - if(getPlugin().pumpState.lowBattery){ - pumpstateBatteryText.setText("{fa-battery-empty}"); - pumpstateBatteryText.setTextColor(Color.RED); - } else { - pumpstateBatteryText.setText("{fa-battery-three-quarters}"); - pumpstateBatteryText.setTextColor(Color.WHITE); - } - switch (getPlugin().pumpState.insulinState){ - case 0: insulinstateText.setText("ok"); - insulinstateText.setTextColor(Color.WHITE); - break; - case 1: insulinstateText.setText("low"); - insulinstateText.setTextColor(Color.YELLOW); - break; - case 2: insulinstateText.setText("empty"); - insulinstateText.setTextColor(Color.RED); - break; - } - - } tbrCapabilityText.setText(getPlugin().getPumpDescription().maxTempPercent + "%"); }