0
0
mirror of https://github.com/florisboard/florisboard.git synced 2024-09-19 11:32:18 +02:00

Fix additional Kotlin migration issues

This commit is contained in:
Patrick Goldinger 2024-02-15 02:39:47 +01:00
parent 9cd413f2f3
commit 4b671b5794
No known key found for this signature in database
GPG Key ID: 533467C3DC7B9262
8 changed files with 11 additions and 11 deletions

View File

@ -22,7 +22,7 @@ enum class ImeUiMode(val value: Int) {
CLIPBOARD(2);
companion object {
fun fromInt(int: Int) = values().firstOrNull { it.value == int } ?: TEXT
fun fromInt(int: Int) = entries.firstOrNull { it.value == int } ?: TEXT
}
fun toInt(): Int = value

View File

@ -51,7 +51,7 @@ enum class ItemType(val value: Int) {
companion object {
fun fromInt(value : Int) : ItemType {
return values().first { it.value == value }
return entries.first { it.value == value }
}
}
}

View File

@ -69,7 +69,7 @@ value class ImeOptions private constructor(val raw: Int) {
SEND(EditorInfo.IME_ACTION_SEND);
companion object {
fun fromInt(int: Int) = values().firstOrNull { it.value == int } ?: NONE
fun fromInt(int: Int) = entries.firstOrNull { it.value == int } ?: NONE
}
fun toInt() = value

View File

@ -102,7 +102,7 @@ value class InputAttributes private constructor(val raw: Int) {
TEXT(EditorInfo.TYPE_CLASS_TEXT);
companion object {
fun fromInt(int: Int) = values().firstOrNull { it.value == int } ?: NULL
fun fromInt(int: Int) = entries.firstOrNull { it.value == int } ?: NULL
}
fun toInt() = value
@ -128,7 +128,7 @@ value class InputAttributes private constructor(val raw: Int) {
WEB_PASSWORD(16);
companion object {
fun fromInt(int: Int) = values().firstOrNull { it.value == int } ?: NORMAL
fun fromInt(int: Int) = entries.firstOrNull { it.value == int } ?: NORMAL
}
fun toInt() = value
@ -150,7 +150,7 @@ value class InputAttributes private constructor(val raw: Int) {
}
}
fun fromInt(int: Int) = values().firstOrNull { it.value == int } ?: NONE
fun fromInt(int: Int) = entries.firstOrNull { it.value == int } ?: NONE
}
fun toFlags(): Int {

View File

@ -40,7 +40,7 @@ enum class InputShiftState(val value: Int) {
CAPS_LOCK(3);
companion object {
fun fromInt(int: Int) = values().firstOrNull { it.value == int } ?: UNSHIFTED
fun fromInt(int: Int) = entries.firstOrNull { it.value == int } ?: UNSHIFTED
}
fun toInt() = value

View File

@ -31,7 +31,7 @@ enum class KeyboardMode(val value: Int) {
SMARTBAR_QUICK_ACTIONS(10);
companion object {
fun fromInt(int: Int) = values().firstOrNull { it.value == int } ?: CHARACTERS
fun fromInt(int: Int) = entries.firstOrNull { it.value == int } ?: CHARACTERS
}
fun toInt() = value

View File

@ -76,10 +76,10 @@ class HanShapeBasedLanguageProvider(val context: Context) : SpellingProvider, Su
override val providerId = ProviderId
init {
// init {
// // FIXME: observeForever only callable on the main thread.
// extensionManager.languagePacks.observeForever { refreshLanguagePacks() }
}
// }
private fun refreshLanguagePacks() {
scope.launch { create() }

View File

@ -33,7 +33,7 @@ enum class KeyVariation(val value: Int) {
URI(4);
companion object {
fun fromInt(int: Int) = values().firstOrNull { it.value == int } ?: ALL
fun fromInt(int: Int) = entries.firstOrNull { it.value == int } ?: ALL
}
fun toInt() = value