From d550defcb3bdb5529b5ce59280a31916ff5e5ed9 Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Sun, 26 Mar 2017 17:57:03 +0200 Subject: [PATCH] Do not save an alarm as "smart" if the device does not support it (#612) Opening the activity when a device that does not support smart alarms is connected hides the "smart alarm" toggle. This is now reflected also on the saved data. This solution is not ideal in case of multiple devices but as long as #577 is not solved its the best we can do. --- CHANGELOG.md | 3 +++ .../freeyourgadget/gadgetbridge/activities/AlarmDetails.java | 2 +- app/src/main/res/xml/changelog_master.xml | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 767e9ac49..b3a95f41a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ###Changelog +###Version next +* Alarms activity improvements and fixes + ###Version 0.18.3 * Fix bug that caused the same value in weekly charts for every day on Android 6 and older diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AlarmDetails.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AlarmDetails.java index 43744716a..d14db9dc6 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AlarmDetails.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AlarmDetails.java @@ -105,7 +105,7 @@ public class AlarmDetails extends GBActivity { } private void updateAlarm() { - alarm.setSmartWakeup(cbSmartWakeup.isChecked()); + alarm.setSmartWakeup(supportsSmartWakeup() && cbSmartWakeup.isChecked()); alarm.setRepetition(cbMonday.isChecked(), cbTuesday.isChecked(), cbWednesday.isChecked(), cbThursday.isChecked(), cbFriday.isChecked(), cbSaturday.isChecked(), cbSunday.isChecked()); alarm.setHour(timePicker.getCurrentHour()); alarm.setMinute(timePicker.getCurrentMinute()); diff --git a/app/src/main/res/xml/changelog_master.xml b/app/src/main/res/xml/changelog_master.xml index e881747ab..22c00ad66 100644 --- a/app/src/main/res/xml/changelog_master.xml +++ b/app/src/main/res/xml/changelog_master.xml @@ -1,5 +1,8 @@ + + Alarms activity improvements and fixes + Fix bug that caused the same value in weekly charts for every day on Android 6 and older