1
0
Fork 0

fixed unnecessary restarts, causing AppHacks to contain an invalid TextField, effectively making typing in Termux impossible

This commit is contained in:
sspanak 2024-04-03 19:14:47 +03:00 committed by Dimo Karaivanov
parent a3724bb80c
commit af6ee5114f
2 changed files with 11 additions and 3 deletions

View file

@ -82,6 +82,10 @@ public class TraditionalT9 extends HotkeyHandler {
setStatusText(mInputMode.toString());
setDarkTheme();
mainView.render();
if (!isInputViewShown()) {
updateInputViewShown();
}
}
@ -100,7 +104,6 @@ public class TraditionalT9 extends HotkeyHandler {
initUi();
}
updateInputViewShown();
return true;
}
@ -121,6 +124,10 @@ public class TraditionalT9 extends HotkeyHandler {
setStatusIcon(0);
setStatusText("--");
if (isInputViewShown()) {
updateInputViewShown();
}
normalizationHandler.removeCallbacksAndMessages(null);
normalizationHandler.postDelayed(
() -> { if (!DictionaryLoader.getInstance(this).isRunning()) WordStoreAsync.normalizeNext(); },

View file

@ -65,8 +65,6 @@ public abstract class TypingHandler extends KeyPadHandler {
suggestionOps.set(null);
appHacks = new AppHacks(settings, connection, field, textField);
return true;
}
@ -75,6 +73,9 @@ public abstract class TypingHandler extends KeyPadHandler {
currentInputConnection = connection;
inputType = new InputType(currentInputConnection, field);
textField = new TextField(currentInputConnection, field);
// changing the TextField and notifying all interested classes is an atomic operation
appHacks = new AppHacks(settings, connection, field, textField);
suggestionOps.setTextField(textField);
}