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:
parent
9cd413f2f3
commit
4b671b5794
@ -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
|
||||
|
@ -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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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() }
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user