From 356b105b986e83863a6f3ffed39e338596be3cfa Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Thu, 22 Aug 2024 22:26:13 +1000 Subject: [PATCH] Clipping content --- .../securesms/conversation/v2/MessageDetailActivity.kt | 7 ++++++- .../main/java/org/thoughtcrime/securesms/ui/Components.kt | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailActivity.kt index 764161d863..b02fefc5e7 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailActivity.kt @@ -30,6 +30,7 @@ import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -37,6 +38,7 @@ import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource @@ -284,7 +286,10 @@ private fun CarouselPager( attachments: List, onClick: (Int) -> Unit ) { - Cell { + Cell( + modifier = Modifier + .clip(MaterialTheme.shapes.small) + ) { HorizontalPager(state = pagerState) { i -> GlideImage( contentScale = ContentScale.Crop, diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/Components.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/Components.kt index f68f3ba198..81d8855ac8 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/Components.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/Components.kt @@ -258,12 +258,13 @@ fun PrewviewItemButton() { @Composable fun Cell( + modifier: Modifier = Modifier, padding: PaddingValues = PaddingValues(all = 0.dp), margin: PaddingValues = PaddingValues(all = 0.dp), content: @Composable () -> Unit ) { Box( - modifier = Modifier + modifier = modifier .padding(margin) .background( color = LocalColors.current.backgroundSecondary,