mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-06-05 22:19:17 +02:00
simplifying alarm sorting handling
This commit is contained in:
@ -1,18 +0,0 @@
|
||||
package com.simplemobiletools.clock.models
|
||||
|
||||
enum class AlarmSort(open val value: Int) {
|
||||
CREATED_AT(0),
|
||||
TIME_OF_DAY(1);
|
||||
|
||||
companion object {
|
||||
fun default(): AlarmSort {
|
||||
return CREATED_AT
|
||||
}
|
||||
|
||||
fun valueOf(value: Int): AlarmSort? {
|
||||
return AlarmSort.values()
|
||||
.filter { it.value == value }
|
||||
.getOrNull(0)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user