Stanley Gomes
03/20/2021, 6:37 PMAnimatedVisibility
composables like here to slide in/out the composables
My issue is that only the top AnimatedVisibility
plays the animation. I would like to play them both in parallel so it looks like a seamless sliding in and out transition like a viewPager. Thanks!Stanley Gomes
03/20/2021, 6:38 PMColton Idle
03/20/2021, 6:45 PMStanley Gomes
03/20/2021, 6:52 PMRow {
AnimatedVisibility(
visible = formState.value == FormState.TIME,
enter = slideInHorizontally(
{ it },
animationSpec = tween()
),
exit = slideOutHorizontally(
{ it },
animationSpec = tween()
)
) {
EnterTime()
}
AnimatedVisibility(
visible = formState.value == FormState.NAME,
enter = slideInHorizontally(
{ -it },
animationSpec = tween()
),
exit = slideOutHorizontally(
{ -it },
animationSpec = tween()
)
) {
EnterName(
text = name,
onNameChange = { name = it }
)
}
}
Doris Liu
03/20/2021, 7:37 PMAnimatedVisibilty
in a Box instead of a Row?Doris Liu
03/20/2021, 7:50 PMRow
is that if both children want to lay out to be the same size as the parent, the 2nd child will be allocated 0 size, until the first child gets removed from the tree.
That's what the video showed: During the time that the first AnimatedVisiblity
is animating out, the 2nd one reports its width to be 0, and only snaps to the full size when the previous AnimatedVisibility
has finished its animation.Stanley Gomes
03/20/2021, 8:05 PMBox
worked 🙂Colton Idle
03/20/2021, 8:08 PMStanley Gomes
03/20/2021, 8:15 PMDoris Liu
03/20/2021, 8:54 PMfadeIn
that was fixed in beta03. Just so you don't spend a bunch of time debugging it. 🙂 For now you could work around that by offsetting the slideIn a little more so it starts from off screen.