Skip to content

리싸이클러뷰 갱신 최적화#8

Open
HoneyPot8014 wants to merge 1 commit into
boostcampth:masterfrom
HoneyPot8014:develop
Open

리싸이클러뷰 갱신 최적화#8
HoneyPot8014 wants to merge 1 commit into
boostcampth:masterfrom
HoneyPot8014:develop

Conversation

@HoneyPot8014

@HoneyPot8014 HoneyPot8014 commented Jan 18, 2019

Copy link
Copy Markdown

리싸이클러뷰 갱신 최적화

  • support library 24.2.0에서 추가된 DiffUtil 클래스 이용했습니다.
  • 변경된 부분을 찾아 갱신해주는 역할을 합니다.
  • 리싸이클러뷰의 갱신을 개발자에게서 위임해 실수를 줄일 수 있습니다.
  • 기존에 사용되던 notifyDataSetChanged에 비해 성능이 더 좋다고 알고있습니다.

구현 사항

  • DiffUtill의 Callback 추상클래스를 재정한 POJODiffUtil 클래스를 생성 했습니다.
  • POJO의 equals()메서드를 재정의하여 Movie의 title을 비교하여 비교하도록 했습니다.
  • title이 같을 때 더 이상 비교하지 않도록, POJODiffUtil 클래스에서 areContentsTheSame의 메서드를 항상 true로 리턴하게 했습니다.

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.

1 participant