Fix scheduled-post card edges around the rounded corners

This commit is contained in:
davotoula
2026-05-07 21:23:55 +02:00
parent 1c4159f3b0
commit d9f1237ff3
2 changed files with 5 additions and 3 deletions
@@ -166,7 +166,7 @@ fun ConfirmDeleteBackground(
if (!settled) { if (!settled) {
Color(0xFFFF1744) Color(0xFFFF1744)
} else { } else {
MaterialTheme.colorScheme.surfaceVariant Color.Transparent
}, },
label = "ConfirmDeleteBackground", label = "ConfirmDeleteBackground",
) )
@@ -71,7 +71,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.drawBehind import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Brush
@@ -267,7 +267,8 @@ private fun Modifier.urgentEdge(enabled: Boolean): Modifier {
remember(gradientStart, gradientEnd) { remember(gradientStart, gradientEnd) {
Brush.verticalGradient(listOf(gradientStart, gradientEnd)) Brush.verticalGradient(listOf(gradientStart, gradientEnd))
} }
return this.drawBehind { return this.drawWithContent {
drawContent()
drawRect( drawRect(
brush = brush, brush = brush,
topLeft = Offset(0f, 8.dp.toPx()), topLeft = Offset(0f, 8.dp.toPx()),
@@ -318,6 +319,7 @@ private fun ScheduledPostCardCollapsed(
modifier = modifier =
Modifier Modifier
.fillMaxWidth() .fillMaxWidth()
.clip(RoundedCornerShape(14.dp))
.urgentEdge(!isFailed && post.publishAtSec - nowSec in 1..URGENT_THRESHOLD_SEC), .urgentEdge(!isFailed && post.publishAtSec - nowSec in 1..URGENT_THRESHOLD_SEC),
colors = CardDefaults.cardColors(containerColor = containerColor), colors = CardDefaults.cardColors(containerColor = containerColor),
border = BorderStroke(1.dp, borderColor), border = BorderStroke(1.dp, borderColor),