-
Notifications
You must be signed in to change notification settings - Fork 1
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
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.
야미~
OnItemClickListener { | ||
private val viewModel by activityViewModels<StudyViewModel>() | ||
|
||
private var homeworkDialog: WeakReference<Dialog>? = null |
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.
메모리 누수 막는 용도입니다!
다 쓰고나면 알아서 GC가 처리해줘용
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() |
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.
ㅋㅋㅋㅋ 굿~
} | ||
|
||
private fun setToggleState(isMe: Boolean) { | ||
when (isMe) { |
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.
요친구들 중복이 좀 많은거같은데 isMe TF로 합치는건 어려웠나용?
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 (isMe) { | ||
ivDelete.visibility = View.GONE | ||
} else { | ||
ivDelete.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.
if (isMe) { | |
ivDelete.visibility = View.GONE | |
} else { | |
ivDelete.visibility = View.VISIBLE | |
ivDelete.isVisible = !isMe |
크크
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일 경우에는 추가적인 액션이 있어서 이렇게 했서용~
어차피 if-else를 해야한다면 이렇게 나타내주는게 더 직관적이라 가독성 좋은느낌!
}.onFailure(Timber::e) | ||
studyRepository.addHomework(description) | ||
.onSuccess { id -> | ||
_toast.emit("추가되었습니다") |
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.
ㅋㅋㅋㅋㅋ먼가 이거는 컴포즈 습관이 이어지는 느낌인데 좋네요
사실 요거는 뷰모델에서 R.string에 접근이 어려워서 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.
음...
리소스 접근이 어렵다는 것만 제외한다면 이게 더 일관된 방식이라 viewModel에서 호출하는게 좋은 방법인거 같네요
그렇다면 만약 저라면 enum을 emit할 것 같아요. 그래서 enum에 따라 activity에서 string을 toast로 띄우는 방식!
물론 지금 급하게 생각한거라 좋은 방법은 아닌거 같긴 하네요. 그렇다고 메시지별로 emit하는 대상을 바꾸는건 최악인거 같긴 해서 좀더 생각해보겠슴다
android:layout_marginHorizontal="16dp" | ||
android:layout_marginTop="20dp" | ||
android:autofillHints="false" | ||
android:backgroundTint="@color/purple_50" |
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.
넵넵 의도한거입니다!
저도 딱붙어있는거 봣는데 흐린눈 했는데 ㅎ.ㅎㅎ... 해결하려고 했는데 잘 안되더라구요
그래도 저 보라 줄이 없게된다면 사용자가 어디를 터치해야할지 모르기 때문에 그냥 두겠습니다!
추후 수정해볼게요
⛳️ Work Description
📸 Screenshot
finish.mp4
📢 To Reviewers