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

[Feat/#57] homework UI / API #62

Merged
merged 20 commits into from
Sep 22, 2024
Merged

[Feat/#57] homework UI / API #62

merged 20 commits into from
Sep 22, 2024

Conversation

chattymin
Copy link
Member

⛳️ Work Description

  • ui 하구요
  • api 붙였어요
  • 분기처리 짱마나요

📸 Screenshot

finish.mp4

📢 To Reviewers

  • 속도와 코드의 완성도는 반비례한다.

Copy link
Member

@Marchbreeze Marchbreeze left a comment

Choose a reason for hiding this comment

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

야미~

OnItemClickListener {
private val viewModel by activityViewModels<StudyViewModel>()

private var homeworkDialog: WeakReference<Dialog>? = null
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 Author

Choose a reason for hiding this comment

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

메모리 누수 막는 용도입니다!
다 쓰고나면 알아서 GC가 처리해줘용

Comment on lines 82 to 88
binding.layoutHomeworkEmpty.visibility = View.INVISIBLE
binding.layoutHomeworkValid.visibility = View.VISIBLE

binding.progressBarHomework.max = studyList.size
binding.progressBarHomework.progress = studyList.count { it.completed }
binding.ivSeekbarThumb.x =
binding.progressBarHomework.width * binding.progressBarHomework.progress / binding.progressBarHomework.max.toFloat()
Copy link
Member

Choose a reason for hiding this comment

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

�with(binding)이 너무 땡겨요 ㅋ ㅋ

Copy link
Member Author

Choose a reason for hiding this comment

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

ㅋㅋㅋㅋ 굿~

}

private fun setToggleState(isMe: Boolean) {
when (isMe) {
Copy link
Member

Choose a reason for hiding this comment

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

요친구들 중복이 좀 많은거같은데 isMe TF로 합치는건 어려웠나용?

Copy link
Member Author

Choose a reason for hiding this comment

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

알면서 흐린눈했었는데 ㅎ.ㅎ

수정했습니다!

Comment on lines +23 to +26
if (isMe) {
ivDelete.visibility = View.GONE
} else {
ivDelete.visibility = View.VISIBLE
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (isMe) {
ivDelete.visibility = View.GONE
} else {
ivDelete.visibility = View.VISIBLE
ivDelete.isVisible = !isMe

크크

Copy link
Member Author

Choose a reason for hiding this comment

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

false일 경우에는 추가적인 액션이 있어서 이렇게 했서용~
어차피 if-else를 해야한다면 이렇게 나타내주는게 더 직관적이라 가독성 좋은느낌!

}.onFailure(Timber::e)
studyRepository.addHomework(description)
.onSuccess { id ->
_toast.emit("추가되었습니다")
Copy link
Member

Choose a reason for hiding this comment

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

ㅋㅋㅋㅋㅋ먼가 이거는 컴포즈 습관이 이어지는 느낌인데 좋네요
사실 요거는 뷰모델에서 R.string에 접근이 어려워서 UI에서 담당하는게 좋을 것 같긴 합니당 어케생각하시는지? 안고쳐도 됨 ㅎㅎ

Copy link
Member Author

Choose a reason for hiding this comment

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

음...
리소스 접근이 어렵다는 것만 제외한다면 이게 더 일관된 방식이라 viewModel에서 호출하는게 좋은 방법인거 같네요
그렇다면 만약 저라면 enum을 emit할 것 같아요. 그래서 enum에 따라 activity에서 string을 toast로 띄우는 방식!
물론 지금 급하게 생각한거라 좋은 방법은 아닌거 같긴 하네요. 그렇다고 메시지별로 emit하는 대상을 바꾸는건 최악인거 같긴 해서 좀더 생각해보겠슴다

android:layout_marginHorizontal="16dp"
android:layout_marginTop="20dp"
android:autofillHints="false"
android:backgroundTint="@color/purple_50"
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 Author

Choose a reason for hiding this comment

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

넵넵 의도한거입니다!
저도 딱붙어있는거 봣는데 흐린눈 했는데 ㅎ.ㅎㅎ... 해결하려고 했는데 잘 안되더라구요

그래도 저 보라 줄이 없게된다면 사용자가 어디를 터치해야할지 모르기 때문에 그냥 두겠습니다!
추후 수정해볼게요

@chattymin chattymin merged commit 73f3907 into develop Sep 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] homework
2 participants