am 6b46dc86: Merge change 8840 into donut
Merge commit '6b46dc8616dff7a5049b9fbaa7bbf8b4c0840eb4'
* commit '6b46dc8616dff7a5049b9fbaa7bbf8b4c0840eb4':
Add padding to height of AutoCompleteTextView drop-down.
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java
index e8b7672..ea88b5b 100644
--- a/core/java/android/widget/AutoCompleteTextView.java
+++ b/core/java/android/widget/AutoCompleteTextView.java
@@ -104,6 +104,7 @@
private View mDropDownAnchorView; // view is retrieved lazily from id once needed
private int mDropDownWidth;
private int mDropDownHeight;
+ private final Rect mTempRect = new Rect();
private Drawable mDropDownListHighlight;
@@ -1309,7 +1310,15 @@
getDropDownAnchorView(), mDropDownVerticalOffset, ignoreBottomDecorations);
if (mDropDownAlwaysVisible) {
- return maxHeight;
+ // getMaxAvailableHeight() subtracts the padding, so we put it back,
+ // to get the available height for the whole window
+ int padding = 0;
+ Drawable background = mPopup.getBackground();
+ if (background != null) {
+ background.getPadding(mTempRect);
+ padding = mTempRect.top + mTempRect.bottom;
+ }
+ return maxHeight + padding;
}
return mDropDownList.measureHeightOfChildren(MeasureSpec.UNSPECIFIED,