diff options
| author | 2023-10-10 15:12:19 -0400 | |
|---|---|---|
| committer | 2023-10-23 13:19:43 -0400 | |
| commit | 7406ab15eb14ac05885a40899b9a9e930c33e87a (patch) | |
| tree | 7ed8dbca00d73e9154a845f56f351edb32f39095 /libs/androidfw/StringPool.cpp | |
| parent | da362ca165d9159475f2c52e2d297a781ddd9733 (diff) | |
AnimatedValue per-value animation end signal
This change reworks animation end signalling for AnimatedValue; rather
than consuming a top-level Flow to signal that an animation has ended,
each AnimatedValue exposes its own stopAnimating() method that,
critically, only affects that specific AnimatedValue; if a new
AnimatedValue is emitted by the Flow returned from
toAnimatedValueFlow(), then a invoking stopAnimating() on a
previously-emitted AnimatedValue will be ignored.
This helps avoid a common pitfall with modelling animation state, where
a new AnimatedValue is emitted whilst a previous animation is still
occurring. In many cases, we want to cancel() the previous animation,
which without careful management, will result in a cancel signal making
it back to the toAnimatedValueFlow(), *before* the new animation is even
started. This will cause a new AnimatedValue to be emitted with
isAnimating == false, immediately cancelling the new animation.
Bug: 278765923
Test: atest SystemUITests
Change-Id: I3503cbf604d6b85b573987264c0bb7611632b293
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions