优化
This commit is contained in:
@@ -56,6 +56,9 @@ abstract class BaseBooksAdapter<VB : ViewBinding>(context: Context) :
|
|||||||
) {
|
) {
|
||||||
bundle.putBoolean("refresh", true)
|
bundle.putBoolean("refresh", true)
|
||||||
}
|
}
|
||||||
|
if (oldItem.latestChapterTime != newItem.latestChapterTime) {
|
||||||
|
bundle.putBoolean("lastUpdateTime", true)
|
||||||
|
}
|
||||||
if (bundle.isEmpty) return null
|
if (bundle.isEmpty) return null
|
||||||
return bundle
|
return bundle
|
||||||
}
|
}
|
||||||
@@ -63,15 +66,13 @@ abstract class BaseBooksAdapter<VB : ViewBinding>(context: Context) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun notification(bookUrl: String) {
|
fun notification(bookUrl: String) {
|
||||||
for (i in 0 until itemCount) {
|
getItems().forEachIndexed { i, it ->
|
||||||
getItem(i)?.let {
|
|
||||||
if (it.bookUrl == bookUrl) {
|
if (it.bookUrl == bookUrl) {
|
||||||
notifyItemChanged(i, bundleOf(Pair("refresh", null), Pair("lastUpdateTime", null)))
|
notifyItemChanged(i, bundleOf(Pair("refresh", null), Pair("lastUpdateTime", null)))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fun upLastUpdateTime() {
|
fun upLastUpdateTime() {
|
||||||
notifyItemRangeChanged(0, itemCount, bundleOf(Pair("lastUpdateTime", null)))
|
notifyItemRangeChanged(0, itemCount, bundleOf(Pair("lastUpdateTime", null)))
|
||||||
|
|||||||
Reference in New Issue
Block a user