Fix recent groups not showing body text for unread history entries

This commit is contained in:
Jays2Kings 2023-03-10 15:36:37 -05:00
parent 9ffde130b9
commit a28e1b8759

View file

@ -72,7 +72,10 @@ class RecentMangaHolder(
} else {
addMoreUpdatesText(!moreVisible)
}
readLastText(!moreVisible).takeIf { it.isNotEmpty() }?.let { binding.body.text = it }
if (adapter.viewType.isHistory) {
readLastText(!moreVisible).takeIf { it.isNotEmpty() }
?.let { binding.body.text = it }
}
binding.endView.updateLayoutParams<ViewGroup.LayoutParams> {
height = binding.mainView.height
}
@ -299,7 +302,7 @@ class RecentMangaHolder(
private fun readLastText(show: Boolean, originalItem: RecentMangaItem? = null): String {
val item = originalItem ?: adapter.getItem(bindingAdapterPosition) as? RecentMangaItem ?: return ""
val notValidNum = item.mch.chapter.chapter_number <= 0
return if (adapter.viewType.isHistory && item.chapter.id != item.mch.chapter.id) {
return if (item.chapter.id != item.mch.chapter.id) {
if (show) {
itemView.context.timeSpanFromNow(R.string.read_, item.mch.history.last_read) + "\n"
} else {