diff options
author | Bjorn Bringert <bringert@android.com> | 2009-07-28 20:17:27 +0100 |
---|---|---|
committer | Bjorn Bringert <bringert@android.com> | 2009-07-28 21:08:25 +0100 |
commit | 5420d01cef810c34d754cadfaa1e8cae13af06de (patch) | |
tree | e77a7e3aa8ae4f0925637b745f96a1afab358f83 /core/java/android/widget | |
parent | f4acf39d99d105e1e4fc7c43fa54377bb2f262ae (diff) | |
download | frameworks_base-5420d01cef810c34d754cadfaa1e8cae13af06de.zip frameworks_base-5420d01cef810c34d754cadfaa1e8cae13af06de.tar.gz frameworks_base-5420d01cef810c34d754cadfaa1e8cae13af06de.tar.bz2 |
Add padding to height of AutoCompleteTextView drop-down.
As described in http://b/issue?id=2017825
PopupWindow.getMaxAvailableHeight() does not include the padding in
the available height. To get the ACTV drop-down to actually fill
the screen, this change adds the padding to the value returned
by PopupWindow.getMaxAvailableHeight().
This is part of the fix for http://b/issue?id=2014450
Diffstat (limited to 'core/java/android/widget')
-rw-r--r-- | core/java/android/widget/AutoCompleteTextView.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java index a998072..456f8ed 100644 --- a/core/java/android/widget/AutoCompleteTextView.java +++ b/core/java/android/widget/AutoCompleteTextView.java @@ -104,6 +104,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe 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; @@ -1323,7 +1324,15 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe 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, |