Skip to content

feat: 3주차 미션_우가#21

Open
sua710 wants to merge 2 commits intomainfrom
wooga-m3
Open

feat: 3주차 미션_우가#21
sua710 wants to merge 2 commits intomainfrom
wooga-m3

Conversation

@sua710
Copy link
Copy Markdown
Collaborator

@sua710 sua710 commented Apr 1, 2026

📌 PR 제목

[feat] 3주차 미션 - RecyclerView 및 상품 화면 구현


🔗 관련 이슈

Closes #이슈번호


✨ 변경 사항

  • 홈 화면 RecyclerView 구현 (가로 스크롤)
  • 구매하기 화면 RecyclerView GridLayout 구현
  • 위시리스트 화면 RecyclerView 구현
  • 상품 클릭 시 상품 상세 페이지로 이동 기능 구현
  • 구매하기 화면 하트 버튼 클릭 시 찜/해제 기능 구현
  • 장바구니 페이지 UI 구현 (비어있는 장바구니 화면)
  • Bottom Navigation을 이용한 화면 전환 구현

🔍 테스트

  • 홈 화면 상품 클릭 시 상세 페이지 이동 확인
  • 구매하기 화면 상품 클릭 시 상세 페이지 이동 확인
  • 구매하기 화면 하트 클릭 시 이미지 변경 확인
  • 위시리스트 화면 상품 클릭 시 상세 페이지 이동 확인
  • 화면 전환 정상 동작 확인
  • 앱 실행 시 오류 없음

📸 스크린샷 (선택)

홈 화면 구매하기
(이미지 첨부) (이미지 첨부)
위시리스트 장바구니
(이미지 첨부) (이미지 첨부)

📎 추가 이슈

  • 현재 위시리스트는 더미 데이터로 구현되어 있으며,
    이후 DB 연동을 통해 실제 찜한 상품이 표시되도록 구현 예정.

Copy link
Copy Markdown
Collaborator

@kimdoyeon1234 kimdoyeon1234 left a comment

Choose a reason for hiding this comment

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

미션하시느라 수고하셨습니다! 전체적인 코드 구조가 깔끔하고 특히 어댑터 하나로 여러 화면의 UI를 재사용하신 점이 인상적입니다

2주차와 중복되는 코멘트는 뺐고, pr내용과 커밋태그 대문자만 신경써주세요!

현재 상태로도 기능 동작에는 전혀 문제가 없지만, 추후 고도화를 위해 ListAdapter와 DiffUtil을 도입해 성능을 높이고, 클릭 이벤트 로직을 어댑터에서 분리해 보는 것을 추천드려요. 나이키 앱의 느낌을 아주 잘 살린 완성도 높은 작업물입니다. 고생 많으셨습니다! 🤓

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

필요없는 제트팩 컴포즈 파일안에 프래그먼트들이 들어가 있습니다! 아마 프로젝트를 생성할때 기본적으로 들어가 있는 파일(color.kt, theme.kt, type.kt)로 보이는데 ui/theme 밖에 프래그먼트를 빼고 따로 프래그먼트 파일을 정의해서 넣어주세요! adapter도 따로 파일 만들어서 보면은 프로젝트 구조를 볼때 편하게 나눠 볼 수 있습니다!

Copy link
Copy Markdown
Collaborator

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 +19
val imgProduct: ImageView = itemView.findViewById(R.id.imgProduct)
val tvName: TextView = itemView.findViewById(R.id.tvName)
val tvPrice: TextView = itemView.findViewById(R.id.tvPrice)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

findViewById를 사용해 뷰를 참조하고 있는데, 이는 런타임 Null 포인터 예외의 위험이 있고 코드가 길어집니다. 프로젝트의 다른 부분(MainActivity)처럼 어댑터 내에서도 ViewBinding을 적용하여 안정성과 가독성을 높이는 것이 좋을거 같습니다!

Comment on lines +11 to +14
class HomeProductAdapter(
private val productList: List<Product>,
private val onItemClick: (Product) -> Unit
) : RecyclerView.Adapter<HomeProductAdapter.HomeProductViewHolder>() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

현재 RecyclerView.Adapter를 상속받아 사용 중인데, 데이터 변경 시 notifyDataSetChanged()를 호출하게 되면 리스트 전체를 다시 그리게 되어 성능 저하가 발생할 수 있습니다. 지금은 괜찮지만 화면에 그리는게 많은 경우에는 ListAdapter와 DiffUtil을 사용해 변경된 아이템만 효율적으로 업데이트하도록 개선하는것도 좋을거 같습니다!

Comment on lines +51 to +57
holder.imgLike.setOnClickListener {
product.isLiked = !product.isLiked

holder.imgLike.setImageResource(
if (product.isLiked) R.drawable.ic_heart_filled
else R.drawable.ic_heartstraight
)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

현재 onBindViewHolder 내부에서 imgLike.setOnClickListener를 통해 직접 product.isLiked 상태를 변경하고 있습니다

지금은 단순한 기능 구현이니 괜찮지만, 상태 변경 로직은 어댑터가 아닌 ViewModel이나 Fragment에서 처리하도록 콜백 함수를 하나 더 추가하는 것이 좋습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants