From a72bac49fa10c243dbf08d79f4ced11dc3b78a5f Mon Sep 17 00:00:00 2001 From: Aleksandar Ilic Date: Mon, 13 May 2024 14:21:38 +0200 Subject: [PATCH] Set fadeIn/fadeOut transitions for media screen --- .../android/navigation/NavigationTransitions.kt | 6 ------ .../primal/android/navigation/PrimalAppNavigation.kt | 11 +++++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/src/main/kotlin/net/primal/android/navigation/NavigationTransitions.kt b/app/src/main/kotlin/net/primal/android/navigation/NavigationTransitions.kt index 2364732cf..da4d76b1a 100644 --- a/app/src/main/kotlin/net/primal/android/navigation/NavigationTransitions.kt +++ b/app/src/main/kotlin/net/primal/android/navigation/NavigationTransitions.kt @@ -4,18 +4,12 @@ import androidx.compose.animation.core.tween import androidx.compose.animation.scaleIn import androidx.compose.animation.scaleOut import androidx.compose.animation.slideInHorizontally -import androidx.compose.animation.slideInVertically import androidx.compose.animation.slideOutHorizontally -import androidx.compose.animation.slideOutVertically val primalSlideInHorizontallyFromEnd = slideInHorizontally(animationSpec = tween(), initialOffsetX = { it }) val primalSlideOutHorizontallyToEnd = slideOutHorizontally(animationSpec = tween(), targetOffsetX = { it }) -val primalSlideInVerticallyFromBottom = slideInVertically(initialOffsetY = { it }) - -val primalSlideOutVerticallyToBottom = slideOutVertically(targetOffsetY = { it }) - val primalScaleIn = scaleIn(animationSpec = tween(), initialScale = 0.9f) val primalScaleOut = scaleOut(animationSpec = tween(), targetScale = 0.9f) diff --git a/app/src/main/kotlin/net/primal/android/navigation/PrimalAppNavigation.kt b/app/src/main/kotlin/net/primal/android/navigation/PrimalAppNavigation.kt index 1477e701f..a8b6557de 100644 --- a/app/src/main/kotlin/net/primal/android/navigation/PrimalAppNavigation.kt +++ b/app/src/main/kotlin/net/primal/android/navigation/PrimalAppNavigation.kt @@ -1,6 +1,9 @@ package net.primal.android.navigation +import androidx.compose.animation.EnterTransition import androidx.compose.animation.core.tween +import androidx.compose.animation.fadeIn +import androidx.compose.animation.fadeOut import androidx.compose.animation.scaleOut import androidx.compose.animation.slideInHorizontally import androidx.compose.animation.slideOutHorizontally @@ -946,10 +949,10 @@ private fun NavGraphBuilder.media( ) = composable( route = route, arguments = arguments, - enterTransition = { primalSlideInVerticallyFromBottom }, - exitTransition = { primalSlideOutVerticallyToBottom }, - popEnterTransition = { primalScaleIn }, - popExitTransition = { primalSlideOutVerticallyToBottom }, + enterTransition = { fadeIn() }, + exitTransition = { fadeOut() }, + popEnterTransition = { EnterTransition.None }, + popExitTransition = { fadeOut() }, ) { navBackEntry -> val viewModel = hiltViewModel(navBackEntry) PrimalTheme(primalTheme = PrimalTheme.Sunset) {