-
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
#42 [feat] 데일리 루틴 #45
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.
민정이 덕에 빠르게 나아간다...
고생 너무 많았습니다!
viewModel.isEditBtnEnabled.observe(viewLifecycleOwner) { isBtnEnabled -> | ||
if (isBtnEnabled) { | ||
binding.btnDailyRoutineDelete.setOnClickListener { | ||
BindingBottomSheet.Builder().build( |
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.
Builder( )함수는 어떤 역할을 하나요??
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.
builder 패턴은 필요한 parameter만 설정해두면 build 메소드를 통해 객체를 생성할 수 있습니다..! 여기서 제가 공통 바텀시트를 만들어 두어서 이 builder 패턴을 통해서 각 뷰에서 커스텀되는 parameter만 넣어주면 바텀시트를 생성할 수 있습니다!!
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.
빌더 패턴까지 사용하시다니 정말 대단하군요 디자인패턴 공부 많이 한게 느껴졌어요. 저희꺼 바텀시트도 빌더로 만들어주세요 !!
binding.tvDailyRoutineEdit.setOnClickListener { | ||
val intent = Intent(requireActivity(), DailyRoutineEditActivity::class.java) | ||
startActivity(intent) | ||
private fun initSetDailyRoutineContent() { |
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 fun routineItemView(routineTitle: TextView, achieveMsg: TextView, index: Int) { | ||
viewModel.mockDailyRoutineList.observe(viewLifecycleOwner) { dailyRoutineList -> | ||
val achieveCountMsg = | ||
getString(R.string.daily_routine_ing).format(dailyRoutineList[index].achieveCount) | ||
achieveMsg.text = achieveCountMsg | ||
routineTitle.text = dailyRoutineList[index].content | ||
} | ||
} |
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 routineAddList = listOf<Int>(1, 2) | ||
// val routineAddList = listOf<Int>(1, 2) | ||
|
||
private val _mockDailyRoutineList: MutableLiveData<List<DailyRoutine>> = 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 fun initSetDeleteView() { | ||
viewModel.isDeleteView.observe(viewLifecycleOwner) { isDeleteView -> | ||
if (!isDeleteView) { |
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문 안에는 ! 연산자를 넣지 않는 것이 좋다고 합니다!
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
🛠️ Issue
📷 Screenshot
feat.daily.routine.edit.finish.mp4
💬 To Reviewers
커스텀 스낵바를 만들었는데 위치를 bottom navi 위로 올려야 하는데 방법이 생각이 안나서 일단 위치 계산해서 넣었습니다(좋은 방법 있으면 알려주세요ㅜ)
'완료하기' 버튼 클릭시 바텀시트 이미지에 해당 데일리 루틴의 이미지 넣는 것은 서버통신 붙이면서 연결하겠습니다 (지금은 그냥 drawable 이미지로 넣었습니다)