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

Commit a31d4edb authored by tianran.x.li's avatar tianran.x.li Committed by Shunta Sato
Browse files

Skip ListPopupWindow position update if detached

Symptom:
A part of the option is displayed in the wrong location.

Root cause:
When the search item is clicked, the menu item will be
hidden. The PopupWindow will be detached from window and the
mAttachInfo property will be set to null. The anchor coordinates
will return x 0 and y 0.

Solution:
If the anchor view is detached from window, the ListPopupWindow will
not be update.

Bug: 36207919

Change-Id: I2b370c31542fae454592463e12313fdeaef25afe
parent 06a192fa
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -600,6 +600,10 @@ public class ListPopupWindow implements ShowableListMenu {
        mPopup.setWindowLayoutType(mDropDownWindowLayoutType);

        if (mPopup.isShowing()) {
            if (!getAnchorView().isAttachedToWindow()) {
                //Don't update position if the anchor view is detached from window.
                return;
            }
            final int widthSpec;
            if (mDropDownWidth == ViewGroup.LayoutParams.MATCH_PARENT) {
                // The call to PopupWindow's update method below can accept -1 for any