diff options
author | Bjorn Bringert <bringert@android.com> | 2009-10-01 10:30:25 +0100 |
---|---|---|
committer | Bjorn Bringert <bringert@android.com> | 2009-10-01 10:56:19 +0100 |
commit | a6309c30722ad3aee88ddc2394cea2a499168d99 (patch) | |
tree | 7f0c5e97b9095b695be3013a161dd5690c2b4896 /core/java/android | |
parent | 95c98dd5fd5920933231c424ff53f91adeee9503 (diff) | |
download | frameworks_base-a6309c30722ad3aee88ddc2394cea2a499168d99.zip frameworks_base-a6309c30722ad3aee88ddc2394cea2a499168d99.tar.gz frameworks_base-a6309c30722ad3aee88ddc2394cea2a499168d99.tar.bz2 |
On BACK in search, hide just IME if IME is fullscreen
Since a fullscreen IME covers the entire search dialog, there was
no discoverable way to get back to the search dialog.
Now, on BACK presses when the IME is fullscreen (e.g. in landscape
mode without hard keyboard), we dismiss only the IME.
A second BACK press will dismiss the search dialog.
Fixes http://b/issue?id=2159132
Change-Id: I8e5736d83d7c35936a718929017ea04c6214700b
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/app/SearchDialog.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index 36d3678..605647a 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -1812,7 +1812,18 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS @Override public void onBackPressed() { + // If the input method is covering the search dialog completely, + // e.g. in landscape mode with no hard keyboard, dismiss just the input method + InputMethodManager imm = (InputMethodManager)getContext() + .getSystemService(Context.INPUT_METHOD_SERVICE); + if (imm != null && imm.isFullscreenMode() && + imm.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(), 0)) { + return; + } + // Otherwise, go back to any previous source (e.g. back to QSB when + // pivoted into a source. if (!backToPreviousComponent()) { + // If no previous source, close search dialog cancel(); } } |