Android Jetpack

ROOM + Coroutine Flow - 1 (ListAdapter / DiffUtil 이란?)

----___<<<<< 2023. 1. 24. 03:24

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://developer.android.com/reference/androidx/recyclerview/widget/DiffUtil

 

 

 

 

 

- 참조

 

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

https://medium.com/geekculture/android-listadapter-a-better-implementation-for-the-recyclerview-1af1826a7d21

 

Android: ListAdapter, a Better Implementation for the RecyclerView

I am assuming you are aware of the RecyclerView and it’s implementation!

medium.com