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

[ADD/#19] TerningTextField #22

Merged
merged 10 commits into from
Jul 9, 2024
Merged

[ADD/#19] TerningTextField #22

merged 10 commits into from
Jul 9, 2024

Conversation

arinming
Copy link
Contributor

@arinming arinming commented Jul 7, 2024

⛳️ Work Description

  • BasicTextField를 커스텀하여 TerningTextField 구현
  • TerningTextField를 상속받은 SearchTextField, NameTextField 구현
  • 키보드 숨기기

📸 Screenshot

Screenshot_20240708_013052

📢 To Reviewers

  • NameTextField는 디테일까지 챙기진 못해서, 뷰 담당자가 추가로 구현할 거 있으면 해주시면 될 것 같아요! Helper 로직은 일단 SearchScreen에 남겨두었는데, SearchScreen에서는 삭제할 예정입니다
  • 외부 영역 터치시 키보드 숨기는 건......... 컴포즈에서 레퍼런스가 없어서,,,,,,,....어떤 외국인이 하란대로 했는데도 에러가 발생하는,,,,,,,음.. ㅠㅠ

@arinming arinming added ADD ➕ 부수적인 코드 추가 및 라이브러리 추가, 새로운 파일 생성 아린💛 아린 labels Jul 7, 2024
@arinming arinming added this to the 1차 스프린트 UI 작업 milestone Jul 7, 2024
@arinming arinming self-assigned this Jul 7, 2024
@arinming arinming linked an issue Jul 7, 2024 that may be closed by this pull request
3 tasks
Copy link
Member

@leeeyubin leeeyubin left a 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 > 요거 이용해주면 좋을 것 같아용
최고!!!!💚

Comment on lines 34 to 51
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,
) {
Copy link
Member

@leeeyubin leeeyubin Jul 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

파라미터 순서 맞춰주면 좋을 것 같아요!

보통은 기본 값이 없는 파라미터(필수 값)를 두고 그 뒤에 옵셔널 값을 둬요!
Modifier는 옵서녈의 위에 두면 됩니다!!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 새롭게 알아갑니다!!!!!!!!!!

Comment on lines 22 to 26
@Composable get() = navController
.currentBackStackEntryAsState().value?.destination

val startDestination = SignIn
val startDestination = Search

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거 다시 SignIn으로 바꿔야 하지 않나용..?

Comment on lines 32 to 37

@Composable
fun TerningTextField(
value: String,
onValueChange: (String) -> Unit,
textStyle: TextStyle,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 함수가 텍스트필드 중에서도 기본인 거니까 TerningBasicTextField로 명시해주는 것도 괜찮은 방법일 것 같네용

Comment on lines 24 to 26
onValueChange = onValueChange,
textStyle = TerningTypography().detail1,
textColor = Black,
Copy link
Member

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인해보니 SearchTextField랑 NameTextField 모두 각각의 textColor를 넣어주고 있는 것 같은데 여기서 디폴트로 TerningMain 색을 넣어준 이유는 무엇인가용?

Suggested change
textColor: Color = TerningMain,
textColor: Color,

이렇게 기본 값 없이도 갈 수 있을 것 같아요!

Comment on lines 109 to 114
if (showTextLength && maxTextLength != null) {
Text(
text = "${value.length}/$maxTextLength",
style = TerningTypography().button3,
color = Grey300,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

허걱 완전 최고다,,,ㄷㄷ

Copy link
Member

@boiledEgg-s boiledEgg-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 퀄리티가 엄청나네요,, 감탄하고 갑니다!!

Copy link
Member

@Hyobeen-Park Hyobeen-Park left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

진짜 퀄리티 미쳤네요..!! 키보드 숨기는거까지 구현한거 진짜 짱이에요❤️ 수고하셨습니당!!

Comment on lines +59 to +63
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
keyboardActions = KeyboardActions(onDone = {
keyboardController?.hide()
focusManager.clearFocus()
}),
Copy link
Member

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
Copy link
Member

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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

진짜 짱이다

@arinming arinming merged commit c617801 into develop Jul 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADD ➕ 부수적인 코드 추가 및 라이브러리 추가, 새로운 파일 생성 아린💛 아린
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[ADD] TextField 컴포넌트 구현
4 participants