From 623823dbdca802f557756b9ef21c1d487e2710eb Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 20 Nov 2023 16:36:45 +0100 Subject: [PATCH 1/2] Fix navigating back to the welcome screen --- .../k9mail/feature/preview/navigation/FeatureNavHost.kt | 8 +++----- .../feature/launcher/navigation/FeatureLauncherNavHost.kt | 4 +--- .../onboarding/main/navigation/OnboardingNavHost.kt | 3 +-- .../onboarding/main/navigation/OnboardingNavigation.kt | 2 -- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/app-feature-preview/src/main/java/app/k9mail/feature/preview/navigation/FeatureNavHost.kt b/app-feature-preview/src/main/java/app/k9mail/feature/preview/navigation/FeatureNavHost.kt index 20e0e70181b..00fceba5c72 100644 --- a/app-feature-preview/src/main/java/app/k9mail/feature/preview/navigation/FeatureNavHost.kt +++ b/app-feature-preview/src/main/java/app/k9mail/feature/preview/navigation/FeatureNavHost.kt @@ -24,11 +24,9 @@ fun FeatureNavHost( ) { onboardingRoute( onImport = { /* TODO */ }, - onBack = navController::popBackStack, - onFinish = { accountUuid -> - navController.navigateToAccountEditIncomingServerSettings(accountUuid) - }, - ) + ) { accountUuid -> + navController.navigateToAccountEditIncomingServerSettings(accountUuid) + } accountSetupRoute( onBack = navController::popBackStack, onFinish = { accountUuid -> diff --git a/feature/launcher/src/main/kotlin/app/k9mail/feature/launcher/navigation/FeatureLauncherNavHost.kt b/feature/launcher/src/main/kotlin/app/k9mail/feature/launcher/navigation/FeatureLauncherNavHost.kt index 0ca3213dbe3..1e4d2637d59 100644 --- a/feature/launcher/src/main/kotlin/app/k9mail/feature/launcher/navigation/FeatureLauncherNavHost.kt +++ b/feature/launcher/src/main/kotlin/app/k9mail/feature/launcher/navigation/FeatureLauncherNavHost.kt @@ -30,9 +30,7 @@ fun FeatureLauncherNavHost( ) { onboardingRoute( onImport = { importSettingsLauncher.launch() }, - onBack = onBack, - onFinish = { accountUuid -> accountSetupFinishedLauncher.launch(accountUuid) }, - ) + ) { accountUuid -> accountSetupFinishedLauncher.launch(accountUuid) } accountSetupRoute( onBack = onBack, onFinish = { accountSetupFinishedLauncher.launch(it) }, diff --git a/feature/onboarding/main/src/main/kotlin/app/k9mail/feature/onboarding/main/navigation/OnboardingNavHost.kt b/feature/onboarding/main/src/main/kotlin/app/k9mail/feature/onboarding/main/navigation/OnboardingNavHost.kt index a2d82a9a5e2..5f955fe2eb0 100644 --- a/feature/onboarding/main/src/main/kotlin/app/k9mail/feature/onboarding/main/navigation/OnboardingNavHost.kt +++ b/feature/onboarding/main/src/main/kotlin/app/k9mail/feature/onboarding/main/navigation/OnboardingNavHost.kt @@ -30,7 +30,6 @@ private fun NavController.navigateToPermissions() { @Composable fun OnboardingNavHost( onImport: () -> Unit, - onBack: () -> Unit, onFinish: (String) -> Unit, hasRuntimePermissions: HasRuntimePermissions = koinInject(), ) { @@ -50,7 +49,7 @@ fun OnboardingNavHost( composable(route = NESTED_NAVIGATION_ROUTE_ACCOUNT_SETUP) { AccountSetupNavHost( - onBack = onBack, + onBack = { navController.popBackStack() }, onFinish = { createdAccountUuid: String -> accountUuid = createdAccountUuid if (hasRuntimePermissions()) { diff --git a/feature/onboarding/main/src/main/kotlin/app/k9mail/feature/onboarding/main/navigation/OnboardingNavigation.kt b/feature/onboarding/main/src/main/kotlin/app/k9mail/feature/onboarding/main/navigation/OnboardingNavigation.kt index 16cd0b3e78b..b87edd2f43c 100644 --- a/feature/onboarding/main/src/main/kotlin/app/k9mail/feature/onboarding/main/navigation/OnboardingNavigation.kt +++ b/feature/onboarding/main/src/main/kotlin/app/k9mail/feature/onboarding/main/navigation/OnboardingNavigation.kt @@ -15,13 +15,11 @@ fun NavController.navigateToOnboarding( fun NavGraphBuilder.onboardingRoute( onImport: () -> Unit, - onBack: () -> Unit, onFinish: (String) -> Unit, ) { deepLinkComposable(route = NAVIGATION_ROUTE_ONBOARDING) { OnboardingNavHost( onImport = onImport, - onBack = onBack, onFinish = onFinish, ) } From 54608d78e08cc9e5a162a28273a919174dabecc3 Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 20 Nov 2023 17:03:15 +0100 Subject: [PATCH 2/2] Change text of "Finish" button in account options screen --- .../feature/account/setup/ui/options/AccountOptionsScreen.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/options/AccountOptionsScreen.kt b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/options/AccountOptionsScreen.kt index 886f1f5f11f..f54c5982827 100644 --- a/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/options/AccountOptionsScreen.kt +++ b/feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/options/AccountOptionsScreen.kt @@ -48,7 +48,6 @@ internal fun AccountOptionsScreen( }, bottomBar = { WizardNavigationBar( - nextButtonText = stringResource(id = string.account_setup_button_finish), onNextClick = { dispatch(Event.OnNextClicked) }, onBackClick = { dispatch(Event.OnBackClicked) }, )