-
Notifications
You must be signed in to change notification settings - Fork 1
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
[ADD/#19] TerningTextField #22
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
외부 영역 터치해서 키보드 숨기는 건 제가 확장함수로 넣어뒀어요!!! 그거 활용하면 됩니당~!!
아린 언니 진짜 너무 야무져서 눈물광광,,,🥹
그리구 사진 올릴 때는 <img src="이미지 주소" width=270 >
요거 이용해주면 좋을 것 같아용
최고!!!!💚
fun TerningTextField( | ||
value: String, | ||
onValueChange: (String) -> Unit, | ||
textStyle: TextStyle, | ||
textColor: Color = TerningMain, | ||
cursorBrush: Brush = SolidColor(TerningMain), | ||
hint: String = "", | ||
hintColor: Color = TerningMain, | ||
strokeWidth: Float = 1f, | ||
drawLineColor: Color, | ||
leftIcon: Int? = null, | ||
leftIconColor: Color = TerningMain, | ||
maxTextLength: Int? = null, | ||
showTextLength: Boolean = false, | ||
helperMessage: String = "", | ||
helperIcon: Int? = null, | ||
helperColor: Color = TerningMain, | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
파라미터 순서 맞춰주면 좋을 것 같아요!
보통은 기본 값이 없는 파라미터(필수 값)를 두고 그 뒤에 옵셔널 값을 둬요!
Modifier는 옵서녈의 위에 두면 됩니다!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 새롭게 알아갑니다!!!!!!!!!!
@Composable get() = navController | ||
.currentBackStackEntryAsState().value?.destination | ||
|
||
val startDestination = SignIn | ||
val startDestination = Search | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요거 다시 SignIn으로 바꿔야 하지 않나용..?
|
||
@Composable | ||
fun TerningTextField( | ||
value: String, | ||
onValueChange: (String) -> Unit, | ||
textStyle: TextStyle, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 함수가 텍스트필드 중에서도 기본인 거니까 TerningBasicTextField
로 명시해주는 것도 괜찮은 방법일 것 같네용
onValueChange = onValueChange, | ||
textStyle = TerningTypography().detail1, | ||
textColor = Black, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스타일 적용할 때 TerningTypography().detail1
로 바로 적용하면 새로운 인스턴스를 생성하는 거라 TerningTheme.typography.detail1
로 해줘야 할 것 같아요!
value: String, | ||
onValueChange: (String) -> Unit, | ||
textStyle: TextStyle, | ||
textColor: Color = TerningMain, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인해보니 SearchTextField랑 NameTextField 모두 각각의 textColor를 넣어주고 있는 것 같은데 여기서 디폴트로 TerningMain 색을 넣어준 이유는 무엇인가용?
textColor: Color = TerningMain, | |
textColor: Color, |
이렇게 기본 값 없이도 갈 수 있을 것 같아요!
if (showTextLength && maxTextLength != null) { | ||
Text( | ||
text = "${value.length}/$maxTextLength", | ||
style = TerningTypography().button3, | ||
color = Grey300, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
허걱 완전 최고다,,,ㄷㄷ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 퀄리티가 엄청나네요,, 감탄하고 갑니다!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
진짜 퀄리티 미쳤네요..!! 키보드 숨기는거까지 구현한거 진짜 짱이에요❤️ 수고하셨습니당!!
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done), | ||
keyboardActions = KeyboardActions(onDone = { | ||
keyboardController?.hide() | ||
focusManager.clearFocus() | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이부분이 키보드 숨기는 부분인거 맞죠?!?? 진짜 최고다👍🏻👍🏻
Box(modifier = Modifier.weight(1f)) { | ||
if (value.isEmpty()) { | ||
Text( | ||
text = hint, style = textStyle, color = hintColor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요부분 줄바꿈해주면 더 보기 편할 것 같아요!!
} | ||
if (showTextLength && maxTextLength != null) { | ||
Text( | ||
text = "${value.length}/$maxTextLength", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
진짜 짱이다
# Conflicts: # feature/src/main/res/values/strings.xml
⛳️ Work Description
📸 Screenshot
📢 To Reviewers