Tash
06/28/2021, 7:22 PMAnimatedVisibility
, is it possible for the content to provide custom `Enter/ExitTransition`s, i.e. other than slide/fade/shrink/expand?Doris Liu
06/28/2021, 8:10 PMTash
06/28/2021, 8:14 PMAnimatable<Offset>
& an Animatable<Float>
that I want to simultaneously update when the component enters/exitsâŚalthough I feel like the Transition
framework is different from these singular `Animatable`s đ¤Doris Liu
06/28/2021, 8:29 PMalthough I feel like theÂDepending on what you use the `Animatable`s for. If they are purely for defining an initial value to animate from, the Transition from AnimatedVisibilityScope would be more convenient, because it asks you for the target values for preEnter, Visible, and postExit states, and automatically kicks off the transition preEnter -> Visible as a form of enter transition, similarly Visible -> postExit for exit transition. Give it a try, I'd love to know how it works for your case. We are looking at other possibilities for expanding Enter/ExitTransition support as well. đ framework is different from these singular `Animatable`sTransition
Tash
06/28/2021, 9:45 PMAnimatable<Offset>
. If the element enters/exits, theoretically wanted to use that same Animatable<Offset>
to animate a slide-in/slide-out starting at the `Animatable<Offset>`âs current X/Y, for example.Tash
06/28/2021, 9:48 PMoffset
modifier is already being defined by that `Animatable<Offset>`:
offset {
IntOffset(
x = animatableOffset.value.x.roundToInt(),
y = animatableOffset.value.y.roundToInt()
)
}
Doris Liu
06/28/2021, 9:51 PMTash
06/28/2021, 9:52 PMAnimatable<Offset>
and a State<Float>
from transition.animateFloat(âŚ)
Doris Liu
06/28/2021, 9:57 PMTash
06/28/2021, 9:59 PMDoris Liu
06/28/2021, 10:01 PMTash
06/28/2021, 10:01 PMEnter/ExitTransition
and that seems to work. So the component can be controlled by two separate âoffsetsââŚ. Thanks for this insight, will run with it and see how it goes đ