diff options
author | Romain Guy <romainguy@google.com> | 2012-02-15 18:34:37 -0800 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2012-02-15 18:34:37 -0800 |
commit | c27cc01f6abf8564dc9b7b6cd7f2a12a347f725d (patch) | |
tree | 31b1c6044b0f79ed98f7d09b0ec5c038c734aa45 | |
parent | fe455af277183f910eb74653a3ad172c717e7abf (diff) | |
download | frameworks_base-c27cc01f6abf8564dc9b7b6cd7f2a12a347f725d.zip frameworks_base-c27cc01f6abf8564dc9b7b6cd7f2a12a347f725d.tar.gz frameworks_base-c27cc01f6abf8564dc9b7b6cd7f2a12a347f725d.tar.bz2 |
Prevent AutoCompleteTextView from opening a popup when it shouldn't
Bug #5553515
The People app is forcing ACTV to show the IME which had the side effect
of showing the drop down popup. ACTV was unfortunately not ready to show
the drop down if the filtering resulted in no results. Doing so was putting
ACTV in a weird state that in turn caused a window to be leaked and really
bad behavior to occur in the lower graphics levels.
Change-Id: I2ff146d5ae4e4a28edf6ea17039c9f8fdb710e4f
-rw-r--r-- | core/java/android/widget/AutoCompleteTextView.java | 4 | ||||
-rw-r--r-- | tests/HwAccelerationTest/src/com/android/test/hwui/TextActivity.java | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java index f7a6b27..de11fe9 100644 --- a/core/java/android/widget/AutoCompleteTextView.java +++ b/core/java/android/widget/AutoCompleteTextView.java @@ -1031,7 +1031,9 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe public void ensureImeVisible(boolean visible) { mPopup.setInputMethodMode(visible ? ListPopupWindow.INPUT_METHOD_NEEDED : ListPopupWindow.INPUT_METHOD_NOT_NEEDED); - showDropDown(); + if (mPopup.isDropDownAlwaysVisible() || (mFilter != null && enoughToFilter())) { + showDropDown(); + } } /** diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TextActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/TextActivity.java index 4037a69..0a868fa 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/TextActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/TextActivity.java @@ -21,6 +21,7 @@ import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.os.Bundle; +import android.text.TextPaint; import android.view.View; @SuppressWarnings({"UnusedDeclaration"}) @@ -39,6 +40,7 @@ public class TextActivity extends Activity { private final Paint mScaledPaint; private final Paint mSkewPaint; private final Paint mHugePaint; + private final TextPaint mEventPaint; CustomTextView(Context c) { super(c); @@ -70,6 +72,11 @@ public class TextActivity extends Activity { mHugePaint.setAntiAlias(true); mHugePaint.setColor(0xff000000); mHugePaint.setTextSize(300f); + + mEventPaint = new TextPaint(); + mEventPaint.setFakeBoldText(true); + mEventPaint.setAntiAlias(true); + mEventPaint.setTextSize(14); } @Override @@ -77,6 +84,8 @@ public class TextActivity extends Activity { super.onDraw(canvas); canvas.drawRGB(255, 255, 255); + canvas.drawText("Hello OpenGL renderer!", 300, 20, mEventPaint); + mMediumPaint.setStyle(Paint.Style.FILL_AND_STROKE); mMediumPaint.setStrokeWidth(2.0f); canvas.drawText("Hello OpenGL renderer!", 100, 20, mMediumPaint); |