pull/90/head^2
kunfei 5 years ago
parent 07ca45d5ae
commit 7712df964e
  1. 1
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceAdapter.kt
  2. 10
      app/src/main/java/io/legado/app/ui/book/source/manage/DiffCallBack.kt

@ -106,7 +106,6 @@ class BookSourceAdapter(context: Context, val callBack: CallBack) :
} else {
when (payloads[0]) {
1 -> cb_book_source.isChecked = selected.contains(item)
2 -> swt_enabled.isChecked = item.enabled
}
}
}

@ -30,14 +30,4 @@ class DiffCallBack(
&& oldItem.enabled == newItem.enabled
}
override fun getChangePayload(oldItemPosition: Int, newItemPosition: Int): Any? {
val oldItem = oldItems[oldItemPosition]
val newItem = newItems[newItemPosition]
return when {
oldItem.bookSourceName == newItem.bookSourceName
&& oldItem.bookSourceGroup == newItem.bookSourceGroup
&& oldItem.enabled != newItem.enabled -> 2
else -> null
}
}
}
Loading…
Cancel
Save