|
|
|
@ -74,8 +74,7 @@ abstract class DiffRecyclerAdapter<ITEM, VB : ViewBinding>(protected val context |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
suspend fun updateItem(item: ITEM) { |
|
|
|
|
withContext(Dispatchers.Main) { |
|
|
|
|
fun updateItem(item: ITEM) { |
|
|
|
|
synchronized(asyncListDiffer) { |
|
|
|
|
kotlin.runCatching { |
|
|
|
|
val index = asyncListDiffer.currentList.indexOf(item) |
|
|
|
@ -86,10 +85,8 @@ abstract class DiffRecyclerAdapter<ITEM, VB : ViewBinding>(protected val context |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
suspend fun updateItem(position: Int, payload: Any) { |
|
|
|
|
withContext(Dispatchers.Main) { |
|
|
|
|
fun updateItem(position: Int, payload: Any) { |
|
|
|
|
synchronized(asyncListDiffer) { |
|
|
|
|
kotlin.runCatching { |
|
|
|
|
val size = itemCount |
|
|
|
@ -99,10 +96,8 @@ abstract class DiffRecyclerAdapter<ITEM, VB : ViewBinding>(protected val context |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
suspend fun updateItems(fromPosition: Int, toPosition: Int, payloads: Any) { |
|
|
|
|
withContext(Dispatchers.Main) { |
|
|
|
|
fun updateItems(fromPosition: Int, toPosition: Int, payloads: Any) { |
|
|
|
|
synchronized(asyncListDiffer) { |
|
|
|
|
kotlin.runCatching { |
|
|
|
|
val size = itemCount |
|
|
|
@ -116,7 +111,6 @@ abstract class DiffRecyclerAdapter<ITEM, VB : ViewBinding>(protected val context |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun isEmpty() = asyncListDiffer.currentList.isEmpty() |
|
|
|
|
|
|
|
|
|