diff --git a/core/src/main/java/com/terning/core/designsystem/component/textfield/NameTextField.kt b/core/src/main/java/com/terning/core/designsystem/component/textfield/NameTextField.kt index 9913a9bd4..7f92022bf 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/textfield/NameTextField.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/textfield/NameTextField.kt @@ -2,10 +2,14 @@ package com.terning.core.designsystem.component.textfield import androidx.annotation.StringRes import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.platform.LocalFocusManager +import androidx.compose.ui.platform.LocalSoftwareKeyboardController import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.input.ImeAction import com.terning.core.designsystem.theme.Black import com.terning.core.designsystem.theme.Grey300 import com.terning.core.designsystem.theme.Grey400 @@ -21,6 +25,9 @@ fun NameTextField( helperColor: Color, helperIcon: Int? = null, ) { + val focusManager = LocalFocusManager.current + val keyboardController = LocalSoftwareKeyboardController.current + TerningBasicTextField( value = value, onValueChange = onValueChange, @@ -36,5 +43,10 @@ fun NameTextField( helperMessage = stringResource(id = helperMessage), helperIcon = helperIcon, helperColor = helperColor, + imeAction = ImeAction.Done, + onDoneAction = { + focusManager.clearFocus() + keyboardController?.hide() + } ) -} \ No newline at end of file +} diff --git a/feature/src/main/java/com/terning/feature/filtering/starthome/StartHomeScreen.kt b/feature/src/main/java/com/terning/feature/filtering/starthome/StartHomeScreen.kt index 94a9dc6f9..e117e44bf 100644 --- a/feature/src/main/java/com/terning/feature/filtering/starthome/StartHomeScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/starthome/StartHomeScreen.kt @@ -28,6 +28,7 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.navigation.NavController +import androidx.navigation.NavOptions import androidx.navigation.compose.rememberNavController import com.airbnb.lottie.Lottie import com.airbnb.lottie.compose.LottieAnimation @@ -39,7 +40,10 @@ import com.terning.core.designsystem.component.button.RectangleButton import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R +import com.terning.feature.filtering.starthome.navigation.StartHome import com.terning.feature.home.home.navigation.navigateHome +import com.terning.feature.onboarding.signin.navigation.SignIn +import com.terning.feature.onboarding.splash.navigation.Splash import kotlinx.coroutines.delay @Composable @@ -87,7 +91,12 @@ fun StartHomeScreen( style = TerningTheme.typography.button0, paddingVertical = 20.dp, text = R.string.start_home_next_button, - onButtonClick = { navController.navigateHome() }, + onButtonClick = { navController.navigateHome( + navOptions = NavOptions.Builder().setPopUpTo( + route = SignIn, + inclusive = true + ).build() + ) }, ) } } diff --git a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt index 774425f78..7d66dfeac 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt @@ -53,7 +53,12 @@ fun SplashScreen( inclusive = true ).build() ) - else navController.navigateSignIn() + else navController.navigateSignIn( + navOptions = NavOptions.Builder().setPopUpTo( + route = Splash, + inclusive = true + ).build() + ) } } }