mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +01:00
hold the active tab icon colour for the first part of a swipe
This commit is contained in:
@@ -642,7 +642,8 @@ private fun LibraryTabs(
|
|||||||
onOpenSettings: () -> Unit,
|
onOpenSettings: () -> Unit,
|
||||||
artwork: ArtworkColors?,
|
artwork: ArtworkColors?,
|
||||||
) {
|
) {
|
||||||
val iconFadeThreshold = 0.65f
|
val iconFadeStart = 0.25f
|
||||||
|
val iconFadeEnd = 0.65f
|
||||||
val indicatorStretch = 18.dp
|
val indicatorStretch = 18.dp
|
||||||
val density = LocalDensity.current
|
val density = LocalDensity.current
|
||||||
val bounds = remember { mutableStateMapOf<Int, Rect>() }
|
val bounds = remember { mutableStateMapOf<Int, Rect>() }
|
||||||
@@ -682,7 +683,7 @@ private fun LibraryTabs(
|
|||||||
tab = tab,
|
tab = tab,
|
||||||
artwork = artwork,
|
artwork = artwork,
|
||||||
progress =
|
progress =
|
||||||
((iconFadeThreshold - abs(position - index)) / iconFadeThreshold)
|
((iconFadeEnd - abs(position - index)) / (iconFadeEnd - iconFadeStart))
|
||||||
.coerceIn(0f, 1f),
|
.coerceIn(0f, 1f),
|
||||||
onClick = { onTabSelected(tab) },
|
onClick = { onTabSelected(tab) },
|
||||||
modifier =
|
modifier =
|
||||||
|
|||||||
Reference in New Issue
Block a user