diff options
| author | 2023-08-11 09:12:56 +0000 | |
|---|---|---|
| committer | 2023-08-11 09:12:56 +0000 | |
| commit | 33558d6274903458efb403dee92c12750fd7ea20 (patch) | |
| tree | b147f71d09ded5233f2b7f009a0a51356acf4503 /libs/WindowManager/Shell | |
| parent | eb277dabbac3044319b0f02a6726c1c5ea14ac98 (diff) | |
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
Diffstat (limited to 'libs/WindowManager/Shell')
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityAnimation.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityAnimation.java b/libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityAnimation.java index edefe9e3ab06..74a243d34642 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityAnimation.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityAnimation.java @@ -371,7 +371,15 @@ class CrossActivityAnimation { @Override 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 |