From 19b62f50cb1a0eba9a9bb6b5ba4d8b08c07e8dc6 Mon Sep 17 00:00:00 2001 From: Goofyz Leung Date: Fri, 24 Nov 2023 17:09:42 +0800 Subject: [PATCH] fix: missing init values for `LandscapeInputUIMode` Supply the initial values so it can correctly converting `String` to `enum`. Fix #930 --- .../trime/ime/landscapeinput/LandscapeInputUIMode.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/osfans/trime/ime/landscapeinput/LandscapeInputUIMode.kt b/app/src/main/java/com/osfans/trime/ime/landscapeinput/LandscapeInputUIMode.kt index 83d07d2baf..f59a368034 100644 --- a/app/src/main/java/com/osfans/trime/ime/landscapeinput/LandscapeInputUIMode.kt +++ b/app/src/main/java/com/osfans/trime/ime/landscapeinput/LandscapeInputUIMode.kt @@ -10,7 +10,12 @@ enum class LandscapeInputUIMode { ; companion object { - private val convertMap: HashMap = hashMapOf() + private val convertMap: HashMap = + hashMapOf( + Pair("AUTO_SHOW", AUTO_SHOW), + Pair("ALWAYS_SHOW", ALWAYS_SHOW), + Pair("NEVER_SHOW", NEVER_SHOW), + ) fun fromString(mode: String): LandscapeInputUIMode { val type = convertMap[mode.uppercase(Locale.getDefault())]