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

Commit adf08d4e authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev
Browse files

Fix anchor overlap handling in ListPopupWindow

Do not change anchor overlap on the underlying
PopupWindow unless ListPopupWindow.setOverlapAnchor
has been called explicitly.

Bug: 36714649
Test: ApiDemos > Views > Spinner
Change-Id: I5e66d4409a1f04cdc0fbe64e255609836c2b0e95
parent f68766f6
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ public class ListPopupWindow implements ShowableListMenu {
    private boolean mDropDownVerticalOffsetSet;
    private boolean mIsAnimatedFromAnchor = true;
    private boolean mOverlapAnchor;
    private boolean mOverlapAnchorSet;

    private int mDropDownGravity = Gravity.NO_GRAVITY;

@@ -681,7 +682,9 @@ public class ListPopupWindow implements ShowableListMenu {
            mPopup.setOutsideTouchable(!mForceIgnoreOutsideTouch && !mDropDownAlwaysVisible);
            mPopup.setTouchInterceptor(mTouchInterceptor);
            mPopup.setEpicenterBounds(mEpicenterBounds);
            if (mOverlapAnchorSet) {
                mPopup.setOverlapAnchor(mOverlapAnchor);
            }
            mPopup.showAsDropDown(getAnchorView(), mDropDownHorizontalOffset,
                    mDropDownVerticalOffset, mDropDownGravity);
            mDropDownList.setSelection(ListView.INVALID_POSITION);
@@ -1259,6 +1262,7 @@ public class ListPopupWindow implements ShowableListMenu {
     * @hide
     */
    public void setOverlapAnchor(boolean overlap) {
        mOverlapAnchorSet = true;
        mOverlapAnchor = overlap;
    }