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

Commit 33558d62 authored by wilsonshih's avatar wilsonshih
Browse files

Fix flickering when cancel cross activity animation.

Cross activity animation use different spring animations to control
different object/status, so the finish stage of each animations are
arrived separatly. For the cancel animation case, force update the
closing target to final stage before release all animation leashes.

Bug: 230798396
Test: manual enter/cancel animation and verify no flicker.
Change-Id: I82d99ce4bc922cf7ecb7013ef532e8b18c47c35a
parent eb277dab
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -371,7 +371,15 @@ class CrossActivityAnimation {


        @Override
        @Override
        public void onBackCancelled() {
        public void onBackCancelled() {
            mProgressAnimator.onBackCancelled(CrossActivityAnimation.this::finishAnimation);
            mProgressAnimator.onBackCancelled(() -> {
                // mProgressAnimator can reach finish stage earlier than mLeavingProgressSpring,
                // and if we release all animation leash first, the leavingProgressSpring won't
                // able to update the animation anymore, which cause flicker.
                // Here should force update the closing animation target to the final stage before
                // release it.
                setLeavingProgress(0);
                finishAnimation();
            });
        }
        }


        @Override
        @Override