All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.moe.tlaster.precompose.navigation.route.SceneRoute.kt Maven / Gradle / Ivy

Go to download

A third-party Jetbrains Compose library with ViewModel, LiveData and Navigation support.

There is a newer version: 1.7.0-alpha03
Show newest version
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) },
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy