Skip to content

Commit 8963822

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Prevent AutoCompleteTextView from opening a popup when it shouldn't Bug #5553515"
2 parents d22bf4b + c27cc01 commit 8963822

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

core/java/android/widget/AutoCompleteTextView.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,9 @@ public void showDropDownAfterLayout() {
10311031
public void ensureImeVisible(boolean visible) {
10321032
mPopup.setInputMethodMode(visible
10331033
? ListPopupWindow.INPUT_METHOD_NEEDED : ListPopupWindow.INPUT_METHOD_NOT_NEEDED);
1034-
showDropDown();
1034+
if (mPopup.isDropDownAlwaysVisible() || (mFilter != null && enoughToFilter())) {
1035+
showDropDown();
1036+
}
10351037
}
10361038

10371039
/**

tests/HwAccelerationTest/src/com/android/test/hwui/TextActivity.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import android.graphics.Canvas;
2222
import android.graphics.Paint;
2323
import android.os.Bundle;
24+
import android.text.TextPaint;
2425
import android.view.View;
2526

2627
@SuppressWarnings({"UnusedDeclaration"})
@@ -39,6 +40,7 @@ static class CustomTextView extends View {
3940
private final Paint mScaledPaint;
4041
private final Paint mSkewPaint;
4142
private final Paint mHugePaint;
43+
private final TextPaint mEventPaint;
4244

4345
CustomTextView(Context c) {
4446
super(c);
@@ -70,13 +72,20 @@ static class CustomTextView extends View {
7072
mHugePaint.setAntiAlias(true);
7173
mHugePaint.setColor(0xff000000);
7274
mHugePaint.setTextSize(300f);
75+
76+
mEventPaint = new TextPaint();
77+
mEventPaint.setFakeBoldText(true);
78+
mEventPaint.setAntiAlias(true);
79+
mEventPaint.setTextSize(14);
7380
}
7481

7582
@Override
7683
protected void onDraw(Canvas canvas) {
7784
super.onDraw(canvas);
7885
canvas.drawRGB(255, 255, 255);
7986

87+
canvas.drawText("Hello OpenGL renderer!", 300, 20, mEventPaint);
88+
8089
mMediumPaint.setStyle(Paint.Style.FILL_AND_STROKE);
8190
mMediumPaint.setStrokeWidth(2.0f);
8291
canvas.drawText("Hello OpenGL renderer!", 100, 20, mMediumPaint);

0 commit comments

Comments
 (0)