Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Speedup navigation animations
Browse files Browse the repository at this point in the history
  • Loading branch information
M3DZIK committed Mar 18, 2024
1 parent a722a6b commit f598627
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/src/main/java/dev/medzik/librepass/android/ui/Navigation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ fun LibrePassNavigation(viewModel: LibrePassViewModel = hiltViewModel()) {
return Screen.Vault.getRoute()
}

val transmissionDurationMills = 400

NavHost(
navController,
startDestination = remember { getStartRoute() },
Expand All @@ -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)
)
}
) {
Expand Down

0 comments on commit f598627

Please sign in to comment.