mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -49,7 +49,11 @@ abstract class DiffRecyclerAdapter<ITEM, VB : ViewBinding>(protected val context
|
||||
@Synchronized
|
||||
fun setItems(items: List<ITEM>?) {
|
||||
kotlin.runCatching {
|
||||
asyncListDiffer.submitList(items)
|
||||
if (items == null) {
|
||||
asyncListDiffer.submitList(null)
|
||||
} else {
|
||||
asyncListDiffer.submitList(ArrayList(items))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class ChangeCoverViewModel(application: Application) : BaseViewModel(application
|
||||
searchSuccess = {
|
||||
if (!searchBooks.contains(it)) {
|
||||
searchBooks.add(it)
|
||||
trySend(ArrayList(searchBooks))
|
||||
trySend(searchBooks)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user