From c764c4e5b3edd26f7a8bb4a3c7b57ea3b3971457 Mon Sep 17 00:00:00 2001 From: longnghia <41385034+longnghia@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:34:59 +0700 Subject: [PATCH] Add small animation for PostCard --- .../java/com/paulcoding/hviewer/ui/page/posts/PostsPage.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/paulcoding/hviewer/ui/page/posts/PostsPage.kt b/app/src/main/java/com/paulcoding/hviewer/ui/page/posts/PostsPage.kt index f1b6004..28e8e4f 100644 --- a/app/src/main/java/com/paulcoding/hviewer/ui/page/posts/PostsPage.kt +++ b/app/src/main/java/com/paulcoding/hviewer/ui/page/posts/PostsPage.kt @@ -1,6 +1,8 @@ package com.paulcoding.hviewer.ui.page.posts import android.widget.Toast +import androidx.compose.animation.animateContentSize +import androidx.compose.animation.core.tween import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -200,7 +202,10 @@ fun PostCard( Card( elevation = CardDefaults.cardElevation(8.dp), modifier = Modifier - .padding(horizontal = 16.dp, vertical = 12.dp), + .padding(horizontal = 16.dp, vertical = 12.dp) + .animateContentSize( + animationSpec = tween(durationMillis = 300) + ), shape = MaterialTheme.shapes.medium, ) { Box(modifier = Modifier.fillMaxSize()) {