Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs 42 #689

Merged
merged 8 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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!

Expand Down
3 changes: 3 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ android {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
dependenciesInfo {
includeInApk false
}

flavorDimensions = ['app']
productFlavors {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.os.Looper;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.util.ArrayList;

Expand All @@ -16,10 +17,10 @@ public class SuggestionOps {
@NonNull private final Handler delayedAcceptHandler;
@NonNull private final ConsumerCompat<String> 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<String> onDelayedAccept, @NonNull Runnable onSuggestionClick) {
public SuggestionOps(@NonNull SettingsStore settings, @NonNull ResizableMainView mainView, @Nullable TextField textField, @NonNull ConsumerCompat<String> onDelayedAccept, @NonNull Runnable onSuggestionClick) {
delayedAcceptHandler = new Handler(Looper.getMainLooper());
this.onDelayedAccept = onDelayedAccept;

Expand All @@ -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;
}

Expand All @@ -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<String> suggestions) {
Expand Down Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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("(?<!\\.)(^|[.?!؟¿¡])\\s+$");


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ public static ArrayList<String> getEmoji(int level) {
}

public static int getMaxEmojiLevel() {
return Emoji.size();
return noEmojiSupported() ? 1 : Emoji.size();
}
}
7 changes: 0 additions & 7 deletions app/src/main/res/xml/prefs_screen_debug.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@
<DropDownPreference
app:key="pref_input_handling_mode"
app:title="Keypad Handling Mode" />

<SwitchPreferenceCompat
app:defaultValue="true"
app:key="pref_hold_for_punctuation_in_korean"
app:title="Hold to type special chars in Korean"
app:summaryOff="Type special chars by multi-pressing 1-key or 0-key"
app:summaryOn="Type special chars by holding 1-key or 0-key" />
</PreferenceCategory>

<PreferenceCategory app:title="Logging" app:singleLineTitle="true">
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 1 addition & 1 deletion fastlane/metadata/android/bg-BG/full_description.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TT9 е 12-клавишна Т9 клавиатура за устройства с физически бутони. Поддържа подскаващ текст на повече от 30 езика и бързи клавиши, а виртуалната клавиатура може да превърне всеки смартфон в Нокия от 2000 година. И най-хубавото — не Ви шпионира!

Поддържани езици: английски, арабски, български, виетнамски, гръцки, датски, идиш, иврит, индонезийски, испански, италиански, каталонски, кисуахили, корейски, немски, норвежки, полски, португалски (европейски и бразилски), румънски, руски, тайски, унгарски, украински, финландски, френски, хинглиш, холандски, хърватски, чешки, шведски, турски.
Поддържани езици: английски, арабски, български, виетнамски, гръцки, датски, идиш, иврит, индонезийски, испански, италиански, каталонски, кисуахили, корейски, немски, норвежки, полски, португалски (европейски и бразилски), румънски, руски, тайски, унгарски, украински, финландски, френски, хинглиш, хинди, холандски, хърватски, чешки, шведски, турски.

Философия и защита на личните данни:
- Без реклами, специални или платени функции. Всичко е напълно безплатно.
Expand Down
2 changes: 1 addition & 1 deletion fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Loading