-
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
#36 [ui] home 작업 #44
#36 [ui] home 작업 #44
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.
아주 멋진 코드에요!
private fun setUserLottieList() { | ||
viewModel.getHome() | ||
userLottieList = when (viewModel.homeResponse.value?.dollType) { | ||
"BROWN" -> brownBearLottieList | ||
"GRAY" -> grayBearLottieList | ||
"RED" -> redBearLottieList | ||
"PANDA" -> pandaBearLottieList | ||
else -> brownBearLottieList | ||
} | ||
} |
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.
리스트 형식과 switch도 좋지만 Map 형식은 어떤가요?
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.
찾아오겠습니다.! ! !
val intentToSetting = Intent(activity, SettingActivity::class.java) | ||
startActivity(intentToSetting) |
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.
분리 좋아요!
viewModel.patchSom(cottonType) | ||
playLottieAnimation(userLottieList[DAILY]) |
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.
2줄을 담당하는 메소드를 따로 지정하면 해당 메소드의 책임이 더 줄 수 있을 것 같아요!
val changeData = when (cotton) { | ||
Cotton.DAILY -> homeResponse.value?.copy(dailyCottonCount = cottonCount - 1) | ||
Cotton.HAPPINESS -> homeResponse.value?.copy(happinessCottonCount = cottonCount - 1) | ||
} |
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.
switch문만 담당하는 메소드를 따로 분리해서, 메소드를 호출하는 방식도 가독성에 좋을 것 같아요!
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.
daily와 happiness가 반복되니까 따로 메소드로 빼주는 것도 좋을 것 같습니당
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.
메인작업 고생하셨습니다~
@@ -0,0 +1,5 @@ | |||
package com.sopetit.softie.domain.entity | |||
|
|||
enum class Cotton { |
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.
DAILY와 HAPPINESS를 왜 enum으로 묶은 건가요?
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.
각 상황에 따라서 로직은 동일한데 넣는 파일이 달라서 분류해주려고 만들었습니다!
enum class를 만들면 when에서 else 처리가 따로 필요없어서 만들었습니다.
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.
홈뷰 작업 수고하셨습니당!
dollType = "PANDA", | ||
dailyCottonCount = 5, | ||
happinessCottonCount = 3, | ||
conversations = listOf("야", "메롱", "루틴이나 해", "솔직히 나 귀엽지", "안드로이드 사랑해", "나 소프티야") |
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.
안드소프리티 사랑해
private fun setClickListener() { | ||
setClickSetting() | ||
setClickBear() | ||
setClickDaily() | ||
setClickHappy() | ||
} |
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.
아앗 부끄럽다,,,😥 더 열심히 코드 짤게요,,,
setRandomMessage() | ||
} | ||
|
||
private fun setRandomMessage() { |
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.
랜덤 메세지 list를 받고 그 리스트 안에서 띄우는 건 클라가 처리합니다!
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.
수고하셨습니당!!! 역시 리드님 짱짱
app/src/main/AndroidManifest.xml
Outdated
android:exported="true" | ||
android:screenOrientation="portrait" /> | ||
|
||
<activity | ||
android:name=".ui.onboarding.OnboardingActivity" | ||
android:exported="false" | ||
android:exported="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.
mainActivity랑 onboardingActivity는 false로 바꿔주세요!
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.
앗 감사합니다~
dollType = "PANDA", | ||
dailyCottonCount = 5, | ||
happinessCottonCount = 3, | ||
conversations = listOf("야", "메롱", "루틴이나 해", "솔직히 나 귀엽지", "안드로이드 사랑해", "나 소프티야") |
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.
안드소프리티 사랑해
val changeData = when (cotton) { | ||
Cotton.DAILY -> homeResponse.value?.copy(dailyCottonCount = cottonCount - 1) | ||
Cotton.HAPPINESS -> homeResponse.value?.copy(happinessCottonCount = cottonCount - 1) | ||
} |
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.
daily와 happiness가 반복되니까 따로 메소드로 빼주는 것도 좋을 것 같습니당
📑 Work Description
🛠️ Issue
📷 Screenshot
Screen_recording_20240112_232751.mp4
💬 To Reviewers