-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat/#6 week2 compose 필수과제 구현 #8
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.
너무 잘하셔서 할 말이 없네~🐎
id.length !in 6..10 -> R.string.sign_up_id_error | ||
pw.length !in 8..12 -> R.string.sign_up_pw_error | ||
nick.isBlank() || nick.length != nick.trim().length -> R.string.sign_up_nick_error | ||
etc.length !in 1..Int.MAX_VALUE -> R.string.sign_up_etc_error |
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.
이렇게 숫자를 하드코딩하는건 안좋다고 합니다!!
Companion Object에 선언해봐요~
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 | ||
fun FriendProfileItem(friend: Friend) { |
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.
friend를 넣어주는 것도 좋지만, 저는 각각 나눠서 넣어주는 것을 더 선호합니다.
만약 friend내부 객체가 바뀐다면?
friend가 아닌 객체도 해당 함수를 재사용하게 된다면?
ui테스트를 위해 Preview를 만들 때 객체도 생성해야 하는 불편함
이런 부분들을 생각해서 저는 image, name, description 등등.. 나눠서 넣어주는걸 선호합니다
putExtra("userId", id) | ||
putExtra("userPw", pw) | ||
putExtra("userNick", nick) |
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.
숫자를 Companion Object로 빼면서 이것도 빼면 좋을거 같아요~
fun LoginUI(userId: String?, userPw: String?, userNick: String?) { | ||
val context = LocalContext.current | ||
var id by remember { mutableStateOf("") } | ||
var pw by remember { mutableStateOf("") } |
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.
이름이 UI이기 때문에 id와 pw도 SatateHoisting을 활용해 값을 상단으로 빼는건 어떨까요??
LoginUI에는 UI와 관련된 부분만 존재하고, 값을 수정하거나 클릭했을때의 액션은 밖으로 빼는게 좋아 보입니다!
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.
컴포즈도 잘 하시네요🔥🔥
Text( | ||
text = "ID", | ||
fontSize = 20.sp) | ||
fontSize = 20.sp | ||
) | ||
TextField( | ||
value = id, | ||
label = { Text(stringResource(R.string.tf_label_id)) }, | ||
onValueChange = { id = it }, | ||
placeholder = {Text(stringResource(R.string.tf_ph_id))}, | ||
singleLine = true | ||
) | ||
Spacer(modifier = Modifier.height(50.dp),) | ||
value = id, | ||
label = { Text(stringResource(R.string.tf_label_id)) }, | ||
onValueChange = { id = it }, | ||
placeholder = { Text(stringResource(R.string.tf_ph_id)) }, | ||
singleLine = true | ||
) |
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.
수고하셨습니다!!
노력하신게 보이는 코드네요...!!
📌𝘐𝘴𝘴𝘶𝘦𝘴
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵
KakaoTalk_20240419_013037282.mp4
💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴
그래도...1주차때보다는 0.0001%정도 더 컴포즈랑 가까워진것같아요....
제 코드 ... 부족한 점 많지만 리뷰달아주시면 열심히 반영하겠습니다!!!
코리 반영하기