From 87241ba1d49c7a2670a9a934f7d2bfbe3c37704b Mon Sep 17 00:00:00 2001 From: Kyle Bolen Date: Tue, 28 Jul 2026 05:34:38 +0000 Subject: [PATCH] ImportScreen: shadow fades out over last 80px of scroll MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit shadowAlpha = (remaining / 80).coerceIn(0,1) — full strength when far from bottom, smoothly fades to zero over the last 80px. --- .../bolenpad/photophetch/ui/ImportScreen.kt | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/com/bolenpad/photophetch/ui/ImportScreen.kt b/src/main/kotlin/com/bolenpad/photophetch/ui/ImportScreen.kt index 4e664d9..d666f40 100644 --- a/src/main/kotlin/com/bolenpad/photophetch/ui/ImportScreen.kt +++ b/src/main/kotlin/com/bolenpad/photophetch/ui/ImportScreen.kt @@ -48,24 +48,32 @@ fun ImportScreen(state: AppState) { // ── Scrollable body with bottom shadow indicator ───────────────────── val scrollState = rememberScrollState() - val showShadow by remember { derivedStateOf { scrollState.value < scrollState.maxValue } } + // shadowAlpha: 1.0 when far from bottom, fades to 0.0 over the last 80px + val shadowAlpha by remember { + derivedStateOf { + val remaining = scrollState.maxValue - scrollState.value + (remaining / 80f).coerceIn(0f, 1f) + } + } Box( modifier = Modifier .weight(1f) - .then( - if (showShadow) Modifier.drawWithContent { - drawContent() - // Thin shadow strip along the bottom edge + .drawWithContent { + drawContent() + if (shadowAlpha > 0f) { drawRect( brush = Brush.verticalGradient( - colors = listOf(Color.Transparent, Color.Black.copy(alpha = 0.10f)), + colors = listOf( + Color.Transparent, + Color.Black.copy(alpha = 0.10f * shadowAlpha), + ), startY = size.height - 24.dp.toPx(), endY = size.height, ) ) - } else Modifier - ) + } + } ) { Column( modifier = Modifier