Room 과 Flow를 공부하기 전에, 잠시 ListAdapater와 DiffUtil에 대해서 알아보고 가겠습니다.
DiffUtil이란?
DiffUtil is a utility class that calculates the difference between two lists and outputs a list of update operations that converts the first list into the second one.
2개 list를 비교하는 것이다.
It can be used to calculate updates for a RecyclerView Adapter. See ListAdapter and AsyncListDiffer which can simplify the use of DiffUtil on a background thread.
RecyclerView의 Adapter를 계산하는데 사용할 수 있다. ListAdapater 및 AsyncListDiffer를 참조해봐라.
- 참조
https://blog.jcoglan.com/2017/02/12/the-myers-diff-algorithm-part-1/
https://www.nathaniel.ai/myers-diff/
https://developer.android.com/reference/androidx/recyclerview/widget/DiffUtil
https://developer.android.com/reference/androidx/recyclerview/widget/ListAdapter
'Android Jetpack' 카테고리의 다른 글
ROOM + Coroutine Flow - 3 (Why Room & Coroutine - 1) (0) | 2023.01.27 |
---|---|
ROOM + Coroutine Flow - 2 (ListAdapter / DiffUtil Ex) (0) | 2023.01.25 |
DataBinding - 5 (Two Way Binding + BindingAdapter Ex) (0) | 2023.01.21 |
DataBinding - 4 (BindingAdapter) (0) | 2023.01.20 |
DataBinding - 3 (BindingAdapter) (0) | 2023.01.20 |