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

Commit d2ec5a62 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Defer showing pip menu activity until pip animation ends" into oc-dev

parents eef5d285 6455e500
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ public class PipTouchHandler implements TunerService.Tunable {
    private final PipDismissViewController mDismissViewController;
    private final PipSnapAlgorithm mSnapAlgorithm;
    private final AccessibilityManager mAccessibilityManager;
    private boolean mShowPipMenuOnAnimationEnd = false;

    // The current movement bounds
    private Rect mMovementBounds = new Rect();
@@ -221,13 +222,18 @@ public class PipTouchHandler implements TunerService.Tunable {
            setMinimizedStateInternal(false);
        }
        mDismissViewController.destroyDismissTarget();
        mMenuController.showMenu(MENU_STATE_CLOSE, mMotionHelper.getBounds(),
                mMovementBounds, true /* allowMenuTimeout */);
        mShowPipMenuOnAnimationEnd = true;
    }

    public void onPinnedStackAnimationEnded() {
        // Always synchronize the motion helper bounds once PiP animations finish
        mMotionHelper.synchronizePinnedStackBounds();

        if (mShowPipMenuOnAnimationEnd) {
            mMenuController.showMenu(MENU_STATE_CLOSE, mMotionHelper.getBounds(),
                    mMovementBounds, true /* allowMenuTimeout */);
            mShowPipMenuOnAnimationEnd = false;
        }
    }

    @Override