From 11eed6f35d395c23e998d3b429cc5cbc2d433d0d Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 21 Feb 2022 09:04:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/base/adapter/DiffRecyclerAdapter.kt | 6 +----- .../legado/app/ui/book/changecover/ChangeCoverViewModel.kt | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/base/adapter/DiffRecyclerAdapter.kt b/app/src/main/java/io/legado/app/base/adapter/DiffRecyclerAdapter.kt index d874a6774..dc001fbb4 100644 --- a/app/src/main/java/io/legado/app/base/adapter/DiffRecyclerAdapter.kt +++ b/app/src/main/java/io/legado/app/base/adapter/DiffRecyclerAdapter.kt @@ -49,11 +49,7 @@ abstract class DiffRecyclerAdapter(protected val context @Synchronized fun setItems(items: List?) { kotlin.runCatching { - if (items == null) { - asyncListDiffer.submitList(null) - } else { - asyncListDiffer.submitList(ArrayList(items)) - } + asyncListDiffer.submitList(items) } } diff --git a/app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverViewModel.kt b/app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverViewModel.kt index 8f33ed661..2f86d473b 100644 --- a/app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverViewModel.kt @@ -37,7 +37,7 @@ class ChangeCoverViewModel(application: Application) : BaseViewModel(application searchSuccess = { if (!searchBooks.contains(it)) { searchBooks.add(it) - trySend(searchBooks) + trySend(ArrayList(searchBooks)) } }