summaryrefslogtreecommitdiff
path: root/core/java/android/widget/AutoCompleteTextView.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-03-10 21:09:28 -0800
committerAmith Yamasani <yamasani@google.com>2010-03-11 16:05:17 -0800
commitd25eb35b6b80b6f8065ab39b1cf1abb1fd801234 (patch)
tree4fa5b47b841f3e0471678fd3e159d8aa364dba56 /core/java/android/widget/AutoCompleteTextView.java
parent4ea0628a8418b033bd22c8f38c3c66960e43c359 (diff)
Fix for 2175289 : Can't get keyboard in search dialog after switching to landscape
The auto complete drop down was obscuring the keyboard. This fix checks if the screen is in landscape mode and forces the keyboard in front when necessary.
Diffstat (limited to 'core/java/android/widget/AutoCompleteTextView.java')
-rw-r--r--core/java/android/widget/AutoCompleteTextView.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java
index ed6378737606..65f7cdbee3ce 100644
--- a/core/java/android/widget/AutoCompleteTextView.java
+++ b/core/java/android/widget/AutoCompleteTextView.java
@@ -17,9 +17,11 @@
package android.widget;
import android.content.Context;
+import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
+import android.graphics.drawable.GradientDrawable.Orientation;
import android.text.Editable;
import android.text.Selection;
import android.text.TextUtils;
@@ -210,10 +212,10 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
* Private hook into the on click event, dispatched from {@link PassThroughClickListener}
*/
private void onClickImpl() {
- // If the dropdown is showing, bring it back in front of the soft
- // keyboard when the user touches the text field.
- if (mPopup.isShowing() && isInputMethodNotNeeded()) {
- ensureImeVisible();
+ // If the dropdown is showing, bring the keyboard to the front
+ // when the user touches the text field.
+ if (mPopup.isShowing()) {
+ ensureImeVisible(true);
}
}
@@ -1114,11 +1116,13 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
/**
* Ensures that the drop down is not obscuring the IME.
- *
+ * @param visible whether the ime should be in front. If false, the ime is pushed to
+ * the background.
* @hide internal used only here and SearchDialog
*/
- public void ensureImeVisible() {
- mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
+ public void ensureImeVisible(boolean visible) {
+ mPopup.setInputMethodMode(visible
+ ? PopupWindow.INPUT_METHOD_NEEDED : PopupWindow.INPUT_METHOD_NOT_NEEDED);
showDropDown();
}