mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-06-05 22:19:17 +02:00
Implement concise view for timer
- implement EditTimerDialog - adding a new timer would show the dialog - clicking on a timer item would show the dialog
This commit is contained in:
@ -5,6 +5,7 @@ import android.media.RingtoneManager
|
||||
import com.simplemobiletools.clock.extensions.gson.gson
|
||||
import com.simplemobiletools.clock.models.Alarm
|
||||
import com.simplemobiletools.clock.models.StateWrapper
|
||||
import com.simplemobiletools.clock.models.Timer
|
||||
import com.simplemobiletools.clock.models.TimerState
|
||||
import com.simplemobiletools.commons.extensions.getDefaultAlarmSound
|
||||
import com.simplemobiletools.commons.extensions.getDefaultAlarmTitle
|
||||
@ -79,6 +80,12 @@ class Config(context: Context) : BaseConfig(context) {
|
||||
}
|
||||
set(alarm) = prefs.edit().putString(ALARM_LAST_CONFIG, gson.toJson(alarm)).apply()
|
||||
|
||||
var timerLastConfig: Timer?
|
||||
get() = prefs.getString(TIMER_LAST_CONFIG, null)?.let { lastAlarm ->
|
||||
gson.fromJson(lastAlarm, Timer::class.java)
|
||||
}
|
||||
set(alarm) = prefs.edit().putString(TIMER_LAST_CONFIG, gson.toJson(alarm)).apply()
|
||||
|
||||
var timerChannelId: String?
|
||||
get() = prefs.getString(TIMER_CHANNEL_ID, null)
|
||||
set(id) = prefs.edit().putString(TIMER_CHANNEL_ID, id).apply()
|
||||
|
Reference in New Issue
Block a user