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

Commit 9189550e authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Fix bug 3465210 - Anchored popups don't appear above anchor when there isn't enough room."

parents 51510388 b7c1b20c
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -1056,16 +1056,17 @@ public class PopupWindow {
        anchor.getWindowVisibleDisplayFrame(displayFrame);
        
        final View root = anchor.getRootView();
        if (mAllowScrollingAnchorParent && (p.y + mPopupHeight > displayFrame.bottom ||
                p.x + mPopupWidth - root.getWidth() > 0)) {
        if (p.y + mPopupHeight > displayFrame.bottom || p.x + mPopupWidth - root.getWidth() > 0) {
            // if the drop down disappears at the bottom of the screen. we try to
            // scroll a parent scrollview or move the drop down back up on top of
            // the edit box
            if (mAllowScrollingAnchorParent) {
                int scrollX = anchor.getScrollX();
                int scrollY = anchor.getScrollY();
                Rect r = new Rect(scrollX, scrollY,  scrollX + mPopupWidth + xoff,
                        scrollY + mPopupHeight + anchor.getHeight() + yoff);
                anchor.requestRectangleOnScreen(r, true);
            }

            // now we re-evaluate the space available, and decide from that
            // whether the pop-up will go above or below the anchor.