Merge "When KEYCODE_BACK is received, hide keyboard" into sc-dev am: 24c8ebd88d am: 5d52dc0201
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15107283 Change-Id: I220fbd2740df73b15805300767b0c1a7bf3617d8
This commit is contained in:
@@ -70,6 +70,9 @@ public class ExtendedEditText extends EditText {
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user