submitList

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

Pass a new List to the AdapterHelper. Adapter updates will be computed on a background thread.

If a List is already present, a diff will be computed asynchronously on a background thread. When the diff is computed, it will be applied (dispatched to the ListUpdateCallback), and the new List will be swapped in.

Parameters

newList

The new List.


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

Pass a new List to the AdapterHelper. Adapter updates will be computed on a background thread.

If a List is already present, a diff will be computed asynchronously on a background thread. When the diff is computed, it will be applied (dispatched to the ListUpdateCallback), and the new List will be swapped in.

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

newList

The new List.

commitCallback

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