commonMain.moe.tlaster.precompose.navigation.route.SceneRoute.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of precompose-jvm Show documentation
Show all versions of precompose-jvm Show documentation
A third-party Jetbrains Compose library with ViewModel, LiveData and Navigation support.
package moe.tlaster.precompose.navigation.route
import androidx.compose.animation.AnimatedContentScope
import androidx.compose.runtime.Composable
import moe.tlaster.precompose.navigation.BackStackEntry
import moe.tlaster.precompose.navigation.SwipeProperties
import moe.tlaster.precompose.navigation.transition.NavTransition
internal class SceneRoute(
override val route: String,
val deepLinks: List,
val navTransition: NavTransition?,
val swipeProperties: SwipeProperties?,
override val content: @Composable AnimatedContentScope.(BackStackEntry) -> Unit,
) : ComposeRoute, ComposeSceneRoute
@Deprecated(
message = """
Used as a backwards compatible for the old RouteBuilder APIs which do not expect the content to
be an extension function on AnimatedContentScope
""",
level = DeprecationLevel.WARNING,
)
internal fun sceneRouteWithoutAnimatedContent(
route: String,
deepLinks: List,
navTransition: NavTransition?,
swipeProperties: SwipeProperties?,
content: @Composable (BackStackEntry) -> Unit,
): SceneRoute {
return SceneRoute(
route,
deepLinks,
navTransition,
swipeProperties,
content = { entry -> content(entry) },
)
}