-
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
Fix/calendar error #136
Fix/calendar error #136
Conversation
private var monthYearText: TextView? = null | ||
private var calendarRecyclerView: RecyclerView? = 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.
별거는 아닌데, 요즘 리팩하면서 드는 생각이 이런경우에 ? =null을 하는게 맞을지, 아니면 non-nullable에 디폴트값(0이나 "")을 넣는게 나을지 고민입니다. 어떠한 방식이 나을까요?
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.
음 null을 넣어서 따로 처리하는 것 보다는 디폴트 값을 넣는 것이 데이터를 처리하는데 더 편할 거 같다고 생각이 드네요..!
val intent = Intent(this, MyPageActivity::class.java) // 인텐트를 생성해줌, | ||
startActivity(intent) // 화면 전환을 시켜줌 |
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.
요기 화면 이동도 util 함수로 있습니다! startActivity였던 것 같네용
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 layoutParams = view.layoutParams | ||
layoutParams.height = parent.height | ||
layoutParams.width = Gravity.RIGHT | ||
return CalendarViewHolder(binding, view, onItemListener, days) |
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.
여기 view.layoutParams가 반복되어서 이렇게 한거라면, 스코프 함수 (apply, let 등)을 이용해보는건 어떠할까요~!
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.
오 apply 함수로 변경해서 반영해보도록 하겠습니다!
|
||
class CalendarViewModel : ViewModel() { | ||
private val data = MutableLiveData<String>() | ||
private val data = MutableLiveData<LocalDate>() |
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.
오호 LocalDate로 사용했을때의 장점이 있을까용?
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.
MenuFragment에서도 LocalDate를 사용해야 되니까 굳이 String으로 보낼 필요가 없는거 같아서 수정했습니다!
관련 이슈
개요
작업 사항
Check List
ctrl + alert + O
⇒ 안쓰는 import 제거 /ctrl + alert + L
⇒ 코드 정렬 등)main
브랜치의 최신 상태를 반영하고 있는지 확인스크린샷 및 작동 영상