From 7c93edb2c3d5831ea2b5ef818aab84c2d321bb8c Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Nov 2016 21:24:24 +0100 Subject: [PATCH] set reminder to AT_START if its custom with 0 minutes --- app/src/main/java/com/simplemobiletools/calendar/Config.java | 3 +++ .../simplemobiletools/calendar/activities/SettingsActivity.kt | 2 ++ 2 files changed, 5 insertions(+) diff --git a/app/src/main/java/com/simplemobiletools/calendar/Config.java b/app/src/main/java/com/simplemobiletools/calendar/Config.java index 83686ebf2..50e09a07f 100644 --- a/app/src/main/java/com/simplemobiletools/calendar/Config.java +++ b/app/src/main/java/com/simplemobiletools/calendar/Config.java @@ -62,6 +62,9 @@ public class Config { } public void setDefaultReminderType(int type) { + if (type == Constants.REMINDER_CUSTOM && getDefaultReminderMinutes() == 0) + type = Constants.REMINDER_AT_START; + mPrefs.edit().putInt(Constants.REMINDER_TYPE, type).apply(); } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt index 798710ad6..7da4ffff6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt @@ -87,7 +87,9 @@ class SettingsActivity : SimpleActivity() { 2 -> Constants.DAY_MINS else -> 1 } + mConfig.defaultReminderMinutes = Integer.valueOf(value) * multiplier + mConfig.defaultReminderType = Constants.REMINDER_CUSTOM toast(R.string.reminder_saved) hideKeyboard() }