Use an enum to represent the selected items
This commit is contained in:
@ -1,7 +1,11 @@
|
||||
package bou.amine.apps.readerforselfossv2.utils
|
||||
|
||||
enum class ItemType(val type: String) {
|
||||
UNREAD("unread"),
|
||||
ALL("all"),
|
||||
STARRED("starred")
|
||||
enum class ItemType(val position: Int, val type: String) {
|
||||
UNREAD(1, "unread"),
|
||||
ALL(2, "all"),
|
||||
STARRED(3, "starred");
|
||||
|
||||
companion object {
|
||||
fun fromInt(value: Int) = values().first { it.position == value }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user