-
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
#39 [ui] 행복루틴 추가하기 상세뷰 #43
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.
비율 맞추느라 고생하셨습니다!
with(binding.vpHappyAddDetailCard) { | ||
clipChildren = false | ||
clipToPadding = false | ||
offscreenPageLimit = 3 |
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.
오오 감사합니다!
app/src/main/java/com/sopetit/softie/ui/happyroutine/adddetail/HappyDetailCardViewModel.kt
Show resolved
Hide resolved
app/src/main/java/com/sopetit/softie/ui/happyroutine/adddetail/HappyDetailCardViewModel.kt
Show resolved
Hide resolved
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.
고생하셨습니다! 반복되는 부분들을 함수로 빼거나, 변수명 조금만 다듬어주세요~
) { | ||
data class Routines( | ||
val routineId: Int, | ||
@DrawableRes val cardImageUrl: Int, |
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:name=".ui.main.happy.addlist.HappyAddListActivity" | ||
android:exported="false" | ||
android:name=".ui.happyroutine.addlist.HappyAddListActivity" | ||
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.
false로 바꿔서 올려주세요!
app/src/main/AndroidManifest.xml
Outdated
|
||
<activity | ||
android:name=".ui.happyroutine.adddetail.HappyDetailActivity" | ||
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.
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.
ㅇㅊㅊ
happyCard?.let { | ||
binding.tvHappyAddDetailTitle.text = happyCard.name | ||
binding.ivHappyAddDetailIcon.setImageResource(happyCard.iconImageUrl) | ||
binding.tvHappyAddDetailSubtitle.text = happyCard.title | ||
binding.tvHappyAddDetailTitle.setTextColor(Color.parseColor(happyCard.nameColor)) | ||
} |
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.
with(binding)으로 묶어주세요
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.
onCreate 안이 아닌 따로 함수로 빼주세요
} | ||
} | ||
|
||
private fun moveToIng() { |
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.
moveToProgress처럼 바꿔주세요!
binding.ivHappyRoutineAddCard.setImageResource(data.cardImageUrl) | ||
binding.tvHappyRoutineAddCardDetailTitle.text = data.detailTitle | ||
binding.tvHappyRoutineAddCardDetailTitleBack.text = data.detailTitle | ||
binding.tvHappyRoutineAddCardDetailContentBack.text = data.detailContent | ||
binding.tvHappyRoutineAddCardDetailTimeBack.text = data.detailTime | ||
binding.tvHappyRoutineAddCardDetailPlaceBack.text = data.detailPlace |
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.
다음 번에는 item.xml에서 data binding 써보세요! activity, fragment에서 쓰는 것처럼 코드가 간결해집니다.
- with(binding) 써주세요
binding.clHappyRoutineAddCard.visibility = View.INVISIBLE | ||
binding.clHappyRoutineAddCardBack.visibility = View.VISIBLE |
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.
이 로직은 뒷면이 보이는 로직이고
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.
오 그게 더 깔끔하겠네요 함수화하겠습니다!
if (isVisible) { | ||
binding.clHappyRoutineAddCardBack.visibility = View.INVISIBLE | ||
binding.clHappyRoutineAddCard.visibility = View.VISIBLE | ||
} else { | ||
binding.clHappyRoutineAddCardBack.visibility = View.VISIBLE | ||
binding.clHappyRoutineAddCard.visibility = View.INVISIBLE |
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 (isVisible) { | |
binding.clHappyRoutineAddCardBack.visibility = View.INVISIBLE | |
binding.clHappyRoutineAddCard.visibility = View.VISIBLE | |
} else { | |
binding.clHappyRoutineAddCardBack.visibility = View.VISIBLE | |
binding.clHappyRoutineAddCard.visibility = View.INVISIBLE | |
if (isVisible) { | |
showCardFront() | |
} else { | |
showCardBack() |
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.
리드님 리뷰처럼 따로 함수화해주면 더 좋을 것 같습니당
fun getHappyCardListForId(categoryId: Int): List<HappyCard> { | ||
return _mockHappyCardList.value?.filter { it.categoryId == categoryId } ?: emptyList() | ||
} |
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/res/values/strings.xml
Outdated
<string name="happy_routine_add_card_detail_title">이상형의 특성 10가지 적어보고,\n절대 포기 못할 2가지와\n나와 비슷한 3가지 찾아보기</string> | ||
<string name="happy_routine_add_card_detail_content">평소에 바빠서 연락하지 못한 사람이 있다면 안부인사 개인톡을 보내 봐. 꼭 만나서 밥을 먹거나 하지 않아도 연락 한 통이 나와 그 사람을 연결하는 방법이 될 수 있어</string> | ||
<string name="happy_routine_add_card_detail_time">5~10분</string> | ||
<string name="happy_routine_add_card_detail_place">회사 옥상, 점심식사 후 돌아가는 길</string> |
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.
서버가 주는 값들은 tools:text로 처리한 뒤에 string으로 추출한 거 제거해주세요!
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.
어려웠을 텐데 정말 수고하셨습니다!!!
if (isVisible) { | ||
binding.clHappyRoutineAddCardBack.visibility = View.INVISIBLE | ||
binding.clHappyRoutineAddCard.visibility = View.VISIBLE | ||
} else { | ||
binding.clHappyRoutineAddCardBack.visibility = View.VISIBLE | ||
binding.clHappyRoutineAddCard.visibility = View.INVISIBLE |
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.
리드님 리뷰처럼 따로 함수화해주면 더 좋을 것 같습니당
onItemsTheSame = { oldItem, newItem -> oldItem.routineId == newItem.routineId }, | ||
onContentsTheSame = { oldItem, newItem -> oldItem.routineId == newItem.routineId } |
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.
onContentsTheSame은 { oldItem, newItem -> oldItem == newItem }
으로 바꿔주세요!
onItemsTheSame = { oldItem, newItem -> oldItem.routineId == newItem.routineId },
onContentsTheSame = { oldItem, newItem -> oldItem == newItem }
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.
정말Ing로 가는 거야,,?
📑 Work Description
🛠️ Issue
📷 Screenshot
Screen_Recording_20240114_183940_Softie.mp4
💬 To Reviewers