mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 15:29:15 +01:00
use one 200ms overlay duration
This commit is contained in:
@@ -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 },
|
||||||
|
|||||||
Reference in New Issue
Block a user