From f598627255107219e60dfc9680149e9a99cec91c Mon Sep 17 00:00:00 2001 From: M3DZIK Date: Mon, 18 Mar 2024 22:13:09 +0100 Subject: [PATCH] Speedup navigation animations --- .../java/dev/medzik/librepass/android/ui/Navigation.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/dev/medzik/librepass/android/ui/Navigation.kt b/app/src/main/java/dev/medzik/librepass/android/ui/Navigation.kt index 4cd9bc2c..d1579b3d 100644 --- a/app/src/main/java/dev/medzik/librepass/android/ui/Navigation.kt +++ b/app/src/main/java/dev/medzik/librepass/android/ui/Navigation.kt @@ -324,6 +324,8 @@ fun LibrePassNavigation(viewModel: LibrePassViewModel = hiltViewModel()) { return Screen.Vault.getRoute() } + val transmissionDurationMills = 400 + NavHost( navController, startDestination = remember { getStartRoute() }, @@ -335,25 +337,25 @@ fun LibrePassNavigation(viewModel: LibrePassViewModel = hiltViewModel()) { enterTransition = { slideIntoContainer( AnimatedContentTransitionScope.SlideDirection.Left, - animationSpec = tween(500) + animationSpec = tween(transmissionDurationMills) ) }, exitTransition = { slideOutOfContainer( AnimatedContentTransitionScope.SlideDirection.Left, - animationSpec = tween(500) + animationSpec = tween(transmissionDurationMills) ) }, popEnterTransition = { slideIntoContainer( AnimatedContentTransitionScope.SlideDirection.Right, - animationSpec = tween(500) + animationSpec = tween(transmissionDurationMills) ) }, popExitTransition = { slideOutOfContainer( AnimatedContentTransitionScope.SlideDirection.Right, - animationSpec = tween(500) + animationSpec = tween(transmissionDurationMills) ) } ) {