diff --git a/shared/ui/src/androidMain/kotlin/com/androidmakers/ui/MainLayout.android.kt b/shared/ui/src/androidMain/kotlin/com/androidmakers/ui/MainLayout.android.kt new file mode 100644 index 00000000..17939d74 --- /dev/null +++ b/shared/ui/src/androidMain/kotlin/com/androidmakers/ui/MainLayout.android.kt @@ -0,0 +1,5 @@ +package com.androidmakers.ui + +import moe.tlaster.precompose.navigation.transition.NavTransition + +actual val defaultTransition: NavTransition = NavTransition() diff --git a/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/MainLayout.kt b/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/MainLayout.kt index 653f605a..e78b8aa4 100644 --- a/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/MainLayout.kt +++ b/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/MainLayout.kt @@ -17,6 +17,7 @@ import moe.tlaster.precompose.navigation.Navigator import moe.tlaster.precompose.navigation.SwipeProperties import moe.tlaster.precompose.navigation.path import moe.tlaster.precompose.navigation.rememberNavigator +import moe.tlaster.precompose.navigation.transition.NavTransition import org.koin.core.parameter.parametersOf /** @@ -80,7 +81,8 @@ private fun MainNavHost( scene( route = "${MainNavigationRoute.SESSION_DETAIL.name}/{sessionId}", swipeProperties = SwipeProperties(), - deepLinks = listOf("https://androidmakers.fr/session/{sessionId}") + deepLinks = listOf("https://androidmakers.fr/session/{sessionId}"), + navTransition = defaultTransition ) { val sessionId = it.path("sessionId") @@ -96,6 +98,7 @@ private fun MainNavHost( route = "${MainNavigationRoute.SPEAKER_DETAIL.name}/{speakerId}", deepLinks = listOf("https://androidmakers.fr/speaker/{speakerId}"), swipeProperties = SwipeProperties(), + navTransition = defaultTransition ) { backstackEntry -> val speakerId = backstackEntry.path("speakerId") @@ -109,6 +112,8 @@ private fun MainNavHost( } } +expect val defaultTransition: NavTransition + expect class PlatformContext val LocalPlatformContext = staticCompositionLocalOf { null } diff --git a/shared/ui/src/iosMain/kotlin/com/androidmakers/ui/MainLayout.ios.kt b/shared/ui/src/iosMain/kotlin/com/androidmakers/ui/MainLayout.ios.kt new file mode 100644 index 00000000..e2aea4b1 --- /dev/null +++ b/shared/ui/src/iosMain/kotlin/com/androidmakers/ui/MainLayout.ios.kt @@ -0,0 +1,13 @@ +package com.androidmakers.ui + +import androidx.compose.animation.slideInHorizontally +import androidx.compose.animation.slideOutHorizontally +import moe.tlaster.precompose.navigation.transition.NavTransition + +actual val defaultTransition: NavTransition = NavTransition( + createTransition = slideInHorizontally { it }, + pauseTransition = slideOutHorizontally { -it / 4 }, + destroyTransition = slideOutHorizontally { it }, + resumeTransition = slideInHorizontally { -it / 4 }, + exitTargetContentZIndex = 1f +)