mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +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,
|
syncing = syncing,
|
||||||
onSync = onSync,
|
onSync = onSync,
|
||||||
onOpenSettings = onOpenSettings,
|
onOpenSettings = onOpenSettings,
|
||||||
|
artwork = artwork,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -639,6 +640,7 @@ private fun LibraryTabs(
|
|||||||
syncing: Boolean,
|
syncing: Boolean,
|
||||||
onSync: () -> Unit,
|
onSync: () -> Unit,
|
||||||
onOpenSettings: () -> Unit,
|
onOpenSettings: () -> Unit,
|
||||||
|
artwork: ArtworkColors?,
|
||||||
) {
|
) {
|
||||||
val iconFadeThreshold = 0.65f
|
val iconFadeThreshold = 0.65f
|
||||||
val indicatorStretch = 18.dp
|
val indicatorStretch = 18.dp
|
||||||
@@ -666,7 +668,7 @@ private fun LibraryTabs(
|
|||||||
.width(with(density) { (right - left + stretch * 2f).toDp() })
|
.width(with(density) { (right - left + stretch * 2f).toDp() })
|
||||||
.height(with(density) { current.height.toDp() })
|
.height(with(density) { current.height.toDp() })
|
||||||
.clip(RoundedCornerShape(8.dp))
|
.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 ->
|
LibraryTab.entries.forEachIndexed { index, tab ->
|
||||||
TabButton(
|
TabButton(
|
||||||
tab = tab,
|
tab = tab,
|
||||||
|
artwork = artwork,
|
||||||
progress =
|
progress =
|
||||||
((iconFadeThreshold - abs(position - index)) / iconFadeThreshold)
|
((iconFadeThreshold - abs(position - index)) / iconFadeThreshold)
|
||||||
.coerceIn(0f, 1f),
|
.coerceIn(0f, 1f),
|
||||||
@@ -717,11 +720,13 @@ private fun LibraryTabs(
|
|||||||
@Composable
|
@Composable
|
||||||
private fun TabButton(
|
private fun TabButton(
|
||||||
tab: LibraryTab,
|
tab: LibraryTab,
|
||||||
|
artwork: ArtworkColors?,
|
||||||
progress: Float,
|
progress: Float,
|
||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
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(
|
Box(
|
||||||
modifier =
|
modifier =
|
||||||
modifier
|
modifier
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ private const val DARKEN_END_SCREENS = 1.5f
|
|||||||
private const val DARKEN_KNEE = 0.2f
|
private const val DARKEN_KNEE = 0.2f
|
||||||
private const val PLAYER_SURFACE_SATURATION_FACTOR = 1.6f
|
private const val PLAYER_SURFACE_SATURATION_FACTOR = 1.6f
|
||||||
private const val LIBRARY_SURFACE_LIGHTNESS = 0.10f
|
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_FULL = 90f
|
||||||
private const val WARM_HUE_NONE = 150f
|
private const val WARM_HUE_NONE = 150f
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user