submitList

open fun submitList(@Nullable list: List<T>)(source)

Submits a new list to be diffed, and displayed.

If a list is already being displayed, a diff will be computed on a background thread, which will dispatch Adapter.notifyItem events on the main thread.

Parameters

list

The new list to be displayed.


open fun submitList(@Nullable list: List<T>, @Nullable commitCallback: Runnable)(source)

Set the new list to be displayed.

If a List is already being displayed, a diff will be computed on a background thread, which will dispatch Adapter.notifyItem events on the main thread.

The commit callback can be used to know when the List is committed, but note that it may not be executed. If List B is submitted immediately after List A, and is committed directly, the callback associated with List A will not be run.

Parameters

list

The new list to be displayed.

commitCallback

Optional runnable that is executed when the List is committed, if it is committed.