From 166c3ca13ceaeb71c206494ea7ef12d53e1bc085 Mon Sep 17 00:00:00 2001 From: sspanak Date: Thu, 19 Dec 2024 16:40:09 +0200 Subject: [PATCH 1/8] fixed a crash on Android 5 and 6 when switching between languages and Korean is enabled --- .../main/java/io/github/sspanak/tt9/ime/TypingHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/github/sspanak/tt9/ime/TypingHandler.java b/app/src/main/java/io/github/sspanak/tt9/ime/TypingHandler.java index ac03137ef..573a59ae0 100644 --- a/app/src/main/java/io/github/sspanak/tt9/ime/TypingHandler.java +++ b/app/src/main/java/io/github/sspanak/tt9/ime/TypingHandler.java @@ -295,8 +295,8 @@ protected int determineInputModeId() { } allowedInputModes = new ArrayList<>(inputType.determineInputModes(getApplicationContext())); - if (LanguageKind.isKorean(mLanguage) && allowedInputModes.contains(InputMode.MODE_ABC)) { - allowedInputModes.remove(InputMode.MODE_ABC); + if (LanguageKind.isKorean(mLanguage)) { + allowedInputModes.remove((Integer) InputMode.MODE_ABC); } return InputModeValidator.validateMode(settings.getInputMode(), allowedInputModes); From 6d6ecb7556c376a7dfd34b381bf1ac65e3c61955 Mon Sep 17 00:00:00 2001 From: sspanak Date: Thu, 19 Dec 2024 17:01:18 +0200 Subject: [PATCH 2/8] fixed a crash when shutting down or when switching to another keyboard --- .../sspanak/tt9/ime/helpers/SuggestionOps.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/github/sspanak/tt9/ime/helpers/SuggestionOps.java b/app/src/main/java/io/github/sspanak/tt9/ime/helpers/SuggestionOps.java index 6cca6a960..9ea9a551b 100644 --- a/app/src/main/java/io/github/sspanak/tt9/ime/helpers/SuggestionOps.java +++ b/app/src/main/java/io/github/sspanak/tt9/ime/helpers/SuggestionOps.java @@ -4,6 +4,7 @@ import android.os.Looper; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import java.util.ArrayList; @@ -16,10 +17,10 @@ public class SuggestionOps { @NonNull private final Handler delayedAcceptHandler; @NonNull private final ConsumerCompat onDelayedAccept; @NonNull protected final SuggestionsBar suggestionBar; - @NonNull private TextField textField; + @Nullable private TextField textField; - public SuggestionOps(@NonNull SettingsStore settings, @NonNull ResizableMainView mainView, @NonNull TextField textField, @NonNull ConsumerCompat onDelayedAccept, @NonNull Runnable onSuggestionClick) { + public SuggestionOps(@NonNull SettingsStore settings, @NonNull ResizableMainView mainView, @Nullable TextField textField, @NonNull ConsumerCompat onDelayedAccept, @NonNull Runnable onSuggestionClick) { delayedAcceptHandler = new Handler(Looper.getMainLooper()); this.onDelayedAccept = onDelayedAccept; @@ -28,7 +29,7 @@ public SuggestionOps(@NonNull SettingsStore settings, @NonNull ResizableMainView } - public void setTextField(@NonNull TextField textField) { + public void setTextField(@Nullable TextField textField) { this.textField = textField; } @@ -50,8 +51,10 @@ public String get(int index) { public void clear() { set(null); - textField.setComposingText(""); - textField.finishComposingText(); + if (textField != null) { + textField.setComposingText(""); + textField.finishComposingText(); + } } public void set(ArrayList suggestions) { @@ -103,7 +106,7 @@ public String acceptPrevious(int sequenceLength) { public void commitCurrent(boolean entireSuggestion) { - if (!suggestionBar.isEmpty()) { + if (textField != null && !suggestionBar.isEmpty()) { if (entireSuggestion) { textField.setComposingText(getCurrent()); } From 957e6af0973cc7879cff88fa66c5a9bb2d5359b1 Mon Sep 17 00:00:00 2001 From: sspanak Date: Thu, 19 Dec 2024 17:04:52 +0200 Subject: [PATCH 3/8] upgraded com.android.application 8.7.2 -> 8.7.3 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 49875739d..883346565 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '8.7.2' apply false + id 'com.android.application' version '8.7.3' apply false } \ No newline at end of file From 565c6f035900fe949ae6ee72940fe20e891d96a5 Mon Sep 17 00:00:00 2001 From: sspanak Date: Thu, 19 Dec 2024 17:19:13 +0200 Subject: [PATCH 4/8] removed the Korean punctuation hack --- .../sspanak/tt9/ime/modes/ModeCheonjiin.java | 16 +++++----------- .../tt9/preferences/settings/SettingsHacks.java | 4 ---- app/src/main/res/xml/prefs_screen_debug.xml | 7 ------- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/io/github/sspanak/tt9/ime/modes/ModeCheonjiin.java b/app/src/main/java/io/github/sspanak/tt9/ime/modes/ModeCheonjiin.java index b63fd15f6..69ce43dea 100644 --- a/app/src/main/java/io/github/sspanak/tt9/ime/modes/ModeCheonjiin.java +++ b/app/src/main/java/io/github/sspanak/tt9/ime/modes/ModeCheonjiin.java @@ -46,7 +46,7 @@ class ModeCheonjiin extends InputMode { protected ModeCheonjiin(SettingsStore settings, InputType inputType, TextField textField) { super(settings, inputType); - SPECIAL_CHAR_SEQUENCE_PREFIX = settings.holdForPunctuationInKorean() ? "11" : "1"; + SPECIAL_CHAR_SEQUENCE_PREFIX = "11"; digitSequence = ""; allowedTextCases.add(CASE_LOWER); @@ -77,9 +77,7 @@ protected ModeCheonjiin(SettingsStore settings, InputType inputType, TextField t protected void setCustomSpecialCharacters() { // special KEY_CHARACTERS.add(TextTools.removeLettersFromList(applyPunctuationOrder(Characters.Special, 0))); - if (settings.holdForPunctuationInKorean()) { - KEY_CHARACTERS.get(0).add(0, "0"); - } + KEY_CHARACTERS.get(0).add(0, "0"); // punctuation KEY_CHARACTERS.add( @@ -107,7 +105,7 @@ protected void initPredictions() { @Override public boolean onBackspace() { - if (settings.holdForPunctuationInKorean() && digitSequence.equals(PUNCTUATION_SEQUENCE)) { + if (digitSequence.equals(PUNCTUATION_SEQUENCE)) { digitSequence = ""; } else if (digitSequence.equals(SPECIAL_CHAR_SEQUENCE) || (!digitSequence.startsWith(PUNCTUATION_SEQUENCE) && Cheonjiin.isSingleJamo(digitSequence))) { digitSequence = ""; @@ -137,10 +135,10 @@ public boolean onNumber(int number, boolean hold, int repeat) { protected void onNumberHold(int number) { - if (settings.holdForPunctuationInKorean() && number == 0) { + if (number == 0) { disablePredictions = false; digitSequence = SPECIAL_CHAR_SEQUENCE; - } else if (settings.holdForPunctuationInKorean() && number == 1) { + } else if (number == 1) { disablePredictions = false; digitSequence = PUNCTUATION_SEQUENCE; } else { @@ -169,10 +167,6 @@ private int shouldRewindRepeatingNumbers(int nextNumber) { final int repeatingDigits = digitSequence.length() > 1 && digitSequence.charAt(digitSequence.length() - 1) == nextChar ? Cheonjiin.getRepeatingEndingDigits(digitSequence) : 0; final int keyCharsCount = nextNumber == 0 ? 2 : language.getKeyCharacters(nextNumber).size(); - if (!settings.holdForPunctuationInKorean() && SPECIAL_CHAR_SEQUENCE.equals(digitSequence + nextNumber)) { - return 0; - } - if (SPECIAL_CHAR_SEQUENCE.equals(digitSequence)) { return SPECIAL_CHAR_SEQUENCE.length(); } diff --git a/app/src/main/java/io/github/sspanak/tt9/preferences/settings/SettingsHacks.java b/app/src/main/java/io/github/sspanak/tt9/preferences/settings/SettingsHacks.java index 36a93d8c3..1413ed1d7 100644 --- a/app/src/main/java/io/github/sspanak/tt9/preferences/settings/SettingsHacks.java +++ b/app/src/main/java/io/github/sspanak/tt9/preferences/settings/SettingsHacks.java @@ -37,10 +37,6 @@ public int getInputHandlingMode() { /************* hack settings *************/ - public boolean holdForPunctuationInKorean() { - return prefs.getBoolean("pref_hold_for_punctuation_in_korean", true); - } - public int getSuggestionScrollingDelay() { boolean defaultOn = DeviceInfo.noTouchScreen(context) && Build.VERSION.SDK_INT < Build.VERSION_CODES.Q; return prefs.getBoolean("pref_alternative_suggestion_scrolling", defaultOn) ? 200 : 0; diff --git a/app/src/main/res/xml/prefs_screen_debug.xml b/app/src/main/res/xml/prefs_screen_debug.xml index a8eeebbba..26a1b1090 100644 --- a/app/src/main/res/xml/prefs_screen_debug.xml +++ b/app/src/main/res/xml/prefs_screen_debug.xml @@ -19,13 +19,6 @@ - - From 467e79f20bae21d43950d846a86ee89811673f31 Mon Sep 17 00:00:00 2001 From: sspanak Date: Thu, 19 Dec 2024 17:20:15 +0200 Subject: [PATCH 5/8] fixed Backspace not erasing text emoticons properly after '1' has been pressed multiple times (Android 4 and 5 only) --- app/src/main/java/io/github/sspanak/tt9/util/chars/Emoji.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/github/sspanak/tt9/util/chars/Emoji.java b/app/src/main/java/io/github/sspanak/tt9/util/chars/Emoji.java index 78bff1684..c59e7ca3d 100644 --- a/app/src/main/java/io/github/sspanak/tt9/util/chars/Emoji.java +++ b/app/src/main/java/io/github/sspanak/tt9/util/chars/Emoji.java @@ -59,6 +59,6 @@ public static ArrayList getEmoji(int level) { } public static int getMaxEmojiLevel() { - return Emoji.size(); + return noEmojiSupported() ? 1 : Emoji.size(); } } From 7377a9bc2782d91881ce4ad3a0f4d7dd3bbcf58c Mon Sep 17 00:00:00 2001 From: sspanak Date: Thu, 19 Dec 2024 17:40:09 +0200 Subject: [PATCH 6/8] removed the encrypted dependencies block from the APK --- app/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 2afe501d3..0e6e66d0b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -113,6 +113,9 @@ android { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } + dependenciesInfo { + includeInApk false + } flavorDimensions = ['app'] productFlavors { From 595b6af282826448e5e888b115636a5a1888a7e4 Mon Sep 17 00:00:00 2001 From: sspanak Date: Thu, 19 Dec 2024 18:03:22 +0200 Subject: [PATCH 7/8] documentation update --- README.md | 4 ++-- fastlane/metadata/android/bg-BG/full_description.txt | 2 +- fastlane/metadata/android/en-US/full_description.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cde218de1..269b55da3 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ _If your phone does not have Google Play and it does not allow installing custom ## ⚙️ System Requirements - Android 4.4 or higher. - A hardware keypad or a keyboard. For touchscreen-only devices, an on-screen keypad can be activated from the Settings. -- Storage space depends on the Android version. The lite version requires at least 4-7 Mb and the full version requires at least 110 Mb. +- Storage space depends on the Android version. The lite version requires at least 4-7 Mb and the full version requires at least 120 Mb. - Extra storage space is necessary for language dictionaries in Predictive Mode. - Languages with character predictions only (Korean): ~1 Mb per language - Very small languages (< 100k words; Kiswahili, Indonesian, Vietnamese): 5-6 Mb per language. @@ -62,7 +62,7 @@ As with many other open-source projects, this one is also maintained by its auth - Add [a new language](CONTRIBUTING.md#adding-a-new-language), [new UI translations](CONTRIBUTING.md#translating-the-ui) or simply fix a spelling mistake. The process is very simple and even with minimum technical knowledge, your skills as a native speaker will be of great use. Or, if you are not tech-savvy, just [open a new issue](https://github.com/sspanak/tt9/issues) and put the correct translations or words there. Correcting misspelled words or adding new ones is the best you can do to help. Processing millions of words in multiple languages is a very difficult task for a single person. - Share your list of added words. Use the Export function in Settings → Languages → Added Words and upload the generated CSV file in a [new issue](https://github.com/sspanak/tt9/issues). You are also welcome to [open a PR](https://github.com/sspanak/tt9/pulls) if you have good technical knowledge and can split them by language. - [Report bugs](https://github.com/sspanak/tt9/issues) or other unusual behavior on different phones. It is only possible to verify correct operation and compatibility on a handful of phones, but Android behavior and appearance vary a lot across the millions of devices available out there. -- Experienced developers who are willing to fix a bug, or maybe create a brand new feature, see the [Contribution Guide](CONTRIBUTING.md). +- Experienced developers, who are willing to get your hands dirty with the code, see the [Contribution Guide](CONTRIBUTING.md). Your PRs are welcome! diff --git a/fastlane/metadata/android/bg-BG/full_description.txt b/fastlane/metadata/android/bg-BG/full_description.txt index 4db017014..13b120b87 100644 --- a/fastlane/metadata/android/bg-BG/full_description.txt +++ b/fastlane/metadata/android/bg-BG/full_description.txt @@ -1,6 +1,6 @@ TT9 е 12-клавишна Т9 клавиатура за устройства с физически бутони. Поддържа подскаващ текст на повече от 30 езика и бързи клавиши, а виртуалната клавиатура може да превърне всеки смартфон в Нокия от 2000 година. И най-хубавото — не Ви шпионира! -Поддържани езици: английски, арабски, български, виетнамски, гръцки, датски, идиш, иврит, индонезийски, испански, италиански, каталонски, кисуахили, корейски, немски, норвежки, полски, португалски (европейски и бразилски), румънски, руски, тайски, унгарски, украински, финландски, френски, хинглиш, холандски, хърватски, чешки, шведски, турски. +Поддържани езици: английски, арабски, български, виетнамски, гръцки, датски, идиш, иврит, индонезийски, испански, италиански, каталонски, кисуахили, корейски, немски, норвежки, полски, португалски (европейски и бразилски), румънски, руски, тайски, унгарски, украински, финландски, френски, хинглиш, хинди, холандски, хърватски, чешки, шведски, турски. Философия и защита на личните данни: - Без реклами, специални или платени функции. Всичко е напълно безплатно. diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt index 2a37a4670..b9a633439 100644 --- a/fastlane/metadata/android/en-US/full_description.txt +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -1,6 +1,6 @@ TT9 is a 12-key T9 keyboard for devices with a hardware numpad. It supports predictive text typing in 30+ languages, configurable hotkeys, and an on-screen keypad that can turn your smartphone into a Nokia from the 2000s. And, best of all, it doesn't spy on you! -Supported languages: Arabic, Bulgarian, Catalan, Croatian, Czech, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hinglish, Hungarian, Indonesian, Italian, Kiswahili, Korean, Norwegian, Polish, Portuguese (European and Brazilian), Romanian, Russian, Spanish, Swedish, Thai, Turkish, Ukrainian, Vietnamese, Yiddish. +Supported languages: Arabic, Bulgarian, Catalan, Croatian, Czech, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Hinglish, Hungarian, Indonesian, Italian, Kiswahili, Korean, Norwegian, Polish, Portuguese (European and Brazilian), Romanian, Russian, Spanish, Swedish, Thai, Turkish, Ukrainian, Vietnamese, Yiddish. Philosophy and Privacy Policy: - No ads, no premium or paid features. It's all free. From dfea41717b341462f8fb62435a0d321388794980 Mon Sep 17 00:00:00 2001 From: sspanak Date: Fri, 20 Dec 2024 10:25:48 +0200 Subject: [PATCH 8/8] fixed auto-space sometimes not working when typing in Hindi --- app/src/main/java/io/github/sspanak/tt9/util/TextTools.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/github/sspanak/tt9/util/TextTools.java b/app/src/main/java/io/github/sspanak/tt9/util/TextTools.java index 9646ee7df..6b6cd64a1 100644 --- a/app/src/main/java/io/github/sspanak/tt9/util/TextTools.java +++ b/app/src/main/java/io/github/sspanak/tt9/util/TextTools.java @@ -16,7 +16,7 @@ public class TextTools { private static final Pattern nextIsPunctuation = Pattern.compile("^\\p{Punct}"); private static final Pattern isHangul = Pattern.compile("[\u1100-\u11FF\u302E-\u302F\u3131-\u318F\u3200-\u321F\u3260-\u327E\uA960-\uA97F\uAC00-\uD7FB\uFFA0-\uFFDF]+"); private static final Pattern nextToWord = Pattern.compile("\\b$"); - private static final Pattern previousIsLetter = Pattern.compile("\\p{L}$"); + private static final Pattern previousIsLetter = Pattern.compile("[\\p{L}\\p{M}]$"); private static final Pattern startOfSentence = Pattern.compile("(?