summaryrefslogtreecommitdiff
path: root/core/java/android/widget/AutoCompleteTextView.java
diff options
context:
space:
mode:
authorMike LeBeau <mlebeau@android.com>2009-07-16 18:18:37 -0700
committerMike LeBeau <mlebeau@android.com>2009-07-16 19:51:48 -0700
commitffe3ecf2b1ee04288008758c0f60ae22238797c1 (patch)
treeeaa3437728a00af746e9fd0199540d701a178bb1 /core/java/android/widget/AutoCompleteTextView.java
parent3735df20ae9994a759aa9464534d57eab4af4011 (diff)
Make the SearchDialog's AutoCompleteTextView dropdown respect the
IME again when the user presses right or left from a query-jammed suggestion to continue editing. Previously we required the user to press on the text field again in order to get the IME to show. We accomplish this by factoring out the code to 'ensureImeVisible' into a separate method and calling that from SearchDialog. Fixes http://b/1976338
Diffstat (limited to 'core/java/android/widget/AutoCompleteTextView.java')
-rw-r--r--core/java/android/widget/AutoCompleteTextView.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java
index 9eef98c04c7b..0df587f1bda7 100644
--- a/core/java/android/widget/AutoCompleteTextView.java
+++ b/core/java/android/widget/AutoCompleteTextView.java
@@ -210,8 +210,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
if (mDropDownAlwaysVisible
&& mPopup.isShowing()
&& mPopup.getInputMethodMode() == PopupWindow.INPUT_METHOD_NOT_NEEDED) {
- mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
- showDropDown();
+ ensureImeVisible();
}
}
@@ -1086,11 +1085,21 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
/**
* Issues a runnable to show the dropdown as soon as possible.
*
- * @hide internal used only by Search Dialog
+ * @hide internal used only by SearchDialog
*/
public void showDropDownAfterLayout() {
post(mShowDropDownRunnable);
}
+
+ /**
+ * Ensures that the drop down is not obscuring the IME.
+ *
+ * @hide internal used only here and SearchDialog
+ */
+ public void ensureImeVisible() {
+ mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
+ showDropDown();
+ }
/**
* <p>Displays the drop down on screen.</p>