fixed an unnecessary input mode reset on start, causing the Status Bar to display uppercase as lowercase
This commit is contained in:
parent
d5fc1fe4b1
commit
24c002ef09
4 changed files with 15 additions and 15 deletions
|
|
@ -29,8 +29,8 @@ abstract public class AbstractHandler extends InputMethodService {
|
||||||
abstract protected void resetStatus();
|
abstract protected void resetStatus();
|
||||||
|
|
||||||
// informational
|
// informational
|
||||||
abstract protected InputMode getInputMode();
|
abstract protected InputMode determineInputMode();
|
||||||
abstract protected int getInputModeId();
|
abstract protected int determineInputModeId();
|
||||||
abstract protected SuggestionOps getSuggestionOps();
|
abstract protected SuggestionOps getSuggestionOps();
|
||||||
abstract protected boolean shouldBeOff();
|
abstract protected boolean shouldBeOff();
|
||||||
abstract protected TraditionalT9 getFinalContext();
|
abstract protected TraditionalT9 getFinalContext();
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ public class TraditionalT9 extends MainViewHandler {
|
||||||
onStop();
|
onStop();
|
||||||
} else {
|
} else {
|
||||||
backgroundTasks.removeCallbacksAndMessages(null);
|
backgroundTasks.removeCallbacksAndMessages(null);
|
||||||
initUi();
|
initUi(mInputMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
InputType newInputType = new InputType(connection, field);
|
InputType newInputType = new InputType(connection, field);
|
||||||
|
|
|
||||||
|
|
@ -65,12 +65,12 @@ public abstract class TypingHandler extends KeyPadHandler {
|
||||||
|
|
||||||
// ignore multiple calls for the same field, caused by requestShowSelf() -> showWindow(),
|
// ignore multiple calls for the same field, caused by requestShowSelf() -> showWindow(),
|
||||||
// or weirdly functioning apps, such as the Qin SMS app
|
// or weirdly functioning apps, such as the Qin SMS app
|
||||||
if (restart && !languageChanged && mInputMode.getId() == getInputModeId()) {
|
if (restart && !languageChanged && mInputMode.getId() == determineInputModeId()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
resetKeyRepeat();
|
resetKeyRepeat();
|
||||||
mInputMode = getInputMode();
|
mInputMode = determineInputMode();
|
||||||
determineTextCase();
|
determineTextCase();
|
||||||
suggestionOps.set(null);
|
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.
|
* 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).
|
* 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.
|
* 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.
|
* 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())) {
|
if (!inputType.isValid() || (inputType.isLimited() && !inputType.isTermux())) {
|
||||||
return InputMode.MODE_PASSTHROUGH;
|
return InputMode.MODE_PASSTHROUGH;
|
||||||
}
|
}
|
||||||
|
|
@ -284,11 +284,11 @@ public abstract class TypingHandler extends KeyPadHandler {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getInputMode
|
* determineInputMode
|
||||||
* Same as getInputModeId(), but returns an actual InputMode.
|
* Same as determineInputModeId(), but returns an actual InputMode.
|
||||||
*/
|
*/
|
||||||
protected InputMode getInputMode() {
|
protected InputMode determineInputMode() {
|
||||||
return InputMode.getInstance(settings, mLanguage, inputType, textField, getInputModeId());
|
return InputMode.getInstance(settings, mLanguage, inputType, textField, determineInputModeId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,13 +32,13 @@ abstract class UiHandler extends AbstractHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void initUi() {
|
public void initUi(InputMode inputMode) {
|
||||||
if (mainView.createInputView()) {
|
if (mainView.createInputView()) {
|
||||||
initTray();
|
initTray();
|
||||||
}
|
}
|
||||||
setDarkTheme();
|
setDarkTheme();
|
||||||
setStatusIcon(getInputMode());
|
setStatusIcon(inputMode);
|
||||||
statusBar.setText(getInputMode());
|
statusBar.setText(inputMode);
|
||||||
mainView.hideCommandPalette();
|
mainView.hideCommandPalette();
|
||||||
mainView.render();
|
mainView.render();
|
||||||
|
|
||||||
|
|
@ -65,7 +65,7 @@ abstract class UiHandler extends AbstractHandler {
|
||||||
|
|
||||||
|
|
||||||
protected boolean shouldBeVisible() {
|
protected boolean shouldBeVisible() {
|
||||||
return getInputModeId() != InputMode.MODE_PASSTHROUGH && !settings.isMainLayoutStealth();
|
return determineInputModeId() != InputMode.MODE_PASSTHROUGH && !settings.isMainLayoutStealth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue