Open
Conversation
탭 레이아웃 저장한 곡, 음악파일, 저장 앨범 프래그먼트 추가 및 연결 기능 구현
yangjiae12
reviewed
Oct 12, 2025
Member
yangjiae12
left a comment
There was a problem hiding this comment.
4주차 미션 수고 많으셨습니다~! 다음부터는 커밋 컨벤션도 지켜서 작성해 주시면 좋을 것 같습니다
| // } | ||
| // binding.songSelectRandomIv.setOnClickListener { | ||
| // setRandomStatus(false) | ||
| // } |
Member
There was a problem hiding this comment.
주석 자체를 삭제하여 코드를 간결하게 유지할 수 없고 보존할 필요가 있는 내용이라면 한줄 주석(//)이 아닌 블록 주석(/* */)을 활용하여 코드를 깔끔하게 관리해도 좋을 것 같습니다
Comment on lines
+24
to
+29
| fun removeItem(position:Int){ | ||
| savedList.removeAt(position) | ||
| notifyItemRemoved(position) | ||
| notifyItemRangeChanged(position, savedList.size) | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
현재 removeItem()에서 연속으로 호출하고 있는데, notifyItemRemoved(position)만 호출해도 이후 아이템들의 위치가 자동으로 재계산되므로, 일반적으로 notifyItemRangeChanged()는 불필요합니다.
| holder.binding.itemSavedMore01Iv.setOnClickListener { | ||
| myItemClickListener.onRemoveItem(position) | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
현재 클릭 리스너가 bind() 함수 내부에 설정되어 있는데, onBindViewHolder가 호출되어 bind()가 실행될 때마다, 즉 아이템이 화면에 나타날 때마다 리스너 객체를 새로 생성하여 설정하게 되고 이로 인해 불필요한 객체를 생성하게 된다고 생각합니다. 따라서 ViewHolder의 init 블록을 사용하여 클릭 리스너를 한 번만 설정하면 좋을 것 같습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 PR 제목
다시 수정해서 제대로 올렸습니다! 감사합니당
✅ 변경 사항
📷 영상 및 스크린샷