mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 23:21:59 +01:00
colour the selected tab from the artwork and raise the warm damping
This commit is contained in:
@@ -348,6 +348,7 @@ fun LibraryScreen(
|
||||
syncing = syncing,
|
||||
onSync = onSync,
|
||||
onOpenSettings = onOpenSettings,
|
||||
artwork = artwork,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -639,6 +640,7 @@ private fun LibraryTabs(
|
||||
syncing: Boolean,
|
||||
onSync: () -> Unit,
|
||||
onOpenSettings: () -> Unit,
|
||||
artwork: ArtworkColors?,
|
||||
) {
|
||||
val iconFadeThreshold = 0.65f
|
||||
val indicatorStretch = 18.dp
|
||||
@@ -666,7 +668,7 @@ private fun LibraryTabs(
|
||||
.width(with(density) { (right - left + stretch * 2f).toDp() })
|
||||
.height(with(density) { current.height.toDp() })
|
||||
.clip(RoundedCornerShape(8.dp))
|
||||
.background(MaterialTheme.colorScheme.onBackground),
|
||||
.background(artwork?.scheme?.primary ?: MaterialTheme.colorScheme.onBackground),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -678,6 +680,7 @@ private fun LibraryTabs(
|
||||
LibraryTab.entries.forEachIndexed { index, tab ->
|
||||
TabButton(
|
||||
tab = tab,
|
||||
artwork = artwork,
|
||||
progress =
|
||||
((iconFadeThreshold - abs(position - index)) / iconFadeThreshold)
|
||||
.coerceIn(0f, 1f),
|
||||
@@ -717,11 +720,13 @@ private fun LibraryTabs(
|
||||
@Composable
|
||||
private fun TabButton(
|
||||
tab: LibraryTab,
|
||||
artwork: ArtworkColors?,
|
||||
progress: Float,
|
||||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
val content = lerp(MaterialTheme.colorScheme.onBackground, MaterialTheme.colorScheme.background, progress)
|
||||
val selected = artwork?.scheme?.onPrimary ?: MaterialTheme.colorScheme.background
|
||||
val content = lerp(MaterialTheme.colorScheme.onBackground, selected, progress)
|
||||
Box(
|
||||
modifier =
|
||||
modifier
|
||||
|
||||
@@ -34,7 +34,7 @@ private const val DARKEN_END_SCREENS = 1.5f
|
||||
private const val DARKEN_KNEE = 0.2f
|
||||
private const val PLAYER_SURFACE_SATURATION_FACTOR = 1.6f
|
||||
private const val LIBRARY_SURFACE_LIGHTNESS = 0.10f
|
||||
private const val WARM_SURFACE_SATURATION_DAMPING = 0.2f
|
||||
private const val WARM_SURFACE_SATURATION_DAMPING = 0.4f
|
||||
private const val WARM_HUE_FULL = 90f
|
||||
private const val WARM_HUE_NONE = 150f
|
||||
|
||||
|
||||
Reference in New Issue
Block a user