diff --git a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/ImeUiMode.kt b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/ImeUiMode.kt index befffe38..1ad8beef 100644 --- a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/ImeUiMode.kt +++ b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/ImeUiMode.kt @@ -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 diff --git a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/clipboard/provider/ClipboardDatabase.kt b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/clipboard/provider/ClipboardDatabase.kt index 9977676f..c5f758a5 100644 --- a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/clipboard/provider/ClipboardDatabase.kt +++ b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/clipboard/provider/ClipboardDatabase.kt @@ -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 } } } } diff --git a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/editor/ImeOptions.kt b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/editor/ImeOptions.kt index 081eba89..cddb5980 100644 --- a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/editor/ImeOptions.kt +++ b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/editor/ImeOptions.kt @@ -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 diff --git a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/editor/InputAttributes.kt b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/editor/InputAttributes.kt index 8688a509..5784d9be 100644 --- a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/editor/InputAttributes.kt +++ b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/editor/InputAttributes.kt @@ -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 { diff --git a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/input/InputShiftState.kt b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/input/InputShiftState.kt index f9ebb401..78b94b80 100644 --- a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/input/InputShiftState.kt +++ b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/input/InputShiftState.kt @@ -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 diff --git a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/keyboard/KeyboardMode.kt b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/keyboard/KeyboardMode.kt index 8d70357a..c6d319a4 100644 --- a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/keyboard/KeyboardMode.kt +++ b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/keyboard/KeyboardMode.kt @@ -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 diff --git a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/nlp/han/HanShapeBasedLanguageProvider.kt b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/nlp/han/HanShapeBasedLanguageProvider.kt index 4292ff96..6d289f93 100644 --- a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/nlp/han/HanShapeBasedLanguageProvider.kt +++ b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/nlp/han/HanShapeBasedLanguageProvider.kt @@ -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() } diff --git a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/text/key/KeyVariation.kt b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/text/key/KeyVariation.kt index 63ea4b18..46540511 100644 --- a/app/src/main/kotlin/dev/patrickgold/florisboard/ime/text/key/KeyVariation.kt +++ b/app/src/main/kotlin/dev/patrickgold/florisboard/ime/text/key/KeyVariation.kt @@ -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