diff options
| author | 2024-09-24 17:41:11 +0800 | |
|---|---|---|
| committer | 2024-09-24 12:19:26 +0000 | |
| commit | e698208f582641f7227288d311cf5e297c00e42a (patch) | |
| tree | 913295f65ecae417bbb3123ee6e8b8ce14f012a6 /libs/androidfw/AttributeResolution.cpp | |
| parent | 0776993706eb3c832fbb4ce191a04fa2120e8fb1 (diff) | |
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 625ff9d80e2896e45e441e141a4e9a13029a169b.
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
Diffstat (limited to 'libs/androidfw/AttributeResolution.cpp')
0 files changed, 0 insertions, 0 deletions