From add34217002384d4bf82f64305faaa51e4452aec Mon Sep 17 00:00:00 2001 From: LeanBitLab <245915690+LeanBitLab@users.noreply.github.com> Date: Mon, 27 Apr 2026 18:26:03 +0000 Subject: [PATCH 1/5] Refactor: Rename popup key specifiers Renamed '!autoColumnOrder!' and '!fixedColumnOrder!' to '!autoOrder!' and '!fixedOrder!' respectively. This change involves: - Updating constants in Key.java and removing the TODO. - Renaming references in TextKeyData.kt, LocaleKeyboardInfos.kt, and PopupKeysUtils.kt. - Updating all occurrences in layout assets and locale key texts. - Updating documentation in layouts.md. --- .../assets/layouts/main/bengali_baishakhi.json | 2 +- .../assets/layouts/main/bengali_inscript.json | 2 +- .../assets/layouts/main/bengali_probhat.json | 2 +- .../assets/layouts/main/bengali_unijoy.json | 2 +- .../layouts/more_symbols/symbols_shifted.txt | 4 ++-- app/src/main/assets/layouts/number/number.json | 4 ++-- app/src/main/assets/locale_key_texts/ar.txt | 4 ++-- app/src/main/assets/locale_key_texts/bn-BD.txt | 4 ++-- app/src/main/assets/locale_key_texts/bn-IN.txt | 4 ++-- app/src/main/assets/locale_key_texts/ca.txt | 2 +- app/src/main/assets/locale_key_texts/ckb.txt | 2 +- app/src/main/assets/locale_key_texts/es.txt | 2 +- app/src/main/assets/locale_key_texts/fa.txt | 4 ++-- app/src/main/assets/locale_key_texts/hi.txt | 2 +- app/src/main/assets/locale_key_texts/hy.txt | 2 +- .../locale_key_texts/more_popups_all.txt | 2 +- .../locale_key_texts/more_popups_more.txt | 2 +- app/src/main/assets/locale_key_texts/my.txt | 2 +- app/src/main/assets/locale_key_texts/ne.txt | 2 +- .../java/helium314/keyboard/keyboard/Key.java | 9 ++++----- .../keyboard_parser/LocaleKeyboardInfos.kt | 16 ++++++++-------- .../keyboard_parser/floris/TextKeyData.kt | 18 +++++++++--------- .../keyboard/latin/utils/PopupKeysUtils.kt | 10 +++++----- layouts.md | 4 ++-- 24 files changed, 53 insertions(+), 54 deletions(-) diff --git a/app/src/main/assets/layouts/main/bengali_baishakhi.json b/app/src/main/assets/layouts/main/bengali_baishakhi.json index 6b6ee4487..2ceb7d979 100644 --- a/app/src/main/assets/layouts/main/bengali_baishakhi.json +++ b/app/src/main/assets/layouts/main/bengali_baishakhi.json @@ -94,7 +94,7 @@ }, { "$": "shift_state_selector", "manualOrLocked": { "label": "ঁ", "labelFlags": 1073741824, "popup": { "relevant": [ - { "label": "!autoColumnOrder!6" }, + { "label": "!autoOrder!6" }, { "label": "়" }, { "label": "ৄ" }, { "label": "ঽ" }, diff --git a/app/src/main/assets/layouts/main/bengali_inscript.json b/app/src/main/assets/layouts/main/bengali_inscript.json index 3e03525e8..0ccd49dc9 100644 --- a/app/src/main/assets/layouts/main/bengali_inscript.json +++ b/app/src/main/assets/layouts/main/bengali_inscript.json @@ -98,7 +98,7 @@ }, { "$": "shift_state_selector", "manualOrLocked": { "label": "ঁ", "labelFlags": 1073741824, "popup": { "relevant": [ - {"label": "!autoColumnOrder!6" }, + {"label": "!autoOrder!6" }, { "label": "়" }, { "label": "ৄ" }, { "label": "ঽ" }, diff --git a/app/src/main/assets/layouts/main/bengali_probhat.json b/app/src/main/assets/layouts/main/bengali_probhat.json index fc147f0e6..85a1a914b 100644 --- a/app/src/main/assets/layouts/main/bengali_probhat.json +++ b/app/src/main/assets/layouts/main/bengali_probhat.json @@ -122,7 +122,7 @@ }, { "$": "shift_state_selector", "manualOrLocked": { "label": "ঁ", "popup": { "relevant": [ - { "label": "!autoColumnOrder!6"}, + { "label": "!autoOrder!6"}, { "label": "়" }, { "label": "ৄ"}, { "label": "ঽ"}, diff --git a/app/src/main/assets/layouts/main/bengali_unijoy.json b/app/src/main/assets/layouts/main/bengali_unijoy.json index 929f5d93e..df419c63d 100644 --- a/app/src/main/assets/layouts/main/bengali_unijoy.json +++ b/app/src/main/assets/layouts/main/bengali_unijoy.json @@ -60,7 +60,7 @@ }, { "$": "shift_state_selector", "manualOrLocked": { "label": "ঁ", "labelFlags": 1073741824, "popup": { "relevant": [ - { "label": "!autoColumnOrder!6" }, + { "label": "!autoOrder!6" }, { "label": "়" }, { "label": "ৄ" }, { "label": "ঽ" }, diff --git a/app/src/main/assets/layouts/more_symbols/symbols_shifted.txt b/app/src/main/assets/layouts/more_symbols/symbols_shifted.txt index c707680a8..ba776860b 100644 --- a/app/src/main/assets/layouts/more_symbols/symbols_shifted.txt +++ b/app/src/main/assets/layouts/more_symbols/symbols_shifted.txt @@ -27,5 +27,5 @@ $$$4 [ ] -< !fixedColumnOrder!3 ‹ ≤ « -> !fixedColumnOrder!3 › ≥ » +< !fixedOrder!3 ‹ ≤ « +> !fixedOrder!3 › ≥ » diff --git a/app/src/main/assets/layouts/number/number.json b/app/src/main/assets/layouts/number/number.json index 267716236..d2d4ef656 100644 --- a/app/src/main/assets/layouts/number/number.json +++ b/app/src/main/assets/layouts/number/number.json @@ -93,7 +93,7 @@ "popup": { "relevant": [ { - "label": "!fixedColumnOrder!2" + "label": "!fixedOrder!2" }, { "label": "!hasLabels!" @@ -115,7 +115,7 @@ "popup": { "relevant": [ { - "label": "!fixedColumnOrder!2" + "label": "!fixedOrder!2" }, { "label": "!hasLabels!" diff --git a/app/src/main/assets/locale_key_texts/ar.txt b/app/src/main/assets/locale_key_texts/ar.txt index 5c4b3c007..133219aeb 100644 --- a/app/src/main/assets/locale_key_texts/ar.txt +++ b/app/src/main/assets/locale_key_texts/ar.txt @@ -7,12 +7,12 @@ ي ئ ى ب پ ل ﻻ|لا ﻷ|لأ ﻹ|لإ ﻵ|لآ -ا !fixedColumnOrder!5 آ ء أ إ ٱ +ا !fixedOrder!5 آ ء أ إ ٱ ك گ ک ى ئ ز ژ و ؤ -punctuation !fixedColumnOrder!7 ٕ|ٕ ٔ|ٔ ْ|ْ ٍ|ٍ ٌ|ٌ ً|ً ّ|ّ ٖ|ٖ ٰ|ٰ ٓ|ٓ ِ|ِ ُ|ُ َ|َ ـــ|ـ +punctuation !fixedOrder!7 ٕ|ٕ ٔ|ٔ ْ|ْ ٍ|ٍ ٌ|ٌ ً|ً ّ|ّ ٖ|ٖ ٰ|ٰ ٓ|ٓ ِ|ِ ُ|ُ َ|َ ـــ|ـ « „ “ ” » ‚ ‘ ’ ‹ › diff --git a/app/src/main/assets/locale_key_texts/bn-BD.txt b/app/src/main/assets/locale_key_texts/bn-BD.txt index fe5d56d4d..8c3fb7e27 100644 --- a/app/src/main/assets/locale_key_texts/bn-BD.txt +++ b/app/src/main/assets/locale_key_texts/bn-BD.txt @@ -16,7 +16,7 @@ ী ঈ া আ অ ্ ঁ -ঁ !autoColumnOrder!6 ় ৄ ঽ ৢ ৱ ৣ ৗ ৠ ৺ ঌ ৰ ৡ +ঁ !autoOrder!6 ় ৄ ঽ ৢ ৱ ৣ ৗ ৠ ৺ ঌ ৰ ৡ ব ভ ক খ ত থ ৎ @@ -30,7 +30,7 @@ ন ণ স ষ ম শ -punctuation !autoColumnOrder!8 \, ॥ ? ! !icon/zwnj_key|‌ !icon/zwj_key|‍ # @ ( ) / ; : - + \% +punctuation !autoOrder!8 \, ॥ ? ! !icon/zwnj_key|‌ !icon/zwj_key|‍ # @ ( ) / ; : - + \% [labels] alphabet: কখগ diff --git a/app/src/main/assets/locale_key_texts/bn-IN.txt b/app/src/main/assets/locale_key_texts/bn-IN.txt index f32ed305f..4bd7467e2 100644 --- a/app/src/main/assets/locale_key_texts/bn-IN.txt +++ b/app/src/main/assets/locale_key_texts/bn-IN.txt @@ -23,14 +23,14 @@ ট ঠ ৃ ঋ ং ঁ ঃ -ঁ !autoColumnOrder!6 ় ৄ ঽ ৢ ৱ ৣ ৗ ৠ ৺ ঌ ৰ ৡ +ঁ !autoOrder!6 ় ৄ ঽ ৢ ৱ ৣ ৗ ৠ ৺ ঌ ৰ ৡ ম ণ ন ঞ ব ঢ় ল ষ স শ য় য -punctuation !autoColumnOrder!8 \, ॥ ? ! !icon/zwnj_key|‌ !icon/zwj_key|‍ # @ ( ) / ; : - + \% +punctuation !autoOrder!8 \, ॥ ? ! !icon/zwnj_key|‌ !icon/zwj_key|‍ # @ ( ) / ; : - + \% [labels] alphabet: কখগ diff --git a/app/src/main/assets/locale_key_texts/ca.txt b/app/src/main/assets/locale_key_texts/ca.txt index 619481bcd..4beb4e6f5 100644 --- a/app/src/main/assets/locale_key_texts/ca.txt +++ b/app/src/main/assets/locale_key_texts/ca.txt @@ -6,7 +6,7 @@ o ò ó u ú ü c ç l l·l -punctuation !autoColumnOrder!9 \, ? ! · # ) ( / ; ' @ : - " + \% & +punctuation !autoOrder!9 \, ? ! · # ) ( / ; ' @ : - " + \% & [extra_keys] 2: ç diff --git a/app/src/main/assets/locale_key_texts/ckb.txt b/app/src/main/assets/locale_key_texts/ckb.txt index 5e13897b8..a9c1e5c2f 100644 --- a/app/src/main/assets/locale_key_texts/ckb.txt +++ b/app/src/main/assets/locale_key_texts/ckb.txt @@ -22,7 +22,7 @@ ز ظ ع ؏ ب ى -punctuation !autoColumnOrder!8 \؟ ! ، ٫ ؍ : ؛ ; : | - @ _ # * ٪ & ^ +punctuation !autoOrder!8 \؟ ! ، ٫ ؍ : ؛ ; : | - @ _ # * ٪ & ^ « „ “ ” » ‚ ‘ ’ ‹ › diff --git a/app/src/main/assets/locale_key_texts/es.txt b/app/src/main/assets/locale_key_texts/es.txt index bfaa35a94..5cd4e0591 100644 --- a/app/src/main/assets/locale_key_texts/es.txt +++ b/app/src/main/assets/locale_key_texts/es.txt @@ -6,7 +6,7 @@ o ó º u ú ü n ñ y ý -punctuation !autoColumnOrder!9 \, ? ! # ) ( / ; ¡ ' @ : - " + \% & ¿ +punctuation !autoOrder!9 \, ? ! # ) ( / ; ¡ ' @ : - " + \% & ¿ [extra_keys] 2: ñ diff --git a/app/src/main/assets/locale_key_texts/fa.txt b/app/src/main/assets/locale_key_texts/fa.txt index 3ce747ec4..e84824d74 100644 --- a/app/src/main/assets/locale_key_texts/fa.txt +++ b/app/src/main/assets/locale_key_texts/fa.txt @@ -1,11 +1,11 @@ [popup_keys] ه ﻫ|ه‍ هٔ ة ی ئ ي ﯨ|ى -ا !fixedColumnOrder!5 ٱ ء آ أ إ +ا !fixedOrder!5 ٱ ء آ أ إ ت ة ک ك و ؤ -punctuation !fixedColumnOrder!7 ٕ|ٕ ْ|ْ ّ|ّ ٌ|ٌ ٍ|ٍ ً|ً ٔ|ٔ ٖ|ٖ ٰ|ٰ ٓ|ٓ ُ|ُ ِ|ِ َ|َ ـــ|ـ +punctuation !fixedOrder!7 ٕ|ٕ ْ|ْ ّ|ّ ٌ|ٌ ٍ|ٍ ً|ً ٔ|ٔ ٖ|ٖ ٰ|ٰ ٓ|ٓ ُ|ُ ِ|ِ َ|َ ـــ|ـ « „ “ ” » ‚ ‘ ’ ‹ › diff --git a/app/src/main/assets/locale_key_texts/hi.txt b/app/src/main/assets/locale_key_texts/hi.txt index c30631dca..37ddc5a99 100644 --- a/app/src/main/assets/locale_key_texts/hi.txt +++ b/app/src/main/assets/locale_key_texts/hi.txt @@ -37,7 +37,7 @@ ल ऌ ॡ य य़ ़ ॽ ॰ ऽ -punctuation !autoColumnOrder!9 \, . ॥ ? ! !icon/zwnj_key|‌ !icon/zwj_key|‍ # @ ( ) / ; : - + \% +punctuation !autoOrder!9 \, . ॥ ? ! !icon/zwnj_key|‌ !icon/zwj_key|‍ # @ ( ) / ; : - + \% औ ौ ऐ ै आ ा diff --git a/app/src/main/assets/locale_key_texts/hy.txt b/app/src/main/assets/locale_key_texts/hy.txt index 66b3f3443..c50b1d783 100644 --- a/app/src/main/assets/locale_key_texts/hy.txt +++ b/app/src/main/assets/locale_key_texts/hy.txt @@ -1,5 +1,5 @@ [popup_keys] -punctuation !autoColumnOrder!8 \, ՞ ՜ ․ … ' = / ՝ ՛ ֊ » « ― ) ( +punctuation !autoOrder!8 \, ՞ ՜ ․ … ' = / ՝ ՛ ֊ » « ― ) ( ? ՞ ¿ ! ՜ ¡ diff --git a/app/src/main/assets/locale_key_texts/more_popups_all.txt b/app/src/main/assets/locale_key_texts/more_popups_all.txt index a66fe37fd..c7e0bc996 100644 --- a/app/src/main/assets/locale_key_texts/more_popups_all.txt +++ b/app/src/main/assets/locale_key_texts/more_popups_all.txt @@ -11,7 +11,7 @@ g ğ ģ ġ g\' ĝ c ç ć č ċ ĉ z ž ź ż l ł ĺ ļ ľ ŀ l·l -punctuation !autoColumnOrder!10 \, ? ! # ) ( / ; ' @ : - " + \% & · ¡ ¿ +punctuation !autoOrder!10 \, ? ! # ) ( / ; ' @ : - " + \% & · ¡ ¿ d ď đ ð r ř ŕ ŗ t ť ţ þ ț ŧ diff --git a/app/src/main/assets/locale_key_texts/more_popups_more.txt b/app/src/main/assets/locale_key_texts/more_popups_more.txt index c48b21ad4..6e56422df 100644 --- a/app/src/main/assets/locale_key_texts/more_popups_more.txt +++ b/app/src/main/assets/locale_key_texts/more_popups_more.txt @@ -11,7 +11,7 @@ g ğ ģ ġ c ç ć č ċ z ž ź ż l ł ĺ ļ ľ ŀ -punctuation !autoColumnOrder!9 \, ? ! # ) ( / ; ' @ : - " + \% & ¡ ¿ +punctuation !autoOrder!9 \, ? ! # ) ( / ; ' @ : - " + \% & ¡ ¿ d ď đ ð r ř ŕ ŗ t ť ţ þ ț ŧ diff --git a/app/src/main/assets/locale_key_texts/my.txt b/app/src/main/assets/locale_key_texts/my.txt index f670e805b..74d5a1e5e 100644 --- a/app/src/main/assets/locale_key_texts/my.txt +++ b/app/src/main/assets/locale_key_texts/my.txt @@ -1,5 +1,5 @@ [popup_keys] -punctuation !autoColumnOrder!9 ၊ . ? ! # ) ( / ; ... ' @ : - " + \% & +punctuation !autoOrder!9 ၊ . ? ! # ) ( / ; ... ' @ : - " + \% & [labels] alphabet: ကခဂ diff --git a/app/src/main/assets/locale_key_texts/ne.txt b/app/src/main/assets/locale_key_texts/ne.txt index e89e7d14f..1fd67712f 100644 --- a/app/src/main/assets/locale_key_texts/ne.txt +++ b/app/src/main/assets/locale_key_texts/ne.txt @@ -1,7 +1,7 @@ [popup_keys] ट ़ ् ऽ -punctuation !autoColumnOrder!9 . \, ? ! # ) ( / ; ' @ : - " + \% & +punctuation !autoOrder!9 . \, ? ! # ) ( / ; ' @ : - " + \% & त्त ञ ज्ञ ॥ ड्ढ ई ऐ घ diff --git a/app/src/main/java/helium314/keyboard/keyboard/Key.java b/app/src/main/java/helium314/keyboard/keyboard/Key.java index 7700b0527..1c40bc5ff 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/Key.java +++ b/app/src/main/java/helium314/keyboard/keyboard/Key.java @@ -145,9 +145,8 @@ public class Key implements Comparable { private static final int POPUP_KEYS_FLAGS_HAS_LABELS = 0x40000000; private static final int POPUP_KEYS_FLAGS_NEEDS_DIVIDERS = 0x20000000; private static final int POPUP_KEYS_FLAGS_NO_PANEL_AUTO_POPUP_KEY = 0x10000000; - // TODO: Rename these specifiers to !autoOrder! and !fixedOrder! respectively. - public static final String POPUP_KEYS_AUTO_COLUMN_ORDER = "!autoColumnOrder!"; - public static final String POPUP_KEYS_FIXED_COLUMN_ORDER = "!fixedColumnOrder!"; + public static final String POPUP_KEYS_AUTO_ORDER = "!autoOrder!"; + public static final String POPUP_KEYS_FIXED_ORDER = "!fixedOrder!"; public static final String POPUP_KEYS_HAS_LABELS = "!hasLabels!"; private static final String POPUP_KEYS_NEEDS_DIVIDERS = "!needsDividers!"; private static final String POPUP_KEYS_NO_PANEL_AUTO_POPUP_KEY = "!noPanelAutoPopupKey!"; @@ -1111,12 +1110,12 @@ private static int getPopupKeysColumnAndFlagsAndSetNullInArray(final KeyboardPar int popupKeysColumnAndFlags = POPUP_KEYS_MODE_MAX_COLUMN_WITH_AUTO_ORDER | params.mMaxPopupKeysKeyboardColumn; int value; - if ((value = PopupKeySpec.getIntValue(popupKeys, POPUP_KEYS_AUTO_COLUMN_ORDER, -1)) > 0) { + if ((value = PopupKeySpec.getIntValue(popupKeys, POPUP_KEYS_AUTO_ORDER, -1)) > 0) { // Override with fixed column order number and set a relevant mode value. popupKeysColumnAndFlags = POPUP_KEYS_MODE_FIXED_COLUMN_WITH_AUTO_ORDER | (value & POPUP_KEYS_COLUMN_NUMBER_MASK); } - if ((value = PopupKeySpec.getIntValue(popupKeys, POPUP_KEYS_FIXED_COLUMN_ORDER, -1)) > 0) { + if ((value = PopupKeySpec.getIntValue(popupKeys, POPUP_KEYS_FIXED_ORDER, -1)) > 0) { // Override with fixed column order number and set a relevant mode value. popupKeysColumnAndFlags = POPUP_KEYS_MODE_FIXED_COLUMN_WITH_FIXED_ORDER | (value & POPUP_KEYS_COLUMN_NUMBER_MASK); diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/LocaleKeyboardInfos.kt b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/LocaleKeyboardInfos.kt index 676685a15..79a2d6465 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/LocaleKeyboardInfos.kt +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/LocaleKeyboardInfos.kt @@ -53,15 +53,15 @@ class LocaleKeyboardInfos(dataStream: InputStream?, locale: Locale) { // should this also be done with punctuation popupKeys? // todo: those defaults should not be in here if ("\'" !in popupKeys) - popupKeys["\'"] = mutableListOf("!fixedColumnOrder!5", "‚", "‘", "’", "‹", "›") + popupKeys["\'"] = mutableListOf("!fixedOrder!5", "‚", "‘", "’", "‹", "›") if ("\"" !in popupKeys) - popupKeys["\""] = mutableListOf("!fixedColumnOrder!5", "„", "“", "”", "«", "»") + popupKeys["\""] = mutableListOf("!fixedOrder!5", "„", "“", "”", "«", "»") if ("!" !in popupKeys) popupKeys["!"] = mutableListOf("¡") if (labelQuestion !in popupKeys) popupKeys[labelQuestion] = if (labelQuestion == "?") mutableListOf("¿") else mutableListOf("?", "¿") if ("punctuation" !in popupKeys) - popupKeys["punctuation"] = mutableListOf("${Key.POPUP_KEYS_AUTO_COLUMN_ORDER}8", "\\,", "?", "!", "#", ")", "(", "/", ";", "'", "@", ":", "-", "\"", "+", "\\%", "&") + popupKeys["punctuation"] = mutableListOf("${Key.POPUP_KEYS_AUTO_ORDER}8", "\\,", "?", "!", "#", ")", "(", "/", ";", "'", "@", ":", "-", "\"", "+", "\\%", "&") } private fun readStream(stream: InputStream?, onlyPopupKeys: Boolean, priority: Boolean) { @@ -170,21 +170,21 @@ class LocaleKeyboardInfos(dataStream: InputStream?, locale: Locale) { private fun addFixedColumnOrder(popupKeys: MutableCollection) { // use intermediate list, because we can't add first in a LinkedHashSet (i.e. MutableSet) - popupKeys.removeAll { it.startsWith(Key.POPUP_KEYS_FIXED_COLUMN_ORDER) } + popupKeys.removeAll { it.startsWith(Key.POPUP_KEYS_FIXED_ORDER) } val temp = popupKeys.toList() popupKeys.clear() - popupKeys.add("${Key.POPUP_KEYS_FIXED_COLUMN_ORDER}${temp.size}") + popupKeys.add("${Key.POPUP_KEYS_FIXED_ORDER}${temp.size}") popupKeys.addAll(temp) } private fun adjustAutoColumnOrder(popupKeys: MutableCollection) { // same style as above - // currently, POPUP_KEYS_AUTO_COLUMN_ORDER is only used for 2 lines of punctuation popups, so assume 2 lines - if (!popupKeys.removeAll { it.startsWith(Key.POPUP_KEYS_AUTO_COLUMN_ORDER) }) + // currently, POPUP_KEYS_AUTO_ORDER is only used for 2 lines of punctuation popups, so assume 2 lines + if (!popupKeys.removeAll { it.startsWith(Key.POPUP_KEYS_AUTO_ORDER) }) return val temp = popupKeys.toList() popupKeys.clear() - popupKeys.add("${Key.POPUP_KEYS_AUTO_COLUMN_ORDER}${((temp.size + 1) / 2).coerceAtMost(9)}") + popupKeys.add("${Key.POPUP_KEYS_AUTO_ORDER}${((temp.size + 1) / 2).coerceAtMost(9)}") popupKeys.addAll(temp) } diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/TextKeyData.kt b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/TextKeyData.kt index 07f3a3738..7b1a6708f 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/TextKeyData.kt +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/TextKeyData.kt @@ -122,13 +122,13 @@ sealed interface KeyData : AbstractKeyData { popupKeys[i] = popupKeys[i].rtlLabel(params) // for parentheses } if (params.setTabletExtraKeys && popupKeys.contains("!") && popupKeys.contains("?")) { - // remove ! and ? keys and reduce number in autoColumnOrder + // remove ! and ? keys and reduce number in autoOrder // this makes use of removal of empty popupKeys in PopupKeySpec.insertAdditionalPopupKeys popupKeys[popupKeys.indexOf("!")] = "" popupKeys[popupKeys.indexOf("?")] = "" - val columns = popupKeys[0].substringAfter(Key.POPUP_KEYS_AUTO_COLUMN_ORDER).toIntOrNull() + val columns = popupKeys[0].substringAfter(Key.POPUP_KEYS_AUTO_ORDER).toIntOrNull() if (columns != null) - popupKeys[0] = "${Key.POPUP_KEYS_AUTO_COLUMN_ORDER}${columns - 1}" + popupKeys[0] = "${Key.POPUP_KEYS_AUTO_ORDER}${columns - 1}" } return popupKeys } @@ -208,9 +208,9 @@ sealed interface KeyData : AbstractKeyData { // (probably not necessary, but whatever) and in emoji mode if ((Settings.getInstance().isTablet || params.mId.mElementId == KeyboardId.ELEMENT_EMOJI_BOTTOM_ROW) && popupKeys.remove("!icon/emoji_action_key|!code/key_emoji")) { - val i = popupKeys.indexOfFirst { it.startsWith(Key.POPUP_KEYS_FIXED_COLUMN_ORDER) } + val i = popupKeys.indexOfFirst { it.startsWith(Key.POPUP_KEYS_FIXED_ORDER) } if (i > -1) { - val n = popupKeys[i].substringAfter(Key.POPUP_KEYS_FIXED_COLUMN_ORDER).toIntOrNull() + val n = popupKeys[i].substringAfter(Key.POPUP_KEYS_FIXED_ORDER).toIntOrNull() if (n != null) popupKeys[i] = popupKeys[i].replace(n.toString(), (n - 1).toString()) } @@ -245,11 +245,11 @@ sealed interface KeyData : AbstractKeyData { // could make arrays right away, but they need to be copied anyway as popupKeys arrays are modified when creating KeyParams private const val POPUP_KEYS_NAVIGATE_PREVIOUS = "!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard" private const val POPUP_KEYS_NAVIGATE_NEXT = "!icon/clipboard_action_key|!code/key_clipboard,!icon/next_key|!code/key_action_next" - private const val POPUP_KEYS_NAVIGATE_PREVIOUS_NEXT = "!fixedColumnOrder!3,!needsDividers!,!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard,!icon/next_key|!code/key_action_next" - private const val POPUP_KEYS_NAVIGATE_EMOJI_PREVIOUS = "!fixedColumnOrder!3,!needsDividers!,!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji" + private const val POPUP_KEYS_NAVIGATE_PREVIOUS_NEXT = "!fixedOrder!3,!needsDividers!,!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard,!icon/next_key|!code/key_action_next" + private const val POPUP_KEYS_NAVIGATE_EMOJI_PREVIOUS = "!fixedOrder!3,!needsDividers!,!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji" private const val POPUP_KEYS_NAVIGATE_EMOJI = "!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji" - private const val POPUP_KEYS_NAVIGATE_EMOJI_NEXT = "!fixedColumnOrder!3,!needsDividers!,!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji,!icon/next_key|!code/key_action_next" - private const val POPUP_KEYS_NAVIGATE_EMOJI_PREVIOUS_NEXT = "!fixedColumnOrder!4,!needsDividers!,!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji,!icon/next_key|!code/key_action_next" + private const val POPUP_KEYS_NAVIGATE_EMOJI_NEXT = "!fixedOrder!3,!needsDividers!,!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji,!icon/next_key|!code/key_action_next" + private const val POPUP_KEYS_NAVIGATE_EMOJI_PREVIOUS_NEXT = "!fixedOrder!4,!needsDividers!,!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji,!icon/next_key|!code/key_action_next" } /** get the label, but also considers code, which can't be set separately for popup keys and thus goes into the label */ diff --git a/app/src/main/java/helium314/keyboard/latin/utils/PopupKeysUtils.kt b/app/src/main/java/helium314/keyboard/latin/utils/PopupKeysUtils.kt index 7cb6c7846..503dbf6f2 100644 --- a/app/src/main/java/helium314/keyboard/latin/utils/PopupKeysUtils.kt +++ b/app/src/main/java/helium314/keyboard/latin/utils/PopupKeysUtils.kt @@ -38,17 +38,17 @@ fun createPopupKeysArray(popupSet: PopupSet<*>?, params: KeyboardParams, label: } if (!popupKeysDelegate.isInitialized() || popupKeys.isEmpty()) return null - val fco = popupKeys.firstOrNull { it.startsWith(Key.POPUP_KEYS_FIXED_COLUMN_ORDER) } - if (fco != null && fco.substringAfter(Key.POPUP_KEYS_FIXED_COLUMN_ORDER).toIntOrNull() != popupKeys.size - 1) { + val fco = popupKeys.firstOrNull { it.startsWith(Key.POPUP_KEYS_FIXED_ORDER) } + if (fco != null && fco.substringAfter(Key.POPUP_KEYS_FIXED_ORDER).toIntOrNull() != popupKeys.size - 1) { val fcoExpected = popupKeys.size - popupKeys.count { it.startsWith("!") && it.endsWith("!") } - 1 - if (fco.substringAfter(Key.POPUP_KEYS_FIXED_COLUMN_ORDER).toIntOrNull() != fcoExpected) + if (fco.substringAfter(Key.POPUP_KEYS_FIXED_ORDER).toIntOrNull() != fcoExpected) popupKeys.remove(fco) // maybe rather adjust the number instead of remove? } if (popupKeys.size > 1 && (label == "(" || label == ")")) { // add fixed column order for that case (typically other variants of brackets / parentheses // not really fast, but no other way to add first in a LinkedHashSet val tmp = popupKeys.toList() popupKeys.clear() - popupKeys.add("${Key.POPUP_KEYS_FIXED_COLUMN_ORDER}${tmp.size}") + popupKeys.add("${Key.POPUP_KEYS_FIXED_ORDER}${tmp.size}") popupKeys.addAll(tmp) } // autoColumnOrder should be fine @@ -76,7 +76,7 @@ fun getHintLabel(popupSet: PopupSet<*>?, params: KeyboardParams, label: String): return null // better show nothing instead of the toolbar key label return KeySpecParser.getLabel(transformLabel(hintLabel, params)) - // avoid e.g. !autoColumnOrder! as label + // avoid e.g. !autoOrder! as label // this will avoid having labels on comma and period keys ?.takeIf { label -> !label.startsWith("!") || label.count { it == '!' } != 2 } // excluding the special labels } diff --git a/layouts.md b/layouts.md index 09ea59fbe..c7c6f8c51 100644 --- a/layouts.md +++ b/layouts.md @@ -110,8 +110,8 @@ You can also specify special key codes like `a|!code/key_action_previous` or `ab * `!noPanelAutoPopupKey!`: no popups are shown, a long press will result in the first normal popup of the key being selected * `!needsDividers!`: dividers are shown between popup keys * `!hasLabels!`: reduces text size in popup keys for nicer display of labels instead of letters - * `!autoColumnOrder!`: use with a number, e.g. _!autoColumnOrder!4_ will result in 4 popup columns - * `!fixedColumnOrder!`: use with a number, e.g. _!fixedColumnOrder!4_ will result in 4 popup columns. Keys will not be re-ordered if the result is a single line. + * `!autoOrder!`: use with a number, e.g. _!autoOrder!4_ will result in 4 popup columns + * `!fixedOrder!`: use with a number, e.g. _!fixedOrder!4_ will result in 4 popup columns. Keys will not be re-ordered if the result is a single line. ## Adding new layouts / languages * You need a layout file in one of the formats above, and add it to [layouts](app/src/main/assets/layouts) From 2c546dbf19d501d66019404d6101f6aa1772834a Mon Sep 17 00:00:00 2001 From: LeanBitLab <245915690+LeanBitLab@users.noreply.github.com> Date: Mon, 27 Apr 2026 19:17:50 +0000 Subject: [PATCH 2/5] Refactor: Rename popup key specifiers and fix CI task ambiguity - Renamed '!autoColumnOrder!' and '!fixedColumnOrder!' to '!autoOrder!' and '!fixedOrder!' respectively across code and assets. - Updated constants in Key.java and removed the TODO. - Fixed CI failure by using 'testStandardRunTestsUnitTest' to resolve Gradle task ambiguity caused by multiple product flavors. --- .github/workflows/build-test-auto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-auto.yml b/.github/workflows/build-test-auto.yml index a887aa5f8..577db7f67 100644 --- a/.github/workflows/build-test-auto.yml +++ b/.github/workflows/build-test-auto.yml @@ -33,7 +33,7 @@ jobs: run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew testRunTestsUnitTest + run: ./gradlew testStandardRunTestsUnitTest - name: Archive reports for failed job uses: actions/upload-artifact@v4 From fb29af6e65ae649fbaec1be19e854f8447c42f5e Mon Sep 17 00:00:00 2001 From: LeanBitLab <245915690+LeanBitLab@users.noreply.github.com> Date: Mon, 27 Apr 2026 19:42:47 +0000 Subject: [PATCH 3/5] Refactor: Rename popup key specifiers and fix CI/test issues - Renamed '!autoColumnOrder!' and '!fixedColumnOrder!' to '!autoOrder!' and '!fixedOrder!' respectively across code and assets. - Updated constants in Key.java and removed the TODO. - Fixed CI failure by using 'testStandardRunTestsUnitTest' to resolve Gradle task ambiguity caused by multiple product flavors. - Fixed Kotlin test compilation errors by updating InputLogicTest.kt and SuggestTest.kt to use public getters instead of private fields. --- app/src/test/java/helium314/keyboard/latin/InputLogicTest.kt | 4 ++-- app/src/test/java/helium314/keyboard/latin/SuggestTest.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/test/java/helium314/keyboard/latin/InputLogicTest.kt b/app/src/test/java/helium314/keyboard/latin/InputLogicTest.kt index 6acec390d..6296b071e 100644 --- a/app/src/test/java/helium314/keyboard/latin/InputLogicTest.kt +++ b/app/src/test/java/helium314/keyboard/latin/InputLogicTest.kt @@ -55,7 +55,7 @@ class InputLogicTest { private lateinit var latinIME: LatinIME private val settingsValues get() = Settings.getValues() private val inputLogic get() = latinIME.mInputLogic - private val connection: RichInputConnection get() = inputLogic.mConnection + private val connection: RichInputConnection get() = inputLogic.connection private val composerReader = InputLogic::class.java.getDeclaredField("mWordComposer").apply { isAccessible = true } private val composer get() = composerReader.get(inputLogic) as WordComposer private val spaceStateReader = InputLogic::class.java.getDeclaredField("mSpaceState").apply { isAccessible = true } @@ -755,7 +755,7 @@ class InputLogicTest { if (currentScript != ScriptUtils.SCRIPT_HANGUL // check fails if hangul combiner merges symbols && !(codePoint == Constants.CODE_SPACE && oldBefore.lastOrNull() == ' ') // check fails when 2 spaces are converted into a period - && !latinIME.mInputLogic.mSuggestedWords.mWillAutoCorrect // autocorrect obviously creates inconsistencies + && !latinIME.mInputLogic.suggestedWords.mWillAutoCorrect // autocorrect obviously creates inconsistencies ) { if (phantomSpaceToInsert.isEmpty()) assertEquals(oldBefore + insert, textBeforeCursor) diff --git a/app/src/test/java/helium314/keyboard/latin/SuggestTest.kt b/app/src/test/java/helium314/keyboard/latin/SuggestTest.kt index a89575ab9..5e5ea4d9f 100644 --- a/app/src/test/java/helium314/keyboard/latin/SuggestTest.kt +++ b/app/src/test/java/helium314/keyboard/latin/SuggestTest.kt @@ -39,7 +39,7 @@ import kotlin.test.assertEquals ]) class SuggestTest { private lateinit var latinIME: LatinIME - private val suggest get() = latinIME.mInputLogic.mSuggest + private val suggest get() = latinIME.mInputLogic.suggest // values taken from the string array auto_correction_threshold_mode_indexes private val thresholdModest = 0.185f From a3eedaf3584245b08141b1e4176b57b17057e7d5 Mon Sep 17 00:00:00 2001 From: LeanBitLab <245915690+LeanBitLab@users.noreply.github.com> Date: Mon, 27 Apr 2026 19:56:16 +0000 Subject: [PATCH 4/5] Refactor: Rename popup key specifiers and fix CI/tests - Renamed '!autoColumnOrder!' to '!autoOrder!' and '!fixedColumnOrder!' to '!fixedOrder!' across code and assets. - Updated constants in Key.java and removed the TODO. - Fixed CI failure by using 'testOfflineRunTestsUnitTest' to resolve Gradle task ambiguity. - Fixed Kotlin test compilation errors by using public getters for fields that were made private in InputLogic.java. --- .github/workflows/build-test-auto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-auto.yml b/.github/workflows/build-test-auto.yml index 577db7f67..285ea93df 100644 --- a/.github/workflows/build-test-auto.yml +++ b/.github/workflows/build-test-auto.yml @@ -33,7 +33,7 @@ jobs: run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew testStandardRunTestsUnitTest + run: ./gradlew testOfflineRunTestsUnitTest - name: Archive reports for failed job uses: actions/upload-artifact@v4 From 3bc53389ccb3344ef00ec4090703f7c3b77d12fc Mon Sep 17 00:00:00 2001 From: LeanBitLab <245915690+LeanBitLab@users.noreply.github.com> Date: Mon, 27 Apr 2026 20:05:30 +0000 Subject: [PATCH 5/5] Refactor: Rename popup key specifiers and fix CI/tests - Renamed '!autoColumnOrder!' to '!autoOrder!' and '!fixedColumnOrder!' to '!fixedOrder!' across code and assets. - Updated constants in Key.java and removed the TODO. - Aligned CI workflow with main branch by using 'compileOfflineRunTestsKotlin'. - Fixed Kotlin test compilation errors by using public getters for fields that were made private in InputLogic.java. --- .github/workflows/build-test-auto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-auto.yml b/.github/workflows/build-test-auto.yml index 285ea93df..e38a803b0 100644 --- a/.github/workflows/build-test-auto.yml +++ b/.github/workflows/build-test-auto.yml @@ -33,7 +33,7 @@ jobs: run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew testOfflineRunTestsUnitTest + run: ./gradlew compileOfflineRunTestsKotlin - name: Archive reports for failed job uses: actions/upload-artifact@v4