Is there any known animation issue with `0.4.0-bui...
# compose-desktop
t
Is there any known animation issue with
0.4.0-build178
?
animateFloatAsState
doesn't seem to work anymore. 🤔 🧵
FYI. The code was working in previous versions.
j
Looks like a (unintentional?) behavioral change in animations. Specifically, the
finishedListener
would previously run upon first composition allowing you to use
tween
+
finishedListener
to implement an infinite animation. It appears this is no longer the case. @Doris Liu WAI or bug?
d
It's an intentional change to avoid unnecessary animations. Previously,
animateFloatAsState
would animate (from/to the same target) when it enters composition, and subsequently invokes the finished listener. Now it only animates when target changes.
👍 2
Looking at the code snippet, the previous behavior would have been no visible change (due to the same from/to value) for the first animation duration, then animating in-between the two target values. 🙂 I suspect that's not the desired behavior. If it's intended for the animation to start as soon as enters composition, consider putting an initial state toggle in a
DisposableEffect
[Edit:] using
Animatable
. Note, it's generally recommended to avoid writing compositions that take more than one pass to converge. Putting state toggle in
DisposableEffect
would therefore be an antipattern.
t
Understood. was this document anywhere in the release notes?
Yeah got it. Thanks @Doris Liu @jim
d
It wasn't in the release note, as we weren't expecting that behavior to be depended on. 😅