From 21dbff35edb19afb2d6686a0910ea0ce6d5d1c9c Mon Sep 17 00:00:00 2001 From: Goofyz Leung Date: Fri, 17 Nov 2023 09:56:45 +0800 Subject: [PATCH] fix: incorrect schemaId to resolve keyboard Use `crrentSchemaId` instead Of `shortSchemaId` to get the keyboard. Fixes #907. --- app/src/main/java/com/osfans/trime/data/theme/Theme.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/osfans/trime/data/theme/Theme.kt b/app/src/main/java/com/osfans/trime/data/theme/Theme.kt index 591d2b04de..3bca904772 100644 --- a/app/src/main/java/com/osfans/trime/data/theme/Theme.kt +++ b/app/src/main/java/com/osfans/trime/data/theme/Theme.kt @@ -250,9 +250,8 @@ class Theme { val remapped = if (".default" == name) { val currentSchemaId = Rime.getCurrentRimeSchema() - val shortSchemaId = currentSchemaId.split("_".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()[0] - if (theme.presetKeyboards!!.containsKey(shortSchemaId)) { - return shortSchemaId + if (theme.presetKeyboards!!.containsKey(currentSchemaId)) { + return currentSchemaId } else { val alphabet = SchemaManager.getActiveSchema().alphabet val twentySix = "qwerty"