Closed radityagumay closed 4 years ago
According to https://developer.android.com/reference/androidx/recyclerview/widget/ListAdapter?hl=en, "This class is a convenience wrapper around AsyncListDiffer that implements Adapter common default behavior for item access and counting. "
According to https://developer.android.com/reference/androidx/recyclerview/widget/ListAdapter?hl=en, "This class is a convenience wrapper around AsyncListDiffer that implements Adapter common default behavior for item access and counting. "
omg, I missed that.
ListAdapter is available both support and androidx. will close this PR
here's the old one https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/widget/ListAdapter.java;l=26?q=ListAda&sq=&ss=android
So technically we are already using AsyncListDiffer
by using ListAdapter
, that's nice!
Thank you @iNoles and @radityagumay for your efforts 🙏
Continuing our discussion on twitter. So, it's always better if engineers could collaborate with open source projects.
I just create a PR for proxying a few functions that ListAdapter has and override by AsyncListDiffer.
these the list of functions that changes:
Under the hood,
AsyncListDiffer
will executesubmitList
in the form of background thread. See here https://cs.android.com/androidx/platform/frameworks/support/+/androidx-master-dev:recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/AsyncListDiffer.java;l=289;bpv=1Thank you!