File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
app/src/main/java/pro/jayeshseth/animations/ui/screens Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 11package pro.jayeshseth.animations.ui.screens
22
3+ import androidx.compose.animation.animateContentSize
4+ import androidx.compose.animation.core.tween
5+ import androidx.compose.foundation.layout.Box
36import androidx.compose.foundation.layout.Column
47import androidx.compose.foundation.layout.PaddingValues
58import androidx.compose.foundation.layout.fillMaxWidth
@@ -26,7 +29,8 @@ fun AnimationCard(animationScreen: AnimationScreen) {
2629 Column (
2730 modifier = Modifier
2831 .fillMaxWidth()
29- .padding(12 .dp),
32+ .padding(12 .dp)
33+ .animateContentSize(tween(500 )),
3034 horizontalAlignment = Alignment .CenterHorizontally
3135 ) {
3236 Text (
@@ -37,7 +41,11 @@ fun AnimationCard(animationScreen: AnimationScreen) {
3741 fontSize = 20 .sp,
3842 fontWeight = FontWeight .SemiBold
3943 )
40- animationScreen.content(isVisible)
44+ Box (
45+ Modifier .animateContentSize(tween(500 ))
46+ ) {
47+ animationScreen.content(isVisible)
48+ }
4149 InteractiveButton (
4250 text = " Animate" ,
4351 onClick = { isVisible = ! isVisible },
You can’t perform that action at this time.
0 commit comments