Remove unnecessary hide keyboard call in onKeyPreIme.
The default handling of back in this preIme case already closes
the keyboard if we return false, so adding it before our own key
handling was stomping on our existing syncronized keyboard.
We should still handle other cases where the system ime animation
coincides with our control, but we at least shouldn't force it on
ourselves.
This fixes the back issue in 3 button mode, and also closes all
apps on the first back gesture as intended (if you hadn't entered
0 state that is).
Demo after fix: https://drive.google.com/file/d/1pK18iEdgxQ0HQmilAMFzn66LVyCH5Ma1/view?usp=drive_link&resourcekey=0-kW4BOC-Pj-wZ_DZL51z6Rg
Bug: 270144901
Bug: 277738379
Test: Manual with 3 button mode and gesture nav, with always on
keyboard on and off
Flag: N/A
Change-Id: I9b1c525494b49cde3307df8b0a73d6143ac9c616
diff --git a/src/com/android/launcher3/ExtendedEditText.java b/src/com/android/launcher3/ExtendedEditText.java
index 3c90408..8ec5c18 100644
--- a/src/com/android/launcher3/ExtendedEditText.java
+++ b/src/com/android/launcher3/ExtendedEditText.java
@@ -74,14 +74,9 @@
@Override
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
// If this is a back key, propagate the key back to the listener
- if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
- if (TextUtils.isEmpty(getText())) {
- hideKeyboard();
- }
- if (mBackKeyListener != null) {
- return mBackKeyListener.onBackKey();
- }
- return false;
+ if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP
+ && mBackKeyListener != null) {
+ return mBackKeyListener.onBackKey();
}
return super.onKeyPreIme(keyCode, event);
}