simplifying alarm sorting handling

This commit is contained in:
tibbi
2021-04-19 15:34:52 +02:00
parent 7ff56ac15a
commit f5aef41a6e
8 changed files with 43 additions and 74 deletions

View File

@ -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)
}
}
}