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

Commit 37a4a1c8 authored by Alan Viverette's avatar Alan Viverette Committed by Android (Google) Code Review
Browse files

Merge "Don't move non-modal popups in response to global layout"

parents 2004798c 64b71573
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -80,11 +80,15 @@ final class CascadingMenuPopup extends MenuPopup implements MenuPresenter, OnKey
    private final OnGlobalLayoutListener mGlobalLayoutListener = new OnGlobalLayoutListener() {
        @Override
        public void onGlobalLayout() {
            if (isShowing()) {
            // Only move the popup if it's showing and non-modal. We don't want
            // to be moving around the only interactive window, since there's a
            // good chance the user is interacting with it.
            if (isShowing() && mShowingMenus.size() > 0
                    && !mShowingMenus.get(0).window.isModal()) {
                final View anchor = mShownAnchorView;
                if (anchor == null || !anchor.isShown()) {
                    dismiss();
                } else if (isShowing()) {
                } else {
                    // Recompute window sizes and positions.
                    for (CascadingMenuInfo info : mShowingMenus) {
                        info.window.show();
+5 −2
Original line number Diff line number Diff line
@@ -59,11 +59,14 @@ final class StandardMenuPopup extends MenuPopup implements OnDismissListener, On
    private final OnGlobalLayoutListener mGlobalLayoutListener = new OnGlobalLayoutListener() {
        @Override
        public void onGlobalLayout() {
            if (isShowing()) {
            // Only move the popup if it's showing and non-modal. We don't want
            // to be moving around the only interactive window, since there's a
            // good chance the user is interacting with it.
            if (isShowing() && !mPopup.isModal()) {
                final View anchor = mShownAnchorView;
                if (anchor == null || !anchor.isShown()) {
                    dismiss();
                } else if (isShowing()) {
                } else {
                    // Recompute window size and position
                    mPopup.show();
                }