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 f4a8c6104..2eb5cf9cf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt @@ -88,11 +88,11 @@ class SettingsActivity : SimpleActivity() { private fun setupEventReminder() { val reminderType = config.defaultReminderType val reminderMinutes = config.defaultReminderMinutes - settings_default_reminder.setSelection(reminderType) + settings_default_reminder.setSelection(getDefaultReminderTypeIndex(reminderType)) custom_reminder_save.setTextColor(custom_reminder_other_val.currentTextColor) setupReminderPeriod(reminderMinutes) - settings_custom_reminder_holder.beVisibleIf(reminderType == 2) + settings_custom_reminder_holder.beVisibleIf(reminderType == REMINDER_CUSTOM) custom_reminder_save.setOnClickListener { saveReminder() } settings_default_reminder.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { @@ -113,6 +113,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun getDefaultReminderTypeIndex(type: Int): Int { + return when (type) { + REMINDER_OFF -> 0 + REMINDER_AT_START -> 1 + else -> 2 + } + } + private fun getDefaultReminderValue(index: Int): Int { return when (index) { 0 -> REMINDER_OFF