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/
The Myers diff algorithm: part 1 – The If Works
If you enjoy this article, I have published a book explaining the internals of Git through implementation: Building Git. — As a programmer, you probably use a version control system such as Git, and spend an awful lot of your time looking at diffs. You u
blog.jcoglan.com
https://www.nathaniel.ai/myers-diff/
The Myers Difference Algorithm
Visualizing Diffs The Myers difference algorithm In 1986, Eugene Myers published An O(ND) Difference Algorithm and Its Variations, which unified the problems of finding the longest common subsequence of two sequences (the LCS of "driftwood" and "artwork" i
www.nathaniel.ai
https://developer.android.com/reference/androidx/recyclerview/widget/DiffUtil
DiffUtil | Android Developers
androidx.constraintlayout.core.motion.parse
developer.android.com
https://developer.android.com/reference/androidx/recyclerview/widget/ListAdapter
ListAdapter | Android Developers
androidx.constraintlayout.core.motion.parse
developer.android.com
Android: ListAdapter, a Better Implementation for the RecyclerView
I am assuming you are aware of the RecyclerView and it’s implementation!
medium.com
'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 |