Skip to content
Snippets Groups Projects
Commit 9fa0800e authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

DiffUtil: Implement getItemCount & set CB optional

parent b16dafcd
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ abstract class DiffUtilAdapter<D, VH : androidx.recyclerview.widget.RecyclerView
private val updateActor = actor<List<D>>(capacity = Channel.CONFLATED) {
for (list in channel) internalUpdate(list)
}
protected abstract fun onUpdateFinished()
protected open fun onUpdateFinished() {}
@MainThread
fun update (list: List<D>) {
......@@ -43,6 +43,8 @@ abstract class DiffUtilAdapter<D, VH : androidx.recyclerview.widget.RecyclerView
open fun getItem(position: Int) = dataset[position]
override fun getItemCount() = dataset.size
protected open fun detectMoves() = false
protected open fun createCB() = DiffCallback<D>()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment