RecyclerViewListAdapterAsyncListDiffDemo
RecyclerView's new ListAdapter & AsyncListDeff demo in kotlin
Install / Use
/learn @sayem405/RecyclerViewListAdapterAsyncListDiffDemoREADME
RecyclerViewListAdapterAsyncListDiffDemo
This is a demo of using new recyclerView's ListAdapter using Kotlin. Demo shows simple insert delete operation. This List adapter uses new AsyncListDiffer inside. AsyncListDiffer calculates the diffs of list item differences asynchronously. So, no need to worry about any threading implementation.
those ListAdapter & AsyncListDiffer are available from support library 27.1.0. So, consider to update it before using it.

prerequisite
need knowledge about RecyclerView & DiffUtil.Callback
Advantage
- Less code
- No need to worry about threading during comparing diffs
Disadvantage
you can not update any data in same list. Always need to pass a new list inside adapter to update your views. This is due to inside AsyncListDiffer there is a checking that if it founds old list reference it ommits the calculations of DiffUtil.Callback.
public void submitList(final List<T> newList) {
if (newList == mList) {
// nothing to do
return;
}
// rest of the code
}
Languages
Security Score
Audited on Jan 11, 2025
