From f3900f1b99a61fa107b6ea5967bb456488f36a1e Mon Sep 17 00:00:00 2001 From: Johannes Gallmann Date: Fri, 17 May 2024 13:17:11 +0000 Subject: Fix predictive back animations jump at beginning We should not call reset() in BackProgressAnimator#onBackStarted, to prevent progress jumps at the beginning of the animation. The reason for the jumps is that inside `reset()` `skipToEnd()` is called. This causes a SpringAnimation-internal flag `mEndRequested` to be flipped to true, which in turn has the effect that on the next frame the spring is immediately set to the requested position. However, by that time, the progress may already have moved a substantial amount, which causes the animation jumps. Bug: 341257287 Flag: com.android.window.flags.predictive_back_system_anims NEXTFOOD Test: Manual, i.e. comparing screen recordings and analysing logcat Change-Id: Ic0b8926d60a0d37a5ead51e130159d7e3219801e --- core/java/android/window/BackProgressAnimator.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core/java/android/window/BackProgressAnimator.java b/core/java/android/window/BackProgressAnimator.java index 163e43a009e7..6fe0784a2fa5 100644 --- a/core/java/android/window/BackProgressAnimator.java +++ b/core/java/android/window/BackProgressAnimator.java @@ -114,7 +114,6 @@ public class BackProgressAnimator { * dispatches as the progress animation updates. */ public void onBackStarted(BackMotionEvent event, ProgressCallback callback) { - reset(); mLastBackEvent = event; mCallback = callback; mBackAnimationInProgress = true; -- cgit v1.2.3-59-g8ed1b