mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 15:11:58 +01:00
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:
@@ -172,7 +172,7 @@ fun ArtistDetailScreen(
|
||||
if (index <= 0) {
|
||||
offset
|
||||
} 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)) {
|
||||
val screenHeightPx = with(density) { maxHeight.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(
|
||||
colors = effectiveArtwork,
|
||||
scrollPx = { scrollPx - imageHeightPx },
|
||||
scrollPx = { gradientScrollPx },
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
)
|
||||
LazyVerticalGrid(
|
||||
|
||||
Reference in New Issue
Block a user