YASAN
04/14/2021, 10:07 PMColton Idle
04/14/2021, 10:09 PMYASAN
04/14/2021, 10:12 PMYASAN
04/14/2021, 10:12 PMYASAN
04/14/2021, 10:13 PMColton Idle
04/14/2021, 10:13 PMYASAN
04/14/2021, 10:14 PMYASAN
04/14/2021, 10:15 PMYASAN
04/14/2021, 10:25 PMIan Lake
04/15/2021, 12:01 AMAnimatedVisibility
is already keeping track of the float of the current animated size and moving it in the direction of your `visible`: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]kotlin/androidx/compose/animation/AnimatedVisibility.kt;l=283rnett
04/15/2021, 2:07 AMAlso my Spacer fully disappears when its placed in an AnimatedVisibility which I am not sure whyI ran into this too, so it's not just you.
YASAN
04/15/2021, 2:43 PMDoris Liu
04/15/2021, 6:11 PMAnimatedVisibility
- it is designed to always animate from the value at the point of interruption to the new target. (This is also the default behavior for all animations in compose.)Doris Liu
04/15/2021, 6:16 PMAlso my Spacer fully disappears when its placed in an AnimatedVisibility which I am not sure why
AnimatedVisibility
uses a custom layout that stacks all the children like a Box/FrameLayout. That is why Spacer doesn't offset the other content in AnimatedVisibility. You could try creating a Row/Column in AnimatedVisibility for the Spacer and other content. 🙂