Skip to content

Commit 8fbae90

Browse files
committed
feat/#78 : 로그인 요청시 키보드 내리기
1 parent 94a0bfc commit 8fbae90

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

feature/login/src/main/java/com/yapp/feature/login/LoginScreen.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import androidx.compose.runtime.Composable
1212
import androidx.compose.runtime.getValue
1313
import androidx.compose.ui.Modifier
1414
import androidx.compose.ui.platform.LocalContext
15+
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
1516
import androidx.compose.ui.tooling.preview.Preview
1617
import androidx.compose.ui.unit.dp
1718
import androidx.hilt.navigation.compose.hiltViewModel
@@ -48,6 +49,7 @@ internal fun LoginRoute(
4849
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(Url.PRIVACY_POLICY))
4950
context.startActivity(intent)
5051
}
52+
5153
LoginSideEffect.NavigateToHome -> navigateToHome()
5254
is LoginSideEffect.ShowToast -> {
5355
Toast.makeText(context, effect.message, Toast.LENGTH_SHORT).show()
@@ -65,6 +67,8 @@ fun LoginScreen(
6567
loginState: LoginState,
6668
onIntent: (LoginIntent) -> Unit = {},
6769
) {
70+
val keyboardController = LocalSoftwareKeyboardController.current
71+
6872
YappBackground {
6973
Column(
7074
modifier = Modifier
@@ -79,7 +83,10 @@ fun LoginScreen(
7983
onEmailChange = { onIntent(LoginIntent.ChangeEmail(it)) },
8084
onPasswordChange = { onIntent(LoginIntent.ChangePassword(it)) },
8185
buttonEnable = loginState.enableLoginButton,
82-
onButtonClick = { onIntent(LoginIntent.ClickLoginButton) },
86+
onButtonClick = {
87+
keyboardController?.hide()
88+
onIntent(LoginIntent.ClickLoginButton)
89+
},
8390
emailErrorDescription = loginState.emailErrorDescription,
8491
passwordErrorDescription = loginState.passwordErrorDescription
8592
)

0 commit comments

Comments
 (0)