fixed some more issues with automatic MainView showing, as well as showing with OK on XP3900
This commit is contained in:
parent
2e019409e8
commit
0c6c463d96
6 changed files with 26 additions and 20 deletions
|
|
@ -28,7 +28,7 @@ abstract public class AbstractHandler extends InputMethodService {
|
|||
// UI
|
||||
abstract protected View createMainView();
|
||||
abstract protected void createSuggestionBar(View mainView);
|
||||
abstract protected void forceShowWindow(boolean forceHarder);
|
||||
abstract protected boolean forceShowWindow();
|
||||
abstract protected void renderMainView();
|
||||
abstract protected void setStatusIcon(InputMode mode);
|
||||
abstract protected void setStatusText(String status);
|
||||
|
|
|
|||
|
|
@ -30,12 +30,12 @@ public abstract class HotkeyHandler extends TypingHandler {
|
|||
@Override public boolean onOK() {
|
||||
suggestionOps.cancelDelayedAccept();
|
||||
|
||||
if (forceShowWindow()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!suggestionOps.isEmpty()) {
|
||||
if (shouldBeVisible() && !isInputViewShown()) {
|
||||
forceShowWindow(true);
|
||||
} else {
|
||||
onAcceptSuggestionManually(suggestionOps.acceptCurrent(), KeyEvent.KEYCODE_ENTER);
|
||||
}
|
||||
onAcceptSuggestionManually(suggestionOps.acceptCurrent(), KeyEvent.KEYCODE_ENTER);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -44,7 +44,7 @@ public abstract class HotkeyHandler extends TypingHandler {
|
|||
if (action == TextField.IME_ACTION_ENTER) {
|
||||
boolean actionPerformed = appHacks.onEnter();
|
||||
if (actionPerformed) {
|
||||
forceShowWindow(false);
|
||||
forceShowWindow();
|
||||
}
|
||||
return actionPerformed;
|
||||
}
|
||||
|
|
@ -230,7 +230,7 @@ public abstract class HotkeyHandler extends TypingHandler {
|
|||
DictionaryLoader.autoLoad(this, mLanguage);
|
||||
}
|
||||
|
||||
forceShowWindow(false);
|
||||
forceShowWindow();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -252,7 +252,7 @@ public abstract class HotkeyHandler extends TypingHandler {
|
|||
UI.toastShortSingle(this, mInputMode.getClass().getSimpleName(), mInputMode.toString());
|
||||
}
|
||||
|
||||
forceShowWindow(false);
|
||||
forceShowWindow();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class TraditionalT9 extends HotkeyHandler {
|
|||
|
||||
String message = intent != null ? intent.getStringExtra(PopupDialog.INTENT_CLOSE) : null;
|
||||
if (message != null) {
|
||||
forceShowWindow(false);
|
||||
forceShowWindow();
|
||||
if (!message.isEmpty()) {
|
||||
UI.toastLong(this, message);
|
||||
}
|
||||
|
|
@ -173,9 +173,10 @@ public class TraditionalT9 extends HotkeyHandler {
|
|||
* WARNING! Calling this may cause a restart, which will cause InputMode to be recreated. Depending
|
||||
* on how much time the restart takes, this may erase the current user input.
|
||||
*/
|
||||
protected void forceShowWindow(boolean forceHarder) {
|
||||
@Override
|
||||
protected boolean forceShowWindow() {
|
||||
if (isInputViewShown() || !shouldBeVisible()) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
|
|
@ -185,10 +186,13 @@ public class TraditionalT9 extends HotkeyHandler {
|
|||
}
|
||||
|
||||
// Sonim XP3900 is quite stubborn and wouldn't show the MainView the regular way.
|
||||
// Sending DPAD_CENTER seems to be the only way of doing it.
|
||||
if (forceHarder && !isInputViewShown() && DeviceInfo.noTouchScreen(this)) {
|
||||
// Sending DPAD_CENTER seems to be the only way of doing it. But, we only want to do this
|
||||
// when there is no text to avoid undesired submitting of something.
|
||||
if (!isInputViewShown() && DeviceInfo.noTouchScreen(this) && textField.isEmpty()) {
|
||||
sendDownUpKeyEvents(KeyEvent.KEYCODE_DPAD_CENTER);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -155,6 +155,7 @@ public abstract class TypingHandler extends KeyPadHandler {
|
|||
}
|
||||
|
||||
if (!mInputMode.onNumber(key, hold, repeat)) {
|
||||
forceShowWindow();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -190,7 +191,7 @@ public abstract class TypingHandler extends KeyPadHandler {
|
|||
textField.setText(text);
|
||||
autoCorrectSpace(text, true, -1);
|
||||
|
||||
forceShowWindow(false);
|
||||
forceShowWindow();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -273,6 +274,7 @@ public abstract class TypingHandler extends KeyPadHandler {
|
|||
|
||||
private void onAcceptSuggestionsDelayed(String word) {
|
||||
onAcceptSuggestionManually(word, -1);
|
||||
forceShowWindow();
|
||||
}
|
||||
|
||||
protected void onAcceptSuggestionManually(String word, int fromKey) {
|
||||
|
|
@ -327,7 +329,7 @@ public abstract class TypingHandler extends KeyPadHandler {
|
|||
String trimmedWord = suggestionOps.getCurrent(mInputMode.getSequenceLength());
|
||||
appHacks.setComposingTextWithHighlightedStem(trimmedWord, mInputMode);
|
||||
|
||||
forceShowWindow(false);
|
||||
forceShowWindow();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ public class InputType {
|
|||
ArrayList<Integer> allowedModes = new ArrayList<>();
|
||||
|
||||
if (field == null) {
|
||||
allowedModes.add(InputMode.MODE_123);
|
||||
allowedModes.add(InputMode.MODE_PASSTHROUGH);
|
||||
return allowedModes;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -195,14 +195,14 @@ This happens if you are using one of the small-sized layouts. Currently, there i
|
|||
- You can now go back to the settings and disable the on-screen numpad. The emoji and sticker panels will remain accessible until you restart the app or the phone.
|
||||
|
||||
#### Traditional T9 does not appear immediately in some applications
|
||||
If you have opened an application where you can type, but TT9 does not wake up automatically, just start typing and it will. If it is still invisible, press the OK key, while you are typing the word and it should appear. Alternatively, pressing the hotkeys to change [the input mode](#next-input-mode-key-default-press-) or the [language](#next-language-key-default-hold-) can also bring up TT9, when it is hidden.
|
||||
If you have opened an application where you can type, but TT9 does not wake up automatically, just start typing and it will. If it is still invisible, erase all text and press the OK key. Alternatively, pressing the hotkeys to change [the input mode](#next-input-mode-key-default-press-) or the [language](#next-language-key-default-hold-) can also bring up TT9, when it is hidden.
|
||||
|
||||
_Just typing something may work on one phone, but pressing OK may be the way on another one. It depends on the Android version and the device model._
|
||||
|
||||
**Long explanation.** The reason for this problem is Android is primarily designed for touchscreen devices. Hence, it expects you to touch the text/number field to show the keyboard. It is possible to make TT9 appear without this confirmation, but then, in some cases, Android will forget to hide it when it must. For example, it may remain visible after you have dialed a phone number or after you have submitted text in a search field.
|
||||
|
||||
For these reasons, in order to stick with the expected Android standards, the control is in your hands. Just press a key to "touch" the screen and keep typing.
|
||||
|
||||
Moreover, there are at least 3 different ways of asking Android to show the keyboard, so just typing something may work on one phone, but pressing OK may be required on another one.
|
||||
|
||||
#### On the Qin F21 Pro, holding 2-key or 8-key turns up or down the volume instead of typing a number
|
||||
To mitigate this problem, go to Settings → Appearance, and enable "Status Icon". TT9 should detect Qin F21 and enable the settings automatically, but in case auto-detection fails, or you have disabled the icon for some reason, you need to have it enabled, for all keys to work properly.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue