Add recyclerview submit with callback + up version

This commit is contained in:
Georgy Turev 2021-04-29 20:06:15 +05:00
parent 0c8b444f20
commit 194f1862c6
2 changed files with 14 additions and 1 deletions

View File

@ -10,7 +10,7 @@ dependencies {
constraints {
implementation("androidx.recyclerview:recyclerview") {
version {
require '1.0.0'
require '1.1.0'
}
}
implementation("androidx.core:core-ktx") {

View File

@ -71,6 +71,19 @@ open class DelegationListAdapter<TItem>(config: AsyncDifferConfig<TItem>) : Recy
*/
fun submitList(list: List<TItem>?) = differ.submitList(list)
/**
* Submits a new list to be diffed, and displayed.
*
* 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.
*
* @param newList The new List.
* @param commitCallback Optional runnable that is executed when the List is committed, if
* it is committed.
*/
fun submitList(list: List<TItem>?, commitCallback: (() -> Unit)?) = differ.submitList(list, commitCallback)
/**
* Same as [submitList] with fast simple remove all items of a previous list
*/