diff options
author | Mike LeBeau <mlebeau@android.com> | 2009-07-14 18:56:32 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-07-14 18:56:32 -0700 |
commit | 6d54c172c3273c2e78d150c5049ca3dc15e26a1f (patch) | |
tree | 6a8455cbc4c779e98140f39bace5c069c8d30587 | |
parent | e2a5385c70b48b57476a0c8c52bad4ea40398641 (diff) | |
parent | 1fffbd97fa756ef7d3e7e885a5c1c8bb64380c20 (diff) | |
download | frameworks_base-6d54c172c3273c2e78d150c5049ca3dc15e26a1f.zip frameworks_base-6d54c172c3273c2e78d150c5049ca3dc15e26a1f.tar.gz frameworks_base-6d54c172c3273c2e78d150c5049ca3dc15e26a1f.tar.bz2 |
am 1fffbd97: Fix keyboard not showing for global search on Dream. Rather than trying to call the hidden showSoftInputUnchecked method to show the IME in SearchDialog#show(), override onWindowFocusChanged in our subclass of AutoCompleteTextView so that whenever it gets
Merge commit '1fffbd97fa756ef7d3e7e885a5c1c8bb64380c20'
* commit '1fffbd97fa756ef7d3e7e885a5c1c8bb64380c20':
Fix keyboard not showing for global search on Dream. Rather than trying to
-rw-r--r-- | core/java/android/app/SearchDialog.java | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index 13eb034..1283b8f 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -337,16 +337,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS mActivityContext = mSearchable.getActivityContext(getContext()); // show the dialog. this will call onStart(). - if (!isShowing()) { - // First make sure the keyboard is showing (if needed), so that we get the right height - // for the dropdown to respect the IME. - if (getContext().getResources().getConfiguration().hardKeyboardHidden == - Configuration.HARDKEYBOARDHIDDEN_YES) { - InputMethodManager inputManager = (InputMethodManager) - getContext().getSystemService(Context.INPUT_METHOD_SERVICE); - inputManager.showSoftInputUnchecked(0, null); - } - + if (!isShowing()) { // The Dialog uses a ContextThemeWrapper for the context; use this to change the // theme out from underneath us, between the global search theme and the in-app // search theme. They are identical except that the global search theme does not @@ -1535,7 +1526,22 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS @Override public void performCompletion() { } - + + /** + * We override this method to be sure and show the soft keyboard if appropriate when + * the TextView has focus. + */ + @Override + public void onWindowFocusChanged(boolean hasWindowFocus) { + super.onWindowFocusChanged(hasWindowFocus); + + if (hasWindowFocus) { + InputMethodManager inputManager = (InputMethodManager) + getContext().getSystemService(Context.INPUT_METHOD_SERVICE); + inputManager.showSoftInput(this, 0); + } + } + /** * We override this method so that we can allow a threshold of zero, which ACTV does not. */ |