Skip to content

Commit a1788c5

Browse files
committed
fix(ui): changing color scheme doesn't work
1 parent 3393a3f commit a1788c5

File tree

1 file changed

+5
-3
lines changed
  • app/src/main/java/com/osfans/trime/ui/main

1 file changed

+5
-3
lines changed

app/src/main/java/com/osfans/trime/ui/main/Pickers.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ suspend fun Context.colorPicker(
4848
val all = Config.get().presetColorSchemes
4949
items = all.map { it.second }.toTypedArray()
5050
val current = prefs.themeAndColor.selectedColor
51-
val source = all.map { it.first }.toTypedArray()
52-
checkedItem = source.indexOf(current)
51+
val schemeIds = all.map { it.first }
52+
checkedItem = schemeIds.indexOf(current)
5353
}
5454
postiveDispatcher = Dispatchers.Default
5555
onOKButton {
56-
prefs.themeAndColor.selectedColor = items[checkedItem].toString()
56+
val all = Config.get().presetColorSchemes
57+
val schemeIds = all.map { it.first }
58+
prefs.themeAndColor.selectedColor = schemeIds[checkedItem]
5759
Trime.getServiceOrNull()?.initKeyboard() // 立刻重初始化键盘生效
5860
}
5961
}.create()

0 commit comments

Comments
 (0)