From 11359880e82bbe4ac91db9e3da4ec99f579caecf Mon Sep 17 00:00:00 2001 From: bryan Date: Wed, 11 Dec 2024 00:57:35 +0800 Subject: [PATCH 1/6] feat(Candidate & Theme): Adding control of Candidate Text Adding new theme propety `candidateTextColor` to control candidate text color. The default value is as same as the keyTextColor --- .../java/org/fcitx/fcitx5/android/data/theme/Theme.kt | 9 +++++++++ .../fcitx/fcitx5/android/data/theme/ThemePreset.kt | 11 +++++++++++ .../android/input/candidates/CandidateItemUi.kt | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/Theme.kt b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/Theme.kt index 3f59a66ef..89e3db598 100644 --- a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/Theme.kt +++ b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/Theme.kt @@ -30,6 +30,9 @@ sealed class Theme : Parcelable { abstract val keyBackgroundColor: Int abstract val keyTextColor: Int + // Color of candidate text + abstract val candidateTextColor: Int + abstract val altKeyBackgroundColor: Int abstract val altKeyTextColor: Int @@ -67,6 +70,7 @@ sealed class Theme : Parcelable { override val keyboardColor: Int, override val keyBackgroundColor: Int, override val keyTextColor: Int, + override val candidateTextColor: Int, override val altKeyBackgroundColor: Int, override val altKeyTextColor: Int, override val accentKeyBackgroundColor: Int, @@ -115,6 +119,7 @@ sealed class Theme : Parcelable { override val keyboardColor: Int, override val keyBackgroundColor: Int, override val keyTextColor: Int, + override val candidateTextColor: Int, override val altKeyBackgroundColor: Int, override val altKeyTextColor: Int, override val accentKeyBackgroundColor: Int, @@ -140,6 +145,7 @@ sealed class Theme : Parcelable { keyboardColor: Number, keyBackgroundColor: Number, keyTextColor: Number, + candidateTextColor: Number, altKeyBackgroundColor: Number, altKeyTextColor: Number, accentKeyBackgroundColor: Number, @@ -161,6 +167,7 @@ sealed class Theme : Parcelable { keyboardColor.toInt(), keyBackgroundColor.toInt(), keyTextColor.toInt(), + candidateTextColor.toInt(), altKeyBackgroundColor.toInt(), altKeyTextColor.toInt(), accentKeyBackgroundColor.toInt(), @@ -185,6 +192,7 @@ sealed class Theme : Parcelable { keyboardColor, keyBackgroundColor, keyTextColor, + candidateTextColor, altKeyBackgroundColor, altKeyTextColor, accentKeyBackgroundColor, @@ -222,6 +230,7 @@ sealed class Theme : Parcelable { keyboardColor, keyBackgroundColor, keyTextColor, + candidateTextColor, altKeyBackgroundColor, altKeyTextColor, accentKeyBackgroundColor, diff --git a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/ThemePreset.kt b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/ThemePreset.kt index 429270372..5f2fb7dda 100644 --- a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/ThemePreset.kt +++ b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/ThemePreset.kt @@ -14,6 +14,7 @@ object ThemePreset { keyboardColor = 0xffeceff1, keyBackgroundColor = 0xfffbfbfc, keyTextColor = 0xff37474f, + candidateTextColor = 0xff37474f, altKeyBackgroundColor = 0xffdfe2e4, // Google Pinyin's symbol color on alphabet key: #727d82 altKeyTextColor = 0xff7a858a, @@ -38,6 +39,7 @@ object ThemePreset { keyboardColor = 0xff263238, keyBackgroundColor = 0xff404a50, keyTextColor = 0xffd9dbdc, + candidateTextColor = 0xffd9dbdc, altKeyBackgroundColor = 0xff313c42, // Google Pinyin's symbol color on alphabet key: #b3b7b9 altKeyTextColor = 0xffadb1b3, @@ -62,6 +64,7 @@ object ThemePreset { keyboardColor = 0xfffafafa, keyBackgroundColor = 0xffffffff, keyTextColor = 0xff212121, + candidateTextColor = 0xff212121, altKeyBackgroundColor = 0xffe1e1e1, // Google Pinyin's symbol color on alphabet key: #4e4e4e altKeyTextColor = 0xff6e6e6e, @@ -86,6 +89,7 @@ object ThemePreset { keyboardColor = 0xff2d2d2d, keyBackgroundColor = 0xff464646, keyTextColor = 0xfffafafa, + candidateTextColor = 0xfffafafa, altKeyBackgroundColor = 0xff373737, // Google Pinyin's symbol color on alphabet key: #d6d6d6 altKeyTextColor = 0xffacacac, @@ -110,6 +114,7 @@ object ThemePreset { keyboardColor = 0xff1565c0, keyBackgroundColor = 0xff3f80cb, keyTextColor = 0xffffffff, + candidateTextColor = 0xffffffff, altKeyBackgroundColor = 0xff2771c4, // Google Pinyin's symbol color on alphabet key: #d6d6d6 altKeyTextColor = 0xffa9c6e7, @@ -134,6 +139,7 @@ object ThemePreset { keyboardColor = 0xff000000, keyBackgroundColor = 0xff2e2e2e, keyTextColor = 0xffffffff, + candidateTextColor = 0xffffffff, altKeyBackgroundColor = 0xff141414, // Google Pinyin's symbol color on alphabet key: #d9e6f5 altKeyTextColor = 0xffa1a1a1, @@ -158,6 +164,7 @@ object ThemePreset { keyboardColor = 0xffECEFF4, keyBackgroundColor = 0xffECEFF4, keyTextColor = 0xff2E3440, + candidateTextColor = 0xff2E3440, altKeyBackgroundColor = 0xffE5E9F0, altKeyTextColor = 0xff434C5E, accentKeyBackgroundColor = 0xff5E81AC, @@ -181,6 +188,7 @@ object ThemePreset { keyboardColor = 0xff2E3440, keyBackgroundColor = 0xff4C566A, keyTextColor = 0xffECEFF4, + candidateTextColor = 0xffECEFF4, altKeyBackgroundColor = 0xff3B4252, altKeyTextColor = 0xffD8DEE9, accentKeyBackgroundColor = 0xff88C0D0, @@ -204,6 +212,7 @@ object ThemePreset { keyboardColor = 0xff272822, keyBackgroundColor = 0xff33342c, keyTextColor = 0xffd6d6d6, + candidateTextColor = 0xffd6d6d6, altKeyBackgroundColor = 0xff2d2e27, altKeyTextColor = 0xff797979, accentKeyBackgroundColor = 0xffb05279, @@ -230,6 +239,7 @@ object ThemePreset { keyboardColor = 0x00000000, keyBackgroundColor = 0x4bffffff, keyTextColor = 0xffffffff, + candidateTextColor = 0xffffffff, altKeyBackgroundColor = 0x0cffffff, altKeyTextColor = 0xc9ffffff, accentKeyBackgroundColor = 0xff5e97f6, @@ -256,6 +266,7 @@ object ThemePreset { keyboardColor = 0x00000000, keyBackgroundColor = 0x4bffffff, keyTextColor = 0xff000000, + candidateTextColor = 0xff000000, altKeyBackgroundColor = 0x0cffffff, altKeyTextColor = 0xb9000000, accentKeyBackgroundColor = 0xff5e97f6, diff --git a/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/CandidateItemUi.kt b/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/CandidateItemUi.kt index 80ffe83b9..e927b15fb 100644 --- a/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/CandidateItemUi.kt +++ b/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/CandidateItemUi.kt @@ -25,7 +25,7 @@ class CandidateItemUi(override val ctx: Context, theme: Theme) : Ui { textSize = 20f // sp isSingleLine = true gravity = gravityCenter - setTextColor(theme.keyTextColor) + setTextColor(theme.candidateTextColor) } override val root = view(::CustomGestureView) { From 9d7b9201e4a9c46b608e758468c2beb696a51072 Mon Sep 17 00:00:00 2001 From: Bryan Nie Date: Sat, 28 Dec 2024 03:13:04 +0800 Subject: [PATCH 2/6] feat(theme): add candidate text color support - Add candidateTextColor, candidateLabelColor, and candidateCommentColor to Theme interface - Update CandidateItemUi and LabeledCandidateItemUi to use new candidate text colors - Add migration strategy for upgrading themes to version 2.1 - Update ThemePreset with default values for new candidate text colors --- .../data/theme/CustomThemeSerializer.kt | 23 ++++++++++-- .../fcitx/fcitx5/android/data/theme/Theme.kt | 23 ++++++++++++ .../fcitx5/android/data/theme/ThemePreset.kt | 35 ++++++++++++++++++- .../input/candidates/CandidateItemUi.kt | 2 +- .../floating/LabeledCandidateItemUi.kt | 4 +-- 5 files changed, 81 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt index de6507e21..251458d67 100644 --- a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt +++ b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt @@ -55,6 +55,25 @@ object CustomThemeSerializer : JsonTransformingSerializer(Theme.Cu private val strategies: List = // Add migrations here listOf( + MigrationStrategy("2.1") { + JsonObject(it.toMutableMap().apply { + if (get("candidateTextColor") != null) { + put("candidateTextColor", getValue("candidateTextColor")) + } else { + put("candidateTextColor", getValue("keyTextColor")) + } + if (get("candidateLabelColor") != null) { + put("candidateLabelColor", getValue("candidateLabelColor")) + } else { + put("candidateLabelColor", getValue("keyTextColor")) + } + if (get("candidateCommentColor") != null) { + put("candidateCommentColor", getValue("candidateCommentColor")) + } else { + put("candidateCommentColor", getValue("altKeyTextColor")) + } + }) + }, MigrationStrategy("2.0") { JsonObject(it.toMutableMap().apply { if (get("backgroundImage") != null) { @@ -80,8 +99,8 @@ object CustomThemeSerializer : JsonTransformingSerializer(Theme.Cu private const val VERSION = "version" - private const val CURRENT_VERSION = "2.0" - private const val FALLBACK_VERSION = "1.0" + private const val CURRENT_VERSION = "2.1" + private const val FALLBACK_VERSION = "2.0" private val knownVersions = strategies.map { it.version } diff --git a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/Theme.kt b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/Theme.kt index 3f59a66ef..d9501d4b7 100644 --- a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/Theme.kt +++ b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/Theme.kt @@ -30,6 +30,11 @@ sealed class Theme : Parcelable { abstract val keyBackgroundColor: Int abstract val keyTextColor: Int + // Color of candidate text + abstract val candidateTextColor: Int + abstract val candidateLabelColor: Int + abstract val candidateCommentColor: Int + abstract val altKeyBackgroundColor: Int abstract val altKeyTextColor: Int @@ -67,6 +72,9 @@ sealed class Theme : Parcelable { override val keyboardColor: Int, override val keyBackgroundColor: Int, override val keyTextColor: Int, + override val candidateTextColor: Int, + override val candidateLabelColor: Int, + override val candidateCommentColor: Int, override val altKeyBackgroundColor: Int, override val altKeyTextColor: Int, override val accentKeyBackgroundColor: Int, @@ -115,6 +123,9 @@ sealed class Theme : Parcelable { override val keyboardColor: Int, override val keyBackgroundColor: Int, override val keyTextColor: Int, + override val candidateTextColor: Int, + override val candidateLabelColor: Int, + override val candidateCommentColor: Int, override val altKeyBackgroundColor: Int, override val altKeyTextColor: Int, override val accentKeyBackgroundColor: Int, @@ -140,6 +151,9 @@ sealed class Theme : Parcelable { keyboardColor: Number, keyBackgroundColor: Number, keyTextColor: Number, + candidateTextColor: Number, + candidateLabelColor: Number, + candidateCommentColor: Number, altKeyBackgroundColor: Number, altKeyTextColor: Number, accentKeyBackgroundColor: Number, @@ -161,6 +175,9 @@ sealed class Theme : Parcelable { keyboardColor.toInt(), keyBackgroundColor.toInt(), keyTextColor.toInt(), + candidateTextColor.toInt(), + candidateLabelColor.toInt(), + candidateCommentColor.toInt(), altKeyBackgroundColor.toInt(), altKeyTextColor.toInt(), accentKeyBackgroundColor.toInt(), @@ -185,6 +202,9 @@ sealed class Theme : Parcelable { keyboardColor, keyBackgroundColor, keyTextColor, + candidateTextColor, + candidateLabelColor, + candidateCommentColor, altKeyBackgroundColor, altKeyTextColor, accentKeyBackgroundColor, @@ -222,6 +242,9 @@ sealed class Theme : Parcelable { keyboardColor, keyBackgroundColor, keyTextColor, + candidateTextColor, + candidateLabelColor, + candidateCommentColor, altKeyBackgroundColor, altKeyTextColor, accentKeyBackgroundColor, diff --git a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/ThemePreset.kt b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/ThemePreset.kt index 429270372..239e22cb8 100644 --- a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/ThemePreset.kt +++ b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/ThemePreset.kt @@ -14,6 +14,9 @@ object ThemePreset { keyboardColor = 0xffeceff1, keyBackgroundColor = 0xfffbfbfc, keyTextColor = 0xff37474f, + candidateTextColor = 0xff37474f, + candidateLabelColor = 0xff37474f, + candidateCommentColor = 0xff7a858a, altKeyBackgroundColor = 0xffdfe2e4, // Google Pinyin's symbol color on alphabet key: #727d82 altKeyTextColor = 0xff7a858a, @@ -38,6 +41,9 @@ object ThemePreset { keyboardColor = 0xff263238, keyBackgroundColor = 0xff404a50, keyTextColor = 0xffd9dbdc, + candidateTextColor = 0xffd9dbdc, + candidateLabelColor = 0xffd9dbdc, + candidateCommentColor = 0xffadb1b3, altKeyBackgroundColor = 0xff313c42, // Google Pinyin's symbol color on alphabet key: #b3b7b9 altKeyTextColor = 0xffadb1b3, @@ -62,6 +68,9 @@ object ThemePreset { keyboardColor = 0xfffafafa, keyBackgroundColor = 0xffffffff, keyTextColor = 0xff212121, + candidateTextColor = 0xff212121, + candidateLabelColor = 0xff212121, + candidateCommentColor = 0xff6e6e6e, altKeyBackgroundColor = 0xffe1e1e1, // Google Pinyin's symbol color on alphabet key: #4e4e4e altKeyTextColor = 0xff6e6e6e, @@ -86,6 +95,9 @@ object ThemePreset { keyboardColor = 0xff2d2d2d, keyBackgroundColor = 0xff464646, keyTextColor = 0xfffafafa, + candidateTextColor = 0xfffafafa, + candidateLabelColor = 0xfffafafa, + candidateCommentColor = 0xffacacac, altKeyBackgroundColor = 0xff373737, // Google Pinyin's symbol color on alphabet key: #d6d6d6 altKeyTextColor = 0xffacacac, @@ -110,6 +122,9 @@ object ThemePreset { keyboardColor = 0xff1565c0, keyBackgroundColor = 0xff3f80cb, keyTextColor = 0xffffffff, + candidateTextColor = 0xffffffff, + candidateLabelColor = 0xffffffff, + candidateCommentColor = 0xffa9c6e7, altKeyBackgroundColor = 0xff2771c4, // Google Pinyin's symbol color on alphabet key: #d6d6d6 altKeyTextColor = 0xffa9c6e7, @@ -134,6 +149,9 @@ object ThemePreset { keyboardColor = 0xff000000, keyBackgroundColor = 0xff2e2e2e, keyTextColor = 0xffffffff, + candidateTextColor = 0xffffffff, + candidateLabelColor = 0xffffffff, + candidateCommentColor = 0xffa1a1a1, altKeyBackgroundColor = 0xff141414, // Google Pinyin's symbol color on alphabet key: #d9e6f5 altKeyTextColor = 0xffa1a1a1, @@ -158,6 +176,9 @@ object ThemePreset { keyboardColor = 0xffECEFF4, keyBackgroundColor = 0xffECEFF4, keyTextColor = 0xff2E3440, + candidateTextColor = 0xff2E3440, + candidateLabelColor = 0xff2E3440, + candidateCommentColor = 0xff4C566A, altKeyBackgroundColor = 0xffE5E9F0, altKeyTextColor = 0xff434C5E, accentKeyBackgroundColor = 0xff5E81AC, @@ -181,6 +202,9 @@ object ThemePreset { keyboardColor = 0xff2E3440, keyBackgroundColor = 0xff4C566A, keyTextColor = 0xffECEFF4, + candidateTextColor = 0xffECEFF4, + candidateLabelColor = 0xffECEFF4, + candidateCommentColor = 0xffD8DEE9, altKeyBackgroundColor = 0xff3B4252, altKeyTextColor = 0xffD8DEE9, accentKeyBackgroundColor = 0xff88C0D0, @@ -204,6 +228,9 @@ object ThemePreset { keyboardColor = 0xff272822, keyBackgroundColor = 0xff33342c, keyTextColor = 0xffd6d6d6, + candidateTextColor = 0xffd6d6d6, + candidateLabelColor = 0xffd6d6d6, + candidateCommentColor = 0xff797979, altKeyBackgroundColor = 0xff2d2e27, altKeyTextColor = 0xff797979, accentKeyBackgroundColor = 0xffb05279, @@ -230,6 +257,9 @@ object ThemePreset { keyboardColor = 0x00000000, keyBackgroundColor = 0x4bffffff, keyTextColor = 0xffffffff, + candidateTextColor = 0xffffffff, + candidateLabelColor = 0xffffffff, + candidateCommentColor = 0xc9ffffff, altKeyBackgroundColor = 0x0cffffff, altKeyTextColor = 0xc9ffffff, accentKeyBackgroundColor = 0xff5e97f6, @@ -256,6 +286,9 @@ object ThemePreset { keyboardColor = 0x00000000, keyBackgroundColor = 0x4bffffff, keyTextColor = 0xff000000, + candidateTextColor = 0xff000000, + candidateLabelColor = 0xff000000, + candidateCommentColor = 0xb9000000, altKeyBackgroundColor = 0x0cffffff, altKeyTextColor = 0xb9000000, accentKeyBackgroundColor = 0xff5e97f6, @@ -271,4 +304,4 @@ object ThemePreset { genericActiveForegroundColor = 0xffffffff ) -} \ No newline at end of file +} diff --git a/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/CandidateItemUi.kt b/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/CandidateItemUi.kt index 80ffe83b9..e927b15fb 100644 --- a/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/CandidateItemUi.kt +++ b/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/CandidateItemUi.kt @@ -25,7 +25,7 @@ class CandidateItemUi(override val ctx: Context, theme: Theme) : Ui { textSize = 20f // sp isSingleLine = true gravity = gravityCenter - setTextColor(theme.keyTextColor) + setTextColor(theme.candidateTextColor) } override val root = view(::CustomGestureView) { diff --git a/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/floating/LabeledCandidateItemUi.kt b/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/floating/LabeledCandidateItemUi.kt index f308ceb18..7ca863ba3 100644 --- a/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/floating/LabeledCandidateItemUi.kt +++ b/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/floating/LabeledCandidateItemUi.kt @@ -27,8 +27,8 @@ class LabeledCandidateItemUi( } fun update(candidate: FcitxEvent.Candidate, active: Boolean) { - val fg = if (active) theme.genericActiveForegroundColor else theme.keyTextColor - val altFg = if (active) theme.genericActiveForegroundColor else theme.altKeyTextColor + val fg = if (active) theme.genericActiveForegroundColor else theme.candidateLabelColor + val altFg = if (active) theme.genericActiveForegroundColor else theme.candidateCommentColor root.text = buildSpannedString { color(fg) { append(candidate.label) } color(fg) { append(candidate.text) } From 83f282b2b96b7c23beecb88dd00838d572e3fd98 Mon Sep 17 00:00:00 2001 From: Bryan Nie Date: Sat, 28 Dec 2024 14:34:21 +0800 Subject: [PATCH 3/6] Update app/src/main/java/org/fcitx/fcitx5/android/input/candidates/floating/LabeledCandidateItemUi.kt Co-authored-by: rocka --- .../input/candidates/floating/LabeledCandidateItemUi.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/floating/LabeledCandidateItemUi.kt b/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/floating/LabeledCandidateItemUi.kt index 7ca863ba3..b73afe906 100644 --- a/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/floating/LabeledCandidateItemUi.kt +++ b/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/floating/LabeledCandidateItemUi.kt @@ -27,7 +27,8 @@ class LabeledCandidateItemUi( } fun update(candidate: FcitxEvent.Candidate, active: Boolean) { - val fg = if (active) theme.genericActiveForegroundColor else theme.candidateLabelColor + val labelFg = if (active) theme.genericActiveForegroundColor else theme.candidateLabelColor + val fg = if (active) theme.genericActiveForegroundColor else theme.candidateTextColor val altFg = if (active) theme.genericActiveForegroundColor else theme.candidateCommentColor root.text = buildSpannedString { color(fg) { append(candidate.label) } From d48d7c0187793c7ebeec6365ae250b166af8c899 Mon Sep 17 00:00:00 2001 From: Bryan Nie Date: Sat, 28 Dec 2024 14:34:28 +0800 Subject: [PATCH 4/6] Update app/src/main/java/org/fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt Co-authored-by: rocka --- .../data/theme/CustomThemeSerializer.kt | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt index 251458d67..ea4b45b96 100644 --- a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt +++ b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt @@ -57,21 +57,9 @@ object CustomThemeSerializer : JsonTransformingSerializer(Theme.Cu listOf( MigrationStrategy("2.1") { JsonObject(it.toMutableMap().apply { - if (get("candidateTextColor") != null) { - put("candidateTextColor", getValue("candidateTextColor")) - } else { - put("candidateTextColor", getValue("keyTextColor")) - } - if (get("candidateLabelColor") != null) { - put("candidateLabelColor", getValue("candidateLabelColor")) - } else { - put("candidateLabelColor", getValue("keyTextColor")) - } - if (get("candidateCommentColor") != null) { - put("candidateCommentColor", getValue("candidateCommentColor")) - } else { - put("candidateCommentColor", getValue("altKeyTextColor")) - } + put("candidateTextColor", getValue("keyTextColor")) + put("candidateLabelColor", getValue("keyTextColor")) + put("candidateCommentColor", getValue("altKeyTextColor")) }) }, MigrationStrategy("2.0") { From a1bba508da56d85f8c6d469a75a1f00b1518c68e Mon Sep 17 00:00:00 2001 From: Bryan Nie Date: Sat, 28 Dec 2024 14:34:42 +0800 Subject: [PATCH 5/6] Update app/src/main/java/org/fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt Co-authored-by: rocka --- .../fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt index ea4b45b96..ebadfeb16 100644 --- a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt +++ b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/CustomThemeSerializer.kt @@ -88,7 +88,7 @@ object CustomThemeSerializer : JsonTransformingSerializer(Theme.Cu private const val VERSION = "version" private const val CURRENT_VERSION = "2.1" - private const val FALLBACK_VERSION = "2.0" + private const val FALLBACK_VERSION = "1.0" private val knownVersions = strategies.map { it.version } From 07233b7e77ad35e107291219376fb3e7c95ed83a Mon Sep 17 00:00:00 2001 From: Bryan Nie Date: Sat, 28 Dec 2024 14:34:52 +0800 Subject: [PATCH 6/6] Update app/src/main/java/org/fcitx/fcitx5/android/input/candidates/floating/LabeledCandidateItemUi.kt Co-authored-by: rocka --- .../android/input/candidates/floating/LabeledCandidateItemUi.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/floating/LabeledCandidateItemUi.kt b/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/floating/LabeledCandidateItemUi.kt index b73afe906..613473e0f 100644 --- a/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/floating/LabeledCandidateItemUi.kt +++ b/app/src/main/java/org/fcitx/fcitx5/android/input/candidates/floating/LabeledCandidateItemUi.kt @@ -31,7 +31,7 @@ class LabeledCandidateItemUi( val fg = if (active) theme.genericActiveForegroundColor else theme.candidateTextColor val altFg = if (active) theme.genericActiveForegroundColor else theme.candidateCommentColor root.text = buildSpannedString { - color(fg) { append(candidate.label) } + color(labelFg) { append(candidate.label) } color(fg) { append(candidate.text) } if (candidate.comment.isNotBlank()) { append(" ") pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy