提交 c20c7844 编写于 作者: limuyang2's avatar limuyang2

perf: diff 增加 runnable 回掉

上级 9b344142
......@@ -1340,13 +1340,15 @@ abstract class BaseQuickAdapter<T, VH : BaseViewHolder>
*
* @param list MutableList<T>?
*/
open fun setDiffNewData(list: MutableList<T>?) {
@JvmOverloads
open fun setDiffNewData(list: MutableList<T>?, commitCallback: Runnable? = null) {
if (hasEmptyView()) {
// If the current view is an empty view, set the new data directly without diff
setNewInstance(list)
commitCallback?.run()
return
}
mDiffHelper?.submitList(list)
mDiffHelper?.submitList(list, commitCallback)
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册