From f044ab15c00d66d64c335b974146118a4a7cc3e1 Mon Sep 17 00:00:00 2001 From: Roumen Georgiev Date: Tue, 12 Jun 2018 10:39:47 +0300 Subject: [PATCH] setting swithces in activity --- .../activities/DanaRUserOptionsActivity.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRUserOptionsActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRUserOptionsActivity.java index b58148ff45..328a02f0e2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRUserOptionsActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRUserOptionsActivity.java @@ -115,7 +115,23 @@ public class DanaRUserOptionsActivity extends Activity { backlightTimeout.setParams((double) pump.backlightOnTimeSec, 1d, 60d, 1d, new DecimalFormat("1"), false); shutdown.setParams((double) pump.shutdownHour, 0d, 24d, 1d, new DecimalFormat("1"), true); lowReservoir.setParams((double) pump.lowReservoirRate, 10d, 60d, 10d, new DecimalFormat("10"), false); - + switch (pump.beepAndAlarm) { + case 1: pumpAlarmSound.setChecked(true); + break; + case 2: pumpAlarmVibrate.setChecked(true); + break; + case 3: pumpAlarmBoth.setChecked(true); + break; + case 5: pumpAlarmSound.setChecked(true); + beep.setChecked(true); + break; + case 6: pumpAlarmVibrate.setChecked(true); + beep.setChecked(true); + break; + case 7: pumpAlarmBoth.setChecked(true); + beep.setChecked(true); + break; + } if (pump.lastSettingsRead == 0) log.debug("No settings loaded from pump!"); else @@ -127,7 +143,7 @@ public class DanaRUserOptionsActivity extends Activity { timeFormat.setChecked(pump.timeDisplayType != 0); buttonScroll.setChecked(pump.buttonScrollOnOff != 0); - beep.setChecked(pump.beepAndAlarm < 5); + beep.setChecked(pump.beepAndAlarm > 4); screenTimeout.setValue((double) pump.lcdOnTimeSec); backlightTimeout.setValue((double) pump.backlightOnTimeSec); pumpUnits.setChecked(pump.getUnits() != null && pump.getUnits().equals(Constants.MMOL));