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

[REFACTOR/#185] OurTodo, MyTodo 뷰 / 코드 리팩토링만 #186

Merged
merged 8 commits into from
Jan 24, 2024

Conversation

Marchbreeze
Copy link
Member

⛳️ Work Description

  • contextCompat 활용하는 부분들 모두 확장함수로 변경
  • 생성뷰 intent 옮기는 부분 객체 형태로 수정
  • adapter들에 val inflater by lazy { LayoutInflater.from(parent.context) } 활용
  • OffsetChangedListener 하나로 합치기
  • 그 외 자잘한 거슬리던 부분들 모두 수정 ...

📢 To Reviewers

  • 한번 슥 보고 본인 부분 리팩토링에 참고해보세요 ㅎ.ㅎ
  • 특히 확장함수로 더 코드 깔끔하게 바꾸는 부분~!

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 +70 to +74
MyTodoCreateActivity.createIntent(
requireContext(),
viewModel.tripId,
viewModel.participantId
).apply { startActivity(this) }
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.

저도 이 방법 알고는 감탄했는데 아주 굿이에요

Copy link
Contributor

Choose a reason for hiding this comment

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

...미쳤다!!>...저도 이거 이용해서 리팩해볼게요 역시 그는 김상호...

Comment on lines +69 to +70
title = todo.value.orEmpty(),
endDate = endDate.value.orEmpty(),
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 +17 to +26
when {
isCompleted -> {
setTextColor(binding.root.context.colorOf(R.color.gray_300))
setBackgroundResource(R.drawable.shape_rect_2_gray300_line)
}

item.isOwner -> {
setTextColor(binding.root.context.colorOf(R.color.red_500))
isSelected = true
}
Copy link
Member

Choose a reason for hiding this comment

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

if문 말고 이렇게 바꿀 수도 있군용

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 +70 to +74
MyTodoCreateActivity.createIntent(
requireContext(),
viewModel.tripId,
viewModel.participantId
).apply { startActivity(this) }
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 +26 to +30
tvOurTodoItemTitle.setTextColor(binding.root.context.colorOf(R.color.gray_300))
tvOurTodoItemDate.setTextColor(binding.root.context.colorOf(R.color.gray_200))
} else {
tvOurTodoItemTitle.setTextColor(ContextCompat.getColor(binding.root.context,R.color.black_000))
tvOurTodoItemDate.setTextColor(ContextCompat.getColor(binding.root.context,R.color.gray_300))
tvOurTodoItemTitle.setTextColor(binding.root.context.colorOf(R.color.black_000))
tvOurTodoItemDate.setTextColor(binding.root.context.colorOf(R.color.gray_300))
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

@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.

...멋지다....앱잼 끝난 지 이틀도 안됐는데 리팩하는 그.........멋지다 배워갑니다 👍👍👍👍👍👍👍👍👍👍

Comment on lines +70 to +74
MyTodoCreateActivity.createIntent(
requireContext(),
viewModel.tripId,
viewModel.participantId
).apply { startActivity(this) }
Copy link
Contributor

Choose a reason for hiding this comment

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

...미쳤다!!>...저도 이거 이용해서 리팩해볼게요 역시 그는 김상호...

Comment on lines +36 to +37
tvMyTodoItemTitle.setTextColor(binding.root.context.colorOf(R.color.gray_300))
tvMyTodoItemDate.setTextColor(binding.root.context.colorOf(R.color.gray_200))
Copy link
Contributor

Choose a reason for hiding this comment

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

확장함수 야무지다!!

@Marchbreeze Marchbreeze merged commit f4b34fe into develop Jan 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REFACTOR] OurTodo, MyTodo 뷰 / 코드 리팩토링만
4 participants