summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Powell <adamp@google.com> 2011-09-25 13:46:15 -0700
committer Adam Powell <adamp@google.com> 2011-09-25 13:50:57 -0700
commit53f56c4f51ae11d5b3afde8ce221b3fe9aea3cf1 (patch)
treeeb3b35b8e10ebe04d0698b05c9594961d825fb1f
parent4113acf10a60f2e7cfbb835e50ef520df8257cb3 (diff)
Fix bug 5358705 - Request no full-screen mode of the IME when a
SearchView is expanded in an action bar This is a case where we always know there will be room on screen for the user to meaningfully use the UI in the absence of full-screen extract mode. Save the old state and restore it when we go in and out of expanded action bar mode. Change-Id: I4ae2c5df4f581c6824e6a1f7ff8d97fd86d8e260
-rw-r--r--core/java/android/widget/SearchView.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java
index f230031908cf..adf2b7b7a3f9 100644
--- a/core/java/android/widget/SearchView.java
+++ b/core/java/android/widget/SearchView.java
@@ -120,6 +120,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
private CharSequence mOldQueryText;
private CharSequence mUserQuery;
private boolean mExpandedInActionView;
+ private int mCollapsedImeOptions;
private SearchableInfo mSearchable;
private Bundle mAppSearchData;
@@ -1166,6 +1167,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
clearFocus();
updateViewsVisibility(true);
mQueryTextView.setText("");
+ mQueryTextView.setImeOptions(mCollapsedImeOptions);
mExpandedInActionView = false;
}
@@ -1175,6 +1177,8 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
@Override
public void onActionViewExpanded() {
mExpandedInActionView = true;
+ mCollapsedImeOptions = mQueryTextView.getImeOptions();
+ mQueryTextView.setImeOptions(mCollapsedImeOptions | EditorInfo.IME_FLAG_NO_FULLSCREEN);
setIconified(false);
}