From 19833a1a03b3ca2c59c55ea54a42bd52deceeb59 Mon Sep 17 00:00:00 2001 From: Justin Caveda Date: Sun, 11 Jan 2026 16:07:40 -0600 Subject: [PATCH] Add scrim behind season tabs for readability (#657) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Adds a dark gradient scrim behind the season tabs on the TV Show Details screen to improve text readability against bright backdrop images. This follows the same pattern used in PlaybackOverlay.kt for the playback controls. The scrim uses two combined gradients: - Vertical: Dark at top (0.80α → 0.5α) fading to transparent at bottom - Horizontal: Fades in from transparent (left) to full opacity (right), starting at 15% screen width to avoid overlapping with the nav rail The gradients are composited using BlendMode.DstIn to create a smooth 2D fade effect. ### Related issues Fixes #547 ### Screenshots season_darkened_background ### AI/LLM usage AI used to draft PR description and documentation --- .../wholphin/ui/nav/ApplicationContent.kt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/nav/ApplicationContent.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/nav/ApplicationContent.kt index 14f34747..2ada8504 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/ui/nav/ApplicationContent.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/ui/nav/ApplicationContent.kt @@ -49,6 +49,10 @@ import dagger.hilt.android.lifecycle.HiltViewModel import javax.inject.Inject import kotlin.time.Duration.Companion.milliseconds +// Top scrim configuration for text readability (clock, season tabs) +private const val TOP_SCRIM_ALPHA = 0.55f +private const val TOP_SCRIM_END_FRACTION = 0.25f // Fraction of backdrop image height + @HiltViewModel class ApplicationContentViewModel @Inject @@ -73,6 +77,7 @@ fun ApplicationContent( navigationManager: NavigationManager, preferences: UserPreferences, modifier: Modifier = Modifier, + enableTopScrim: Boolean = true, viewModel: ApplicationContentViewModel = hiltViewModel(), ) { val backStack: MutableList = @@ -179,6 +184,20 @@ fun ApplicationContent( .alpha(.95f) .drawWithContent { drawContent() + // Subtle top scrim for system UI readability (clock, tabs) + if (enableTopScrim) { + drawRect( + brush = + Brush.verticalGradient( + colorStops = + arrayOf( + 0f to Color.Black.copy(alpha = TOP_SCRIM_ALPHA), + TOP_SCRIM_END_FRACTION to Color.Transparent, + ), + ), + blendMode = BlendMode.Multiply, + ) + } drawRect( brush = Brush.horizontalGradient(