Skip to content

Commit

Permalink
[FIX/#167] 키보드 및 스택 관리
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeyubin committed Jul 19, 2024
1 parent f3e092a commit ee8f0a9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -21,6 +25,9 @@ fun NameTextField(
helperColor: Color,
helperIcon: Int? = null,
) {
val focusManager = LocalFocusManager.current
val keyboardController = LocalSoftwareKeyboardController.current

TerningBasicTextField(
value = value,
onValueChange = onValueChange,
Expand All @@ -36,5 +43,10 @@ fun NameTextField(
helperMessage = stringResource(id = helperMessage),
helperIcon = helperIcon,
helperColor = helperColor,
imeAction = ImeAction.Done,
onDoneAction = {
focusManager.clearFocus()
keyboardController?.hide()
}
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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()
) },
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ fun SplashScreen(
inclusive = true
).build()
)
else navController.navigateSignIn()
else navController.navigateSignIn(
navOptions = NavOptions.Builder().setPopUpTo(
route = Splash,
inclusive = true
).build()
)
}
}
}
Expand Down

0 comments on commit ee8f0a9

Please sign in to comment.