Hides the keyboard when qsb loses focus in All apps

Bug: 80190879
Change-Id: I88da6ef7a88b9dd4fce06e4f2b4592ee6ce39195
This commit is contained in:
Mehdi Alizadeh
2018-06-05 16:22:35 -07:00
parent e9216a80e4
commit 25b4dfee29
2 changed files with 18 additions and 3 deletions

View File

@@ -99,6 +99,10 @@ public class ExtendedEditText extends EditText {
mShowImeAfterFirstLayout = !showSoftInput();
}
public void hideKeyboard() {
UiThreadHelper.hideKeyboardAsync(getContext(), getWindowToken());
}
private boolean showSoftInput() {
return requestFocus() &&
((InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE))
@@ -106,7 +110,7 @@ public class ExtendedEditText extends EditText {
}
public void dispatchBackKey() {
UiThreadHelper.hideKeyboardAsync(getContext(), getWindowToken());
hideKeyboard();
if (mBackKeyListener != null) {
mBackKeyListener.onBackKey();
}
@@ -135,6 +139,6 @@ public class ExtendedEditText extends EditText {
nextFocus.requestFocus();
}
}
UiThreadHelper.hideKeyboardAsync(getContext(), getWindowToken());
hideKeyboard();
}
}