diff options
| author | Amith Yamasani <yamasani@google.com> | 2011-07-08 15:25:39 -0700 |
|---|---|---|
| committer | Amith Yamasani <yamasani@google.com> | 2011-07-18 17:32:24 -0700 |
| commit | b4569fb17fada4fdc43e4f4dbfbc79bb097a1f74 (patch) | |
| tree | 27e7811c7edfa43bb2fe4916cccfee16523888b7 /core/java/android/app/SearchDialog.java | |
| parent | 3ad4d3ce01f173e80e0ebb751c4a8913aef5648a (diff) | |
SearchView behavioral and visual changes
Align text suggestions and search string.
Close button only clears the field.
Back button clears focus, hides dropdown and keyboard.
Tweaked SearchDialog's use of SearchView to follow above patterns.
Fixed other little bugs.
Change-Id: I9d34c2ebe2b1b2ca887220894c19a26809db85f6
Diffstat (limited to 'core/java/android/app/SearchDialog.java')
| -rw-r--r-- | core/java/android/app/SearchDialog.java | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index 42eda0212e01..8e2d360b5637 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -168,6 +168,7 @@ public class SearchDialog extends Dialog { SearchBar searchBar = (SearchBar) findViewById(com.android.internal.R.id.search_bar); searchBar.setSearchDialog(this); mSearchView = (SearchView) findViewById(com.android.internal.R.id.search_view); + mSearchView.setIconified(false); mSearchView.setOnCloseListener(mOnCloseListener); mSearchView.setOnQueryTextListener(mOnQueryChangeListener); mSearchView.setOnSuggestionListener(mOnSuggestionSelectionListener); @@ -633,31 +634,6 @@ public class SearchDialog extends Dialog { } /** - * Overrides the handling of the back key to move back to the previous - * sources or dismiss the search dialog, instead of dismissing the input - * method. - */ - @Override - public boolean dispatchKeyEventPreIme(KeyEvent event) { - if (DBG) - Log.d(LOG_TAG, "onKeyPreIme(" + event + ")"); - if (mSearchDialog != null && event.getKeyCode() == KeyEvent.KEYCODE_BACK) { - KeyEvent.DispatcherState state = getKeyDispatcherState(); - if (state != null) { - if (event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount() == 0) { - state.startTracking(event, this); - return true; - } else if (event.getAction() == KeyEvent.ACTION_UP && !event.isCanceled() - && state.isTracking(event)) { - mSearchDialog.onBackPressed(); - return true; - } - } - } - return super.dispatchKeyEventPreIme(event); - } - - /** * Don't allow action modes in a SearchBar, it looks silly. */ @Override |
