Quick poll: If you could seek a `Transition` , wou...
# compose
d
Quick poll: If you could seek a
Transition
, would you prefer to seek by: 1️⃣ percentage based progress (0-1f), or 2️⃣ playtime (between 0 and total duration)?
1️⃣ 16
c
total duration could be helpful for chaining animations to come after each other but I suspect you've probably already made or plan a better way to do that anyway
d
Yes, we'll have more straightforward APIs to handle sequential animations. 🙂 Playtime-based seeking would be interesting when used with
withFrameMillis
, which allow switching fluently between precise seeking and running normally. Percentage based seeking is likely more intuitive to use with gestures.
b
@Doris Liu APIs to handle sequential animations sounds really cool! Any CL that I can track for that work?
So far, this is what I came up with for sequential animations. I use it like this (I was just getting started with Compose Animations when I wrote that though, not sure if it's the best way)
d
Thanks for sharing, @bruno.aybar With current
Transition
API, I'd probably do it similar to what you have in the gist linked above. 🙂 As for tracking that work, that feature was unfortunately de-prioritized. You could track it here: https://issuetracker.google.com/issues/174926895
🙌 1
👍 1
a
how would repeatable/indefinite transitions work with a percentage-based-seek API? iirc
AnimatorSet#setCurrentPlayTime()
worked even with repeatable/indefinite animations
d
It won't. 🙂 The percentage-based seeking can support anything but infinite animations. On the other hand, I'm not sure that's a limitation, unless you have a use case in mind where it's useful to seek an infinite animation?
a
yeah i can’t think of a use case either. 🙂 was mainly just asking because i was wondering if transition would support everything
AnimatorSet
supported i suppose. i do tend to agree that the percentage based APIis nicer than one based on duration tho