mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2024-12-28 01:00:19 +01:00
properly select default reminder in settings
This commit is contained in:
parent
33d04cd5e7
commit
99eae5edda
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user