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/#211] 투두 수정뷰 / UI 구현 #232

Merged
merged 26 commits into from
Mar 6, 2024
Merged

Conversation

Marchbreeze
Copy link
Member

⛳️ Work Description

  • 투두 수정뷰 구현
  • 투두 수정 API 설정
  • 투두 조회뷰 수정
  • 투두 조회뷰 API 변경사항 대응

📸 Screenshot

KakaoTalk_Video_2024-03-05-18-42-22.mp4

📢 To Reviewers

  • 다했음 우하하
  • 그 수정하고 조회뷰로 다시 돌아올때 깜빡이는 부분이 좀 거슬리는데 어떻게 처리할지 아직 고민중 ...
  • 아예 지우고 넘어가버리면 깜빡이는게 더 거슬리더라구 ...

@Marchbreeze Marchbreeze added 상호 🍀 FEAT ✨ 새로운 기능 구현 labels Mar 5, 2024
@Marchbreeze Marchbreeze added this to the 2차 스프린트 milestone Mar 5, 2024
@Marchbreeze Marchbreeze self-assigned this Mar 5, 2024
Copy link
Member

@leeeyubin leeeyubin left a comment

Choose a reason for hiding this comment

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

완벽합니다,,,속도 아주 굿!!!! 수고했서요오

Comment on lines 64 to 65
private fun checkIsTodoChanged(): Boolean =
todo.value != oldTodoInfo.title || endDate.value != oldTodoInfo.endDate || memo.value != oldTodoInfo.memo || checkIsListChanged()
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

Choose a reason for hiding this comment

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

조금 사소하긴 한데 저는 두가지를 비교한 값을 하나의 값으로 사용하는 경우에는 괄호로 묶어주는 편입니다! 그게 더 가독성이 좋아보이더라구용

Suggested change
private fun checkIsTodoChanged(): Boolean =
todo.value != oldTodoInfo.title || endDate.value != oldTodoInfo.endDate || memo.value != oldTodoInfo.memo || checkIsListChanged()
private fun checkIsTodoChanged(): Boolean =
(todo.value != oldTodoInfo.title) || (endDate.value != oldTodoInfo.endDate) || (memo.value != oldTodoInfo.memo) || checkIsListChanged()

Comment on lines +28 to +29
private val _todoPatchState = MutableSharedFlow<Boolean>()
val todoPatchState: SharedFlow<Boolean> = _todoPatchState
Copy link
Member

Choose a reason for hiding this comment

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

제가 아직 flow는 공부 중이라,, 이 친구를 sharedFlow로 작성해주신 이유가 궁금합니다,,!!

Copy link
Member Author

Choose a reason for hiding this comment

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

SharedFlow는 StateFlow와 다르게 초기값 설정이 필요없으며,
StateFlow는 초기값으로 뷰모델 init과 함께 flow가 시작되는 반면 SharedFlow는 초기값이 없기에 emit을 진행시키기 전까지는 흐르고 있지 않게 됩니다.

투두패치의 경우, UiState의 로딩이나 엠프티가 필요없는 상태라 Boolean값으로 성공 유무만 처리하면 되는 로직이었고,
서버통신 이후 바로 뷰가 종료되기 때문에 일회성으로 emit 후 종료되어 SharedFlow가 더 효과적이라고 생각했습니다 ~

Copy link
Member

Choose a reason for hiding this comment

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

아하!! 설명 감사합니다~!!! 저도 SharedFlow 적용할 수 있으면 해볼게요!

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
Contributor

Choose a reason for hiding this comment

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

아하@!! 이런 이유로 사용하신거군요, 저도 SharedFlow 부분에 대해 다시 찾아보겠습니다!

Copy link
Member

@chattymin chattymin left a comment

Choose a reason for hiding this comment

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

굿굿!! 조아욤~

Comment on lines +15 to +37
binding.run {
tvTodoName.text = item.name
tvTodoName.isSelected = item.isAllocated

setShapeColor(item.isOwner)
setTextColor()

layoutTodoName.setOnClickListener {
itemClick(position)
tvTodoName.isSelected = !tvTodoName.isSelected
setTextColor()
}
}
}

private fun setShapeColor(isOwner: Boolean) {
with(binding.tvTodoName) {
if (isOwner) {
setBackgroundResource(R.drawable.sel_todo_shape_red500_fill)
} else {
setBackgroundResource(R.drawable.sel_todo_shape_gray400_fill)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

with와 run이 기능상 거의 같은 것으로 알고있는데 위에는 run, 밑에는 with로 사용하신 이유가 있을까요??

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 +28 to +29
private val _todoPatchState = MutableSharedFlow<Boolean>()
val todoPatchState: SharedFlow<Boolean> = _todoPatchState
Copy link
Member

Choose a reason for hiding this comment

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

저도 요즘 이부분 많이 공부하고있었는데 예시 코드 갑사합니다~

Comment on lines 64 to 65
private fun checkIsTodoChanged(): Boolean =
todo.value != oldTodoInfo.title || endDate.value != oldTodoInfo.endDate || memo.value != oldTodoInfo.memo || checkIsListChanged()
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
private fun checkIsTodoChanged(): Boolean =
todo.value != oldTodoInfo.title || endDate.value != oldTodoInfo.endDate || memo.value != oldTodoInfo.memo || checkIsListChanged()
private fun checkIsTodoChanged(): Boolean =
(todo.value != oldTodoInfo.title) || (endDate.value != oldTodoInfo.endDate) || (memo.value != oldTodoInfo.memo) || checkIsListChanged()

Copy link
Contributor

@crownjoe crownjoe left a comment

Choose a reason for hiding this comment

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

patch 서버 붙이면서 많이 도움 받았습니다!!! 수고하셧습니다 !!!!!!!

Comment on lines +28 to +29
private val _todoPatchState = MutableSharedFlow<Boolean>()
val todoPatchState: SharedFlow<Boolean> = _todoPatchState
Copy link
Contributor

Choose a reason for hiding this comment

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

아하@!! 이런 이유로 사용하신거군요, 저도 SharedFlow 부분에 대해 다시 찾아보겠습니다!

Comment on lines 83 to +90
private fun initAdapter() {
_adapter = OurTodoFriendAdapter()
_adapter = OurTodoFriendAdapter(::initFriendInfoListener)
binding.rvOurTripFriend.adapter = adapter
}

private fun initFriendInfoListener(participantId: Long) {
// TODO: 친구 아이템 클릭 시 상세정보 구현
}
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

@chattymin chattymin left a comment

Choose a reason for hiding this comment

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

굿굿~
역시 완벽하네요~

@Marchbreeze Marchbreeze merged commit 30a8bc1 into develop Mar 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FEAT ✨ 새로운 기능 구현 상호 🍀
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 투두 수정뷰 / UI 구현
4 participants