From 48169bafb959a49657e1c63215441c9b95c749b2 Mon Sep 17 00:00:00 2001 From: Brian Yencho Date: Wed, 27 Dec 2023 09:05:37 -0600 Subject: [PATCH] Use consistent naming when adding a single screen to a graph (#433) --- .../bitwarden/ui/auth/feature/auth/AuthNavigation.kt | 12 ++++++------ .../feature/createaccount/CreateAccountNavigation.kt | 2 +- .../ui/auth/feature/landing/LandingNavigation.kt | 2 +- .../ui/auth/feature/login/LoginNavigation.kt | 2 +- .../feature/vaultunlock/VaultUnlockNavigation.kt | 2 +- .../ui/platform/feature/rootnav/RootNavScreen.kt | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/auth/AuthNavigation.kt b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/auth/AuthNavigation.kt index e101bfe4d..45b294b04 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/auth/AuthNavigation.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/auth/AuthNavigation.kt @@ -6,13 +6,13 @@ import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.navOptions import androidx.navigation.navigation -import com.x8bit.bitwarden.ui.auth.feature.createaccount.createAccountDestinations +import com.x8bit.bitwarden.ui.auth.feature.createaccount.createAccountDestination import com.x8bit.bitwarden.ui.auth.feature.createaccount.navigateToCreateAccount import com.x8bit.bitwarden.ui.auth.feature.environment.environmentDestination import com.x8bit.bitwarden.ui.auth.feature.environment.navigateToEnvironment import com.x8bit.bitwarden.ui.auth.feature.landing.LANDING_ROUTE -import com.x8bit.bitwarden.ui.auth.feature.landing.landingDestinations -import com.x8bit.bitwarden.ui.auth.feature.login.loginDestinations +import com.x8bit.bitwarden.ui.auth.feature.landing.landingDestination +import com.x8bit.bitwarden.ui.auth.feature.login.loginDestination import com.x8bit.bitwarden.ui.auth.feature.login.navigateToLogin const val AUTH_GRAPH_ROUTE: String = "auth_graph" @@ -25,7 +25,7 @@ fun NavGraphBuilder.authGraph(navController: NavHostController) { startDestination = LANDING_ROUTE, route = AUTH_GRAPH_ROUTE, ) { - createAccountDestinations( + createAccountDestination( onNavigateBack = { navController.popBackStack() }, onNavigateToLogin = { emailAddress, captchaToken -> navController.navigateToLogin( @@ -37,7 +37,7 @@ fun NavGraphBuilder.authGraph(navController: NavHostController) { ) }, ) - landingDestinations( + landingDestination( onNavigateToCreateAccount = { navController.navigateToCreateAccount() }, onNavigateToLogin = { emailAddress -> navController.navigateToLogin( @@ -49,7 +49,7 @@ fun NavGraphBuilder.authGraph(navController: NavHostController) { navController.navigateToEnvironment() }, ) - loginDestinations( + loginDestination( onNavigateBack = { navController.popBackStack() }, ) environmentDestination( diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/createaccount/CreateAccountNavigation.kt b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/createaccount/CreateAccountNavigation.kt index 5d40e0aba..7b51eb93b 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/createaccount/CreateAccountNavigation.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/createaccount/CreateAccountNavigation.kt @@ -18,7 +18,7 @@ fun NavController.navigateToCreateAccount(navOptions: NavOptions? = null) { /** * Add the create account screen to the nav graph. */ -fun NavGraphBuilder.createAccountDestinations( +fun NavGraphBuilder.createAccountDestination( onNavigateBack: () -> Unit, onNavigateToLogin: (emailAddress: String, captchaToken: String) -> Unit, ) { diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/landing/LandingNavigation.kt b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/landing/LandingNavigation.kt index d7ff0fdea..c02ebfb5a 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/landing/LandingNavigation.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/landing/LandingNavigation.kt @@ -18,7 +18,7 @@ fun NavController.navigateToLanding(navOptions: NavOptions? = null) { /** * Add the Landing screen to the nav graph. */ -fun NavGraphBuilder.landingDestinations( +fun NavGraphBuilder.landingDestination( onNavigateToCreateAccount: () -> Unit, onNavigateToLogin: (emailAddress: String) -> Unit, onNavigateToEnvironment: () -> Unit, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/login/LoginNavigation.kt b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/login/LoginNavigation.kt index b39da9e90..6612fe59a 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/login/LoginNavigation.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/login/LoginNavigation.kt @@ -40,7 +40,7 @@ fun NavController.navigateToLogin( /** * Add the Login screen to the nav graph. */ -fun NavGraphBuilder.loginDestinations( +fun NavGraphBuilder.loginDestination( onNavigateBack: () -> Unit, ) { composable( diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/vaultunlock/VaultUnlockNavigation.kt b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/vaultunlock/VaultUnlockNavigation.kt index d548d5c0c..22a5e0bd7 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/vaultunlock/VaultUnlockNavigation.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/vaultunlock/VaultUnlockNavigation.kt @@ -20,7 +20,7 @@ fun NavController.navigateToVaultUnlock( /** * Add the Vault Unlock screen to the nav graph. */ -fun NavGraphBuilder.vaultUnlockDestinations() { +fun NavGraphBuilder.vaultUnlockDestination() { composable( route = VAULT_UNLOCK_ROUTE, enterTransition = TransitionProviders.Enter.slideUp, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavScreen.kt index d1bf7411c..c48f3819a 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavScreen.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavScreen.kt @@ -15,7 +15,7 @@ import com.x8bit.bitwarden.ui.auth.feature.auth.authGraph import com.x8bit.bitwarden.ui.auth.feature.auth.navigateToAuthGraph import com.x8bit.bitwarden.ui.auth.feature.vaultunlock.VAULT_UNLOCK_ROUTE import com.x8bit.bitwarden.ui.auth.feature.vaultunlock.navigateToVaultUnlock -import com.x8bit.bitwarden.ui.auth.feature.vaultunlock.vaultUnlockDestinations +import com.x8bit.bitwarden.ui.auth.feature.vaultunlock.vaultUnlockDestination import com.x8bit.bitwarden.ui.platform.feature.splash.SPLASH_ROUTE import com.x8bit.bitwarden.ui.platform.feature.splash.navigateToSplash import com.x8bit.bitwarden.ui.platform.feature.splash.splashDestination @@ -50,7 +50,7 @@ fun RootNavScreen( ) { splashDestination() authGraph(navController) - vaultUnlockDestinations() + vaultUnlockDestination() vaultUnlockedGraph(navController) }