Skip to content

Commit

Permalink
changes: update animation card to animate 🙂
Browse files Browse the repository at this point in the history
  • Loading branch information
MadFlasheroo7 committed Aug 23, 2024
1 parent 864f879 commit 79f76d5
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package pro.jayeshseth.animations.ui.screens

import androidx.compose.animation.animateContentSize
import androidx.compose.animation.core.tween
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -26,7 +29,8 @@ fun AnimationCard(animationScreen: AnimationScreen) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(12.dp),
.padding(12.dp)
.animateContentSize(tween(500)),
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
Expand All @@ -37,7 +41,11 @@ fun AnimationCard(animationScreen: AnimationScreen) {
fontSize = 20.sp,
fontWeight = FontWeight.SemiBold
)
animationScreen.content(isVisible)
Box(
Modifier.animateContentSize(tween(500))
) {
animationScreen.content(isVisible)
}
InteractiveButton(
text = "Animate",
onClick = { isVisible = !isVisible },
Expand Down

0 comments on commit 79f76d5

Please sign in to comment.