diff options
author | Brian Attwell <brianattwell@google.com> | 2014-12-03 18:30:21 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-12-03 18:30:22 +0000 |
commit | 44ab57292cf57381337318741944489b20c3bfc0 (patch) | |
tree | 564b9048fe6c5631ee7056fee78f7debf910dc0f /src | |
parent | 75f2c438c25e26edf26a2ca6287ffc27d606196f (diff) | |
parent | 87901e0e2896ffc2a03f519bcc86e7cb88098fa1 (diff) | |
download | packages_apps_Contacts-44ab57292cf57381337318741944489b20c3bfc0.tar.gz packages_apps_Contacts-44ab57292cf57381337318741944489b20c3bfc0.tar.bz2 packages_apps_Contacts-44ab57292cf57381337318741944489b20c3bfc0.zip |
Merge "Hide keyboard when exiting search view" into lmp-mr1-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/contacts/activities/ActionBarAdapter.java | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/com/android/contacts/activities/ActionBarAdapter.java b/src/com/android/contacts/activities/ActionBarAdapter.java index 634f9ade6..4b9e83fa6 100644 --- a/src/com/android/contacts/activities/ActionBarAdapter.java +++ b/src/com/android/contacts/activities/ActionBarAdapter.java @@ -30,7 +30,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.InputMethodManager; -import android.widget.SearchView; import android.widget.SearchView.OnCloseListener; import android.view.View.OnClickListener; import android.widget.EditText; @@ -253,7 +252,11 @@ public class ActionBarAdapter implements OnCloseListener { return; } if (mSearchMode) { + mSearchView.setEnabled(true); setFocusOnSearchView(); + } else { + // Disable search view, so that it doesn't keep the IME visible. + mSearchView.setEnabled(false); } setQueryString(null); } else if (flag) { @@ -399,18 +402,6 @@ public class ActionBarAdapter implements OnCloseListener { outState.putInt(EXTRA_KEY_SELECTED_TAB, mCurrentTab); } - /** - * Clears the focus from the {@link SearchView} if we are in search mode. - * This will suppress the IME if it is visible. - */ - public void clearFocusOnSearchView() { - if (isSearchMode()) { - if (mSearchView != null) { - mSearchView.clearFocus(); - } - } - } - public void setFocusOnSearchView() { mSearchView.requestFocus(); showInputMethod(mSearchView); // Workaround for the "IME not popping up" issue. |