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

Commit 1a77296d authored by Johannes Gallmann's avatar Johannes Gallmann
Browse files

Fix idle frame between pre-commit and post-commit phase

Bug: 343136429
Flag: com.android.window.flags.predictive_back_system_anims NEXTFOOD
Test: Manual, i.e. comparing before and after screen recordings
Change-Id: I93ec816a82b51ca9262f1ffe1dbb045bcec284e6
parent c14c0eac
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.graphics.PointF
import android.graphics.Rect
import android.graphics.RectF
import android.os.RemoteException
import android.util.TimeUtils
import android.view.Choreographer
import android.view.Display
import android.view.IRemoteAnimationFinishedCallback
@@ -259,6 +260,8 @@ abstract class CrossActivityBackAnimation(
            .setStartValue(SPRING_SCALE)
            .setSpring(postCommitFlingSpring)
        flingAnimation.start()
        // do an animation-frame immediately to prevent idle frame
        flingAnimation.doAnimationFrame(choreographer.lastFrameTimeNanos / TimeUtils.NANOS_PER_MS)

        val valueAnimator = ValueAnimator.ofFloat(1f, 0f).setDuration(POST_COMMIT_DURATION)
        valueAnimator.addUpdateListener { animation: ValueAnimator ->