summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2011-02-07 18:26:11 -0800
committerGilles Debunne <debunne@google.com>2011-02-09 16:56:13 -0800
commit711734a2f8d7529df0ed1bce36da651fc835c144 (patch)
tree67bb99752f22af95ee7b228b6794f0e8c01a2e65 /core
parenta4a5758b5f51834f7555ec909e8188c432fc5dc4 (diff)
downloadframeworks_base-711734a2f8d7529df0ed1bce36da651fc835c144.zip
frameworks_base-711734a2f8d7529df0ed1bce36da651fc835c144.tar.gz
frameworks_base-711734a2f8d7529df0ed1bce36da651fc835c144.tar.bz2
AutoComplete list does not hide the IME when it re-appears.
Bug 3415891 With the current behavior, as soon as the list is expanded by 'long' pressing on or scrolling its content, it will always further appear in its long state, thus hiding the IME. This fix changes this behavior so that the default state is always compact, not hiding the IME, and an explicit expansion is always required. Also fixes a bug in ListPopupWindow that prevented the timer that expands the list from being started. Change-Id: I896e92d54961769c10b276c36f6510e91ff096a2
Diffstat (limited to 'core')
-rw-r--r--core/java/android/widget/AutoCompleteTextView.java8
-rw-r--r--core/java/android/widget/ListPopupWindow.java6
2 files changed, 9 insertions, 5 deletions
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java
index 09add5e..3bdba62 100644
--- a/core/java/android/widget/AutoCompleteTextView.java
+++ b/core/java/android/widget/AutoCompleteTextView.java
@@ -204,7 +204,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
private void onClickImpl() {
// If the dropdown is showing, bring the keyboard to the front
// when the user touches the text field.
- if (mPopup.isShowing()) {
+ if (isPopupShowing()) {
ensureImeVisible(true);
}
}
@@ -1008,7 +1008,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
protected boolean setFrame(final int l, int t, final int r, int b) {
boolean result = super.setFrame(l, t, r, b);
- if (mPopup.isShowing()) {
+ if (isPopupShowing()) {
showDropDown();
}
@@ -1054,6 +1054,10 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
mPopup.setAnchorView(this);
}
}
+ if (!isPopupShowing()) {
+ // Make sure the list does not obscure the IME when shown for the first time.
+ mPopup.setInputMethodMode(ListPopupWindow.INPUT_METHOD_NEEDED);
+ }
mPopup.show();
}
diff --git a/core/java/android/widget/ListPopupWindow.java b/core/java/android/widget/ListPopupWindow.java
index 8116a12..8811492 100644
--- a/core/java/android/widget/ListPopupWindow.java
+++ b/core/java/android/widget/ListPopupWindow.java
@@ -26,10 +26,10 @@ import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewParent;
import android.view.View.MeasureSpec;
import android.view.View.OnTouchListener;
+import android.view.ViewGroup;
+import android.view.ViewParent;
/**
* A ListPopupWindow anchors itself to a host view and displays a
@@ -1222,7 +1222,7 @@ public class ListPopupWindow {
if (action == MotionEvent.ACTION_DOWN &&
mPopup != null && mPopup.isShowing() &&
- (x >= 0 && x < getWidth() && y >= 0 && y < getHeight())) {
+ (x >= 0 && x < mPopup.getWidth() && y >= 0 && y < mPopup.getHeight())) {
mHandler.postDelayed(mResizePopupRunnable, EXPAND_LIST_TIMEOUT);
} else if (action == MotionEvent.ACTION_UP) {
mHandler.removeCallbacks(mResizePopupRunnable);