From 904285bc1aefd4d63972130183dd1dfa0aefce2c Mon Sep 17 00:00:00 2001 From: Georgiy Strigun Date: Mon, 24 Oct 2022 13:11:41 +0300 Subject: [PATCH 1/2] Add parameterized start destination support --- .../lanars/compose_easy_route/navigation/EasyRouteNavHost.kt | 5 ++--- .../com/lanars/compose_easy_route/sample/MainActivity.kt | 2 +- .../compose_easy_route/sample/pages/second/SecondPage.kt | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/compose-easy-route/src/main/java/com/lanars/compose_easy_route/navigation/EasyRouteNavHost.kt b/compose-easy-route/src/main/java/com/lanars/compose_easy_route/navigation/EasyRouteNavHost.kt index eb63997..3f64ea4 100644 --- a/compose-easy-route/src/main/java/com/lanars/compose_easy_route/navigation/EasyRouteNavHost.kt +++ b/compose-easy-route/src/main/java/com/lanars/compose_easy_route/navigation/EasyRouteNavHost.kt @@ -11,7 +11,6 @@ import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable import androidx.navigation.compose.navigation import androidx.navigation.compose.rememberNavController -import com.lanars.compose_easy_route.core.model.NavDirection import com.lanars.compose_easy_route.navigation.options.NavigationOptions import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.launch @@ -20,7 +19,7 @@ import kotlinx.coroutines.launch fun EasyRouteNavHost( navigationManager: NavigationManager, navGraph: NavigationGraph, - startDirection: NavDirection, + startDestination: NavDestination, modifier: Modifier = Modifier ) { val navController = rememberNavController() @@ -88,7 +87,7 @@ fun EasyRouteNavHost( NavHost( navController = navController, - startDestination = startDirection.route, + startDestination = startDestination.fullRoute, modifier = modifier ) { buildGraphs(navGraph, navController) diff --git a/sample/src/main/java/com/lanars/compose_easy_route/sample/MainActivity.kt b/sample/src/main/java/com/lanars/compose_easy_route/sample/MainActivity.kt index c8e49aa..260c47d 100644 --- a/sample/src/main/java/com/lanars/compose_easy_route/sample/MainActivity.kt +++ b/sample/src/main/java/com/lanars/compose_easy_route/sample/MainActivity.kt @@ -30,7 +30,7 @@ class MainActivity : ComponentActivity() { EasyRouteNavHost( navigationManager = navigationManager, navGraph = NavGraphs.root, - startDirection = FirstPageDestination() + startDestination = FirstPageDestination ) } } diff --git a/sample/src/main/java/com/lanars/compose_easy_route/sample/pages/second/SecondPage.kt b/sample/src/main/java/com/lanars/compose_easy_route/sample/pages/second/SecondPage.kt index 49591a7..7f55fbe 100644 --- a/sample/src/main/java/com/lanars/compose_easy_route/sample/pages/second/SecondPage.kt +++ b/sample/src/main/java/com/lanars/compose_easy_route/sample/pages/second/SecondPage.kt @@ -60,7 +60,7 @@ fun SecondPage( EasyRouteNavHost( navigationManager = navigationManager, navGraph = NavGraphs.bottomNavigation, - startDirection = BooksScreenDestination() + startDestination = BooksScreenDestination ) } } From 6096fe2111f63c3ca0d8f881cb5c9d9e4a689755 Mon Sep 17 00:00:00 2001 From: Georgiy Strigun Date: Mon, 24 Oct 2022 13:12:56 +0300 Subject: [PATCH 2/2] Bump version 1.3.0 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index faf2a7a..5f8315b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,7 +14,7 @@ plugins { allprojects { group = "com.lanars" - version = "1.2.4" + version = "1.3.0" } subprojects {