address review: share one scroll origin for the artist bar and gradient

heroBarColor was given the raw content scroll while HeroGradient used the image-bottom
anchor, so an opaque bar did not match the background it covered. Both now use
scrollPx - imageHeightPx. Also add the first row gap the scroll estimate was missing.
This commit is contained in:
austinried
2026-10-04 00:29:59 +00:00
parent 63279dec50
commit 8d8c8be2a8
@@ -172,7 +172,7 @@ fun ArtistDetailScreen(
if (index <= 0) { if (index <= 0) {
offset offset
} else { } else {
imageHeightPx + (albumHeightPx + albumRowGapPx) * ((index - 1) / 2) + offset imageHeightPx + albumRowGapPx + (albumHeightPx + albumRowGapPx) * ((index - 1) / 2) + offset
} }
} }
} }
@@ -195,10 +195,11 @@ fun ArtistDetailScreen(
BoxWithConstraints(modifier.fillMaxSize().background(Color.Black)) { BoxWithConstraints(modifier.fillMaxSize().background(Color.Black)) {
val screenHeightPx = with(density) { maxHeight.toPx() } val screenHeightPx = with(density) { maxHeight.toPx() }
val barHeightPx = with(density) { barHeight.toPx() } val barHeightPx = with(density) { barHeight.toPx() }
val barColor = heroBarColor(effectiveArtwork, scrollPx, barHeightPx, screenHeightPx) val gradientScrollPx = scrollPx - imageHeightPx
val barColor = heroBarColor(effectiveArtwork, gradientScrollPx, barHeightPx, screenHeightPx)
HeroGradient( HeroGradient(
colors = effectiveArtwork, colors = effectiveArtwork,
scrollPx = { scrollPx - imageHeightPx }, scrollPx = { gradientScrollPx },
modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize(),
) )
LazyVerticalGrid( LazyVerticalGrid(