Android Jetpack 104

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

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 DiffU..

Android Jetpack 2023.01.24

DataBinding - 2 (two - way binding)

양방향 바인딩을 어떻게 설명할까 생각해봤는데 잘 설명된 글은 맨 아래 링크를 참고하시면 됩니다. 간단하게 한마디로 설명하면 데이터 View 다이렉트 결합이라고 생각하시면 됩니다. 한번 나이를 올리는 예제를 two - way binding이 아닌 일반적인 방식으로 아래글에서 만들어봤었는데 https://philosopher-chan.tistory.com/1598 DataBinding - 1 (two - way binding) 간단한 데이터바인딩에 대해서 알아보겠습니다. 한번정도는 쓰거나 들어보셨을 텐데, 기존에 방법을 한번 보고 가보도록 하겠습니다. 간단하게 나이를 조금씩 올리는 앱입니다. philosopher-chan.tistory.com Two way binding을 이용해서 한번 만들어보겠습니다. -..

Android Jetpack 2023.01.16

Simple Paging3

간단한 Paging 예제입니다. 구글 예제에 충실하게 한번 설명을 해보겠습니다. 여기 코드를 거의 그대로 사용했습니다. https://developer.android.com/codelabs/android-paging-basics#5 Android Paging 기본사항 | Android Developers 이 Codelab에서는 목록을 표시하는 앱에 Paging 라이브러리를 통합합니다. Paging 라이브러리를 사용하면 로컬 저장소에서나 네트워크를 통해 대규모 데이터 세트의 데이터 페이지를 로드하고 표시 developer.android.com 봐야할 부분은 PagingSource와 함께 ViewModel에서 Paging을 호출하는 부분입니다. 일단 ViewModel부터 한번 보겠습니다. ITEMS_PER_..

Android Jetpack 2022.12.24