pull/1198/head
gedoor 3 years ago
parent c751663fef
commit 559e3ba1a1
  1. 2
      app/src/main/java/io/legado/app/base/adapter/RecyclerAdapter.kt
  2. 1
      app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt
  3. 2
      app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt
  4. 3
      app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt
  5. 2
      app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditAdapter.kt
  6. 2
      app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditAdapter.kt

@ -1,5 +1,6 @@
package io.legado.app.base.adapter package io.legado.app.base.adapter
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.util.SparseArray import android.util.SparseArray
import android.view.LayoutInflater import android.view.LayoutInflater
@ -84,6 +85,7 @@ abstract class RecyclerAdapter<ITEM, VB : ViewBinding>(protected val context: Co
} }
} }
@SuppressLint("NotifyDataSetChanged")
@Synchronized @Synchronized
fun setItems(items: List<ITEM>?) { fun setItems(items: List<ITEM>?) {
kotlin.runCatching { kotlin.runCatching {

@ -83,6 +83,7 @@ class ImportBookSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickList
} }
} }
@SuppressLint("NotifyDataSetChanged")
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
binding.toolBar.setBackgroundColor(primaryColor) binding.toolBar.setBackgroundColor(primaryColor)
binding.toolBar.setTitle(R.string.import_book_source) binding.toolBar.setTitle(R.string.import_book_source)

@ -1,5 +1,6 @@
package io.legado.app.ui.association package io.legado.app.ui.association
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.content.DialogInterface import android.content.DialogInterface
import android.os.Bundle import android.os.Bundle
@ -65,6 +66,7 @@ class ImportReplaceRuleDialog : BaseDialogFragment() {
return inflater.inflate(R.layout.dialog_recycler_view, container) return inflater.inflate(R.layout.dialog_recycler_view, container)
} }
@SuppressLint("NotifyDataSetChanged")
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
binding.toolBar.setBackgroundColor(primaryColor) binding.toolBar.setBackgroundColor(primaryColor)
binding.toolBar.setTitle(R.string.import_replace_rule) binding.toolBar.setTitle(R.string.import_replace_rule)

@ -1,5 +1,6 @@
package io.legado.app.ui.book.arrange package io.legado.app.ui.book.arrange
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
@ -88,6 +89,7 @@ class ArrangeBookAdapter(context: Context, val callBack: CallBack) :
} }
} }
@SuppressLint("NotifyDataSetChanged")
fun selectAll(selectAll: Boolean) { fun selectAll(selectAll: Boolean) {
if (selectAll) { if (selectAll) {
getItems().forEach { getItems().forEach {
@ -100,6 +102,7 @@ class ArrangeBookAdapter(context: Context, val callBack: CallBack) :
callBack.upSelectCount() callBack.upSelectCount()
} }
@SuppressLint("NotifyDataSetChanged")
fun revertSelection() { fun revertSelection() {
getItems().forEach { getItems().forEach {
if (selectedBooks.contains(it)) { if (selectedBooks.contains(it)) {

@ -1,5 +1,6 @@
package io.legado.app.ui.book.source.edit package io.legado.app.ui.book.source.edit
import android.annotation.SuppressLint
import android.text.Editable import android.text.Editable
import android.text.TextWatcher import android.text.TextWatcher
import android.view.LayoutInflater import android.view.LayoutInflater
@ -12,6 +13,7 @@ import io.legado.app.databinding.ItemSourceEditBinding
class BookSourceEditAdapter : RecyclerView.Adapter<BookSourceEditAdapter.MyViewHolder>() { class BookSourceEditAdapter : RecyclerView.Adapter<BookSourceEditAdapter.MyViewHolder>() {
var editEntities: ArrayList<EditEntity> = ArrayList() var editEntities: ArrayList<EditEntity> = ArrayList()
@SuppressLint("NotifyDataSetChanged")
set(value) { set(value) {
field = value field = value
notifyDataSetChanged() notifyDataSetChanged()

@ -1,5 +1,6 @@
package io.legado.app.ui.rss.source.edit package io.legado.app.ui.rss.source.edit
import android.annotation.SuppressLint
import android.text.Editable import android.text.Editable
import android.text.TextWatcher import android.text.TextWatcher
import android.view.LayoutInflater import android.view.LayoutInflater
@ -12,6 +13,7 @@ import io.legado.app.databinding.ItemSourceEditBinding
class RssSourceEditAdapter : RecyclerView.Adapter<RssSourceEditAdapter.MyViewHolder>() { class RssSourceEditAdapter : RecyclerView.Adapter<RssSourceEditAdapter.MyViewHolder>() {
var editEntities: ArrayList<EditEntity> = ArrayList() var editEntities: ArrayList<EditEntity> = ArrayList()
@SuppressLint("NotifyDataSetChanged")
set(value) { set(value) {
field = value field = value
notifyDataSetChanged() notifyDataSetChanged()

Loading…
Cancel
Save