Doris Liu
12/16/2020, 11:12 PMTransition
animation to make it easier to use and more extensible. tl;dr No more `PropKey`s and `transitionDefinition`s, and instead animations can be declared dynamically. π Please give the new Transition (available since alpha 09) a try. I would love to hear what you think! π (P.S. Seeking isn't supported yet, but dynamic target values (e.g. theme-specific values) are now supported.)rsktash
12/17/2020, 7:51 PMDoris Liu
12/17/2020, 7:55 PMrsktash
12/17/2020, 8:06 PMrsktash
12/17/2020, 8:25 PMDoris Liu
12/17/2020, 8:31 PMTransition<S>.animateVectorIcons(...)
extension with ShapeShifter? πrsktash
12/17/2020, 8:41 PMDoris Liu
12/17/2020, 8:54 PMAnimatedVectorDrawable
. Meanwhile, we have some ongoing work that is a more general solution for creating custom animated vectors using Transition
. Stay tuned! π @Nader Jawad may be able to share more.Alexjlockwood
12/17/2020, 9:02 PMAlexjlockwood
12/17/2020, 9:03 PMAnimatedVectorDrawable
resources to a compose format sounds like not that much fun πDoris Liu
12/17/2020, 9:04 PMrsktash
12/17/2020, 9:08 PMNader Jawad
12/17/2020, 9:09 PMrsktash
12/18/2020, 11:37 AMhttps://i.stack.imgur.com/oLG2Y.gifβΎ
Doris Liu
12/19/2020, 10:56 PMrsktash
12/20/2020, 1:03 AMrsktash
12/20/2020, 1:06 AMDoris Liu
12/20/2020, 4:44 AMAfzal Najam
12/20/2020, 4:45 AMtransition(FabState.Normal to FabState.Exploded)
as compared to
if (it.initialState == FabState.Initial && it.targetState == FabState.Normal)
Afzal Najam
12/20/2020, 4:49 AMval fabSize by transition.animateDp(
transitionSpec = {
keyframes {
durationMillis = 500
58.dp at 0
48.dp at 200
1500.dp at 500
}
}
) {
when (it) {
initialState -> 20.dp
normalState -> 56.dp
explodedState -> 1500.dp
else -> 56.dp
}
}
The animation always goes to 1500.dp
even if the state is normalState
?Doris Liu
12/20/2020, 6:00 AMinitialState
be a parameter to transition
like in v1 has led to some confusion around what should happen when initialState
changes during a transition animation (i.e. restart everything or ignore it, both of which make sense). For v2 we are trying to avoid such confusion, yet provide the support through other solutions. Stay tuned on that. π
β’ I'm glad you see it as a straightforward conversion from animate
. We aim to make it minimum effort to animate things.π So we expect folks to start with animate
and progress to Transition
as needed.
β’ Very insightful feedback on the ergonomics of transitionSpec
! π I'm also considering a transition spec builder that supports selective overwrites of the default animations. This feedback is very helpful.πDoris Liu
12/20/2020, 6:05 AM1500.dp
(as defined by keyframes
) then snap to whatever value defined for the state. It shouldn't "rest" at 1500.dp
for any state other than explodedState
. I'll file a bug to fix this. Thanks for reporting it. πAfzal Najam
12/20/2020, 6:24 AMrsktash
12/20/2020, 6:52 AM