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

Commit 3b5654d7 authored by Ivan Makarov's avatar Ivan Makarov
Browse files

Fix the expand button changing too soon

The expand button used to change its icon right after it was clicked and
before the animation has finished. This resulted in the icon being changed too soon. This CL fixes this by waiting until the pip transition is finished

Bug: 237269877

Test: Manual
Change-Id: I46d8bc82be7db0532c51aa116ff2dbbf5e09fc68
parent f2c5ecb1
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ public class TvPipMenuController implements PipMenuController, TvPipMenuView.Lis
    void notifyPipAnimating(boolean animating) {
        mPipMenuView.setEduTextActive(!animating);
        if (!animating) {
            mPipMenuView.onPipTransitionFinished();
            mPipMenuView.onPipTransitionFinished(mTvPipBoundsState.isTvPipExpanded());
        }
    }

@@ -267,7 +267,6 @@ public class TvPipMenuController implements PipMenuController, TvPipMenuView.Lis
    void updateExpansionState() {
        mPipMenuView.setExpandedModeEnabled(mTvPipBoundsState.isTvExpandedPipSupported()
                && mTvPipBoundsState.getDesiredTvExpandedAspectRatio() != 0);
        mPipMenuView.setIsExpanded(mTvPipBoundsState.isTvPipExpanded());
    }

    private Rect calculateMenuSurfaceBounds(Rect pipBounds) {
+3 −1
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener {
        }
    }

    void onPipTransitionFinished() {
    void onPipTransitionFinished(boolean isTvPipExpanded) {
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "%s: onPipTransitionFinished()", TAG);

@@ -277,6 +277,8 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener {
                .setInterpolator(TvPipInterpolators.ENTER)
                .start();

        setIsExpanded(isTvPipExpanded);

        // Update buttons.
        if (mSwitchingOrientation) {
            mActionButtonsContainer.animate()