pull/1652/head
kunfei 3 years ago
parent 3a8a51ac7c
commit 3b57ee2d76
  1. 13
      app/src/main/java/io/legado/app/base/adapter/DiffRecyclerAdapter.kt

@ -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 { asyncListDiffer.currentList[position] = item
val list = ArrayList(asyncListDiffer.currentList) notifyItemChanged(position)
list[position] = item
asyncListDiffer.submitList(list)
}
} }
} }
} }

Loading…
Cancel
Save