Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX/#167] 키보드 및 스택 관리 #169

Merged
merged 4 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -43,7 +43,6 @@ fun SearchTextField(
readOnly = readOnly,
onSearchAction = {
if (text.isNotBlank()) {
keyboardController?.hide()
keyboardController?.hide()
focusManager.clearFocus()
onSearchAction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.terning.feature.filtering.starthome

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.fadeIn
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
Expand All @@ -11,7 +10,6 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand All @@ -22,24 +20,21 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
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
import com.airbnb.lottie.compose.LottieCompositionSpec
import com.airbnb.lottie.compose.LottieConstants
import com.airbnb.lottie.compose.rememberLottieAnimatable
import com.airbnb.lottie.compose.rememberLottieComposition
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.home.home.navigation.navigateHome
import com.terning.feature.onboarding.signin.navigation.SignIn
import kotlinx.coroutines.delay

@Composable
Expand Down Expand Up @@ -87,7 +82,14 @@ 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 All @@ -102,10 +104,14 @@ fun StartHomeLottieAnimation(
LottieAnimation(
modifier = modifier
.fillMaxWidth()
.aspectRatio((lottieComposition?.bounds?.width()?.toFloat()?:1f) / (lottieComposition?.bounds?.height()?:1))
.aspectRatio(
(lottieComposition?.bounds
?.width()
?.toFloat()
?: 1f) / (lottieComposition?.bounds?.height() ?: 1)
)
.padding(horizontal = 24.dp),
composition = lottieComposition,
iterations = LottieConstants.IterateForever
)
}

Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ class SignUpViewModel @Inject constructor(

outOfBoundName -> _state.value = _state.value.copy(
name = trimmedName,
drawLineColor = Grey500,
helper = R.string.sign_up_helper,
helperIcon = null,
helperColor = Grey400,
drawLineColor =WarningRed,
helper = R.string.sign_up_helper_out,
helperIcon = R.drawable.ic_sign_up_error,
helperColor = WarningRed,
isButtonValid = false
)

Expand Down Expand Up @@ -114,7 +114,7 @@ class SignUpViewModel @Inject constructor(
}

companion object {
const val NAME_ERROR = "[!@#\$%^&*(),.?\":{}|<>\\[\\]\\\\/]"
const val NAME_ERROR = "[!@#\$%^&*(),.?\":{}|<>\\[\\]\\\\/\\-=+~`\\p{S}\\p{P}]"
private const val MAX_LENGTH = 12
private const val KAKA0 = "KAKAO"
}
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
1 change: 1 addition & 0 deletions feature/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<string name="sign_up_helper">12자리 이내, 문자/숫자 가능, 특수문자/기호 입력불가</string>
<string name="sign_up_helper_error">이름에 특수문자는 입력할 수 없어요</string>
<string name="sign_up_helper_available">사용 가능한 이름이에요</string>
<string name="sign_up_helper_out">이름은 12자리 이내로 설정해 주세요</string>

<!--Search-->
<string name="search_text_field_hint">관심있는 인턴 공고 키워드를 검색해 보세요</string>
Expand Down
Loading