-
Notifications
You must be signed in to change notification settings - Fork 2
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
[FIX/#208] 투두 생성, 조회 뷰 / 메모 빈칸 대응 수정 #210
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 val todo = MutableLiveData("") | ||
private val memo = MutableLiveData("") |
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.
어떤경우에 LiveData를 사용하고, 어떤 경우에 StateFlow를 사용하는지 선택 기준이 궁금합니다!
저는 대부분 초기값이 있어야 하는 경우는 StateFlow를 사용하는 것 같습니다 :)
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.
StateFlow를 사용하는 것을 권장드리긴 합니다만,
LiveData를 사용해둔 부분들은 모두 xml과의 데이터바인딩이 연결된 변수들입니다!
StateFlow와 같은 경우는 계속해서 상태값을 지니고 있기에 백패킹(_달아주는거)으로 안정성을 보장해주는 것이 꼭 권장되는데,
백패킹으로 설정해두게 되면 데이터바인딩을 활용이 어려워졌었던 것 같아서 우선은 LiveData로 구현해뒀습니다.
LiveData가 이후에 deprecated된다면 데이터바인딩도 함께 사라질테니,
지금 상황처럼 데이터바인딩만을 위해서 변수 설정을 해두는 경우라면 LiveDat로 두어도 문제는 없을 것 같습니다 !
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.endDate.observe(this) { | ||
if (!viewModel.endDate.value.isNullOrEmpty()) { | ||
with(binding) { | ||
etTodoCreateDate.background = drawableOf(R.drawable.shape_rect_4_gray700_line) | ||
tvTodoCreateDateHint.setTextColor(colorOf(R.color.gray_700)) | ||
ivTodoCreateDate.setImageResource(R.drawable.ic_dropdown_gray700) |
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 val todo = MutableLiveData("") | ||
private val memo = MutableLiveData("") |
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 val todo = MutableLiveData("") | ||
private val memo = MutableLiveData("") |
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 (state.data.memo.isBlank()) { | ||
with(binding) { | ||
etTodoCreateMemo.background = drawableOf(R.drawable.shape_rect_4_gray200_line) | ||
etTodoCreateMemo.text = stringOf(R.string.my_todo_create_tv_memo_hint) |
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)
습관화 하시는 것 같은데 좋네요!!
…into fix/#208-create-available
⛳️ Work Description
📸 Screenshot
📢 To Reviewers