From ee8ffcd03d4590b079f153ce2f4f39610199c06c Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 10 Jul 2025 11:08:39 -0400 Subject: [PATCH] Fixes some borders of preview cards --- .../amethyst/ui/note/types/LongForm.kt | 29 ++++--------------- .../vitorpamplona/amethyst/ui/theme/Shape.kt | 2 +- .../vitorpamplona/amethyst/ui/theme/Theme.kt | 2 +- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/LongForm.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/LongForm.kt index d029ba7b6..bbeded0da 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/LongForm.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/LongForm.kt @@ -20,7 +20,6 @@ */ package com.vitorpamplona.amethyst.ui.note.types -import androidx.compose.foundation.border import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth @@ -30,7 +29,6 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.remember 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.text.style.TextOverflow @@ -43,11 +41,8 @@ import com.vitorpamplona.amethyst.ui.note.elements.DefaultImageHeader import com.vitorpamplona.amethyst.ui.note.elements.DefaultImageHeaderBackground import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.stringRes -import com.vitorpamplona.amethyst.ui.theme.QuoteBorder -import com.vitorpamplona.amethyst.ui.theme.SimpleImageBorder -import com.vitorpamplona.amethyst.ui.theme.Size5dp import com.vitorpamplona.amethyst.ui.theme.StdVertSpacer -import com.vitorpamplona.amethyst.ui.theme.subtleBorder +import com.vitorpamplona.amethyst.ui.theme.replyModifier import com.vitorpamplona.quartz.nip23LongContent.LongTextNoteEvent @Composable @@ -74,34 +69,20 @@ fun LongFormHeader( noteEvent.summary()?.ifBlank { null } ?: noteEvent.content.take(200).ifBlank { null } } - Column( - modifier = - Modifier - .padding(top = Size5dp) - .clip(shape = QuoteBorder) - .border( - 1.dp, - MaterialTheme.colorScheme.subtleBorder, - QuoteBorder, - ), - ) { + Column(MaterialTheme.colorScheme.replyModifier) { image?.let { MyAsyncImage( imageUrl = it, - contentDescription = - stringRes( - R.string.preview_card_image_for, - it, - ), + contentDescription = stringRes(R.string.preview_card_image_for, it), contentScale = ContentScale.FillWidth, - mainImageModifier = SimpleImageBorder, + mainImageModifier = Modifier.fillMaxWidth(), loadedImageModifier = Modifier, accountViewModel = accountViewModel, onLoadingBackground = { DefaultImageHeaderBackground(note, accountViewModel) }, onError = { DefaultImageHeader(note, accountViewModel) }, ) } ?: run { - DefaultImageHeader(note, accountViewModel, SimpleImageBorder) + DefaultImageHeader(note, accountViewModel, Modifier.fillMaxWidth()) } title?.let { Text( diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt index 317d97ff7..b21b0bc59 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt @@ -336,8 +336,8 @@ val LargeRelayIconModifier = val FollowSetImageModifier = Modifier .fillMaxWidth() - .aspectRatio(ratio = 21f / 9f) .clip(QuoteBorder) + .aspectRatio(ratio = 21f / 9f) val SimpleImageBorder = Modifier.fillMaxSize().clip(QuoteBorder) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt index 39e062d22..2258053c4 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt @@ -167,7 +167,7 @@ val DarkReplyBorderModifier = val LightReplyBorderModifier = Modifier - .padding(top = 2.dp, bottom = 0.dp, start = 0.dp, end = 0.dp) + .padding(top = 5.dp) .fillMaxWidth() .clip(shape = QuoteBorder) .border(1.dp, LightSubtleBorder, QuoteBorder)