From c2a726d18ed1c0e7c33c950b1ca9c26474bed883 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 29 Dec 2024 20:02:59 +0800 Subject: [PATCH 01/46] Fix tense in fastlane changelog 67.txt --- fastlane/metadata/android/en-US/changelogs/67.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fastlane/metadata/android/en-US/changelogs/67.txt b/fastlane/metadata/android/en-US/changelogs/67.txt index ad6cca44..7320162f 100644 --- a/fastlane/metadata/android/en-US/changelogs/67.txt +++ b/fastlane/metadata/android/en-US/changelogs/67.txt @@ -1,3 +1,3 @@ -* Adds phrases 喼汁, 矮瓜, 蜜棗 -* Adds phrases 縮骨, 縮骨遮 -* Adds phrases 生鏽, 不鏽鋼 +* Added phrases 喼汁, 矮瓜, 蜜棗 +* Added phrases 縮骨, 縮骨遮 +* Added phrases 生鏽, 不鏽鋼 From 75410043e5e89bbb20b8e572d92d5960e50601b2 Mon Sep 17 00:00:00 2001 From: Conway Date: Sat, 11 Jan 2025 01:07:57 +0800 Subject: [PATCH 02/46] Improve privacy policy wording and consistently use parenthetical for language --- PRIVACY-zh.md | 8 ++++---- PRIVACY.md | 4 ++-- README.md | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PRIVACY-zh.md b/PRIVACY-zh.md index 64dc2152..9c27ba39 100644 --- a/PRIVACY-zh.md +++ b/PRIVACY-zh.md @@ -1,11 +1,11 @@ -# 私隱政策 +# 私隱政策(中文版) -**此應用程式(筆畫輸入法)不會收集任何個人資料。** +**此應用程式(筆畫輸入法)不收集任何個人資料。** 歡迎並鼓勵考察原碼,<>。 倘發現漏洞或私隱問題,請告諸 <>。 --- -[English version of Privacy Policy](PRIVACY.md#privacy-policy)
-(凡中英文有出入者,則以英文為主。) +[Privacy Policy (English version)](PRIVACY.md#privacy-policy)
+(凡中英文有出入者,則以英文版為主。) diff --git a/PRIVACY.md b/PRIVACY.md index 839f0138..5c684c50 100644 --- a/PRIVACY.md +++ b/PRIVACY.md @@ -1,4 +1,4 @@ -# Privacy Policy +# Privacy Policy (English version) **This app (Stroke Input Method) does not collect any personal data.** @@ -9,6 +9,6 @@ please report to <>. --- -[私隱政策中文版](PRIVACY-zh.md#私隱政策)
+[私隱政策(中文版)](PRIVACY-zh.md#私隱政策)
(If there be any discrepancy between the English and the Chinese, the English version shall prevail.) diff --git a/README.md b/README.md index 7100701d..c810908f 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ Uses [Conway Stroke Data]. [f-droid]: https://f-droid.org/en/packages/io.github.yawnoc.strokeinput/ [google-play]: https://play.google.com/store/apps/details?id=io.github.yawnoc.strokeinput -- [English version of Privacy Policy](PRIVACY.md#privacy-policy) -- [私隱政策中文版](PRIVACY-zh.md#私隱政策) +- [Privacy Policy (English version)](PRIVACY.md#privacy-policy) +- [私隱政策(中文版)](PRIVACY-zh.md#私隱政策) ## License From 6e2c7aee5587c414a6ebecbc8f97190abd3c2a9a Mon Sep 17 00:00:00 2001 From: Conway Date: Sat, 11 Jan 2025 01:11:44 +0800 Subject: [PATCH 03/46] Update anchor links for tweaked privacy policy headings --- PRIVACY-zh.md | 2 +- PRIVACY.md | 2 +- README.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PRIVACY-zh.md b/PRIVACY-zh.md index 9c27ba39..429735e1 100644 --- a/PRIVACY-zh.md +++ b/PRIVACY-zh.md @@ -7,5 +7,5 @@ --- -[Privacy Policy (English version)](PRIVACY.md#privacy-policy)
+[Privacy Policy (English version)](PRIVACY.md#privacy-policy-english-version)
(凡中英文有出入者,則以英文版為主。) diff --git a/PRIVACY.md b/PRIVACY.md index 5c684c50..927a341d 100644 --- a/PRIVACY.md +++ b/PRIVACY.md @@ -9,6 +9,6 @@ please report to <>. --- -[私隱政策(中文版)](PRIVACY-zh.md#私隱政策)
+[私隱政策(中文版)](PRIVACY-zh.md#私隱政策中文版)
(If there be any discrepancy between the English and the Chinese, the English version shall prevail.) diff --git a/README.md b/README.md index c810908f..ea60c590 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ Uses [Conway Stroke Data]. [f-droid]: https://f-droid.org/en/packages/io.github.yawnoc.strokeinput/ [google-play]: https://play.google.com/store/apps/details?id=io.github.yawnoc.strokeinput -- [Privacy Policy (English version)](PRIVACY.md#privacy-policy) -- [私隱政策(中文版)](PRIVACY-zh.md#私隱政策) +- [Privacy Policy (English version)](PRIVACY.md#privacy-policy-english-version) +- [私隱政策(中文版)](PRIVACY-zh.md#私隱政策中文版) ## License From 70c3890877960f27f3cf234fad00c5b96d13d346 Mon Sep 17 00:00:00 2001 From: Conway Date: Sat, 11 Jan 2025 01:21:09 +0800 Subject: [PATCH 04/46] Update privacy policy button URL anchor for tweak --- CHANGELOG.md | 3 +++ .../main/java/io/github/yawnoc/strokeinput/MainActivity.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9024e36d..15175f05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ## [Unreleased] +- Tweaked privacy policy punctuation (English) and wording (Chinese) +- Updated privacy policy button URL anchor for said tweak + ## [v1.4.1] (67) 不鏽鋼 (2024-12-29) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/MainActivity.java b/app/src/main/java/io/github/yawnoc/strokeinput/MainActivity.java index 665d69ff..4db563be 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/MainActivity.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/MainActivity.java @@ -50,7 +50,7 @@ public class MainActivity private static final String ASSETS_DIRECTORY = "file:///android_asset/"; private static final String SOURCE_CODE_URI = "https://github.com/stroke-input/stroke-input-android"; private static final String PRIVACY_POLICY_URI = - "https://github.com/stroke-input/stroke-input-android/blob/master/PRIVACY.md#privacy-policy"; + "https://github.com/stroke-input/stroke-input-android/blob/master/PRIVACY.md#privacy-policy-english-version"; AlertDialog.Builder candidateOrderDialogBuilder; Dialog candidateOrderDialog; From a46b752de28d3c72cdbb48a83b94e5ea186363e1 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 16:02:02 +0800 Subject: [PATCH 05/46] Put function column first in Help > Miscellaneous table --- CHANGELOG.md | 1 + app/src/main/assets/help-zh-Hans-CN.cmd | 6 +++--- app/src/main/assets/help-zh-Hans-CN.html | 6 +++--- app/src/main/assets/help-zh-Hant-HK.cmd | 6 +++--- app/src/main/assets/help-zh-Hant-HK.html | 6 +++--- app/src/main/assets/help-zh-Hant-TW.cmd | 6 +++--- app/src/main/assets/help-zh-Hant-TW.html | 6 +++--- app/src/main/assets/help.cmd | 6 +++--- app/src/main/assets/help.html | 6 +++--- 9 files changed, 25 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15175f05..0252f6af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased] +- Put function column first in Help > Miscellaneous table - Tweaked privacy policy punctuation (English) and wording (Chinese) - Updated privacy policy button URL anchor for said tweak diff --git a/app/src/main/assets/help-zh-Hans-CN.cmd b/app/src/main/assets/help-zh-Hans-CN.cmd index e5f4bc51..cf44cf82 100644 --- a/app/src/main/assets/help-zh-Hans-CN.cmd +++ b/app/src/main/assets/help-zh-Hans-CN.cmd @@ -73,15 +73,15 @@ OrdinaryDictionaryReplacement: #.boilerplate-properties-override '''' |^ // - ; 动作 ; 功能 + ; 动作 |: // - , 横扫 \space-bar-zh , 转语言 + , 横扫 \space-bar-zh // - , 长按 \space-bar-zh , 转至其他键盘 + , 长按 \space-bar-zh '''' diff --git a/app/src/main/assets/help-zh-Hans-CN.html b/app/src/main/assets/help-zh-Hans-CN.html index ff4474db..ce3638ca 100644 --- a/app/src/main/assets/help-zh-Hans-CN.html +++ b/app/src/main/assets/help-zh-Hans-CN.html @@ -70,18 +70,18 @@

杂项

- + - + - +
动作 功能动作
横扫 ◀ 中文 ▶ 转语言横扫 ◀ 中文 ▶
长按 ◀ 中文 ▶ 转至其他键盘长按 ◀ 中文 ▶
diff --git a/app/src/main/assets/help-zh-Hant-HK.cmd b/app/src/main/assets/help-zh-Hant-HK.cmd index b67fcca8..c3e66ad5 100644 --- a/app/src/main/assets/help-zh-Hant-HK.cmd +++ b/app/src/main/assets/help-zh-Hant-HK.cmd @@ -74,15 +74,15 @@ OrdinaryDictionaryReplacement: #.boilerplate-properties-override '''' |^ // - ; 動作 ; 功能 + ; 動作 |: // - , 橫掃 \space-bar-zh , 轉語言 + , 橫掃 \space-bar-zh // - , 長撳 \space-bar-zh , 轉至其他鍵盤 + , 長撳 \space-bar-zh '''' diff --git a/app/src/main/assets/help-zh-Hant-HK.html b/app/src/main/assets/help-zh-Hant-HK.html index cc2c3e1d..4feb8493 100644 --- a/app/src/main/assets/help-zh-Hant-HK.html +++ b/app/src/main/assets/help-zh-Hant-HK.html @@ -70,18 +70,18 @@

雜項

- + - + - +
動作 功能動作
橫掃 ◀ 中文 ▶ 轉語言橫掃 ◀ 中文 ▶
長撳 ◀ 中文 ▶ 轉至其他鍵盤長撳 ◀ 中文 ▶
diff --git a/app/src/main/assets/help-zh-Hant-TW.cmd b/app/src/main/assets/help-zh-Hant-TW.cmd index 8d6e373c..06145a13 100644 --- a/app/src/main/assets/help-zh-Hant-TW.cmd +++ b/app/src/main/assets/help-zh-Hant-TW.cmd @@ -74,15 +74,15 @@ OrdinaryDictionaryReplacement: #.boilerplate-properties-override '''' |^ // - ; 動作 ; 功能 + ; 動作 |: // - , 橫掃 \space-bar-zh , 轉語言 + , 橫掃 \space-bar-zh // - , 長按 \space-bar-zh , 轉至其他鍵盤 + , 長按 \space-bar-zh '''' diff --git a/app/src/main/assets/help-zh-Hant-TW.html b/app/src/main/assets/help-zh-Hant-TW.html index 07aa70eb..b38ff8c7 100644 --- a/app/src/main/assets/help-zh-Hant-TW.html +++ b/app/src/main/assets/help-zh-Hant-TW.html @@ -70,18 +70,18 @@

雜項

- + - + - +
動作 功能動作
橫掃 ◀ 中文 ▶ 轉語言橫掃 ◀ 中文 ▶
長按 ◀ 中文 ▶ 轉至其他鍵盤長按 ◀ 中文 ▶
diff --git a/app/src/main/assets/help.cmd b/app/src/main/assets/help.cmd index 0b9c511b..b5f9ad1e 100644 --- a/app/src/main/assets/help.cmd +++ b/app/src/main/assets/help.cmd @@ -73,15 +73,15 @@ OrdinaryDictionaryReplacement: #.boilerplate-properties-override '''' |^ // - ; Action ; Function + ; Action |: // - , Horizontally swipe \space-bar-en , Change language + , Horizontally swipe \space-bar-en // - , Long press \space-bar-en , Change to other keyboard + , Long press \space-bar-en '''' diff --git a/app/src/main/assets/help.html b/app/src/main/assets/help.html index 2df9b98a..651d4fdc 100644 --- a/app/src/main/assets/help.html +++ b/app/src/main/assets/help.html @@ -70,18 +70,18 @@

Miscellaneous

- + - + - +
Action FunctionAction
Horizontally swipe ◀ English ▶ Change languageHorizontally swipe ◀ English ▶
Long press ◀ English ▶ Change to other keyboardLong press ◀ English ▶
From 35f836a636af4b88bc50cea1c6dd46f4958eef1a Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 16:23:29 +0800 Subject: [PATCH 06/46] Move 'Retract keyboard' into Help > Miscellaneous table --- CHANGELOG.md | 4 +++- app/src/main/assets/help-zh-Hans-CN.cmd | 13 +++---------- app/src/main/assets/help-zh-Hans-CN.html | 11 ++++------- app/src/main/assets/help-zh-Hant-HK.cmd | 13 +++---------- app/src/main/assets/help-zh-Hant-HK.html | 11 ++++------- app/src/main/assets/help-zh-Hant-TW.cmd | 13 +++---------- app/src/main/assets/help-zh-Hant-TW.html | 11 ++++------- app/src/main/assets/help.cmd | 14 +++----------- app/src/main/assets/help.html | 12 ++++-------- 9 files changed, 31 insertions(+), 71 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0252f6af..4db1050d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ ## [Unreleased] -- Put function column first in Help > Miscellaneous table +- Tweaked Help > Miscellaneous explanations + - Put Function column before Action column in table + - Moved 'Retract keyboard' explanation into table - Tweaked privacy policy punctuation (English) and wording (Chinese) - Updated privacy policy button URL anchor for said tweak diff --git a/app/src/main/assets/help-zh-Hans-CN.cmd b/app/src/main/assets/help-zh-Hans-CN.cmd index cf44cf82..cb116d4a 100644 --- a/app/src/main/assets/help-zh-Hans-CN.cmd +++ b/app/src/main/assets/help-zh-Hans-CN.cmd @@ -76,6 +76,9 @@ OrdinaryDictionaryReplacement: #.boilerplate-properties-override ; 功能 ; 动作 |: +// + , 收回键盘 + , 用系统返回按钮(或返回手势) // , 转语言 , 横扫 \space-bar-zh @@ -85,16 +88,6 @@ OrdinaryDictionaryReplacement: #.boilerplate-properties-override '''' -## 收回键盘 - ----- -用系统__返回按钮__(或__返回手势__)来收回键盘。 ----- ----- -(若 Android~13+ __手势导航__不便,可考虑复还__“三按钮”导航__,并使用__返回按钮__。) ----- - -
此页的 [CMD] 源码: [cmd-source]
diff --git a/app/src/main/assets/help-zh-Hans-CN.html b/app/src/main/assets/help-zh-Hans-CN.html index ce3638ca..c87bcfbc 100644 --- a/app/src/main/assets/help-zh-Hans-CN.html +++ b/app/src/main/assets/help-zh-Hans-CN.html @@ -76,6 +76,10 @@

杂项

+收回键盘 +用系统返回按钮(或返回手势) + + 转语言 横扫 ◀ 中文 ▶ @@ -85,13 +89,6 @@

杂项

-

收回键盘

-

-用系统返回按钮(或返回手势)来收回键盘。 -

-

-(若 Android 13+ 手势导航不便,可考虑复还“三按钮”导航,并使用返回按钮。) -

diff --git a/app/src/main/assets/help-zh-Hant-HK.cmd b/app/src/main/assets/help-zh-Hant-HK.cmd index c3e66ad5..2d7ceed3 100644 --- a/app/src/main/assets/help-zh-Hant-HK.cmd +++ b/app/src/main/assets/help-zh-Hant-HK.cmd @@ -77,6 +77,9 @@ OrdinaryDictionaryReplacement: #.boilerplate-properties-override ; 功能 ; 動作 |: +// + , 收回鍵盤 + , 以系統返回掣(或返回手勢) // , 轉語言 , 橫掃 \space-bar-zh @@ -86,16 +89,6 @@ OrdinaryDictionaryReplacement: #.boilerplate-properties-override '''' -## 收回鍵盤 - ----- -以系統__返回掣__(或__返回手勢__)而收回鍵盤。 ----- ----- -(若 Android~13+ __手勢導覽__不便,可考慮復還__三按鈕導覽__,並使用__反回掣__。) ----- - -
此頁之 [CMD] 源碼: [cmd-source]
diff --git a/app/src/main/assets/help-zh-Hant-HK.html b/app/src/main/assets/help-zh-Hant-HK.html index 4feb8493..c6ea0f29 100644 --- a/app/src/main/assets/help-zh-Hant-HK.html +++ b/app/src/main/assets/help-zh-Hant-HK.html @@ -76,6 +76,10 @@

雜項

+收回鍵盤 +以系統返回掣(或返回手勢) + + 轉語言 橫掃 ◀ 中文 ▶ @@ -85,13 +89,6 @@

雜項

-

收回鍵盤

-

-以系統返回掣(或返回手勢)而收回鍵盤。 -

-

-(若 Android 13+ 手勢導覽不便,可考慮復還三按鈕導覽,並使用反回掣。) -

diff --git a/app/src/main/assets/help-zh-Hant-TW.cmd b/app/src/main/assets/help-zh-Hant-TW.cmd index 06145a13..4fc63856 100644 --- a/app/src/main/assets/help-zh-Hant-TW.cmd +++ b/app/src/main/assets/help-zh-Hant-TW.cmd @@ -77,6 +77,9 @@ OrdinaryDictionaryReplacement: #.boilerplate-properties-override ; 功能 ; 動作 |: +// + , 收回鍵盤 + , 以系統返回按鈕(或返回手勢) // , 轉語言 , 橫掃 \space-bar-zh @@ -86,16 +89,6 @@ OrdinaryDictionaryReplacement: #.boilerplate-properties-override '''' -## 收回鍵盤 - ----- -以系統__返回按鈕__(或__返回手勢__)而收回鍵盤。 ----- ----- -(若 Android~13+ __手勢操作__不便,可考慮復還__三按鈕操作__,並使用__返回按鈕__。) ----- - -
此頁之 [CMD] 原始程式: [cmd-source]
diff --git a/app/src/main/assets/help-zh-Hant-TW.html b/app/src/main/assets/help-zh-Hant-TW.html index b38ff8c7..adb4df97 100644 --- a/app/src/main/assets/help-zh-Hant-TW.html +++ b/app/src/main/assets/help-zh-Hant-TW.html @@ -76,6 +76,10 @@

雜項

+收回鍵盤 +以系統返回按鈕(或返回手勢) + + 轉語言 橫掃 ◀ 中文 ▶ @@ -85,13 +89,6 @@

雜項

-

收回鍵盤

-

-以系統返回按鈕(或返回手勢)而收回鍵盤。 -

-

-(若 Android 13+ 手勢操作不便,可考慮復還三按鈕操作,並使用返回按鈕。) -

diff --git a/app/src/main/assets/help.cmd b/app/src/main/assets/help.cmd index b5f9ad1e..a8c8b951 100644 --- a/app/src/main/assets/help.cmd +++ b/app/src/main/assets/help.cmd @@ -76,6 +76,9 @@ OrdinaryDictionaryReplacement: #.boilerplate-properties-override ; Function ; Action |: +// + , Retract keyboard + , Use system Back Button (or Back Gesture) // , Change language , Horizontally swipe \space-bar-en @@ -85,17 +88,6 @@ OrdinaryDictionaryReplacement: #.boilerplate-properties-override '''' -## Retract keyboard - ----- -Use the system __Back Button__ (or __Back Gesture__) to retract the keyboard. ----- ----- -(If Android~13+ __Gesture Navigation__ is inconvenient, -consider reverting to __3-Button Navigation__ and using the __Back Button__.) ----- - -
This page's [CMD] source: [cmd-source]
diff --git a/app/src/main/assets/help.html b/app/src/main/assets/help.html index 651d4fdc..e757c8d2 100644 --- a/app/src/main/assets/help.html +++ b/app/src/main/assets/help.html @@ -76,6 +76,10 @@

Miscellaneous

+Retract keyboard +Use system Back Button (or Back Gesture) + + Change language Horizontally swipe ◀ English ▶ @@ -85,14 +89,6 @@

Miscellaneous

-

Retract keyboard

-

-Use the system Back Button (or Back Gesture) to retract the keyboard. -

-

-(If Android 13+ Gesture Navigation is inconvenient, -consider reverting to 3-Button Navigation and using the Back Button.) -

From aeae3eba3ff8073d63ff10f392a45f6c2a731411 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 18:28:21 +0800 Subject: [PATCH 07/46] Rewrite addCodePointsToSet as toCodePointSet by overloading with a version that takes a collection --- CHANGELOG.md | 1 + .../strokeinput/StrokeInputService.java | 6 +---- .../io/github/yawnoc/utilities/Stringy.java | 27 ++++++++++++++++--- .../github/yawnoc/utilities/StringyTest.java | 21 +++++++-------- 4 files changed, 35 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4db1050d..18e2238c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased] +- Rewrote `addCodePointsToSet` as `toCodePointSet` - Tweaked Help > Miscellaneous explanations - Put Function column before Action column in table - Moved 'Retract keyboard' explanation into table diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index b9df2eb1..8414a8df 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -878,7 +878,6 @@ private List computeCandidateList(final String strokeDigitSequence) exactMatchCandidateList = Collections.emptyList(); } - final Set prefixMatchCodePointSet = new HashSet<>(); final Collection prefixMatchCharactersCollection = charactersFromStrokeDigitSequence .subMap( @@ -888,10 +887,7 @@ private List computeCandidateList(final String strokeDigitSequence) .values(); final long addCodePointsStartMilliseconds = System.currentTimeMillis(); - for (final String characters : prefixMatchCharactersCollection) - { - Stringy.addCodePointsToSet(characters, prefixMatchCodePointSet); - } + final Set prefixMatchCodePointSet = Stringy.toCodePointSet(prefixMatchCharactersCollection); final long addCodePointsEndMilliseconds = System.currentTimeMillis(); if (BuildConfig.DEBUG) { diff --git a/app/src/main/java/io/github/yawnoc/utilities/Stringy.java b/app/src/main/java/io/github/yawnoc/utilities/Stringy.java index 8e5659b0..377e51e3 100644 --- a/app/src/main/java/io/github/yawnoc/utilities/Stringy.java +++ b/app/src/main/java/io/github/yawnoc/utilities/Stringy.java @@ -8,6 +8,8 @@ package io.github.yawnoc.utilities; import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.regex.Pattern; @@ -66,17 +68,36 @@ public static List toCodePointList(final String string) } /* - Add the (unicode) code points of a string to a set + Convert a string to a set of (unicode) code points. */ - public static void addCodePointsToSet(final String string, final Set set) + public static Set toCodePointSet(final String string) { + final Set codePointSet = new HashSet<>(); + final int charCount = string.length(); for (int charIndex = 0; charIndex < charCount;) { final int codePoint = string.codePointAt(charIndex); - set.add(codePoint); + codePointSet.add(codePoint); charIndex += Character.charCount(codePoint); } + + return codePointSet; + } + + /* + Convert a collection of strings to a set of (unicode) code points. + */ + public static Set toCodePointSet(final Collection stringCollection) + { + final Set codePointSet = new HashSet<>(); + + for (final String string : stringCollection) + { + codePointSet.addAll(toCodePointSet(string)); + } + + return codePointSet; } /* diff --git a/app/src/test/java/io/github/yawnoc/utilities/StringyTest.java b/app/src/test/java/io/github/yawnoc/utilities/StringyTest.java index 0a290547..a18f10d2 100644 --- a/app/src/test/java/io/github/yawnoc/utilities/StringyTest.java +++ b/app/src/test/java/io/github/yawnoc/utilities/StringyTest.java @@ -12,10 +12,8 @@ import org.junit.Test; import java.util.Arrays; -import java.util.Collections; import java.util.HashSet; import java.util.List; -import java.util.Set; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -87,18 +85,17 @@ public void toCodePointList_isCorrect() } @Test - public void addCodePointsToSet_isCorrect() + public void toCodePointSet_isCorrect() { - final int SOME_CODE_POINT = 0x1234; - final Set commonsCodePointSet = new HashSet<>(Collections.singletonList(SOME_CODE_POINT)); - Stringy.addCodePointsToSet("天下為公", commonsCodePointSet); - assertEquals(commonsCodePointSet, new HashSet<>(Arrays.asList(SOME_CODE_POINT, 0x5929, 0x4E0B, 0x70BA, 0x516C))); - - final Set asciiFullCodePointSet = new HashSet<>(); - Stringy.addCodePointsToSet(ASCII_FULL_STRING, asciiFullCodePointSet); - assertEquals(asciiFullCodePointSet, new HashSet<>(ASCII_CODE_POINT_RANGE)); + assertEquals(Stringy.toCodePointSet(ASCII_FULL_STRING), new HashSet<>(ASCII_CODE_POINT_RANGE)); + assertEquals(Stringy.toCodePointSet("天下為公"), new HashSet<>(Arrays.asList(0x5929, 0x4E0B, 0x70BA, 0x516C))); + + assertEquals( + Stringy.toCodePointSet(Arrays.asList("ABC", "天地玄黃", "BCD")), + new HashSet<>(Arrays.asList(0x41, 0x42, 0x43, 0x5929, 0x5730, 0x7384, 0x9EC3, 0x44)) + ); } - + @Test public void toString_isCorrect() { From eaf80897e213c431ccb6f591b3201190d45ff3fc Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 18:30:08 +0800 Subject: [PATCH 08/46] Replace import org.junit.Assert.* with actual imports --- app/src/test/java/io/github/yawnoc/utilities/MappyTest.java | 2 +- .../test/java/io/github/yawnoc/utilities/StringyTest.java | 5 ++++- app/src/test/java/io/github/yawnoc/utilities/ValueyTest.java | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/test/java/io/github/yawnoc/utilities/MappyTest.java b/app/src/test/java/io/github/yawnoc/utilities/MappyTest.java index 5282fba9..f0ac28c1 100644 --- a/app/src/test/java/io/github/yawnoc/utilities/MappyTest.java +++ b/app/src/test/java/io/github/yawnoc/utilities/MappyTest.java @@ -7,7 +7,7 @@ package io.github.yawnoc.utilities; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.junit.Test; diff --git a/app/src/test/java/io/github/yawnoc/utilities/StringyTest.java b/app/src/test/java/io/github/yawnoc/utilities/StringyTest.java index a18f10d2..11a3162e 100644 --- a/app/src/test/java/io/github/yawnoc/utilities/StringyTest.java +++ b/app/src/test/java/io/github/yawnoc/utilities/StringyTest.java @@ -7,7 +7,10 @@ package io.github.yawnoc.utilities; -import static org.junit.Assert.*; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import org.junit.Test; diff --git a/app/src/test/java/io/github/yawnoc/utilities/ValueyTest.java b/app/src/test/java/io/github/yawnoc/utilities/ValueyTest.java index 708e8dda..9fffceab 100644 --- a/app/src/test/java/io/github/yawnoc/utilities/ValueyTest.java +++ b/app/src/test/java/io/github/yawnoc/utilities/ValueyTest.java @@ -7,7 +7,7 @@ package io.github.yawnoc.utilities; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import org.junit.Test; From aac91daea71363b651856290084c250fd33b4f68 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 18:32:24 +0800 Subject: [PATCH 09/46] Fix trailing whitespace in Java tests --- .../io/github/yawnoc/utilities/MappyTest.java | 4 +-- .../github/yawnoc/utilities/StringyTest.java | 26 +++++++++---------- .../github/yawnoc/utilities/ValueyTest.java | 6 ++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/src/test/java/io/github/yawnoc/utilities/MappyTest.java b/app/src/test/java/io/github/yawnoc/utilities/MappyTest.java index f0ac28c1..1d35f099 100644 --- a/app/src/test/java/io/github/yawnoc/utilities/MappyTest.java +++ b/app/src/test/java/io/github/yawnoc/utilities/MappyTest.java @@ -23,12 +23,12 @@ public void invertMap_isCorrect() forwardMap.put(1, "one"); forwardMap.put(2, "two"); forwardMap.put(3, "three"); - + final Map inverseMap = new HashMap<>(); inverseMap.put("one", 1); inverseMap.put("two", 2); inverseMap.put("three", 3); - + assertEquals(Mappy.invertMap(forwardMap), inverseMap); assertEquals(Mappy.invertMap(inverseMap), forwardMap); } diff --git a/app/src/test/java/io/github/yawnoc/utilities/StringyTest.java b/app/src/test/java/io/github/yawnoc/utilities/StringyTest.java index 11a3162e..0f51c06d 100644 --- a/app/src/test/java/io/github/yawnoc/utilities/StringyTest.java +++ b/app/src/test/java/io/github/yawnoc/utilities/StringyTest.java @@ -40,13 +40,13 @@ public void isAscii_isCorrect() assertTrue(Stringy.isAscii("abc 123 #@% +-*/ ,:;.?!")); assertTrue(Stringy.isAscii("\"\\")); assertTrue(Stringy.isAscii(ASCII_FULL_STRING)); - + assertFalse(Stringy.isAscii(Stringy.toString(ASCII_CODE_POINT_END + 1))); assertFalse(Stringy.isAscii(ASCII_FULL_STRING + "文")); assertFalse(Stringy.isAscii("一")); assertFalse(Stringy.isAscii("U+FF0C FULLWIDTH COMMA ,")); } - + @Test public void removePrefixRegex_isCorrect() { @@ -55,7 +55,7 @@ public void removePrefixRegex_isCorrect() assertEquals(Stringy.removePrefixRegex("[a-z]+", "abc xyz"), " xyz"); assertEquals(Stringy.removePrefixRegex("[a-z]+", "123 456"), "123 456"); } - + @Test public void removeSuffixRegex_isCorrect() { @@ -63,7 +63,7 @@ public void removeSuffixRegex_isCorrect() assertEquals(Stringy.removeSuffixRegex("[a-z]+", "abc xyz"), "abc "); assertEquals(Stringy.removeSuffixRegex("[a-z]+", "123 456"), "123 456"); } - + @Test public void removePrefix_isCorrect() { @@ -72,21 +72,21 @@ public void removePrefix_isCorrect() assertEquals(Stringy.removePrefix("2", "234"), "34"); assertEquals(Stringy.removePrefix("WELL_", "WELL_SCREW_YOU"), "SCREW_YOU"); } - + @Test public void getFirstCodePoint_isCorrect() { assertEquals(Stringy.getFirstCodePoint("ABC"), 0x0041); assertEquals(Stringy.getFirstCodePoint("天下為公"), 0x5929); } - + @Test public void toCodePointList_isCorrect() { assertEquals(Stringy.toCodePointList(ASCII_FULL_STRING), ASCII_CODE_POINT_RANGE); assertEquals(Stringy.toCodePointList("天下為公"), Arrays.asList(0x5929, 0x4E0B, 0x70BA, 0x516C)); } - + @Test public void toCodePointSet_isCorrect() { @@ -103,17 +103,17 @@ public void toCodePointSet_isCorrect() public void toString_isCorrect() { assertEquals(Stringy.toString(0x0000), "\0"); - + assertEquals(Stringy.toString(0x0030), "0"); assertEquals("!", Stringy.toString(0x0021)); assertEquals("A", Stringy.toString(0x0041)); - + assertEquals(Stringy.toString(0x3007), "〇"); assertEquals(Stringy.toString(0x3400), "㐀"); assertEquals(Stringy.toString(0x4DB5), "䶵"); assertEquals(Stringy.toString(0x4E00), "一"); assertEquals(Stringy.toString(0x9FD0), "鿐"); - + assertEquals(Stringy.toString(0x2000B), "\uD840\uDC0B"); // 𠀋 assertEquals(Stringy.toString(0x2A6B2), "\uD869\uDEB2"); // 𪚲 assertEquals(Stringy.toString(0x2A7DD), "\uD869\uDFDD"); // 𪟝 @@ -123,21 +123,21 @@ public void toString_isCorrect() assertEquals(Stringy.toString(0x2B8B8), "\uD86E\uDCB8"); // 𫢸 assertEquals(Stringy.toString(0x2CE93), "\uD873\uDE93"); // 𬺓 } - + @Test public void toCharacterList_isCorrect() { assertEquals(Stringy.toCharacterList("ABC"), Arrays.asList("A", "B", "C")); assertEquals(Stringy.toCharacterList("天下為公"), Arrays.asList("天", "下", "為", "公")); } - + @Test public void sunder_isCorrect() { assertArrayEquals(Stringy.sunder("abc 123", " "), new String[]{"abc", "123"}); assertArrayEquals(Stringy.sunder("abc\t123", "\t"), new String[]{"abc", "123"}); assertArrayEquals(Stringy.sunder("abc:::123", ":::"), new String[]{"abc", "123"}); - + assertArrayEquals(Stringy.sunder("abc123", " "), new String[]{"abc123", ""}); assertArrayEquals(Stringy.sunder(" abc123", " "), new String[]{"", "abc123"}); } diff --git a/app/src/test/java/io/github/yawnoc/utilities/ValueyTest.java b/app/src/test/java/io/github/yawnoc/utilities/ValueyTest.java index 9fffceab..3621bf89 100644 --- a/app/src/test/java/io/github/yawnoc/utilities/ValueyTest.java +++ b/app/src/test/java/io/github/yawnoc/utilities/ValueyTest.java @@ -17,14 +17,14 @@ public class ValueyTest { private static final float FLOAT_ASSERTION_DELTA = 0f; - + @Test public void clipValueToRange_isCorrect() { final List LESS_THAN_ZERO_VALUES = Arrays.asList(-Float.MAX_VALUE, -10f, -1f, -0.5f, -Float.MIN_VALUE, -0f); final List ZERO_TO_ONE_VALUES = Arrays.asList(0f, +0f, Float.MIN_VALUE, 0.7f, 1f - Float.MIN_VALUE, 1f); final List GREATER_THAN_ONE_VALUES = Arrays.asList(1 + Float.MIN_VALUE, 2f, 10000f, Float.MAX_VALUE); - + for (final float value : LESS_THAN_ZERO_VALUES) { assertEquals(Valuey.clipValueToRange(value, 0f, 1f), 0f, FLOAT_ASSERTION_DELTA); @@ -37,7 +37,7 @@ public void clipValueToRange_isCorrect() { assertEquals(Valuey.clipValueToRange(value, 0f, 1f), 1f, FLOAT_ASSERTION_DELTA); } - + assertEquals(Valuey.clipValueToRange(3f, 4f, 6f), 4f, FLOAT_ASSERTION_DELTA); assertEquals(Valuey.clipValueToRange(5f, 4f, 6f), 5f, FLOAT_ASSERTION_DELTA); assertEquals(Valuey.clipValueToRange(7f, 4f, 6f), 6f, FLOAT_ASSERTION_DELTA); From fe477840be4160cab10b985a99ba4769cf8a97c3 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 18:41:18 +0800 Subject: [PATCH 10/46] Remove debug logging in computeCandidateList --- .../yawnoc/strokeinput/StrokeInputService.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index 8414a8df..e0ba8c6e 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -886,14 +886,7 @@ private List computeCandidateList(final String strokeDigitSequence) ) .values(); - final long addCodePointsStartMilliseconds = System.currentTimeMillis(); final Set prefixMatchCodePointSet = Stringy.toCodePointSet(prefixMatchCharactersCollection); - final long addCodePointsEndMilliseconds = System.currentTimeMillis(); - if (BuildConfig.DEBUG) - { - final long durationMilliseconds = addCodePointsEndMilliseconds - addCodePointsStartMilliseconds; - Log.d(LOG_TAG, String.format("Added code points to set in %d ms", durationMilliseconds)); - } if (prefixMatchCodePointSet.size() > LAG_PREVENTION_CODE_POINT_COUNT) { @@ -901,7 +894,6 @@ private List computeCandidateList(final String strokeDigitSequence) } final List prefixMatchCandidateCodePointList = new ArrayList<>(prefixMatchCodePointSet); - final long sortPrefixMatchesStartMilliseconds = System.currentTimeMillis(); prefixMatchCandidateCodePointList.sort( candidateCodePointComparator( unpreferredCodePointSet, @@ -909,12 +901,6 @@ private List computeCandidateList(final String strokeDigitSequence) phraseCompletionFirstCodePointList ) ); - final long sortPrefixMatchesEndMilliseconds = System.currentTimeMillis(); - if (BuildConfig.DEBUG) - { - final long durationMilliseconds = sortPrefixMatchesEndMilliseconds - sortPrefixMatchesStartMilliseconds; - Log.d(LOG_TAG, String.format("Sorted prefix matches in %d ms", durationMilliseconds)); - } final int prefixMatchCount = Math.min(prefixMatchCandidateCodePointList.size(), MAX_PREFIX_MATCH_COUNT); final List prefixMatchCandidateList = new ArrayList<>(); From 40261f31ddfa0525a36d0e69671374505f6725ea Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 18:57:14 +0800 Subject: [PATCH 11/46] Remove prefix matches that duplicate exact matches Fixes . --- .../java/io/github/yawnoc/strokeinput/StrokeInputService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index e0ba8c6e..edc66104 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -864,10 +864,12 @@ private List computeCandidateList(final String strokeDigitSequence) updateCandidateOrderPreference(); + final Set exactMatchCodePointSet; final List exactMatchCandidateList; final String exactMatchCharacters = charactersFromStrokeDigitSequence.get(strokeDigitSequence); if (exactMatchCharacters != null) { + exactMatchCodePointSet = Stringy.toCodePointSet(exactMatchCharacters); exactMatchCandidateList = Stringy.toCharacterList(exactMatchCharacters); exactMatchCandidateList.sort( candidateComparator(unpreferredCodePointSet, sortingRankFromCodePoint, phraseCompletionFirstCodePointList) @@ -875,6 +877,7 @@ private List computeCandidateList(final String strokeDigitSequence) } else { + exactMatchCodePointSet = Collections.emptySet(); exactMatchCandidateList = Collections.emptyList(); } @@ -888,6 +891,7 @@ private List computeCandidateList(final String strokeDigitSequence) final Set prefixMatchCodePointSet = Stringy.toCodePointSet(prefixMatchCharactersCollection); + prefixMatchCodePointSet.removeAll(exactMatchCodePointSet); if (prefixMatchCodePointSet.size() > LAG_PREVENTION_CODE_POINT_COUNT) { prefixMatchCodePointSet.retainAll(commonCodePointSet); From 4e225506a953f998ca43a1e4c88c6be018e4c336 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 21:13:26 +0800 Subject: [PATCH 12/46] Rename candidateList to candidates (variables) --- .../strokeinput/CandidatesViewAdapter.java | 16 ++++++------ .../yawnoc/strokeinput/InputContainer.java | 4 +-- .../strokeinput/StrokeInputService.java | 26 +++++++++---------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/CandidatesViewAdapter.java b/app/src/main/java/io/github/yawnoc/strokeinput/CandidatesViewAdapter.java index f6d49d65..d362e5d1 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/CandidatesViewAdapter.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/CandidatesViewAdapter.java @@ -27,12 +27,12 @@ public class CandidatesViewAdapter { private CandidateListener candidateListener; private final LayoutInflater layoutInflater; - private final List candidateList; + private final List candidates; - CandidatesViewAdapter(final Context context, final List candidateList) + CandidatesViewAdapter(final Context context, final List candidates) { this.layoutInflater = LayoutInflater.from(context); - this.candidateList = candidateList; + this.candidates = candidates; } public interface CandidateListener @@ -46,10 +46,10 @@ public void setCandidateListener(final CandidateListener candidateListener) } @SuppressLint("NotifyDataSetChanged") - public void updateCandidateList(final List candidateList) + public void updateCandidateList(final List candidates) { - this.candidateList.clear(); - this.candidateList.addAll(candidateList); + this.candidates.clear(); + this.candidates.addAll(candidates); notifyDataSetChanged(); } @@ -64,14 +64,14 @@ public ButtonHolder onCreateViewHolder(@NonNull final ViewGroup viewGroup, final @Override public void onBindViewHolder(@NonNull final ButtonHolder buttonHolder, final int candidateIndex) { - final String candidate = candidateList.get(candidateIndex); + final String candidate = candidates.get(candidateIndex); buttonHolder.candidateButton.setText(candidate); } @Override public int getItemCount() { - return candidateList.size(); + return candidates.size(); } public class ButtonHolder diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/InputContainer.java b/app/src/main/java/io/github/yawnoc/strokeinput/InputContainer.java index b1b698cf..f36341cb 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/InputContainer.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/InputContainer.java @@ -143,9 +143,9 @@ public void setStrokeDigitSequence(final String strokeDigitSequence) strokeSequenceBar.setStrokeDigitSequence(strokeDigitSequence); } - public void setCandidateList(final List candidateList) + public void setCandidateList(final List candidates) { - candidatesViewAdapter.updateCandidateList(candidateList); + candidatesViewAdapter.updateCandidateList(candidates); candidatesView.scrollToPosition(0); } diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index edc66104..ec56ed04 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -147,7 +147,7 @@ public class StrokeInputService private NavigableSet phraseSet; private String strokeDigitSequence = ""; - private List candidateList = new ArrayList<>(); + private List candidates = new ArrayList<>(); private final List phraseCompletionFirstCodePointList = new ArrayList<>(); private int inputActionsBits; @@ -429,7 +429,7 @@ public void onStartInputView(final EditorInfo editorInfo, final boolean isRestar inputContainer.setBackground(isFullscreen); inputContainer.setStrokeDigitSequence(strokeDigitSequence); - inputContainer.setCandidateList(candidateList); + inputContainer.setCandidateList(candidates); setEnterKeyDisplayText(); } @@ -561,7 +561,7 @@ private void effectStrokeAppend(final String strokeDigit) if (newCandidateList.size() > 0) { setStrokeDigitSequence(newStrokeDigitSequence); - setCandidateList(newCandidateList); + setCandidates(newCandidateList); } } @@ -573,7 +573,7 @@ private void effectBackspace(final InputConnection inputConnection) final List newCandidateList = computeCandidateList(newStrokeDigitSequence); setStrokeDigitSequence(newStrokeDigitSequence); - setCandidateList(newCandidateList); + setCandidates(newCandidateList); if (newStrokeDigitSequence.length() == 0) { @@ -713,10 +713,10 @@ private void setStrokeDigitSequence(final String strokeDigitSequence) inputContainer.setStrokeDigitSequence(strokeDigitSequence); } - private void setCandidateList(final List candidateList) + private void setCandidates(final List candidates) { - this.candidateList = candidateList; - inputContainer.setCandidateList(candidateList); + this.candidates = candidates; + inputContainer.setCandidateList(candidates); } private void setPhraseCompletionCandidateList(final InputConnection inputConnection) @@ -729,7 +729,7 @@ private void setPhraseCompletionCandidateList(final InputConnection inputConnect phraseCompletionFirstCodePointList.add(Stringy.getFirstCodePoint(phraseCompletionCandidate)); } - setCandidateList(phraseCompletionCandidateList); + setCandidates(phraseCompletionCandidateList); } /* @@ -913,18 +913,18 @@ private List computeCandidateList(final String strokeDigitSequence) prefixMatchCandidateList.add(Stringy.toString(prefixMatchCodePoint)); } - final List candidateList = new ArrayList<>(); - candidateList.addAll(exactMatchCandidateList); - candidateList.addAll(prefixMatchCandidateList); + final List candidates = new ArrayList<>(); + candidates.addAll(exactMatchCandidateList); + candidates.addAll(prefixMatchCandidateList); - return candidateList; + return candidates; } private String getFirstCandidate() { try { - return candidateList.get(0); + return candidates.get(0); } catch (IndexOutOfBoundsException exception) { From b6f2510160a3592fde7fab0b752b6888d2a04d7b Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 21:20:11 +0800 Subject: [PATCH 13/46] Rename CandidateList to Candidates (methods) --- .../strokeinput/CandidatesViewAdapter.java | 2 +- .../yawnoc/strokeinput/InputContainer.java | 4 ++-- .../strokeinput/StrokeInputService.java | 22 +++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/CandidatesViewAdapter.java b/app/src/main/java/io/github/yawnoc/strokeinput/CandidatesViewAdapter.java index d362e5d1..11f3b138 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/CandidatesViewAdapter.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/CandidatesViewAdapter.java @@ -46,7 +46,7 @@ public void setCandidateListener(final CandidateListener candidateListener) } @SuppressLint("NotifyDataSetChanged") - public void updateCandidateList(final List candidates) + public void updateCandidates(final List candidates) { this.candidates.clear(); this.candidates.addAll(candidates); diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/InputContainer.java b/app/src/main/java/io/github/yawnoc/strokeinput/InputContainer.java index f36341cb..b9619d40 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/InputContainer.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/InputContainer.java @@ -143,9 +143,9 @@ public void setStrokeDigitSequence(final String strokeDigitSequence) strokeSequenceBar.setStrokeDigitSequence(strokeDigitSequence); } - public void setCandidateList(final List candidates) + public void setCandidates(final List candidates) { - candidatesViewAdapter.updateCandidateList(candidates); + candidatesViewAdapter.updateCandidates(candidates); candidatesView.scrollToPosition(0); } diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index ec56ed04..88873c32 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -429,7 +429,7 @@ public void onStartInputView(final EditorInfo editorInfo, final boolean isRestar inputContainer.setBackground(isFullscreen); inputContainer.setStrokeDigitSequence(strokeDigitSequence); - inputContainer.setCandidateList(candidates); + inputContainer.setCandidates(candidates); setEnterKeyDisplayText(); } @@ -504,7 +504,7 @@ public void onCandidate(final String candidate) inputConnection.commitText(candidate, 1); setStrokeDigitSequence(""); - setPhraseCompletionCandidateList(inputConnection); + setPhraseCompletionCandidates(inputConnection); } @Override @@ -557,7 +557,7 @@ public void onKey(final String valueText) private void effectStrokeAppend(final String strokeDigit) { final String newStrokeDigitSequence = strokeDigitSequence + strokeDigit; - final List newCandidateList = computeCandidateList(newStrokeDigitSequence); + final List newCandidateList = computeCandidates(newStrokeDigitSequence); if (newCandidateList.size() > 0) { setStrokeDigitSequence(newStrokeDigitSequence); @@ -570,14 +570,14 @@ private void effectBackspace(final InputConnection inputConnection) if (strokeDigitSequence.length() > 0) { final String newStrokeDigitSequence = Stringy.removeSuffixRegex("(?s).", strokeDigitSequence); - final List newCandidateList = computeCandidateList(newStrokeDigitSequence); + final List newCandidateList = computeCandidates(newStrokeDigitSequence); setStrokeDigitSequence(newStrokeDigitSequence); setCandidates(newCandidateList); if (newStrokeDigitSequence.length() == 0) { - setPhraseCompletionCandidateList(inputConnection); + setPhraseCompletionCandidates(inputConnection); } inputContainer.setKeyRepeatIntervalMilliseconds(BACKSPACE_REPEAT_INTERVAL_MILLISECONDS_UTF_8); @@ -604,7 +604,7 @@ private void effectBackspace(final InputConnection inputConnection) inputConnection.sendKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL)); } - setPhraseCompletionCandidateList(inputConnection); + setPhraseCompletionCandidates(inputConnection); final int nextBackspaceIntervalMilliseconds = (Stringy.isAscii(upToOneCharacterBeforeCursor)) @@ -716,12 +716,12 @@ private void setStrokeDigitSequence(final String strokeDigitSequence) private void setCandidates(final List candidates) { this.candidates = candidates; - inputContainer.setCandidateList(candidates); + inputContainer.setCandidates(candidates); } - private void setPhraseCompletionCandidateList(final InputConnection inputConnection) + private void setPhraseCompletionCandidates(final InputConnection inputConnection) { - List phraseCompletionCandidateList = computePhraseCompletionCandidateList(inputConnection); + List phraseCompletionCandidateList = computePhraseCompletionCandidates(inputConnection); phraseCompletionFirstCodePointList.clear(); for (final String phraseCompletionCandidate : phraseCompletionCandidateList) @@ -855,7 +855,7 @@ else if (firstCodePointMatchesPhraseCompletionCandidate) return coarseRank + fineRank + penalty; } - private List computeCandidateList(final String strokeDigitSequence) + private List computeCandidates(final String strokeDigitSequence) { if (strokeDigitSequence.length() == 0) { @@ -936,7 +936,7 @@ private String getFirstCandidate() Compute the phrase completion candidate list. Longer matches with the text before the cursor are ranked earlier. */ - private List computePhraseCompletionCandidateList(final InputConnection inputConnection) + private List computePhraseCompletionCandidates(final InputConnection inputConnection) { updateCandidateOrderPreference(); From 43b1171904f74cd5251d6394832f447757d28cb4 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 21:24:48 +0800 Subject: [PATCH 14/46] Rename keyList to keys --- .../github/yawnoc/strokeinput/KeyPreviewPlane.java | 14 +++++++------- .../io/github/yawnoc/strokeinput/Keyboard.java | 14 +++++++------- .../io/github/yawnoc/strokeinput/KeyboardView.java | 8 ++++---- .../yawnoc/strokeinput/StrokeInputService.java | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/KeyPreviewPlane.java b/app/src/main/java/io/github/yawnoc/strokeinput/KeyPreviewPlane.java index aa6c905d..33f373f5 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/KeyPreviewPlane.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/KeyPreviewPlane.java @@ -39,7 +39,7 @@ public class KeyPreviewPlane private int width; private int height; private int keyboardHeight; - private final List keyList = new ArrayList<>(); + private final List keys = new ArrayList<>(); private Key latestKey; private int shiftMode = KeyboardView.SHIFT_DISABLED; @@ -77,7 +77,7 @@ private void initialiseDismissalHandler() public void handleMessage(@NonNull Message message) { Key key = (Key) message.obj; - keyList.remove(key); + keys.remove(key); invalidate(); } }; @@ -117,9 +117,9 @@ public void updateShiftMode(final int shiftMode) public void showPreviewAt(final Key key) { - if (key != null && !keyList.contains(key) && key.isPreviewable) + if (key != null && !keys.contains(key) && key.isPreviewable) { - keyList.add(key); + keys.add(key); } latestKey = key; invalidate(); @@ -127,7 +127,7 @@ public void showPreviewAt(final Key key) public void movePreviewTo(final Key key) { - keyList.remove(latestKey); + keys.remove(latestKey); showPreviewAt(key); } @@ -141,7 +141,7 @@ public void dismissLatest() public void dismissAllImmediately() { - keyList.clear(); + keys.clear(); latestKey = null; invalidate(); } @@ -149,7 +149,7 @@ public void dismissAllImmediately() @Override public void onDraw(@NonNull final Canvas canvas) { - for (final Key key : keyList) + for (final Key key : keys) { final int keyPreviewWidth = (int) (key.previewMagnification * key.width); final int keyPreviewHeight = (int) (key.previewMagnification * key.height); diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/Keyboard.java b/app/src/main/java/io/github/yawnoc/strokeinput/Keyboard.java index d52ca143..f3002341 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/Keyboard.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/Keyboard.java @@ -69,7 +69,7 @@ public class Keyboard private final Context applicationContext; private int width; private int height, naturalHeight; - private final List keyList; + private final List keys; public int fillColour; // Key properties @@ -107,15 +107,15 @@ public Keyboard(final Context context, final int layoutResourceId) defaultKeyTextSizePx = (int) Valuey.pxFromSp(DEFAULT_KEY_TEXT_SIZE_SP, displayMetrics); defaultKeyPreviewMarginYPx = (int) Valuey.pxFromDp(DEFAULT_KEY_PREVIEW_MARGIN_Y_DP, displayMetrics); - keyList = new ArrayList<>(); + keys = new ArrayList<>(); makeKeyboard(context, resources.getXml(layoutResourceId)); adjustKeyboardHeight(); } - public List getKeyList() + public List getKeys() { - return keyList; + return keys; } public int getWidth() @@ -176,7 +176,7 @@ private void makeKeyboard(final Context context, final XmlResourceParser xmlReso case KEY_TAG: inKey = true; key = new Key(row, x, y, resources, xmlResourceParser); - keyList.add(key); + keys.add(key); break; } break; @@ -210,7 +210,7 @@ else if (inRow) public void correctKeyboardWidth(int inputContainerWidth) { final float correctionFactor = ((float) inputContainerWidth) / screenWidth; - for (final Key key : keyList) + for (final Key key : keys) { key.x = (int) (key.naturalX * correctionFactor); key.width = (int) (key.naturalWidth * correctionFactor); @@ -224,7 +224,7 @@ public void adjustKeyboardHeight() final float userAdjustmentFactor = MainActivity.keyboardHeightAdjustmentProgressToFactor(userAdjustmentProgress); final float actualAdjustmentFactor = Math.min(userAdjustmentFactor, KEYBOARD_HEIGHT_MAX_FRACTION * screenHeight / naturalHeight); - for (final Key key : keyList) + for (final Key key : keys) { key.y = (int) (key.naturalY * actualAdjustmentFactor); key.height = (int) (key.naturalHeight * actualAdjustmentFactor); diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/KeyboardView.java b/app/src/main/java/io/github/yawnoc/strokeinput/KeyboardView.java index 87c50fb6..12d3ccb0 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/KeyboardView.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/KeyboardView.java @@ -72,7 +72,7 @@ public class KeyboardView private LinearLayout mainInputPlane; private KeyPreviewPlane keyPreviewPlane; private Keyboard keyboard; - private List keyList; + private List keys; // Active key private Key activeKey; @@ -196,7 +196,7 @@ public void setKeyboard(final Keyboard keyboard) { keyboardListener.saveKeyboard(keyboard); this.keyboard = keyboard; - keyList = keyboard.getKeyList(); + keys = keyboard.getKeys(); keyboardFillPaint.setColor(keyboard.fillColour); if (shiftMode != SHIFT_PERSISTENT) { @@ -256,7 +256,7 @@ public void onDraw(@NonNull final Canvas canvas) canvas.drawRect(keyboardRectangle, keyboardFillPaint); - for (final Key key : keyList) + for (final Key key : keys) { keyRectangle.set(0, 0, key.width, key.height); @@ -623,7 +623,7 @@ private void sendShiftUpEvent(boolean shouldRedrawKeyboard) private Key getKeyAtPoint(final int x, final int y) { - for (final Key key : keyList) + for (final Key key : keys) { if (key.containsPoint(x, y)) { diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index 88873c32..0a988bd4 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -470,7 +470,7 @@ private void setEnterKeyDisplayText() for (final Keyboard keyboard : keyboardSet) { - for (final Key key : keyboard.getKeyList()) + for (final Key key : keyboard.getKeys()) { if (key.valueText.equals(ENTER_KEY_VALUE_TEXT)) { From e35e43b1c2015d4097bc6c7aa0aa573bf20e5a75 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 21:29:26 +0800 Subject: [PATCH 15/46] Move containsPoint vertical checks to separate lines --- app/src/main/java/io/github/yawnoc/strokeinput/Key.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/Key.java b/app/src/main/java/io/github/yawnoc/strokeinput/Key.java index edd34cee..2ef83608 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/Key.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/Key.java @@ -167,7 +167,9 @@ public boolean containsPoint(final int x, final int y) && (this.isExtendedRight || x <= this.x + this.width) && - this.y <= y && y <= this.y + this.height + this.y <= y + && + y <= this.y + this.height ); } From cf249b84d7b2cb7ec580200876bc430bb988afb0 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 21:45:16 +0800 Subject: [PATCH 16/46] Rename keyboardSet to keyboards --- .../github/yawnoc/strokeinput/StrokeInputService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index 0a988bd4..fb8d5a77 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -127,7 +127,7 @@ public class StrokeInputService private Map nameFromKeyboard; private Map keyboardFromName; - private Set keyboardSet; + private Set keyboards; private InputContainer inputContainer; @@ -189,7 +189,7 @@ public View onCreateInputView() nameFromKeyboard.put(qwertyKeyboard, QWERTY_KEYBOARD_NAME); nameFromKeyboard.put(qwertySymbolsKeyboard, QWERTY_SYMBOLS_KEYBOARD_NAME); keyboardFromName = Mappy.invertMap(nameFromKeyboard); - keyboardSet = nameFromKeyboard.keySet(); + keyboards = nameFromKeyboard.keySet(); inputContainer = (InputContainer) getLayoutInflater().inflate(R.layout.input_container, null); inputContainer.initialisePopupRecess(); @@ -409,7 +409,7 @@ public void onStartInputView(final EditorInfo editorInfo, final boolean isRestar () -> { final int inputContainerWidth = inputContainer.getWidth(); - for (final Keyboard keyboard : keyboardSet) + for (final Keyboard keyboard : keyboards) { keyboard.correctKeyboardWidth(inputContainerWidth); // needed in API level 35+ due to edge-to-edge breakage } @@ -417,7 +417,7 @@ public void onStartInputView(final EditorInfo editorInfo, final boolean isRestar } ); - for (final Keyboard keyboard : keyboardSet) + for (final Keyboard keyboard : keyboards) { keyboard.adjustKeyboardHeight(); } @@ -468,7 +468,7 @@ private void setEnterKeyDisplayText() enterKeyDisplayText = getString(R.string.display_text__return); } - for (final Keyboard keyboard : keyboardSet) + for (final Keyboard keyboard : keyboards) { for (final Key key : keyboard.getKeys()) { From 10ff135212d0864acc9cc8f23c3e903d9b20bd88 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 21:48:16 +0800 Subject: [PATCH 17/46] Rename codePointSet* to codePoints* --- .../yawnoc/strokeinput/StrokeInputService.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index fb8d5a77..e33a662a 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -132,8 +132,8 @@ public class StrokeInputService private InputContainer inputContainer; private final NavigableMap charactersFromStrokeDigitSequence = new TreeMap<>(); - private final Set codePointSetTraditional = new HashSet<>(); - private final Set codePointSetSimplified = new HashSet<>(); + private final Set codePointsTraditional = new HashSet<>(); + private final Set codePointsSimplified = new HashSet<>(); private final Map sortingRankFromCodePointTraditional = new HashMap<>(); private final Map sortingRankFromCodePointSimplified = new HashMap<>(); private final Set commonCodePointSetTraditional = new HashSet<>(); @@ -160,8 +160,8 @@ public void onCreate() super.onCreate(); loadSequenceCharactersDataIntoMap(SEQUENCE_CHARACTERS_FILE_NAME, charactersFromStrokeDigitSequence); - loadCharactersIntoCodePointSet(CHARACTERS_FILE_NAME_TRADITIONAL, codePointSetTraditional); - loadCharactersIntoCodePointSet(CHARACTERS_FILE_NAME_SIMPLIFIED, codePointSetSimplified); + loadCharactersIntoCodePointSet(CHARACTERS_FILE_NAME_TRADITIONAL, codePointsTraditional); + loadCharactersIntoCodePointSet(CHARACTERS_FILE_NAME_SIMPLIFIED, codePointsSimplified); loadRankingData(RANKING_FILE_NAME_TRADITIONAL, sortingRankFromCodePointTraditional, commonCodePointSetTraditional); loadRankingData(RANKING_FILE_NAME_SIMPLIFIED, sortingRankFromCodePointSimplified, commonCodePointSetSimplified); loadPhrasesIntoSet(PHRASES_FILE_NAME_TRADITIONAL, phraseSetTraditional); @@ -995,14 +995,14 @@ private void updateCandidateOrderPreference() { if (shouldPreferTraditional()) { - unpreferredCodePointSet = codePointSetSimplified; + unpreferredCodePointSet = codePointsSimplified; sortingRankFromCodePoint = sortingRankFromCodePointTraditional; commonCodePointSet = commonCodePointSetTraditional; phraseSet = phraseSetTraditional; } else { - unpreferredCodePointSet = codePointSetTraditional; + unpreferredCodePointSet = codePointsTraditional; sortingRankFromCodePoint = sortingRankFromCodePointSimplified; commonCodePointSet = commonCodePointSetSimplified; phraseSet = phraseSetSimplified; From 7f39a537bc59f70ffdf8c6f90f236515f7a6a60e Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 21:50:08 +0800 Subject: [PATCH 18/46] Consistently use 'Data' suffix in loading method names --- .../yawnoc/strokeinput/StrokeInputService.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index e33a662a..2dc606c3 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -159,13 +159,13 @@ public void onCreate() { super.onCreate(); - loadSequenceCharactersDataIntoMap(SEQUENCE_CHARACTERS_FILE_NAME, charactersFromStrokeDigitSequence); - loadCharactersIntoCodePointSet(CHARACTERS_FILE_NAME_TRADITIONAL, codePointsTraditional); - loadCharactersIntoCodePointSet(CHARACTERS_FILE_NAME_SIMPLIFIED, codePointsSimplified); + loadSequenceCharactersData(SEQUENCE_CHARACTERS_FILE_NAME, charactersFromStrokeDigitSequence); + loadCharactersData(CHARACTERS_FILE_NAME_TRADITIONAL, codePointsTraditional); + loadCharactersData(CHARACTERS_FILE_NAME_SIMPLIFIED, codePointsSimplified); loadRankingData(RANKING_FILE_NAME_TRADITIONAL, sortingRankFromCodePointTraditional, commonCodePointSetTraditional); loadRankingData(RANKING_FILE_NAME_SIMPLIFIED, sortingRankFromCodePointSimplified, commonCodePointSetSimplified); - loadPhrasesIntoSet(PHRASES_FILE_NAME_TRADITIONAL, phraseSetTraditional); - loadPhrasesIntoSet(PHRASES_FILE_NAME_SIMPLIFIED, phraseSetSimplified); + loadPhrasesData(PHRASES_FILE_NAME_TRADITIONAL, phraseSetTraditional); + loadPhrasesData(PHRASES_FILE_NAME_SIMPLIFIED, phraseSetSimplified); updateCandidateOrderPreference(); } @@ -223,7 +223,7 @@ private static boolean isCommentLine(final String line) } @SuppressWarnings("SameParameterValue") - private void loadSequenceCharactersDataIntoMap( + private void loadSequenceCharactersData( final String sequenceCharactersFileName, final Map charactersFromStrokeDigitSequence ) @@ -256,7 +256,7 @@ private void loadSequenceCharactersDataIntoMap( sendLoadingTimeLog(sequenceCharactersFileName, startMilliseconds, endMilliseconds); } - private void loadCharactersIntoCodePointSet(final String charactersFileName, final Set codePointSet) + private void loadCharactersData(final String charactersFileName, final Set codePointSet) { final long startMilliseconds = System.currentTimeMillis(); @@ -326,7 +326,7 @@ private void loadRankingData( sendLoadingTimeLog(rankingFileName, startMilliseconds, endMilliseconds); } - private void loadPhrasesIntoSet(final String phrasesFileName, final Set phraseSet) + private void loadPhrasesData(final String phrasesFileName, final Set phraseSet) { final long startMilliseconds = System.currentTimeMillis(); From 13b33e79bd67a51f6f4ee66e9d664b5b85edc513 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 21:51:09 +0800 Subject: [PATCH 19/46] Rename commonCodePointSet* to commonCodePoints* --- .../yawnoc/strokeinput/StrokeInputService.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index 2dc606c3..3b48b441 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -136,8 +136,8 @@ public class StrokeInputService private final Set codePointsSimplified = new HashSet<>(); private final Map sortingRankFromCodePointTraditional = new HashMap<>(); private final Map sortingRankFromCodePointSimplified = new HashMap<>(); - private final Set commonCodePointSetTraditional = new HashSet<>(); - private final Set commonCodePointSetSimplified = new HashSet<>(); + private final Set commonCodePointsTraditional = new HashSet<>(); + private final Set commonCodePointsSimplified = new HashSet<>(); private final NavigableSet phraseSetTraditional = new TreeSet<>(); private final NavigableSet phraseSetSimplified = new TreeSet<>(); @@ -162,8 +162,8 @@ public void onCreate() loadSequenceCharactersData(SEQUENCE_CHARACTERS_FILE_NAME, charactersFromStrokeDigitSequence); loadCharactersData(CHARACTERS_FILE_NAME_TRADITIONAL, codePointsTraditional); loadCharactersData(CHARACTERS_FILE_NAME_SIMPLIFIED, codePointsSimplified); - loadRankingData(RANKING_FILE_NAME_TRADITIONAL, sortingRankFromCodePointTraditional, commonCodePointSetTraditional); - loadRankingData(RANKING_FILE_NAME_SIMPLIFIED, sortingRankFromCodePointSimplified, commonCodePointSetSimplified); + loadRankingData(RANKING_FILE_NAME_TRADITIONAL, sortingRankFromCodePointTraditional, commonCodePointsTraditional); + loadRankingData(RANKING_FILE_NAME_SIMPLIFIED, sortingRankFromCodePointSimplified, commonCodePointsSimplified); loadPhrasesData(PHRASES_FILE_NAME_TRADITIONAL, phraseSetTraditional); loadPhrasesData(PHRASES_FILE_NAME_SIMPLIFIED, phraseSetSimplified); @@ -997,14 +997,14 @@ private void updateCandidateOrderPreference() { unpreferredCodePointSet = codePointsSimplified; sortingRankFromCodePoint = sortingRankFromCodePointTraditional; - commonCodePointSet = commonCodePointSetTraditional; + commonCodePointSet = commonCodePointsTraditional; phraseSet = phraseSetTraditional; } else { unpreferredCodePointSet = codePointsTraditional; sortingRankFromCodePoint = sortingRankFromCodePointSimplified; - commonCodePointSet = commonCodePointSetSimplified; + commonCodePointSet = commonCodePointsSimplified; phraseSet = phraseSetSimplified; } } From 08ec754cf3ed0e8e8f3921d344d4fd1e43c2a177 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 21:52:05 +0800 Subject: [PATCH 20/46] Rename phraseSet* to phrases* --- .../yawnoc/strokeinput/StrokeInputService.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index 3b48b441..c2487ae0 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -138,8 +138,8 @@ public class StrokeInputService private final Map sortingRankFromCodePointSimplified = new HashMap<>(); private final Set commonCodePointsTraditional = new HashSet<>(); private final Set commonCodePointsSimplified = new HashSet<>(); - private final NavigableSet phraseSetTraditional = new TreeSet<>(); - private final NavigableSet phraseSetSimplified = new TreeSet<>(); + private final NavigableSet phrasesTraditional = new TreeSet<>(); + private final NavigableSet phrasesSimplified = new TreeSet<>(); private Set unpreferredCodePointSet; private Map sortingRankFromCodePoint; @@ -164,8 +164,8 @@ public void onCreate() loadCharactersData(CHARACTERS_FILE_NAME_SIMPLIFIED, codePointsSimplified); loadRankingData(RANKING_FILE_NAME_TRADITIONAL, sortingRankFromCodePointTraditional, commonCodePointsTraditional); loadRankingData(RANKING_FILE_NAME_SIMPLIFIED, sortingRankFromCodePointSimplified, commonCodePointsSimplified); - loadPhrasesData(PHRASES_FILE_NAME_TRADITIONAL, phraseSetTraditional); - loadPhrasesData(PHRASES_FILE_NAME_SIMPLIFIED, phraseSetSimplified); + loadPhrasesData(PHRASES_FILE_NAME_TRADITIONAL, phrasesTraditional); + loadPhrasesData(PHRASES_FILE_NAME_SIMPLIFIED, phrasesSimplified); updateCandidateOrderPreference(); } @@ -998,14 +998,14 @@ private void updateCandidateOrderPreference() unpreferredCodePointSet = codePointsSimplified; sortingRankFromCodePoint = sortingRankFromCodePointTraditional; commonCodePointSet = commonCodePointsTraditional; - phraseSet = phraseSetTraditional; + phraseSet = phrasesTraditional; } else { unpreferredCodePointSet = codePointsTraditional; sortingRankFromCodePoint = sortingRankFromCodePointSimplified; commonCodePointSet = commonCodePointsSimplified; - phraseSet = phraseSetSimplified; + phraseSet = phrasesSimplified; } } From 31f56de507edbdcec9ef25a51e376e400e7ad5da Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 21:54:50 +0800 Subject: [PATCH 21/46] Rename shared *Sets to *s --- .../strokeinput/StrokeInputService.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index c2487ae0..3353fd22 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -141,10 +141,10 @@ public class StrokeInputService private final NavigableSet phrasesTraditional = new TreeSet<>(); private final NavigableSet phrasesSimplified = new TreeSet<>(); - private Set unpreferredCodePointSet; + private Set unpreferredCodePoints; private Map sortingRankFromCodePoint; - private Set commonCodePointSet; - private NavigableSet phraseSet; + private Set commonCodePoints; + private NavigableSet phrases; private String strokeDigitSequence = ""; private List candidates = new ArrayList<>(); @@ -326,7 +326,7 @@ private void loadRankingData( sendLoadingTimeLog(rankingFileName, startMilliseconds, endMilliseconds); } - private void loadPhrasesData(final String phrasesFileName, final Set phraseSet) + private void loadPhrasesData(final String phrasesFileName, final Set phrases) { final long startMilliseconds = System.currentTimeMillis(); @@ -340,7 +340,7 @@ private void loadPhrasesData(final String phrasesFileName, final Set phr { if (!isCommentLine(line)) { - phraseSet.add(line); + phrases.add(line); } } } @@ -872,7 +872,7 @@ private List computeCandidates(final String strokeDigitSequence) exactMatchCodePointSet = Stringy.toCodePointSet(exactMatchCharacters); exactMatchCandidateList = Stringy.toCharacterList(exactMatchCharacters); exactMatchCandidateList.sort( - candidateComparator(unpreferredCodePointSet, sortingRankFromCodePoint, phraseCompletionFirstCodePointList) + candidateComparator(unpreferredCodePoints, sortingRankFromCodePoint, phraseCompletionFirstCodePointList) ); } else @@ -894,13 +894,13 @@ private List computeCandidates(final String strokeDigitSequence) prefixMatchCodePointSet.removeAll(exactMatchCodePointSet); if (prefixMatchCodePointSet.size() > LAG_PREVENTION_CODE_POINT_COUNT) { - prefixMatchCodePointSet.retainAll(commonCodePointSet); + prefixMatchCodePointSet.retainAll(commonCodePoints); } final List prefixMatchCandidateCodePointList = new ArrayList<>(prefixMatchCodePointSet); prefixMatchCandidateCodePointList.sort( candidateCodePointComparator( - unpreferredCodePointSet, + unpreferredCodePoints, sortingRankFromCodePoint, phraseCompletionFirstCodePointList ) @@ -949,7 +949,7 @@ private List computePhraseCompletionCandidates(final InputConnection inp ) { final Set prefixMatchPhraseCandidateSet = - phraseSet.subSet( + phrases.subSet( phrasePrefix, false, phrasePrefix + Character.MAX_VALUE, false ); @@ -964,7 +964,7 @@ private List computePhraseCompletionCandidates(final InputConnection inp } } prefixMatchPhraseCompletionList.sort( - candidateComparator(unpreferredCodePointSet, sortingRankFromCodePoint, Collections.emptyList()) + candidateComparator(unpreferredCodePoints, sortingRankFromCodePoint, Collections.emptyList()) ); phraseCompletionCandidateList.addAll(prefixMatchPhraseCompletionList); } @@ -995,17 +995,17 @@ private void updateCandidateOrderPreference() { if (shouldPreferTraditional()) { - unpreferredCodePointSet = codePointsSimplified; + unpreferredCodePoints = codePointsSimplified; sortingRankFromCodePoint = sortingRankFromCodePointTraditional; - commonCodePointSet = commonCodePointsTraditional; - phraseSet = phrasesTraditional; + commonCodePoints = commonCodePointsTraditional; + phrases = phrasesTraditional; } else { - unpreferredCodePointSet = codePointsTraditional; + unpreferredCodePoints = codePointsTraditional; sortingRankFromCodePoint = sortingRankFromCodePointSimplified; - commonCodePointSet = commonCodePointsSimplified; - phraseSet = phrasesSimplified; + commonCodePoints = commonCodePointsSimplified; + phrases = phrasesSimplified; } } From 5459810aa3a41a24e6f48de1d559ab7559907a72 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 21:57:23 +0800 Subject: [PATCH 22/46] Rename *FirstCodePointList to *FirstCodePoints --- .../yawnoc/strokeinput/StrokeInputService.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index 3353fd22..906729a1 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -148,7 +148,7 @@ public class StrokeInputService private String strokeDigitSequence = ""; private List candidates = new ArrayList<>(); - private final List phraseCompletionFirstCodePointList = new ArrayList<>(); + private final List phraseCompletionFirstCodePoints = new ArrayList<>(); private int inputActionsBits; private boolean enterKeyHasAction; @@ -723,10 +723,10 @@ private void setPhraseCompletionCandidates(final InputConnection inputConnection { List phraseCompletionCandidateList = computePhraseCompletionCandidates(inputConnection); - phraseCompletionFirstCodePointList.clear(); + phraseCompletionFirstCodePoints.clear(); for (final String phraseCompletionCandidate : phraseCompletionCandidateList) { - phraseCompletionFirstCodePointList.add(Stringy.getFirstCodePoint(phraseCompletionCandidate)); + phraseCompletionFirstCodePoints.add(Stringy.getFirstCodePoint(phraseCompletionCandidate)); } setCandidates(phraseCompletionCandidateList); @@ -872,7 +872,7 @@ private List computeCandidates(final String strokeDigitSequence) exactMatchCodePointSet = Stringy.toCodePointSet(exactMatchCharacters); exactMatchCandidateList = Stringy.toCharacterList(exactMatchCharacters); exactMatchCandidateList.sort( - candidateComparator(unpreferredCodePoints, sortingRankFromCodePoint, phraseCompletionFirstCodePointList) + candidateComparator(unpreferredCodePoints, sortingRankFromCodePoint, phraseCompletionFirstCodePoints) ); } else @@ -899,11 +899,7 @@ private List computeCandidates(final String strokeDigitSequence) final List prefixMatchCandidateCodePointList = new ArrayList<>(prefixMatchCodePointSet); prefixMatchCandidateCodePointList.sort( - candidateCodePointComparator( - unpreferredCodePoints, - sortingRankFromCodePoint, - phraseCompletionFirstCodePointList - ) + candidateCodePointComparator(unpreferredCodePoints, sortingRankFromCodePoint, phraseCompletionFirstCodePoints) ); final int prefixMatchCount = Math.min(prefixMatchCandidateCodePointList.size(), MAX_PREFIX_MATCH_COUNT); From 8235e8f3a7a1fb26195cea027863c9b8f5ab5bb9 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 21:59:30 +0800 Subject: [PATCH 23/46] Rename *ListIsEmpty to *sIsEmpty --- .../java/io/github/yawnoc/strokeinput/StrokeInputService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index 906729a1..51ae6e92 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -813,7 +813,7 @@ private int computeCandidateRank( final int fineRank; final int penalty; - final boolean phraseCompletionListIsEmpty = phraseCompletionFirstCodePointList.size() == 0; + final boolean phraseCompletionsIsEmpty = phraseCompletionFirstCodePointList.size() == 0; final int phraseCompletionIndex = phraseCompletionFirstCodePointList.indexOf(firstCodePoint); final boolean firstCodePointMatchesPhraseCompletionCandidate = phraseCompletionIndex > 0; @@ -833,7 +833,7 @@ private int computeCandidateRank( ? RANKING_PENALTY_UNPREFERRED : 0; - if (phraseCompletionListIsEmpty) + if (phraseCompletionsIsEmpty) { coarseRank = Integer.MIN_VALUE; fineRank = sortingRankNonNull; From a11a4f4ef6662d9f4f121acc19406ea5af80dc59 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 22:03:24 +0800 Subject: [PATCH 24/46] Rename Stringy local *List to *s --- .../java/io/github/yawnoc/utilities/Stringy.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/utilities/Stringy.java b/app/src/main/java/io/github/yawnoc/utilities/Stringy.java index 377e51e3..2024ebac 100644 --- a/app/src/main/java/io/github/yawnoc/utilities/Stringy.java +++ b/app/src/main/java/io/github/yawnoc/utilities/Stringy.java @@ -54,17 +54,17 @@ Convert a string to a list of (unicode) code points. */ public static List toCodePointList(final String string) { - final List codePointList = new ArrayList<>(); + final List codePoints = new ArrayList<>(); final int charCount = string.length(); for (int charIndex = 0; charIndex < charCount;) { final int codePoint = string.codePointAt(charIndex); - codePointList.add(codePoint); + codePoints.add(codePoint); charIndex += Character.charCount(codePoint); } - return codePointList; + return codePoints; } /* @@ -113,12 +113,12 @@ Convert a string to a list of (unicode) characters. */ public static List toCharacterList(final String string) { - final List characterList = new ArrayList<>(); + final List characters = new ArrayList<>(); final int codePointCount = string.codePointCount(0, string.length()); for (int codePointIndex = 0; codePointIndex < codePointCount; codePointIndex++) { - characterList.add( + characters.add( string.substring( string.offsetByCodePoints(0, codePointIndex), string.offsetByCodePoints(0, codePointIndex + 1) @@ -126,7 +126,7 @@ public static List toCharacterList(final String string) ); } - return characterList; + return characters; } /* From e492353b343df2532d8640fdde62ab624dfcf528 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 22:04:05 +0800 Subject: [PATCH 25/46] Rename Stringy local *Set to *s --- .../java/io/github/yawnoc/utilities/Stringy.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/utilities/Stringy.java b/app/src/main/java/io/github/yawnoc/utilities/Stringy.java index 2024ebac..55cf7ea4 100644 --- a/app/src/main/java/io/github/yawnoc/utilities/Stringy.java +++ b/app/src/main/java/io/github/yawnoc/utilities/Stringy.java @@ -72,17 +72,17 @@ Convert a string to a set of (unicode) code points. */ public static Set toCodePointSet(final String string) { - final Set codePointSet = new HashSet<>(); + final Set codePoints = new HashSet<>(); final int charCount = string.length(); for (int charIndex = 0; charIndex < charCount;) { final int codePoint = string.codePointAt(charIndex); - codePointSet.add(codePoint); + codePoints.add(codePoint); charIndex += Character.charCount(codePoint); } - return codePointSet; + return codePoints; } /* @@ -90,14 +90,14 @@ Convert a collection of strings to a set of (unicode) code points. */ public static Set toCodePointSet(final Collection stringCollection) { - final Set codePointSet = new HashSet<>(); + final Set codePoints = new HashSet<>(); for (final String string : stringCollection) { - codePointSet.addAll(toCodePointSet(string)); + codePoints.addAll(toCodePointSet(string)); } - return codePointSet; + return codePoints; } /* From 0e1027ce1b0ac7d848969dde9e206c870be91067 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 22:06:33 +0800 Subject: [PATCH 26/46] Use intermediate variables to flatten toCharacterList loop body --- .../main/java/io/github/yawnoc/utilities/Stringy.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/utilities/Stringy.java b/app/src/main/java/io/github/yawnoc/utilities/Stringy.java index 55cf7ea4..164449b6 100644 --- a/app/src/main/java/io/github/yawnoc/utilities/Stringy.java +++ b/app/src/main/java/io/github/yawnoc/utilities/Stringy.java @@ -118,12 +118,10 @@ public static List toCharacterList(final String string) final int codePointCount = string.codePointCount(0, string.length()); for (int codePointIndex = 0; codePointIndex < codePointCount; codePointIndex++) { - characters.add( - string.substring( - string.offsetByCodePoints(0, codePointIndex), - string.offsetByCodePoints(0, codePointIndex + 1) - ) - ); + final int startIndex = string.offsetByCodePoints(0, codePointIndex); + final int endIndex = string.offsetByCodePoints(0, codePointIndex + 1); + final String character = string.substring(startIndex, endIndex); + characters.add(character); } return characters; From bfb4edc10360782b74f422bf983a25e0860f7e05 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 22:12:12 +0800 Subject: [PATCH 27/46] Rename remaining *List to *s --- .../strokeinput/StrokeInputService.java | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index 51ae6e92..4a413781 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -557,11 +557,11 @@ public void onKey(final String valueText) private void effectStrokeAppend(final String strokeDigit) { final String newStrokeDigitSequence = strokeDigitSequence + strokeDigit; - final List newCandidateList = computeCandidates(newStrokeDigitSequence); - if (newCandidateList.size() > 0) + final List newCandidates = computeCandidates(newStrokeDigitSequence); + if (newCandidates.size() > 0) { setStrokeDigitSequence(newStrokeDigitSequence); - setCandidates(newCandidateList); + setCandidates(newCandidates); } } @@ -570,10 +570,10 @@ private void effectBackspace(final InputConnection inputConnection) if (strokeDigitSequence.length() > 0) { final String newStrokeDigitSequence = Stringy.removeSuffixRegex("(?s).", strokeDigitSequence); - final List newCandidateList = computeCandidates(newStrokeDigitSequence); + final List newCandidates = computeCandidates(newStrokeDigitSequence); setStrokeDigitSequence(newStrokeDigitSequence); - setCandidates(newCandidateList); + setCandidates(newCandidates); if (newStrokeDigitSequence.length() == 0) { @@ -721,15 +721,15 @@ private void setCandidates(final List candidates) private void setPhraseCompletionCandidates(final InputConnection inputConnection) { - List phraseCompletionCandidateList = computePhraseCompletionCandidates(inputConnection); + List phraseCompletionCandidates = computePhraseCompletionCandidates(inputConnection); phraseCompletionFirstCodePoints.clear(); - for (final String phraseCompletionCandidate : phraseCompletionCandidateList) + for (final String phraseCompletionCandidate : phraseCompletionCandidates) { phraseCompletionFirstCodePoints.add(Stringy.getFirstCodePoint(phraseCompletionCandidate)); } - setCandidates(phraseCompletionCandidateList); + setCandidates(phraseCompletionCandidates); } /* @@ -738,7 +738,7 @@ private void setPhraseCompletionCandidates(final InputConnection inputConnection private Comparator candidateComparator( final Set unpreferredCodePointSet, final Map sortingRankFromCodePoint, - final List phraseCompletionFirstCodePointList + final List phraseCompletionFirstCodePoints ) { return @@ -748,7 +748,7 @@ private Comparator candidateComparator( string, unpreferredCodePointSet, sortingRankFromCodePoint, - phraseCompletionFirstCodePointList + phraseCompletionFirstCodePoints ) ); } @@ -759,7 +759,7 @@ private Comparator candidateComparator( private Comparator candidateCodePointComparator( final Set unpreferredCodePointSet, final Map sortingRankFromCodePoint, - final List phraseCompletionFirstCodePointList + final List phraseCompletionFirstCodePoints ) { return @@ -770,7 +770,7 @@ private Comparator candidateCodePointComparator( 1, unpreferredCodePointSet, sortingRankFromCodePoint, - phraseCompletionFirstCodePointList + phraseCompletionFirstCodePoints ) ); } @@ -782,7 +782,7 @@ private int computeCandidateRank( final String string, final Set unpreferredCodePointSet, final Map sortingRankFromCodePoint, - final List phraseCompletionFirstCodePointList + final List phraseCompletionFirstCodePoints ) { final int firstCodePoint = Stringy.getFirstCodePoint(string); @@ -794,7 +794,7 @@ private int computeCandidateRank( stringLength, unpreferredCodePointSet, sortingRankFromCodePoint, - phraseCompletionFirstCodePointList + phraseCompletionFirstCodePoints ); } @@ -806,15 +806,15 @@ private int computeCandidateRank( final int stringLength, final Set unpreferredCodePointSet, final Map sortingRankFromCodePoint, - final List phraseCompletionFirstCodePointList + final List phraseCompletionFirstCodePoints ) { final int coarseRank; final int fineRank; final int penalty; - final boolean phraseCompletionsIsEmpty = phraseCompletionFirstCodePointList.size() == 0; - final int phraseCompletionIndex = phraseCompletionFirstCodePointList.indexOf(firstCodePoint); + final boolean phraseCompletionsIsEmpty = phraseCompletionFirstCodePoints.size() == 0; + final int phraseCompletionIndex = phraseCompletionFirstCodePoints.indexOf(firstCodePoint); final boolean firstCodePointMatchesPhraseCompletionCandidate = phraseCompletionIndex > 0; final Integer sortingRank = sortingRankFromCodePoint.get(firstCodePoint); @@ -865,20 +865,20 @@ private List computeCandidates(final String strokeDigitSequence) updateCandidateOrderPreference(); final Set exactMatchCodePointSet; - final List exactMatchCandidateList; + final List exactMatchCandidates; final String exactMatchCharacters = charactersFromStrokeDigitSequence.get(strokeDigitSequence); if (exactMatchCharacters != null) { exactMatchCodePointSet = Stringy.toCodePointSet(exactMatchCharacters); - exactMatchCandidateList = Stringy.toCharacterList(exactMatchCharacters); - exactMatchCandidateList.sort( + exactMatchCandidates = Stringy.toCharacterList(exactMatchCharacters); + exactMatchCandidates.sort( candidateComparator(unpreferredCodePoints, sortingRankFromCodePoint, phraseCompletionFirstCodePoints) ); } else { exactMatchCodePointSet = Collections.emptySet(); - exactMatchCandidateList = Collections.emptyList(); + exactMatchCandidates = Collections.emptyList(); } final Collection prefixMatchCharactersCollection = @@ -897,21 +897,21 @@ private List computeCandidates(final String strokeDigitSequence) prefixMatchCodePointSet.retainAll(commonCodePoints); } - final List prefixMatchCandidateCodePointList = new ArrayList<>(prefixMatchCodePointSet); - prefixMatchCandidateCodePointList.sort( + final List prefixMatchCandidateCodePoints = new ArrayList<>(prefixMatchCodePointSet); + prefixMatchCandidateCodePoints.sort( candidateCodePointComparator(unpreferredCodePoints, sortingRankFromCodePoint, phraseCompletionFirstCodePoints) ); - final int prefixMatchCount = Math.min(prefixMatchCandidateCodePointList.size(), MAX_PREFIX_MATCH_COUNT); - final List prefixMatchCandidateList = new ArrayList<>(); - for (final int prefixMatchCodePoint : prefixMatchCandidateCodePointList.subList(0, prefixMatchCount)) + final int prefixMatchCount = Math.min(prefixMatchCandidateCodePoints.size(), MAX_PREFIX_MATCH_COUNT); + final List prefixMatchCandidates = new ArrayList<>(); + for (final int prefixMatchCodePoint : prefixMatchCandidateCodePoints.subList(0, prefixMatchCount)) { - prefixMatchCandidateList.add(Stringy.toString(prefixMatchCodePoint)); + prefixMatchCandidates.add(Stringy.toString(prefixMatchCodePoint)); } final List candidates = new ArrayList<>(); - candidates.addAll(exactMatchCandidateList); - candidates.addAll(prefixMatchCandidateList); + candidates.addAll(exactMatchCandidates); + candidates.addAll(prefixMatchCandidates); return candidates; } @@ -936,7 +936,7 @@ private List computePhraseCompletionCandidates(final InputConnection inp { updateCandidateOrderPreference(); - final List phraseCompletionCandidateList = new ArrayList<>(); + final List phraseCompletionCandidates = new ArrayList<>(); for ( String phrasePrefix = getTextBeforeCursor(inputConnection, MAX_PHRASE_LENGTH - 1); @@ -949,23 +949,23 @@ private List computePhraseCompletionCandidates(final InputConnection inp phrasePrefix, false, phrasePrefix + Character.MAX_VALUE, false ); - final List prefixMatchPhraseCompletionList = new ArrayList<>(); + final List prefixMatchPhraseCompletions = new ArrayList<>(); for (final String phraseCandidate : prefixMatchPhraseCandidateSet) { final String phraseCompletion = Stringy.removePrefix(phrasePrefix, phraseCandidate); - if (!phraseCompletionCandidateList.contains(phraseCompletion)) + if (!phraseCompletionCandidates.contains(phraseCompletion)) { - prefixMatchPhraseCompletionList.add(phraseCompletion); + prefixMatchPhraseCompletions.add(phraseCompletion); } } - prefixMatchPhraseCompletionList.sort( + prefixMatchPhraseCompletions.sort( candidateComparator(unpreferredCodePoints, sortingRankFromCodePoint, Collections.emptyList()) ); - phraseCompletionCandidateList.addAll(prefixMatchPhraseCompletionList); + phraseCompletionCandidates.addAll(prefixMatchPhraseCompletions); } - return phraseCompletionCandidateList; + return phraseCompletionCandidates; } private String getTextBeforeCursor(final InputConnection inputConnection, final int characterCount) From df8f2bb89a10f74335cbf3a91b606a62d6abfd67 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 22:16:16 +0800 Subject: [PATCH 28/46] Rename remaining *Set to *s --- .../strokeinput/StrokeInputService.java | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index 4a413781..7c5bb946 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -256,7 +256,7 @@ private void loadSequenceCharactersData( sendLoadingTimeLog(sequenceCharactersFileName, startMilliseconds, endMilliseconds); } - private void loadCharactersData(final String charactersFileName, final Set codePointSet) + private void loadCharactersData(final String charactersFileName, final Set codePoints) { final long startMilliseconds = System.currentTimeMillis(); @@ -270,7 +270,7 @@ private void loadCharactersData(final String charactersFileName, final Set sortingRankFromCodePoint, - final Set commonCodePointSet + final Set commonCodePoints ) { final long startMilliseconds = System.currentTimeMillis(); @@ -311,7 +311,7 @@ private void loadRankingData( } if (currentRank < LAG_PREVENTION_CODE_POINT_COUNT) { - commonCodePointSet.add(codePoint); + commonCodePoints.add(codePoint); } } } @@ -736,7 +736,7 @@ private void setPhraseCompletionCandidates(final InputConnection inputConnection Candidate comparator for a string. */ private Comparator candidateComparator( - final Set unpreferredCodePointSet, + final Set unpreferredCodePoints, final Map sortingRankFromCodePoint, final List phraseCompletionFirstCodePoints ) @@ -746,7 +746,7 @@ private Comparator candidateComparator( string -> computeCandidateRank( string, - unpreferredCodePointSet, + unpreferredCodePoints, sortingRankFromCodePoint, phraseCompletionFirstCodePoints ) @@ -757,7 +757,7 @@ private Comparator candidateComparator( Candidate comparator for a code point. */ private Comparator candidateCodePointComparator( - final Set unpreferredCodePointSet, + final Set unpreferredCodePoints, final Map sortingRankFromCodePoint, final List phraseCompletionFirstCodePoints ) @@ -768,7 +768,7 @@ private Comparator candidateCodePointComparator( computeCandidateRank( codePoint, 1, - unpreferredCodePointSet, + unpreferredCodePoints, sortingRankFromCodePoint, phraseCompletionFirstCodePoints ) @@ -780,7 +780,7 @@ private Comparator candidateCodePointComparator( */ private int computeCandidateRank( final String string, - final Set unpreferredCodePointSet, + final Set unpreferredCodePoints, final Map sortingRankFromCodePoint, final List phraseCompletionFirstCodePoints ) @@ -792,7 +792,7 @@ private int computeCandidateRank( computeCandidateRank( firstCodePoint, stringLength, - unpreferredCodePointSet, + unpreferredCodePoints, sortingRankFromCodePoint, phraseCompletionFirstCodePoints ); @@ -804,7 +804,7 @@ private int computeCandidateRank( private int computeCandidateRank( final int firstCodePoint, final int stringLength, - final Set unpreferredCodePointSet, + final Set unpreferredCodePoints, final Map sortingRankFromCodePoint, final List phraseCompletionFirstCodePoints ) @@ -829,7 +829,7 @@ private int computeCandidateRank( final int lengthPenalty = (stringLength - 1) * RANKING_PENALTY_PER_CHAR; final int unpreferredPenalty = - (unpreferredCodePointSet.contains(firstCodePoint)) + (unpreferredCodePoints.contains(firstCodePoint)) ? RANKING_PENALTY_UNPREFERRED : 0; @@ -864,12 +864,12 @@ private List computeCandidates(final String strokeDigitSequence) updateCandidateOrderPreference(); - final Set exactMatchCodePointSet; + final Set exactMatchCodePoints; final List exactMatchCandidates; final String exactMatchCharacters = charactersFromStrokeDigitSequence.get(strokeDigitSequence); if (exactMatchCharacters != null) { - exactMatchCodePointSet = Stringy.toCodePointSet(exactMatchCharacters); + exactMatchCodePoints = Stringy.toCodePointSet(exactMatchCharacters); exactMatchCandidates = Stringy.toCharacterList(exactMatchCharacters); exactMatchCandidates.sort( candidateComparator(unpreferredCodePoints, sortingRankFromCodePoint, phraseCompletionFirstCodePoints) @@ -877,7 +877,7 @@ private List computeCandidates(final String strokeDigitSequence) } else { - exactMatchCodePointSet = Collections.emptySet(); + exactMatchCodePoints = Collections.emptySet(); exactMatchCandidates = Collections.emptyList(); } @@ -889,15 +889,15 @@ private List computeCandidates(final String strokeDigitSequence) ) .values(); - final Set prefixMatchCodePointSet = Stringy.toCodePointSet(prefixMatchCharactersCollection); + final Set prefixMatchCodePoints = Stringy.toCodePointSet(prefixMatchCharactersCollection); - prefixMatchCodePointSet.removeAll(exactMatchCodePointSet); - if (prefixMatchCodePointSet.size() > LAG_PREVENTION_CODE_POINT_COUNT) + prefixMatchCodePoints.removeAll(exactMatchCodePoints); + if (prefixMatchCodePoints.size() > LAG_PREVENTION_CODE_POINT_COUNT) { - prefixMatchCodePointSet.retainAll(commonCodePoints); + prefixMatchCodePoints.retainAll(commonCodePoints); } - final List prefixMatchCandidateCodePoints = new ArrayList<>(prefixMatchCodePointSet); + final List prefixMatchCandidateCodePoints = new ArrayList<>(prefixMatchCodePoints); prefixMatchCandidateCodePoints.sort( candidateCodePointComparator(unpreferredCodePoints, sortingRankFromCodePoint, phraseCompletionFirstCodePoints) ); @@ -944,14 +944,14 @@ private List computePhraseCompletionCandidates(final InputConnection inp phrasePrefix = Stringy.removePrefixRegex("(?s).", phrasePrefix) ) { - final Set prefixMatchPhraseCandidateSet = + final Set prefixMatchPhraseCandidates = phrases.subSet( phrasePrefix, false, phrasePrefix + Character.MAX_VALUE, false ); final List prefixMatchPhraseCompletions = new ArrayList<>(); - for (final String phraseCandidate : prefixMatchPhraseCandidateSet) + for (final String phraseCandidate : prefixMatchPhraseCandidates) { final String phraseCompletion = Stringy.removePrefix(phrasePrefix, phraseCandidate); if (!phraseCompletionCandidates.contains(phraseCompletion)) From 3120b506a9580d33482a582db33cf758221eba79 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 22:55:54 +0800 Subject: [PATCH 29/46] Update changelog for 40261f31d --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bbafe97..f04b39d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased] +- Fixed candidate duplication when exact match is also a prefix match (者, 煮) - Rewrote `addCodePointsToSet` as `toCodePointSet` - Eliminated suffix Hungarian notation outside method names - Tweaked Help > Miscellaneous explanations From a93f0b284b26469c5525fefbd9cefed9ec7ffde8 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 23:22:54 +0800 Subject: [PATCH 30/46] Add fastlane changelog 68.txt --- CHANGELOG.md | 8 +++++--- fastlane/metadata/android/en-US/changelogs/68.txt | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/68.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index f04b39d1..55633d78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,13 @@ - Fixed candidate duplication when exact match is also a prefix match (者, 煮) - Rewrote `addCodePointsToSet` as `toCodePointSet` - Eliminated suffix Hungarian notation outside method names -- Tweaked Help > Miscellaneous explanations +- Improved Help > Miscellaneous table - Put Function column before Action column in table - Moved 'Retract keyboard' explanation into table -- Tweaked privacy policy punctuation (English) and wording (Chinese) -- Updated privacy policy button URL anchor for said tweak +- Made minor edits to Privacy Policy + - English: added parenthetical "(English version)" + - Chinese: added parenthetical "(中文版)", reduced "不會" to "不", expanded "英文" to "英文版" +- Updated privacy policy button URL anchor for said minor edits ## [v1.4.1] (67) 不鏽鋼 (2024-12-29) diff --git a/fastlane/metadata/android/en-US/changelogs/68.txt b/fastlane/metadata/android/en-US/changelogs/68.txt new file mode 100644 index 00000000..360e2d20 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/68.txt @@ -0,0 +1,5 @@ +* Fixed duplicate candidates when exact match is also a prefix match (者, 煮) +* Improved Help > Miscellaneous table +* Made minor edits to Privacy Policy + * English: added parenthetical "(English version)" + * Chinese: added parenthetical "(中文版)", reduced "不會" to "不", expanded "英文" to "英文版" From 8470a8ab458a348f4e4ddc3503b82bb6c95dc6f6 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 23:29:27 +0800 Subject: [PATCH 31/46] Update source code copyright years to 2025 --- README.md | 2 +- .../main/java/io/github/yawnoc/strokeinput/InputContainer.java | 2 +- app/src/main/java/io/github/yawnoc/strokeinput/Key.java | 2 +- app/src/main/java/io/github/yawnoc/strokeinput/Keyboard.java | 2 +- .../main/java/io/github/yawnoc/strokeinput/MainActivity.java | 2 +- .../java/io/github/yawnoc/strokeinput/StrokeInputService.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ea60c590..9709f77a 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Uses [Conway Stroke Data]. ## License -**Copyright 2021–2024 Conway**
+**Copyright 2021–2025 Conway**
Licensed under the GNU General Public License v3.0 (GPL-3.0-only).
This is free software with NO WARRANTY etc. etc., see [LICENSE].
diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/InputContainer.java b/app/src/main/java/io/github/yawnoc/strokeinput/InputContainer.java index b9619d40..0600203c 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/InputContainer.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/InputContainer.java @@ -1,5 +1,5 @@ /* - Copyright 2021--2024 Conway + Copyright 2021--2025 Conway Licensed under the GNU General Public License v3.0 (GPL-3.0-only). This is free software with NO WARRANTY etc. etc., see LICENSE or . diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/Key.java b/app/src/main/java/io/github/yawnoc/strokeinput/Key.java index 2ef83608..29b7fc0f 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/Key.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/Key.java @@ -1,5 +1,5 @@ /* - Copyright 2021, 2023--2024 Conway + Copyright 2021, 2023--2025 Conway Licensed under the GNU General Public License v3.0 (GPL-3.0-only). This is free software with NO WARRANTY etc. etc., see LICENSE or . diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/Keyboard.java b/app/src/main/java/io/github/yawnoc/strokeinput/Keyboard.java index f3002341..7de01f78 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/Keyboard.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/Keyboard.java @@ -1,5 +1,5 @@ /* - Copyright 2021--2024 Conway + Copyright 2021--2025 Conway Licensed under the GNU General Public License v3.0 (GPL-3.0-only). This is free software with NO WARRANTY etc. etc., see LICENSE or . diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/MainActivity.java b/app/src/main/java/io/github/yawnoc/strokeinput/MainActivity.java index 4db563be..332bbdd2 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/MainActivity.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/MainActivity.java @@ -1,5 +1,5 @@ /* - Copyright 2021--2024 Conway + Copyright 2021--2025 Conway Licensed under the GNU General Public License v3.0 (GPL-3.0-only). This is free software with NO WARRANTY etc. etc., see LICENSE or . diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index 7c5bb946..9b6b3967 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -1,5 +1,5 @@ /* - Copyright 2021--2024 Conway + Copyright 2021--2025 Conway Licensed under the GNU General Public License v3.0 (GPL-3.0-only). This is free software with NO WARRANTY etc. etc., see LICENSE or . From 24ed0fcb6c58d87648ec7402f36c7f5d01616e39 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 12 Jan 2025 23:34:34 +0800 Subject: [PATCH 32/46] Bump version to v1.4.2 (68) --- CHANGELOG.md | 7 ++++++- app/build.gradle | 4 ++-- app/src/main/assets/about-zh-Hans-CN.html | 4 ++-- app/src/main/assets/about-zh-Hant-HK.html | 4 ++-- app/src/main/assets/about-zh-Hant-TW.html | 4 ++-- app/src/main/assets/about.html | 4 ++-- app/src/main/assets/links.cmdr | 4 ++-- 7 files changed, 18 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55633d78..c3fe631f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ## [Unreleased] + +## [v1.4.2] (68) 煮者 (2025-01-12) + - Fixed candidate duplication when exact match is also a prefix match (者, 煮) - Rewrote `addCodePointsToSet` as `toCodePointSet` - Eliminated suffix Hungarian notation outside method names @@ -674,7 +677,9 @@ the actual functionality has not been implemented yet. [Unreleased]: - https://github.com/stroke-input/stroke-input-android/compare/v1.4.1...HEAD + https://github.com/stroke-input/stroke-input-android/compare/v1.4.2...HEAD +[v1.4.2]: + https://github.com/stroke-input/stroke-input-android/compare/v1.4.1...v1.4.2 [v1.4.1]: https://github.com/stroke-input/stroke-input-android/compare/v1.4.0...v1.4.1 [v1.4.0]: diff --git a/app/build.gradle b/app/build.gradle index db93691a..4e1c3afb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android minSdkVersion 24 compileSdk 35 targetSdkVersion 35 - versionCode 67 - versionName "1.4.1" + versionCode 68 + versionName "1.4.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes diff --git a/app/src/main/assets/about-zh-Hans-CN.html b/app/src/main/assets/about-zh-Hans-CN.html index 41b03cbd..ecfa92cd 100644 --- a/app/src/main/assets/about-zh-Hans-CN.html +++ b/app/src/main/assets/about-zh-Hans-CN.html @@ -7,12 +7,12 @@ 关于 -

笔画输入法 (v1.4.1)

+

笔画输入法 (v1.4.2)

笔画输入法是自由开源软件,而恕无担保。

-© 2021–2024 Conway
+© 2021–2025 Conway
GPL-3.0-only 授权,见<https://www.gnu.org/licenses/>。

diff --git a/app/src/main/assets/about-zh-Hant-HK.html b/app/src/main/assets/about-zh-Hant-HK.html index 858945c5..345ecd9f 100644 --- a/app/src/main/assets/about-zh-Hant-HK.html +++ b/app/src/main/assets/about-zh-Hant-HK.html @@ -7,12 +7,12 @@ 關於 -

筆畫輸入法 (v1.4.1)

+

筆畫輸入法 (v1.4.2)

筆畫輸入法為自由開源軟件,而恕無擔保。

-© 2021–2024 Conway
+© 2021–2025 Conway
GPL-3.0-only 授權,見<https://www.gnu.org/licenses/>。

diff --git a/app/src/main/assets/about-zh-Hant-TW.html b/app/src/main/assets/about-zh-Hant-TW.html index 7a4e4b8b..7a9d36e6 100644 --- a/app/src/main/assets/about-zh-Hant-TW.html +++ b/app/src/main/assets/about-zh-Hant-TW.html @@ -7,12 +7,12 @@ 關於 -

筆畫輸入法 (v1.4.1)

+

筆畫輸入法 (v1.4.2)

筆畫輸入法為自由開源軟體,而恕無擔保。

-© 2021–2024 Conway
+© 2021–2025 Conway
GPL-3.0-only 授權,見<https://www.gnu.org/licenses/>。

diff --git a/app/src/main/assets/about.html b/app/src/main/assets/about.html index fe490be6..15db3704 100644 --- a/app/src/main/assets/about.html +++ b/app/src/main/assets/about.html @@ -7,13 +7,13 @@ About -

Stroke Input Method (v1.4.1)

+

Stroke Input Method (v1.4.2)

Stroke Input Method is free and open-source software with ABSOLUTELY NO WARRANTY.

-© 2021–2024 Conway
+© 2021–2025 Conway
Licensed under GPL-3.0-only, see <https://www.gnu.org/licenses/>.

diff --git a/app/src/main/assets/links.cmdr b/app/src/main/assets/links.cmdr index b8f52916..91d7135c 100644 --- a/app/src/main/assets/links.cmdr +++ b/app/src/main/assets/links.cmdr @@ -15,8 +15,8 @@ OrdinaryDictionaryReplacement: #.links.license-links OrdinaryDictionaryReplacement: #.links.software-properties - queue_position: BEFORE #explicit-links - apply_mode: SIMULTANEOUS -* \stroke-input-version --> v1.4.1 -* \stroke-input-years --> 2021--2024 +* \stroke-input-version --> v1.4.2 +* \stroke-input-years --> 2021--2025 * \material-version --> v1.12.0 * \material-years --> 2024 * \stroke-data-version --> v1.34.0 From 650bd73ed9c811419873d97a1c396ecdc746dca4 Mon Sep 17 00:00:00 2001 From: Conway Date: Thu, 19 Jun 2025 00:53:23 +0800 Subject: [PATCH 33/46] Align readme miscellaneous table with in-app help --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9709f77a..a33bf001 100644 --- a/README.md +++ b/README.md @@ -73,14 +73,11 @@ see [app/src/main/assets/about.html]. ### Miscellaneous -| Action | Function | +| Function | Action | | - | - | -| Horizontally swipe space-bar | Change language | -| Long press space-bar | Change to other keyboard | - -### Retract keyboard - -Use the system Back Button (or Back Gesture) to retract the keyboard. +| Retract keyboard | Use system Back Button (or Back Gesture) | +| Change language | Horizontally swipe space-bar | +| Change to other keyboard | Long press space-bar | ## Assets (for devs) From b3de662b079cd9973b2e0786a22008230e3e87a4 Mon Sep 17 00:00:00 2001 From: Conway Date: Sat, 21 Jun 2025 01:21:01 +0800 Subject: [PATCH 34/46] Upgrade Android Gradle Plugin to 8.10.1 --- CHANGELOG.md | 2 ++ build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3fe631f..2a418f34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## [Unreleased] +- Upgraded Android Gradle Plugin to 8.10.1 + ## [v1.4.2] (68) 煮者 (2025-01-12) diff --git a/build.gradle b/build.gradle index d0d97f4d..e2a7f6a7 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript } dependencies { - classpath 'com.android.tools.build:gradle:8.1.4' + classpath 'com.android.tools.build:gradle:8.10.1' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f97ab1f0..e76e90e4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=4159b938ec734a8388ce03f52aa8f3c7ed0d31f5438622545de4f83a89b79788 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionSha256Sum=7197a12f450794931532469d4ff21a59ea2c1cd59a3ec3f89c035c3c420a6999 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 49ace3f10f3592397d073623263434af509772cf Mon Sep 17 00:00:00 2001 From: Conway Date: Sat, 21 Jun 2025 01:24:40 +0800 Subject: [PATCH 35/46] Migrate BuildConfig to Gradle Build Files Fixes `'android.defaults.buildfeatures.buildconfig=true' is deprecated`. --- CHANGELOG.md | 1 + app/build.gradle | 4 ++++ gradle.properties | 1 - 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a418f34..831e2ae8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## [Unreleased] - Upgraded Android Gradle Plugin to 8.10.1 +- Migrated BuildConfig to Gradle Build Files ## [v1.4.2] (68) 煮者 (2025-01-12) diff --git a/app/build.gradle b/app/build.gradle index 4e1c3afb..990d18a6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,6 +15,10 @@ android versionName "1.4.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } + buildFeatures + { + buildConfig true + } buildTypes { release diff --git a/gradle.properties b/gradle.properties index 683c3de0..fed1c82a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,6 +15,5 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 # Android operating system, and which are packaged with your app"s APK # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true -android.defaults.buildfeatures.buildconfig=true android.nonTransitiveRClass=false android.nonFinalResIds=false From 62edb66843a26cd8cc9583e4137471bbed65c0e3 Mon Sep 17 00:00:00 2001 From: Conway Date: Sat, 21 Jun 2025 01:28:56 +0800 Subject: [PATCH 36/46] Fix 'buildDir' is deprecated --- CHANGELOG.md | 2 +- build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 831e2ae8..c2525e47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ## [Unreleased] - Upgraded Android Gradle Plugin to 8.10.1 -- Migrated BuildConfig to Gradle Build Files +- Fixed various Gradle-related deprecations ## [v1.4.2] (68) 煮者 (2025-01-12) diff --git a/build.gradle b/build.gradle index e2a7f6a7..b28e6679 100644 --- a/build.gradle +++ b/build.gradle @@ -30,5 +30,5 @@ allprojects tasks.register('clean', Delete) { - delete rootProject.buildDir + delete rootProject.layout.buildDirectory } From e981e7d517a431fb618eb059d37e70145893bc3e Mon Sep 17 00:00:00 2001 From: Conway Date: Sat, 21 Jun 2025 01:45:45 +0800 Subject: [PATCH 37/46] Migrate actions/upload-artifact to v4 --- .github/workflows/build-debug-apk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-debug-apk.yml b/.github/workflows/build-debug-apk.yml index 6f3fb94a..831f7042 100644 --- a/.github/workflows/build-debug-apk.yml +++ b/.github/workflows/build-debug-apk.yml @@ -20,7 +20,7 @@ jobs: distribution: 'temurin' java-version: 17 - run: ./gradlew clean && ./gradlew assembleDebug - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: app-debug.apk path: app/build/outputs/apk/debug/app-debug.apk From 94aa3ceae8805b0c648c00841e3a8fb90d3c266a Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 29 Jun 2025 21:23:25 +0800 Subject: [PATCH 38/46] Fix keyboard fails to spawn in Android 16 (API 36) Fixes . --- .../io/github/yawnoc/strokeinput/StrokeInputService.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index 9b6b3967..a8e13590 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -493,6 +493,13 @@ public void onComputeInsets(final Insets insets) } } + @Override + public boolean onEvaluateInputViewShown() + { + super.onEvaluateInputViewShown(); + return true; // override needed in API level 36 + } + @Override public void onCandidate(final String candidate) { From 0dbe6982c107d2d33a93fcfb025d8ab808348ecf Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 29 Jun 2025 22:04:23 +0800 Subject: [PATCH 39/46] Update changelog for Android 16 fix i.e. 94aa3ceae8805b0c648c00841e3a8fb90d3c266a --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2525e47..9855b9a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ ## [Unreleased] +### User + +- Fixed keyboard failing to spawn in Android 16 + +### Developer + - Upgraded Android Gradle Plugin to 8.10.1 - Fixed various Gradle-related deprecations From c12eb6f003bf72feda9751dbae42a6b7fdf5fec1 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 29 Jun 2025 22:18:11 +0800 Subject: [PATCH 40/46] Replace `printStackTrace()` with logging --- CHANGELOG.md | 1 + .../main/java/io/github/yawnoc/strokeinput/Keyboard.java | 5 ++++- .../io/github/yawnoc/strokeinput/StrokeInputService.java | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9855b9a5..813ce5b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Upgraded Android Gradle Plugin to 8.10.1 - Fixed various Gradle-related deprecations +- Replaced `printStackTrace()` with logging ## [v1.4.2] (68) 煮者 (2025-01-12) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/Keyboard.java b/app/src/main/java/io/github/yawnoc/strokeinput/Keyboard.java index 7de01f78..beb9e42e 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/Keyboard.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/Keyboard.java @@ -26,6 +26,7 @@ import android.content.res.XmlResourceParser; import android.graphics.Color; import android.util.DisplayMetrics; +import android.util.Log; import android.util.Xml; import java.util.ArrayList; @@ -38,6 +39,8 @@ */ public class Keyboard { + private static final String LOG_TAG = "Keyboard"; + private static final String KEYBOARD_TAG = "Keyboard"; private static final String ROW_TAG = "Row"; private static final String KEY_TAG = "Key"; @@ -203,7 +206,7 @@ else if (inRow) } catch (Exception exception) { - exception.printStackTrace(); + Log.e(LOG_TAG, "makeKeyboard failed", exception); } } diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index a8e13590..53818b86 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -249,7 +249,7 @@ private void loadSequenceCharactersData( } catch (IOException exception) { - exception.printStackTrace(); + Log.e(LOG_TAG, "loadSequenceCharactersData failed", exception); } final long endMilliseconds = System.currentTimeMillis(); @@ -276,7 +276,7 @@ private void loadCharactersData(final String charactersFileName, final Set phr } catch (IOException exception) { - exception.printStackTrace(); + Log.e(LOG_TAG, "loadPhrasesData failed", exception); } final long endMilliseconds = System.currentTimeMillis(); From b5a0a8741dc48cb39c6b911b22170263c63ad4d2 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 29 Jun 2025 22:29:22 +0800 Subject: [PATCH 41/46] Replace `size` and `length` comparisons with `isEmpty()` --- CHANGELOG.md | 1 + .../strokeinput/StrokeInputService.java | 22 +++++++++---------- .../yawnoc/strokeinput/StrokeSequenceBar.java | 4 ++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 813ce5b0..f28269ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Upgraded Android Gradle Plugin to 8.10.1 - Fixed various Gradle-related deprecations - Replaced `printStackTrace()` with logging +- Replaced `size()` and `length()` comparisons with `isEmpty()` check ## [v1.4.2] (68) 煮者 (2025-01-12) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java index 53818b86..44ee824b 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java @@ -219,7 +219,7 @@ private Keyboard loadSavedKeyboard() @SuppressWarnings("BooleanMethodIsAlwaysInverted") private static boolean isCommentLine(final String line) { - return line.startsWith("#") || line.length() == 0; + return line.startsWith("#") || line.isEmpty(); } @SuppressWarnings("SameParameterValue") @@ -565,7 +565,7 @@ private void effectStrokeAppend(final String strokeDigit) { final String newStrokeDigitSequence = strokeDigitSequence + strokeDigit; final List newCandidates = computeCandidates(newStrokeDigitSequence); - if (newCandidates.size() > 0) + if (!newCandidates.isEmpty()) { setStrokeDigitSequence(newStrokeDigitSequence); setCandidates(newCandidates); @@ -574,7 +574,7 @@ private void effectStrokeAppend(final String strokeDigit) private void effectBackspace(final InputConnection inputConnection) { - if (strokeDigitSequence.length() > 0) + if (!strokeDigitSequence.isEmpty()) { final String newStrokeDigitSequence = Stringy.removeSuffixRegex("(?s).", strokeDigitSequence); final List newCandidates = computeCandidates(newStrokeDigitSequence); @@ -582,7 +582,7 @@ private void effectBackspace(final InputConnection inputConnection) setStrokeDigitSequence(newStrokeDigitSequence); setCandidates(newCandidates); - if (newStrokeDigitSequence.length() == 0) + if (newStrokeDigitSequence.isEmpty()) { setPhraseCompletionCandidates(inputConnection); } @@ -593,7 +593,7 @@ private void effectBackspace(final InputConnection inputConnection) { final String upToOneCharacterBeforeCursor = getTextBeforeCursor(inputConnection, 1); - if (upToOneCharacterBeforeCursor.length() > 0) + if (!upToOneCharacterBeforeCursor.isEmpty()) { final CharSequence selection = inputConnection.getSelectedText(0); if (TextUtils.isEmpty(selection)) @@ -629,7 +629,7 @@ private void effectKeyboardSwitch(final String keyboardName) private void effectSpaceKey(final InputConnection inputConnection) { - if (strokeDigitSequence.length() > 0) + if (!strokeDigitSequence.isEmpty()) { onCandidate(getFirstCandidate()); } @@ -641,7 +641,7 @@ private void effectSpaceKey(final InputConnection inputConnection) private void effectEnterKey(final InputConnection inputConnection) { - if (strokeDigitSequence.length() > 0) + if (!strokeDigitSequence.isEmpty()) { onCandidate(getFirstCandidate()); } @@ -657,7 +657,7 @@ else if (enterKeyHasAction) private void effectOrdinaryKey(final InputConnection inputConnection, final String valueText) { - if (strokeDigitSequence.length() > 0) + if (!strokeDigitSequence.isEmpty()) { return; } @@ -820,7 +820,7 @@ private int computeCandidateRank( final int fineRank; final int penalty; - final boolean phraseCompletionsIsEmpty = phraseCompletionFirstCodePoints.size() == 0; + final boolean phraseCompletionsIsEmpty = phraseCompletionFirstCodePoints.isEmpty(); final int phraseCompletionIndex = phraseCompletionFirstCodePoints.indexOf(firstCodePoint); final boolean firstCodePointMatchesPhraseCompletionCandidate = phraseCompletionIndex > 0; @@ -864,7 +864,7 @@ else if (firstCodePointMatchesPhraseCompletionCandidate) private List computeCandidates(final String strokeDigitSequence) { - if (strokeDigitSequence.length() == 0) + if (strokeDigitSequence.isEmpty()) { return Collections.emptyList(); } @@ -947,7 +947,7 @@ private List computePhraseCompletionCandidates(final InputConnection inp for ( String phrasePrefix = getTextBeforeCursor(inputConnection, MAX_PHRASE_LENGTH - 1); - phrasePrefix.length() > 0; + !phrasePrefix.isEmpty(); phrasePrefix = Stringy.removePrefixRegex("(?s).", phrasePrefix) ) { diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeSequenceBar.java b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeSequenceBar.java index d0d09cb3..65fedeaa 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/StrokeSequenceBar.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/StrokeSequenceBar.java @@ -1,5 +1,5 @@ /* - Copyright 2021, 2023 Conway + Copyright 2021, 2023, 2025 Conway Licensed under the GNU General Public License v3.0 (GPL-3.0-only). This is free software with NO WARRANTY etc. etc., see LICENSE or . @@ -25,7 +25,7 @@ public StrokeSequenceBar(Context context, AttributeSet attributes) public void setStrokeDigitSequence(final String strokeDigitSequence) { - if (strokeDigitSequence.length() > 0) + if (!strokeDigitSequence.isEmpty()) { final String strokeSequence = strokeDigitSequence From 6805f5565d66c1d31e184cd27e596d250d534af8 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 29 Jun 2025 23:08:39 +0800 Subject: [PATCH 42/46] Add fastlane changelog 69.txt --- fastlane/metadata/android/en-US/changelogs/69.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/69.txt diff --git a/fastlane/metadata/android/en-US/changelogs/69.txt b/fastlane/metadata/android/en-US/changelogs/69.txt new file mode 100644 index 00000000..63b454b5 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/69.txt @@ -0,0 +1 @@ +* Fixed keyboard failing to spawn in Android 16 From 06c5a92ecaa2a0404314f2e775beab16aa75ae9f Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 29 Jun 2025 23:00:20 +0800 Subject: [PATCH 43/46] Bump version to v1.4.3 (69) --- CHANGELOG.md | 7 ++++++- app/build.gradle | 4 ++-- app/src/main/assets/about-zh-Hans-CN.html | 2 +- app/src/main/assets/about-zh-Hant-HK.html | 2 +- app/src/main/assets/about-zh-Hant-TW.html | 2 +- app/src/main/assets/about.html | 2 +- app/src/main/assets/links.cmdr | 2 +- 7 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f28269ce..c8cc661e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ## [Unreleased] + +## [v1.4.3] (69) Cursed be Android 16 (2025-06-29) + ### User - Fixed keyboard failing to spawn in Android 16 @@ -688,7 +691,9 @@ the actual functionality has not been implemented yet. [Unreleased]: - https://github.com/stroke-input/stroke-input-android/compare/v1.4.2...HEAD + https://github.com/stroke-input/stroke-input-android/compare/v1.4.3...HEAD +[v1.4.3]: + https://github.com/stroke-input/stroke-input-android/compare/v1.4.2...v1.4.3 [v1.4.2]: https://github.com/stroke-input/stroke-input-android/compare/v1.4.1...v1.4.2 [v1.4.1]: diff --git a/app/build.gradle b/app/build.gradle index 990d18a6..3390e5ad 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android minSdkVersion 24 compileSdk 35 targetSdkVersion 35 - versionCode 68 - versionName "1.4.2" + versionCode 69 + versionName "1.4.3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildFeatures diff --git a/app/src/main/assets/about-zh-Hans-CN.html b/app/src/main/assets/about-zh-Hans-CN.html index ecfa92cd..e0d7d8f7 100644 --- a/app/src/main/assets/about-zh-Hans-CN.html +++ b/app/src/main/assets/about-zh-Hans-CN.html @@ -7,7 +7,7 @@ 关于 -

笔画输入法 (v1.4.2)

+

笔画输入法 (v1.4.3)

笔画输入法是自由开源软件,而恕无担保。

diff --git a/app/src/main/assets/about-zh-Hant-HK.html b/app/src/main/assets/about-zh-Hant-HK.html index 345ecd9f..ac0a09ac 100644 --- a/app/src/main/assets/about-zh-Hant-HK.html +++ b/app/src/main/assets/about-zh-Hant-HK.html @@ -7,7 +7,7 @@ 關於 -

筆畫輸入法 (v1.4.2)

+

筆畫輸入法 (v1.4.3)

筆畫輸入法為自由開源軟件,而恕無擔保。

diff --git a/app/src/main/assets/about-zh-Hant-TW.html b/app/src/main/assets/about-zh-Hant-TW.html index 7a9d36e6..bb82027c 100644 --- a/app/src/main/assets/about-zh-Hant-TW.html +++ b/app/src/main/assets/about-zh-Hant-TW.html @@ -7,7 +7,7 @@ 關於 -

筆畫輸入法 (v1.4.2)

+

筆畫輸入法 (v1.4.3)

筆畫輸入法為自由開源軟體,而恕無擔保。

diff --git a/app/src/main/assets/about.html b/app/src/main/assets/about.html index 15db3704..092e6c35 100644 --- a/app/src/main/assets/about.html +++ b/app/src/main/assets/about.html @@ -7,7 +7,7 @@ About -

Stroke Input Method (v1.4.2)

+

Stroke Input Method (v1.4.3)

Stroke Input Method is free and open-source software with ABSOLUTELY NO WARRANTY. diff --git a/app/src/main/assets/links.cmdr b/app/src/main/assets/links.cmdr index 91d7135c..7ce2e0b9 100644 --- a/app/src/main/assets/links.cmdr +++ b/app/src/main/assets/links.cmdr @@ -15,7 +15,7 @@ OrdinaryDictionaryReplacement: #.links.license-links OrdinaryDictionaryReplacement: #.links.software-properties - queue_position: BEFORE #explicit-links - apply_mode: SIMULTANEOUS -* \stroke-input-version --> v1.4.2 +* \stroke-input-version --> v1.4.3 * \stroke-input-years --> 2021--2025 * \material-version --> v1.12.0 * \material-years --> 2024 From 45e0703ee47e80550f867a4d49a41ad48197e82a Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 24 Aug 2025 14:49:42 +0800 Subject: [PATCH 44/46] Improve keyboard height adjustment trigger mechanism Previous approach was hideSoftInputFromWindow + showSoftInput. This approach was bad because: 1. It caused a flash due to the keyboard being hidden then reshown. 2. It failed to actually redraw at the new size in Android 16 (API 36), presumably due to changes in the heuristics used to determine whether a redraw is actually required. --- New approach is restartInput + showSoftInput. This seems to fix both problems: 1. The flash no longer occurs. 2. The keyboard is properly redrawn at the new size in Android 16 (API 36). --- Fixes . --- CHANGELOG.md | 2 ++ .../main/java/io/github/yawnoc/strokeinput/MainActivity.java | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8cc661e..e44c408b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## [Unreleased] +- Fixed keyboard height not immediately updating in Android 16 + ## [v1.4.3] (69) Cursed be Android 16 (2025-06-29) diff --git a/app/src/main/java/io/github/yawnoc/strokeinput/MainActivity.java b/app/src/main/java/io/github/yawnoc/strokeinput/MainActivity.java index 332bbdd2..540a01c0 100644 --- a/app/src/main/java/io/github/yawnoc/strokeinput/MainActivity.java +++ b/app/src/main/java/io/github/yawnoc/strokeinput/MainActivity.java @@ -93,13 +93,13 @@ public void onStartTrackingTouch(SeekBar seekBar) @Override public void onStopTrackingTouch(SeekBar seekBar) { - // Hide and reshow keyboard to trigger height readjustment + // Trigger height readjustment and ensure keyboard shown final View focusView = getCurrentFocus(); if (focusView != null) { final InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); - inputMethodManager.hideSoftInputFromWindow(focusView.getWindowToken(), 0); + inputMethodManager.restartInput(focusView); inputMethodManager.showSoftInput(findViewById(R.id.test_input), InputMethodManager.SHOW_IMPLICIT); } } From e9b9b80d422b34fcdb1e750116d6b5c36ac1c590 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 24 Aug 2025 14:55:28 +0800 Subject: [PATCH 45/46] Add fastlane changelog 70.txt --- fastlane/metadata/android/en-US/changelogs/70.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/70.txt diff --git a/fastlane/metadata/android/en-US/changelogs/70.txt b/fastlane/metadata/android/en-US/changelogs/70.txt new file mode 100644 index 00000000..367a686c --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/70.txt @@ -0,0 +1 @@ +* Fixed keyboard height not immediately updating in Android 16 From 8b60218f6bb9a9d99924ccc7bae38ee3178004e4 Mon Sep 17 00:00:00 2001 From: Conway Date: Sun, 24 Aug 2025 15:01:33 +0800 Subject: [PATCH 46/46] Bump version to v1.4.4 (70) --- CHANGELOG.md | 7 ++++++- app/build.gradle | 4 ++-- app/src/main/assets/about-zh-Hans-CN.html | 2 +- app/src/main/assets/about-zh-Hant-HK.html | 2 +- app/src/main/assets/about-zh-Hant-TW.html | 2 +- app/src/main/assets/about.html | 2 +- app/src/main/assets/links.cmdr | 2 +- 7 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e44c408b..9abff3a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ## [Unreleased] + +## [v1.4.4] (70) Cursed be Android 16 again (2025-08-24) + - Fixed keyboard height not immediately updating in Android 16 @@ -693,7 +696,9 @@ the actual functionality has not been implemented yet. [Unreleased]: - https://github.com/stroke-input/stroke-input-android/compare/v1.4.3...HEAD + https://github.com/stroke-input/stroke-input-android/compare/v1.4.4...HEAD +[v1.4.4]: + https://github.com/stroke-input/stroke-input-android/compare/v1.4.3...v1.4.4 [v1.4.3]: https://github.com/stroke-input/stroke-input-android/compare/v1.4.2...v1.4.3 [v1.4.2]: diff --git a/app/build.gradle b/app/build.gradle index 3390e5ad..9903324f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android minSdkVersion 24 compileSdk 35 targetSdkVersion 35 - versionCode 69 - versionName "1.4.3" + versionCode 70 + versionName "1.4.4" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildFeatures diff --git a/app/src/main/assets/about-zh-Hans-CN.html b/app/src/main/assets/about-zh-Hans-CN.html index e0d7d8f7..26f3e7f3 100644 --- a/app/src/main/assets/about-zh-Hans-CN.html +++ b/app/src/main/assets/about-zh-Hans-CN.html @@ -7,7 +7,7 @@ 关于 -

笔画输入法 (v1.4.3)

+

笔画输入法 (v1.4.4)

笔画输入法是自由开源软件,而恕无担保。

diff --git a/app/src/main/assets/about-zh-Hant-HK.html b/app/src/main/assets/about-zh-Hant-HK.html index ac0a09ac..b2c89766 100644 --- a/app/src/main/assets/about-zh-Hant-HK.html +++ b/app/src/main/assets/about-zh-Hant-HK.html @@ -7,7 +7,7 @@ 關於 -

筆畫輸入法 (v1.4.3)

+

筆畫輸入法 (v1.4.4)

筆畫輸入法為自由開源軟件,而恕無擔保。

diff --git a/app/src/main/assets/about-zh-Hant-TW.html b/app/src/main/assets/about-zh-Hant-TW.html index bb82027c..644f5ab5 100644 --- a/app/src/main/assets/about-zh-Hant-TW.html +++ b/app/src/main/assets/about-zh-Hant-TW.html @@ -7,7 +7,7 @@ 關於 -

筆畫輸入法 (v1.4.3)

+

筆畫輸入法 (v1.4.4)

筆畫輸入法為自由開源軟體,而恕無擔保。

diff --git a/app/src/main/assets/about.html b/app/src/main/assets/about.html index 092e6c35..e8c2a631 100644 --- a/app/src/main/assets/about.html +++ b/app/src/main/assets/about.html @@ -7,7 +7,7 @@ About -

Stroke Input Method (v1.4.3)

+

Stroke Input Method (v1.4.4)

Stroke Input Method is free and open-source software with ABSOLUTELY NO WARRANTY. diff --git a/app/src/main/assets/links.cmdr b/app/src/main/assets/links.cmdr index 7ce2e0b9..0ed8df0f 100644 --- a/app/src/main/assets/links.cmdr +++ b/app/src/main/assets/links.cmdr @@ -15,7 +15,7 @@ OrdinaryDictionaryReplacement: #.links.license-links OrdinaryDictionaryReplacement: #.links.software-properties - queue_position: BEFORE #explicit-links - apply_mode: SIMULTANEOUS -* \stroke-input-version --> v1.4.3 +* \stroke-input-version --> v1.4.4 * \stroke-input-years --> 2021--2025 * \material-version --> v1.12.0 * \material-years --> 2024