mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-06-05 22:19:17 +02:00
feat: Add option to sort alarms
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package com.simplemobiletools.clock.helpers
|
||||
|
||||
import android.content.Context
|
||||
import com.simplemobiletools.clock.models.AlarmSort
|
||||
import com.simplemobiletools.clock.extensions.gson.gson
|
||||
import com.simplemobiletools.clock.models.Alarm
|
||||
import com.simplemobiletools.clock.models.StateWrapper
|
||||
@ -57,6 +58,11 @@ class Config(context: Context) : BaseConfig(context) {
|
||||
get() = prefs.getString(TIMER_LABEL, null)
|
||||
set(label) = prefs.edit().putString(TIMER_LABEL, label).apply()
|
||||
|
||||
var alarmSort: AlarmSort
|
||||
get() = AlarmSort.valueOf(prefs.getInt(ALARM_SORT, AlarmSort.default().value))
|
||||
?: AlarmSort.default()
|
||||
set(alarmSort) = prefs.edit().putInt(ALARM_SORT, alarmSort.value).apply()
|
||||
|
||||
var alarmMaxReminderSecs: Int
|
||||
get() = prefs.getInt(ALARM_MAX_REMINDER_SECS, DEFAULT_MAX_ALARM_REMINDER_SECS)
|
||||
set(alarmMaxReminderSecs) = prefs.edit().putInt(ALARM_MAX_REMINDER_SECS, alarmMaxReminderSecs).apply()
|
||||
|
Reference in New Issue
Block a user