|
|
@ -22,46 +22,46 @@ abstract class BaseBooksAdapter<VH : RecyclerView.ViewHolder>( |
|
|
|
return when { |
|
|
|
return when { |
|
|
|
oldItem.durChapterTime != newItem.durChapterTime -> false |
|
|
|
oldItem.durChapterTime != newItem.durChapterTime -> false |
|
|
|
oldItem.name != newItem.name -> false |
|
|
|
oldItem.name != newItem.name -> false |
|
|
|
oldItem.author != newItem.author -> false |
|
|
|
oldItem.author != newItem.author -> false |
|
|
|
oldItem.durChapterTitle != newItem.durChapterTitle -> false |
|
|
|
oldItem.durChapterTitle != newItem.durChapterTitle -> false |
|
|
|
oldItem.latestChapterTitle != newItem.latestChapterTitle -> false |
|
|
|
oldItem.latestChapterTitle != newItem.latestChapterTitle -> false |
|
|
|
oldItem.lastCheckCount != newItem.lastCheckCount -> false |
|
|
|
oldItem.lastCheckCount != newItem.lastCheckCount -> false |
|
|
|
oldItem.getDisplayCover() != newItem.getDisplayCover() -> false |
|
|
|
oldItem.getDisplayCover() != newItem.getDisplayCover() -> false |
|
|
|
oldItem.getUnreadChapterNum() != newItem.getUnreadChapterNum() -> false |
|
|
|
oldItem.getUnreadChapterNum() != newItem.getUnreadChapterNum() -> false |
|
|
|
else -> true |
|
|
|
else -> true |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun getChangePayload(oldItem: Book, newItem: Book): Any? { |
|
|
|
override fun getChangePayload(oldItem: Book, newItem: Book): Any? { |
|
|
|
val bundle = bundleOf() |
|
|
|
val bundle = bundleOf() |
|
|
|
if (oldItem.name != newItem.name) { |
|
|
|
if (oldItem.name != newItem.name) { |
|
|
|
bundle.putString("name", newItem.name) |
|
|
|
bundle.putString("name", newItem.name) |
|
|
|
} |
|
|
|
|
|
|
|
if (oldItem.author != newItem.author) { |
|
|
|
|
|
|
|
bundle.putString("author", newItem.author) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (oldItem.durChapterTitle != newItem.durChapterTitle) { |
|
|
|
|
|
|
|
bundle.putString("dur", newItem.durChapterTitle) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (oldItem.latestChapterTitle != newItem.latestChapterTitle) { |
|
|
|
|
|
|
|
bundle.putString("last", newItem.latestChapterTitle) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (oldItem.getDisplayCover() != newItem.getDisplayCover()) { |
|
|
|
|
|
|
|
bundle.putString("cover", newItem.getDisplayCover()) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (oldItem.lastCheckCount != newItem.lastCheckCount |
|
|
|
|
|
|
|
|| oldItem.durChapterTime != newItem.durChapterTime |
|
|
|
|
|
|
|
|| oldItem.getUnreadChapterNum() != newItem.getUnreadChapterNum() |
|
|
|
|
|
|
|
|| oldItem.lastCheckCount != newItem.lastCheckCount |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
bundle.putBoolean("refresh", true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (bundle.isEmpty) return null |
|
|
|
|
|
|
|
return bundle |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (oldItem.author != newItem.author) { |
|
|
|
|
|
|
|
bundle.putString("author", newItem.author) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (oldItem.durChapterTitle != newItem.durChapterTitle) { |
|
|
|
|
|
|
|
bundle.putString("dur", newItem.durChapterTitle) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (oldItem.latestChapterTitle != newItem.latestChapterTitle) { |
|
|
|
|
|
|
|
bundle.putString("last", newItem.latestChapterTitle) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (oldItem.getDisplayCover() != newItem.getDisplayCover()) { |
|
|
|
|
|
|
|
bundle.putString("cover", newItem.getDisplayCover()) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (oldItem.lastCheckCount != newItem.lastCheckCount |
|
|
|
|
|
|
|
|| oldItem.durChapterTime != newItem.durChapterTime |
|
|
|
|
|
|
|
|| oldItem.getUnreadChapterNum() != newItem.getUnreadChapterNum() |
|
|
|
|
|
|
|
|| oldItem.lastCheckCount != newItem.lastCheckCount |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
bundle.putBoolean("refresh", true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (bundle.isEmpty) return null |
|
|
|
|
|
|
|
return bundle |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun notification(bookUrl: String) { |
|
|
|
fun notification(bookUrl: String) { |
|
|
|
for (i in 0 until itemCount) { |
|
|
|
for (i in 0 until itemCount) { |
|
|
|
callBack.getItem(i).let { |
|
|
|
callBack.getItem(i).let { |
|
|
|