1
0
Fork 0

fixed an unnecessary input mode reset on start, causing the Status Bar to display uppercase as lowercase

This commit is contained in:
sspanak 2024-09-14 15:20:41 +03:00 committed by Dimo Karaivanov
parent d5fc1fe4b1
commit 24c002ef09
4 changed files with 15 additions and 15 deletions

View file

@ -29,8 +29,8 @@ abstract public class AbstractHandler extends InputMethodService {
abstract protected void resetStatus();
// informational
abstract protected InputMode getInputMode();
abstract protected int getInputModeId();
abstract protected InputMode determineInputMode();
abstract protected int determineInputModeId();
abstract protected SuggestionOps getSuggestionOps();
abstract protected boolean shouldBeOff();
abstract protected TraditionalT9 getFinalContext();

View file

@ -140,7 +140,7 @@ public class TraditionalT9 extends MainViewHandler {
onStop();
} else {
backgroundTasks.removeCallbacksAndMessages(null);
initUi();
initUi(mInputMode);
}
InputType newInputType = new InputType(connection, field);

View file

@ -65,12 +65,12 @@ public abstract class TypingHandler extends KeyPadHandler {
// ignore multiple calls for the same field, caused by requestShowSelf() -> showWindow(),
// or weirdly functioning apps, such as the Qin SMS app
if (restart && !languageChanged && mInputMode.getId() == getInputModeId()) {
if (restart && !languageChanged && mInputMode.getId() == determineInputModeId()) {
return false;
}
resetKeyRepeat();
mInputMode = getInputMode();
mInputMode = determineInputMode();
determineTextCase();
suggestionOps.set(null);
@ -267,13 +267,13 @@ public abstract class TypingHandler extends KeyPadHandler {
/**
* getInputModeId
* determineInputModeId
* Return the last input mode ID or choose a more appropriate one.
* Some input fields support only numbers or are not suited for predictions (e.g. password fields).
* Others do not support text retrieval or composing text, or the AppHacks detected them as incompatible with us.
* We do not want to handle any of these, hence we pass through all input to the system.
*/
protected int getInputModeId() {
protected int determineInputModeId() {
if (!inputType.isValid() || (inputType.isLimited() && !inputType.isTermux())) {
return InputMode.MODE_PASSTHROUGH;
}
@ -284,11 +284,11 @@ public abstract class TypingHandler extends KeyPadHandler {
/**
* getInputMode
* Same as getInputModeId(), but returns an actual InputMode.
* determineInputMode
* Same as determineInputModeId(), but returns an actual InputMode.
*/
protected InputMode getInputMode() {
return InputMode.getInstance(settings, mLanguage, inputType, textField, getInputModeId());
protected InputMode determineInputMode() {
return InputMode.getInstance(settings, mLanguage, inputType, textField, determineInputModeId());
}

View file

@ -32,13 +32,13 @@ abstract class UiHandler extends AbstractHandler {
}
public void initUi() {
public void initUi(InputMode inputMode) {
if (mainView.createInputView()) {
initTray();
}
setDarkTheme();
setStatusIcon(getInputMode());
statusBar.setText(getInputMode());
setStatusIcon(inputMode);
statusBar.setText(inputMode);
mainView.hideCommandPalette();
mainView.render();
@ -65,7 +65,7 @@ abstract class UiHandler extends AbstractHandler {
protected boolean shouldBeVisible() {
return getInputModeId() != InputMode.MODE_PASSTHROUGH && !settings.isMainLayoutStealth();
return determineInputModeId() != InputMode.MODE_PASSTHROUGH && !settings.isMainLayoutStealth();
}