From d672f15977e269cfbde60186a50cd66716405a01 Mon Sep 17 00:00:00 2001 From: Antoine Robiez Date: Tue, 16 Apr 2024 13:27:09 +0200 Subject: [PATCH] Use the default on Android too --- .../com/androidmakers/ui/MainLayout.android.kt | 5 +++++ .../kotlin/com/androidmakers/ui/MainLayout.kt | 10 +--------- .../kotlin/com/androidmakers/ui/MainLayout.ios.kt | 13 +++++++++++++ 3 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 shared/ui/src/androidMain/kotlin/com/androidmakers/ui/MainLayout.android.kt create mode 100644 shared/ui/src/iosMain/kotlin/com/androidmakers/ui/MainLayout.ios.kt 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 0a778f76..e78b8aa4 100644 --- a/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/MainLayout.kt +++ b/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/MainLayout.kt @@ -1,7 +1,5 @@ package com.androidmakers.ui -import androidx.compose.animation.slideInHorizontally -import androidx.compose.animation.slideOutHorizontally import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.staticCompositionLocalOf @@ -114,13 +112,7 @@ private fun MainNavHost( } } -private val defaultTransition = NavTransition( - createTransition = slideInHorizontally { it }, - pauseTransition = slideOutHorizontally { -it / 4 }, - destroyTransition = slideOutHorizontally { it }, - resumeTransition = slideInHorizontally { -it / 4 }, - exitTargetContentZIndex = 1f -) +expect val defaultTransition: NavTransition expect class PlatformContext 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 +)