diff --git a/app/src/main/java/io/legado/app/base/adapter/RecyclerAdapter.kt b/app/src/main/java/io/legado/app/base/adapter/RecyclerAdapter.kt index 11dd17f8c..d6749e63a 100644 --- a/app/src/main/java/io/legado/app/base/adapter/RecyclerAdapter.kt +++ b/app/src/main/java/io/legado/app/base/adapter/RecyclerAdapter.kt @@ -1,5 +1,6 @@ package io.legado.app.base.adapter +import android.annotation.SuppressLint import android.content.Context import android.util.SparseArray import android.view.LayoutInflater @@ -84,6 +85,7 @@ abstract class RecyclerAdapter(protected val context: Co } } + @SuppressLint("NotifyDataSetChanged") @Synchronized fun setItems(items: List?) { kotlin.runCatching { diff --git a/app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt b/app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt index 60ca29a36..7775cbc0b 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt @@ -83,6 +83,7 @@ class ImportBookSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickList } } + @SuppressLint("NotifyDataSetChanged") override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { binding.toolBar.setBackgroundColor(primaryColor) binding.toolBar.setTitle(R.string.import_book_source) diff --git a/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt b/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt index 32f039253..0cf97bb6a 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt @@ -1,5 +1,6 @@ package io.legado.app.ui.association +import android.annotation.SuppressLint import android.content.Context import android.content.DialogInterface import android.os.Bundle @@ -65,6 +66,7 @@ class ImportReplaceRuleDialog : BaseDialogFragment() { return inflater.inflate(R.layout.dialog_recycler_view, container) } + @SuppressLint("NotifyDataSetChanged") override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { binding.toolBar.setBackgroundColor(primaryColor) binding.toolBar.setTitle(R.string.import_replace_rule) diff --git a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt index 00474109f..d35d23542 100644 --- a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt @@ -1,5 +1,6 @@ package io.legado.app.ui.book.arrange +import android.annotation.SuppressLint import android.content.Context import android.view.View import android.view.ViewGroup @@ -88,6 +89,7 @@ class ArrangeBookAdapter(context: Context, val callBack: CallBack) : } } + @SuppressLint("NotifyDataSetChanged") fun selectAll(selectAll: Boolean) { if (selectAll) { getItems().forEach { @@ -100,6 +102,7 @@ class ArrangeBookAdapter(context: Context, val callBack: CallBack) : callBack.upSelectCount() } + @SuppressLint("NotifyDataSetChanged") fun revertSelection() { getItems().forEach { if (selectedBooks.contains(it)) { diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditAdapter.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditAdapter.kt index c80271793..b2b168dcc 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditAdapter.kt @@ -1,5 +1,6 @@ package io.legado.app.ui.book.source.edit +import android.annotation.SuppressLint import android.text.Editable import android.text.TextWatcher import android.view.LayoutInflater @@ -12,6 +13,7 @@ import io.legado.app.databinding.ItemSourceEditBinding class BookSourceEditAdapter : RecyclerView.Adapter() { var editEntities: ArrayList = ArrayList() + @SuppressLint("NotifyDataSetChanged") set(value) { field = value notifyDataSetChanged() diff --git a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditAdapter.kt b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditAdapter.kt index a2c80b3e1..9bccbcf04 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditAdapter.kt @@ -1,5 +1,6 @@ package io.legado.app.ui.rss.source.edit +import android.annotation.SuppressLint import android.text.Editable import android.text.TextWatcher import android.view.LayoutInflater @@ -12,6 +13,7 @@ import io.legado.app.databinding.ItemSourceEditBinding class RssSourceEditAdapter : RecyclerView.Adapter() { var editEntities: ArrayList = ArrayList() + @SuppressLint("NotifyDataSetChanged") set(value) { field = value notifyDataSetChanged()