Skip to content

Conversation

@bongbak
Copy link
Contributor

@bongbak bongbak commented Oct 9, 2025

📌 PR 제목

4주차 미션 제출

다시 수정해서 제대로 올렸습니다! 감사합니당

✅ 변경 사항

이번 PR에서 변경된 내용을 간략히 정리해주세요.

  • 홈 화면(HomeFragment) 앨범 RecyclerView 레이아웃 및 RecylcerView 만들기
  • 앨범 화면(AlbumFragment)의 수록곡 RecycierView 레이아웃 및 RecycleriVew 만들기
  • 보관함 화면(LockerFragment) 저장한 곡 탭에 들어 노래 RecyclerView 레이아웃 및 RecyclerView 만들기
  • 홈 화면에서 “오늘 발매 음악”의 앨범 item의 Play 버튼 클릭 시 MiniPlayer에 동기화 해보기
  • 보관함 화면에서 각 음악 item의 […] 버튼 클릭 시 해당 아이템 삭제해보기

📷 영상 및 스크린샷

image image image image image

@bongbak bongbak self-assigned this Oct 9, 2025
@bongbak bongbak changed the title [Mission] 3주차 미션제출 [Mission] 4주차 미션제출 Oct 10, 2025
Copy link
Member

@yangjiae12 yangjiae12 left a comment

Choose a reason for hiding this comment

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

4주차 미션 수고 많으셨습니다~! 다음부터는 커밋 컨벤션도 지켜서 작성해 주시면 좋을 것 같습니다

// }
// binding.songSelectRandomIv.setOnClickListener {
// setRandomStatus(false)
// }
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 +24 to +29
fun removeItem(position:Int){
savedList.removeAt(position)
notifyItemRemoved(position)
notifyItemRangeChanged(position, savedList.size)
}

Copy link
Member

Choose a reason for hiding this comment

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

현재 removeItem()에서 연속으로 호출하고 있는데, notifyItemRemoved(position)만 호출해도 이후 아이템들의 위치가 자동으로 재계산되므로, 일반적으로 notifyItemRangeChanged()는 불필요합니다.

holder.binding.itemSavedMore01Iv.setOnClickListener {
myItemClickListener.onRemoveItem(position)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

현재 클릭 리스너가 bind() 함수 내부에 설정되어 있는데, onBindViewHolder가 호출되어 bind()가 실행될 때마다, 즉 아이템이 화면에 나타날 때마다 리스너 객체를 새로 생성하여 설정하게 되고 이로 인해 불필요한 객체를 생성하게 된다고 생각합니다. 따라서 ViewHolderinit 블록을 사용하여 클릭 리스너를 한 번만 설정하면 좋을 것 같습니다.

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.

3 participants