From 2acf457153c5a193c7488544ca8c4d68f9b2b4f3 Mon Sep 17 00:00:00 2001 From: "Tzouvaras, Stilianos" Date: Thu, 8 Feb 2024 14:07:43 +0200 Subject: [PATCH] Corrections for welcome Screen --- .../ui/welcome/WelcomeScreenView.kt | 3 ++- .../ui/welcome/WelcomeScreenViewModel.kt | 20 +++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/login-feature/src/main/java/eu/europa/ec/loginfeature/ui/welcome/WelcomeScreenView.kt b/login-feature/src/main/java/eu/europa/ec/loginfeature/ui/welcome/WelcomeScreenView.kt index 7bfd5c81..a91a47b1 100644 --- a/login-feature/src/main/java/eu/europa/ec/loginfeature/ui/welcome/WelcomeScreenView.kt +++ b/login-feature/src/main/java/eu/europa/ec/loginfeature/ui/welcome/WelcomeScreenView.kt @@ -42,6 +42,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.navigation.NavController import eu.europa.ec.resourceslogic.R +import eu.europa.ec.resourceslogic.theme.values.backgroundPaper import eu.europa.ec.resourceslogic.theme.values.bottomCorneredShapeSmall import eu.europa.ec.uilogic.component.AppIcons import eu.europa.ec.uilogic.component.preview.PreviewTheme @@ -105,7 +106,7 @@ private fun Content( .fillMaxWidth() .fillMaxHeight(animatedWeight) .background( - color = MaterialTheme.colorScheme.primary, + color = MaterialTheme.colorScheme.backgroundPaper, shape = MaterialTheme.shapes.bottomCorneredShapeSmall ), contentAlignment = Alignment.Center diff --git a/login-feature/src/main/java/eu/europa/ec/loginfeature/ui/welcome/WelcomeScreenViewModel.kt b/login-feature/src/main/java/eu/europa/ec/loginfeature/ui/welcome/WelcomeScreenViewModel.kt index d9a94aa5..5d5a71e8 100644 --- a/login-feature/src/main/java/eu/europa/ec/loginfeature/ui/welcome/WelcomeScreenViewModel.kt +++ b/login-feature/src/main/java/eu/europa/ec/loginfeature/ui/welcome/WelcomeScreenViewModel.kt @@ -16,13 +16,15 @@ package eu.europa.ec.loginfeature.ui.welcome +import eu.europa.ec.commonfeature.model.PinFlow import eu.europa.ec.uilogic.mvi.MviViewModel import eu.europa.ec.uilogic.mvi.ViewEvent import eu.europa.ec.uilogic.mvi.ViewSideEffect import eu.europa.ec.uilogic.mvi.ViewState -import eu.europa.ec.uilogic.navigation.DashboardScreens +import eu.europa.ec.uilogic.navigation.CommonScreens import eu.europa.ec.uilogic.navigation.LoginScreens -import eu.europa.ec.uilogic.navigation.Screen +import eu.europa.ec.uilogic.navigation.helper.generateComposableArguments +import eu.europa.ec.uilogic.navigation.helper.generateComposableNavigationLink import org.koin.android.annotation.KoinViewModel data class State( @@ -50,15 +52,21 @@ class WelcomeScreenViewModel : MviViewModel() { override fun handleEvents(event: Event) { when (event) { - is Event.NavigateToLogin -> navigateTo(DashboardScreens.Dashboard, true) - is Event.NavigateToFaq -> navigateTo(LoginScreens.Faq, false) + is Event.NavigateToLogin -> navigateTo( + route = generateComposableNavigationLink( + screen = CommonScreens.QuickPin, + arguments = generateComposableArguments(mapOf("pinFlow" to PinFlow.CREATE)) + ) + ) + + is Event.NavigateToFaq -> navigateTo(LoginScreens.Faq.screenRoute) } } - private fun navigateTo(screen: Screen, currentInclusive: Boolean) { + private fun navigateTo(route: String, currentInclusive: Boolean = false) { setEffect { Effect.Navigation.SwitchScreen( - screenRoute = screen.screenRoute, + screenRoute = route, currentInclusive = currentInclusive ) }