Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5420d01c authored by Bjorn Bringert's avatar Bjorn Bringert
Browse files

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
parent f4acf39d
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -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,