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

Skip to content
Commit e698208f authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Revert^2 "Extra common logic of default transition animation"

Extra common logic of default transition animation

Make it more flexible to run other animation implementation.

This reverts commit 625ff9d8.
Reason for revert: reland

The previous patch has a problem by calling
AnimationAdapter#onAnimationUpdate again at the end of animation.
Originally it uses va.getDuration() as currentPlayTime, which
will apply the end state of transformation.

The problem is that the adapter uses animator.getCurrentPlayTime(),
which will be 0 if the animation is finished. That causes the
transformation to apply the start state. Then the target surface
could move to original offset which may be outside screen.

The fix is to check if it is animating the last frame, then
use va.getDuration() as currentPlayTime. This also reduces
duplicated surface transactions for the last frame if the animation
ends normally.

Note that the animated fraction will be 1 if the animation plays
to end or ValueAnimator#end is called before animation finishes.
Only ValueAnimator#cancel may satisfy the condition
"va.getAnimatedFraction() < 1f". So far there is no cancel usages.
Just make sure that end state is always applied.

Bug: 326331384
Flag: com.android.window.flags.common_surface_animator
Test: atest DefaultTransitionHandler#testBuildSurfaceAnimation
Change-Id: I082bfe2e57e4374cca9fb30c260051fbafbd21f7
parent 07769937
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment