优化
This commit is contained in:
@@ -62,14 +62,11 @@ abstract class DiffRecyclerAdapter<ITEM, VB : ViewBinding>(protected val context
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun setItem(position: Int, item: ITEM) {
|
fun setItem(position: Int, item: ITEM) {
|
||||||
withContext(Dispatchers.Default) {
|
|
||||||
synchronized(asyncListDiffer) {
|
synchronized(asyncListDiffer) {
|
||||||
kotlin.runCatching {
|
kotlin.runCatching {
|
||||||
val list = ArrayList(asyncListDiffer.currentList)
|
asyncListDiffer.currentList[position] = item
|
||||||
list[position] = item
|
notifyItemChanged(position)
|
||||||
asyncListDiffer.submitList(list)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user