1
0
Fork 0

one more fix for the problem with restarting, this time is for real

This commit is contained in:
sspanak 2024-04-03 21:14:56 +03:00 committed by Dimo Karaivanov
parent 04b66745d1
commit 2a2393aaf9

View file

@ -46,23 +46,25 @@ public abstract class TypingHandler extends KeyPadHandler {
@Override
protected boolean onStart(InputConnection connection, EditorInfo field) {
// ignore multiple calls for the same field, caused by showWindow()
// or weirdly functioning apps, such as the Qin SMS app
if (textField.equals(connection, field)) {
return false;
}
boolean restart = textField.equals(connection, field);
setInputField(connection, field);
// in case we are back from Settings screen, update the language list
int oldLang = mLanguage != null ? mLanguage.getId() : -1;
mEnabledLanguages = settings.getEnabledLanguageIds();
mLanguage = LanguageCollection.getLanguage(getApplicationContext(), settings.getInputLanguage());
validateLanguages();
// ignore multiple calls for the same field, caused by requestShowSelf() -> showWindow(),
// or weirdly functioning apps, such as the Qin SMS app
if (restart && oldLang == mLanguage.getId() && mInputMode.getId() == getInputModeId()) {
return false;
}
resetKeyRepeat();
mInputMode = getInputMode();
determineTextCase();
suggestionOps.set(null);
return true;