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

Skip to content
Commit 7406ab15 authored by Steve Elliott's avatar Steve Elliott
Browse files

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
parent da362ca1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment