Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Nov 3, 2023
1 parent 831e791 commit 6981286
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,20 @@ abstract class BaseBooksAdapter<VB : ViewBinding>(context: Context) :
) {
bundle.putBoolean("refresh", true)
}
if (oldItem.latestChapterTime != newItem.latestChapterTime) {
bundle.putBoolean("lastUpdateTime", true)
}
if (bundle.isEmpty) return null
return bundle
}

}

fun notification(bookUrl: String) {
for (i in 0 until itemCount) {
getItem(i)?.let {
if (it.bookUrl == bookUrl) {
notifyItemChanged(i, bundleOf(Pair("refresh", null), Pair("lastUpdateTime", null)))
return
}
getItems().forEachIndexed { i, it ->
if (it.bookUrl == bookUrl) {
notifyItemChanged(i, bundleOf(Pair("refresh", null), Pair("lastUpdateTime", null)))
return
}
}
}
Expand Down

0 comments on commit 6981286

Please sign in to comment.