From 5f2b227685cd5a236af228c7ae29d4bc15efb124 Mon Sep 17 00:00:00 2001 From: Nikita Bulavin Date: Wed, 20 Nov 2024 18:52:08 +0300 Subject: [PATCH] Rename `SettingsBaseRoute` --- .../feature/settings/navigation/SettingsNavigation.kt | 10 +++++----- .../ru/resodostudios/cashsense/navigation/CsNavHost.kt | 4 ++-- .../cashsense/navigation/TopLevelDestination.kt | 4 ++-- .../kotlin/ru/resodostudios/cashsense/ui/CsAppState.kt | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/feature/settings/src/main/kotlin/ru/resodostudios/cashsense/feature/settings/navigation/SettingsNavigation.kt b/feature/settings/src/main/kotlin/ru/resodostudios/cashsense/feature/settings/navigation/SettingsNavigation.kt index 16cd44344..881faea73 100644 --- a/feature/settings/src/main/kotlin/ru/resodostudios/cashsense/feature/settings/navigation/SettingsNavigation.kt +++ b/feature/settings/src/main/kotlin/ru/resodostudios/cashsense/feature/settings/navigation/SettingsNavigation.kt @@ -9,19 +9,19 @@ import kotlinx.serialization.Serializable import ru.resodostudios.cashsense.feature.settings.SettingsScreen @Serializable -data object SettingsGraph +data object SettingsBaseRoute @Serializable data object SettingsRoute -fun NavController.navigateToSettingsGraph(navOptions: NavOptions? = null) = - navigate(route = SettingsGraph, navOptions) +fun NavController.navigateToSettings(navOptions: NavOptions? = null) = + navigate(route = SettingsRoute, navOptions) -fun NavGraphBuilder.settingsGraph( +fun NavGraphBuilder.settingsSection( onLicensesClick: () -> Unit, nestedGraphs: NavGraphBuilder.() -> Unit, ) { - navigation( + navigation( startDestination = SettingsRoute, ) { composable { diff --git a/mobile/src/main/kotlin/ru/resodostudios/cashsense/navigation/CsNavHost.kt b/mobile/src/main/kotlin/ru/resodostudios/cashsense/navigation/CsNavHost.kt index 76fffd9ef..0fc9eabb3 100644 --- a/mobile/src/main/kotlin/ru/resodostudios/cashsense/navigation/CsNavHost.kt +++ b/mobile/src/main/kotlin/ru/resodostudios/cashsense/navigation/CsNavHost.kt @@ -10,7 +10,7 @@ import androidx.navigation.compose.NavHost import ru.resodostudios.cashsense.feature.category.list.navigation.categoriesScreen import ru.resodostudios.cashsense.feature.settings.navigation.licensesScreen import ru.resodostudios.cashsense.feature.settings.navigation.navigateToLicenses -import ru.resodostudios.cashsense.feature.settings.navigation.settingsGraph +import ru.resodostudios.cashsense.feature.settings.navigation.settingsSection import ru.resodostudios.cashsense.feature.subscription.list.navigation.subscriptionsScreen import ru.resodostudios.cashsense.feature.transfer.navigation.navigateToTransfer import ru.resodostudios.cashsense.feature.transfer.navigation.transferDialog @@ -48,7 +48,7 @@ fun CsNavHost( ) categoriesScreen(onShowSnackbar) subscriptionsScreen(onShowSnackbar) - settingsGraph( + settingsSection( onLicensesClick = navController::navigateToLicenses, nestedGraphs = { licensesScreen(navController::navigateUp) }, ) diff --git a/mobile/src/main/kotlin/ru/resodostudios/cashsense/navigation/TopLevelDestination.kt b/mobile/src/main/kotlin/ru/resodostudios/cashsense/navigation/TopLevelDestination.kt index 92245e52b..4092283e6 100644 --- a/mobile/src/main/kotlin/ru/resodostudios/cashsense/navigation/TopLevelDestination.kt +++ b/mobile/src/main/kotlin/ru/resodostudios/cashsense/navigation/TopLevelDestination.kt @@ -6,7 +6,7 @@ import ru.resodostudios.cashsense.R import ru.resodostudios.cashsense.core.designsystem.icon.CsIcons import ru.resodostudios.cashsense.feature.category.list.navigation.CategoriesRoute import ru.resodostudios.cashsense.feature.home.navigation.HomeRoute -import ru.resodostudios.cashsense.feature.settings.navigation.SettingsGraph +import ru.resodostudios.cashsense.feature.settings.navigation.SettingsBaseRoute import ru.resodostudios.cashsense.feature.settings.navigation.SettingsRoute import ru.resodostudios.cashsense.feature.subscription.list.navigation.SubscriptionsRoute import ru.resodostudios.cashsense.ui.home2pane.HomeListDetailRoute @@ -73,6 +73,6 @@ enum class TopLevelDestination( fabIcon = null, fabTitle = null, route = SettingsRoute::class, - baseRoute = SettingsGraph::class, + baseRoute = SettingsBaseRoute::class, ) } \ No newline at end of file diff --git a/mobile/src/main/kotlin/ru/resodostudios/cashsense/ui/CsAppState.kt b/mobile/src/main/kotlin/ru/resodostudios/cashsense/ui/CsAppState.kt index 8339373b4..fd3c7df83 100644 --- a/mobile/src/main/kotlin/ru/resodostudios/cashsense/ui/CsAppState.kt +++ b/mobile/src/main/kotlin/ru/resodostudios/cashsense/ui/CsAppState.kt @@ -22,7 +22,7 @@ import ru.resodostudios.cashsense.feature.category.list.navigation.navigateToCat import ru.resodostudios.cashsense.feature.home.navigation.HomeRoute import ru.resodostudios.cashsense.feature.home.navigation.navigateToHome import ru.resodostudios.cashsense.feature.settings.navigation.SettingsRoute -import ru.resodostudios.cashsense.feature.settings.navigation.navigateToSettingsGraph +import ru.resodostudios.cashsense.feature.settings.navigation.navigateToSettings import ru.resodostudios.cashsense.feature.subscription.list.navigation.SubscriptionsRoute import ru.resodostudios.cashsense.feature.subscription.list.navigation.navigateToSubscriptions import ru.resodostudios.cashsense.feature.transfer.navigation.TransferRoute @@ -99,7 +99,7 @@ class CsAppState( HOME -> navController.navigateToHome(navOptions = topLevelNavOptions) CATEGORIES -> navController.navigateToCategories(topLevelNavOptions) SUBSCRIPTIONS -> navController.navigateToSubscriptions(topLevelNavOptions) - SETTINGS -> navController.navigateToSettingsGraph(topLevelNavOptions) + SETTINGS -> navController.navigateToSettings(topLevelNavOptions) } } }