mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-06-05 22:19:17 +02:00
handle multiple timer states
- feat: separate timer actions from states by adding a new class TimerEvent to hold actions Reset, Start, Pause, Finish, Refesh that could be performed on a timer. - feat: handle multiple countdown timers in the App file by creating a map of the timer id to the countdown timer. - fix: use gson instance from TypeAdapter in Room's Converters class - ref: remove scroll view parent from each timer item, a fix for the keyboard obscuring a label will be implemented in a future commit
This commit is contained in:
@ -2,10 +2,7 @@ package com.simplemobiletools.clock.models
|
||||
|
||||
sealed class TimerState {
|
||||
object Idle : TimerState()
|
||||
data class Start(val duration: Long) : TimerState()
|
||||
data class Running(val duration: Long, val tick: Long) : TimerState()
|
||||
data class Pause(val duration: Long) : TimerState()
|
||||
data class Paused(val duration: Long, val tick: Long) : TimerState()
|
||||
data class Finish(val duration: Long) : TimerState()
|
||||
object Finished : TimerState()
|
||||
}
|
||||
|
Reference in New Issue
Block a user