From 4d118c5b1af784ce25a7d5d41cd1a1060268c4d7 Mon Sep 17 00:00:00 2001 From: Ren Amamiya Date: Fri, 17 Jul 2026 16:26:58 +0700 Subject: [PATCH] clean up --- .../kotlin/su/reya/coop/screens/HomeScreen.kt | 5 ++++- .../kotlin/su/reya/coop/screens/chat/ChatMessage.kt | 11 +---------- .../kotlin/su/reya/coop/screens/chat/ChatScreen.kt | 7 ++++--- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/composeApp/src/androidMain/kotlin/su/reya/coop/screens/HomeScreen.kt b/composeApp/src/androidMain/kotlin/su/reya/coop/screens/HomeScreen.kt index 3b21eb0..1e97291 100644 --- a/composeApp/src/androidMain/kotlin/su/reya/coop/screens/HomeScreen.kt +++ b/composeApp/src/androidMain/kotlin/su/reya/coop/screens/HomeScreen.kt @@ -7,6 +7,7 @@ import android.os.Build import android.provider.Settings import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.result.contract.ActivityResultContracts +import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -250,7 +251,9 @@ fun HomeScreen( modifier = Modifier.padding(top = innerPadding.calculateTopPadding()), verticalArrangement = Arrangement.spacedBy(16.dp), ) { - if (!isNotificationEnabled && !isBannerDismissed) { + AnimatedVisibility( + visible = !isNotificationEnabled && !isBannerDismissed, + ) { Surface( modifier = Modifier .fillMaxWidth() diff --git a/composeApp/src/androidMain/kotlin/su/reya/coop/screens/chat/ChatMessage.kt b/composeApp/src/androidMain/kotlin/su/reya/coop/screens/chat/ChatMessage.kt index 50e7c99..213c9b9 100644 --- a/composeApp/src/androidMain/kotlin/su/reya/coop/screens/chat/ChatMessage.kt +++ b/composeApp/src/androidMain/kotlin/su/reya/coop/screens/chat/ChatMessage.kt @@ -1,10 +1,5 @@ package su.reya.coop.screens.chat -import androidx.compose.animation.AnimatedVisibility -import androidx.compose.animation.expandVertically -import androidx.compose.animation.fadeIn -import androidx.compose.animation.fadeOut -import androidx.compose.animation.shrinkVertically import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Arrangement @@ -177,11 +172,7 @@ fun ChatMessage( ) } } - AnimatedVisibility( - visible = isMessageClicked, - enter = fadeIn() + expandVertically(), - exit = fadeOut() + shrinkVertically() - ) { + if (isMessageClicked) { Text( text = model.timestamp, style = MaterialTheme.typography.labelSmall, diff --git a/composeApp/src/androidMain/kotlin/su/reya/coop/screens/chat/ChatScreen.kt b/composeApp/src/androidMain/kotlin/su/reya/coop/screens/chat/ChatScreen.kt index b9cf589..bda1743 100644 --- a/composeApp/src/androidMain/kotlin/su/reya/coop/screens/chat/ChatScreen.kt +++ b/composeApp/src/androidMain/kotlin/su/reya/coop/screens/chat/ChatScreen.kt @@ -383,8 +383,10 @@ fun ChatScreen( } else -> { - replyingTo?.let { - ReplyBox(it) { replyingTo = null } + AnimatedVisibility(visible = replyingTo != null) { + replyingTo?.let { + ReplyBox(it) { replyingTo = null } + } } ChatInput( value = text, @@ -423,7 +425,6 @@ fun ChatScreen( } } ) - AnimatedVisibility( visible = selectedMessage != null, enter = fadeIn(),