mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Hides the keyboard when qsb loses focus in All apps
Bug: 80190879 Change-Id: I88da6ef7a88b9dd4fce06e4f2b4592ee6ce39195
This commit is contained in:
@@ -21,6 +21,8 @@ import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.View.OnFocusChangeListener;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.TextView;
|
||||
import android.widget.TextView.OnEditorActionListener;
|
||||
@@ -37,7 +39,8 @@ import java.util.ArrayList;
|
||||
* An interface to a search box that AllApps can command.
|
||||
*/
|
||||
public class AllAppsSearchBarController
|
||||
implements TextWatcher, OnEditorActionListener, ExtendedEditText.OnBackKeyListener {
|
||||
implements TextWatcher, OnEditorActionListener, ExtendedEditText.OnBackKeyListener,
|
||||
OnFocusChangeListener {
|
||||
|
||||
protected Launcher mLauncher;
|
||||
protected Callbacks mCb;
|
||||
@@ -62,6 +65,7 @@ public class AllAppsSearchBarController
|
||||
mInput.addTextChangedListener(this);
|
||||
mInput.setOnEditorActionListener(this);
|
||||
mInput.setOnBackKeyListener(this);
|
||||
mInput.setOnFocusChangeListener(this);
|
||||
mSearchAlgorithm = searchAlgorithm;
|
||||
}
|
||||
|
||||
@@ -123,6 +127,13 @@ public class AllAppsSearchBarController
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFocusChange(View view, boolean hasFocus) {
|
||||
if (!hasFocus) {
|
||||
mInput.hideKeyboard();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the search bar state.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user