pull/32/head
kunfei 5 years ago
parent d623d8a4df
commit f6ad6b0242
  1. 8
      app/src/main/java/io/legado/app/ui/booksource/BookSourceAdapter.kt

@ -68,6 +68,7 @@ class BookSourceAdapter(context: Context, val callBack: CallBack) :
override fun convert(holder: ItemViewHolder, item: BookSource, payloads: MutableList<Any>) { override fun convert(holder: ItemViewHolder, item: BookSource, payloads: MutableList<Any>) {
with(holder.itemView) { with(holder.itemView) {
if (payloads.isEmpty()) {
this.setBackgroundColor(context.backgroundColor) this.setBackgroundColor(context.backgroundColor)
if (item.bookSourceGroup.isNullOrEmpty()) { if (item.bookSourceGroup.isNullOrEmpty()) {
cb_book_source.text = item.bookSourceName cb_book_source.text = item.bookSourceName
@ -102,7 +103,12 @@ class BookSourceAdapter(context: Context, val callBack: CallBack) :
} }
popupMenu.show() popupMenu.show()
} }
} else {
when (payloads[0]) {
1 -> cb_book_source.isChecked = selectedIds.contains(item.bookSourceUrl)
2 -> swt_enabled.isChecked = item.enabled
}
}
} }
} }

Loading…
Cancel
Save