feat: add some basic interactive animations #46

Merged
reya merged 4 commits from feat/animation into master 2026-07-17 09:27:40 +00:00
3 changed files with 9 additions and 14 deletions
Showing only changes of commit 4d118c5b1a - Show all commits

View File

@@ -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()

View File

@@ -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,

View File

@@ -383,9 +383,11 @@ fun ChatScreen(
}
else -> {
AnimatedVisibility(visible = replyingTo != null) {
replyingTo?.let {
ReplyBox(it) { replyingTo = null }
}
}
ChatInput(
value = text,
onValueChange = { text = it },
@@ -423,7 +425,6 @@ fun ChatScreen(
}
}
)
AnimatedVisibility(
visible = selectedMessage != null,
enter = fadeIn(),