mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +01:00
keep the artist bar transparent when it does not scroll
This commit is contained in:
@@ -103,23 +103,10 @@ fun ArtistDetailScreen(
|
|||||||
val fadeEndPx = with(density) { (imageTitleTop + lineHeight / 2 - barHeight).toPx() }
|
val fadeEndPx = with(density) { (imageTitleTop + lineHeight / 2 - barHeight).toPx() }
|
||||||
val barFraction by remember(fadeStartPx, fadeEndPx) {
|
val barFraction by remember(fadeStartPx, fadeEndPx) {
|
||||||
derivedStateOf {
|
derivedStateOf {
|
||||||
when {
|
if (listState.firstVisibleItemIndex > 0) {
|
||||||
listState.layoutInfo.visibleItemsInfo.isEmpty() -> {
|
1f
|
||||||
0f
|
} else {
|
||||||
}
|
((listState.firstVisibleItemScrollOffset - fadeStartPx) / (fadeEndPx - fadeStartPx)).coerceIn(0f, 1f)
|
||||||
|
|
||||||
!listState.canScrollForward -> {
|
|
||||||
1f
|
|
||||||
}
|
|
||||||
|
|
||||||
listState.firstVisibleItemIndex > 0 -> {
|
|
||||||
1f
|
|
||||||
}
|
|
||||||
|
|
||||||
else -> {
|
|
||||||
((listState.firstVisibleItemScrollOffset - fadeStartPx) / (fadeEndPx - fadeStartPx))
|
|
||||||
.coerceIn(0f, 1f)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user