diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/ChatMessageCompose.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/ChatMessageCompose.kt index a9e06c8823..a716ea9388 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/ChatMessageCompose.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/ChatMessageCompose.kt @@ -265,6 +265,12 @@ fun NormalChatNote( } else { null }, + timeRow = + if (!innerQuote && groupPosition.isLastOfGroup) { + { ChatTimeAgo(note) } + } else { + null + }, drawAuthorLine = { DrawAuthorInfo( note, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/layouts/ChatBubbleLayout.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/layouts/ChatBubbleLayout.kt index 5c0e47758f..7a7b47accf 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/layouts/ChatBubbleLayout.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/layouts/ChatBubbleLayout.kt @@ -27,6 +27,7 @@ import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.size @@ -87,6 +88,9 @@ fun ChatBubbleLayout( onAuthorClick: () -> Unit, actionMenu: @Composable (onDismiss: () -> Unit) -> Unit, reactionsRow: (@Composable () -> Unit)? = null, + // Small always-visible timestamp in the bubble's bottom-end corner; skipped + // while the tap-to-expand detail row (which includes the time) is open. + timeRow: (@Composable () -> Unit)? = null, detailRow: @Composable () -> Unit, drawAuthorLine: @Composable () -> Unit, inner: @Composable (MutableState) -> Unit, @@ -193,6 +197,10 @@ fun ChatBubbleLayout( if (showDetails.value) { detailRow() + } else if (timeRow != null) { + Box(modifier = Modifier.align(Alignment.End)) { + timeRow() + } } } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/layouts/ChatGroupPosition.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/layouts/ChatGroupPosition.kt index ac562eba28..9059d3142e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/layouts/ChatGroupPosition.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/layouts/ChatGroupPosition.kt @@ -56,6 +56,9 @@ enum class ChatGroupPosition { val isFirstOfGroup: Boolean get() = this == SINGLE || this == TOP + val isLastOfGroup: Boolean + get() = this == SINGLE || this == BOTTOM + val isConnectedAbove: Boolean get() = this == MIDDLE || this == BOTTOM }