Move from enum.values() to enum.entries.

Resolves #13767
This commit is contained in:
Grzegorz Bobryk
2024-11-03 16:18:10 +01:00
committed by Greyson Parrelli
parent be92b3cf0a
commit cafbf48783
60 changed files with 95 additions and 95 deletions

View File

@@ -210,13 +210,13 @@ class AnalogClockStickerDrawable(val context: Context) : Drawable(), Animatable
GREEN(3);
fun next(): Style {
val values = Style.values()
val values = entries.toTypedArray()
return values[(values.indexOf(this) + 1) % values.size]
}
companion object {
fun fromType(type: Int) = Style.values().first { it.type == type }
fun fromType(type: Int) = entries.first { it.type == type }
}
}
}

View File

@@ -250,13 +250,13 @@ class DigitalClockStickerDrawable(
DARK_WITH_RED_TEXT(4);
fun next(): Style {
val values = Style.values()
val values = entries.toTypedArray()
return values[(values.indexOf(this) + 1) % values.size]
}
companion object {
fun fromType(type: Int) = Style.values().first { it.type == type }
fun fromType(type: Int) = entries.first { it.type == type }
}
}
}

View File

@@ -9,6 +9,6 @@ enum class FeatureSticker(val type: String) {
companion object {
@JvmStatic
fun fromType(type: String) = FeatureSticker.values().first { it.type == type }
fun fromType(type: String) = entries.first { it.type == type }
}
}