use one 200ms overlay duration

This commit is contained in:
austinried
2026-10-04 00:29:54 +00:00
parent ca12ff49bc
commit 79b41c6a15
@@ -74,9 +74,8 @@ class RootViewModel(
} }
private const val NAVIGATION_DURATION_MS = 260 private const val NAVIGATION_DURATION_MS = 260
private const val NOW_PLAYING_DURATION_MS = 300 private const val OVERLAY_DURATION_MS = 200
private const val EXPAND_FADE = 0.1f private const val EXPAND_FADE = 0.1f
private const val SETTLE_DURATION_MS = 200
private object Routes { private object Routes {
const val LIBRARY = "library" const val LIBRARY = "library"
@@ -121,7 +120,7 @@ private fun MainNavigation() {
fun settleNowPlaying(open: Boolean) { fun settleNowPlaying(open: Boolean) {
val target = if (open) 1f else 0f val target = if (open) 1f else 0f
scope.launch { scope.launch {
animate(nowPlayingProgress, target, animationSpec = tween(SETTLE_DURATION_MS)) { value, _ -> animate(nowPlayingProgress, target, animationSpec = tween(OVERLAY_DURATION_MS)) { value, _ ->
nowPlayingProgress = value nowPlayingProgress = value
} }
} }
@@ -288,8 +287,8 @@ private fun MainNavigation() {
AnimatedVisibility( AnimatedVisibility(
visible = showingQueue, visible = showingQueue,
enter = slideInVertically(initialOffsetY = { it }) + fadeIn(tween(NOW_PLAYING_DURATION_MS)), enter = slideInVertically(initialOffsetY = { it }) + fadeIn(tween(OVERLAY_DURATION_MS)),
exit = slideOutVertically(targetOffsetY = { it }) + fadeOut(tween(NOW_PLAYING_DURATION_MS)), exit = slideOutVertically(targetOffsetY = { it }) + fadeOut(tween(OVERLAY_DURATION_MS)),
) { ) {
QueueRoute( QueueRoute(
onBack = { showingQueue = false }, onBack = { showingQueue = false },