mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix scanlator in body of updates
This commit is contained in:
parent
0485a7f692
commit
982cbc42fd
1 changed files with 18 additions and 20 deletions
|
@ -232,18 +232,17 @@ class RecentMangaHolder(
|
|||
it.findViewById<DownloadButton>(R.id.download_button)?.tag
|
||||
}.toList()
|
||||
if (extraIds == item.mch.extraChapters.map { it.id }) {
|
||||
var hasSameChapter = false
|
||||
item.mch.extraChapters.forEachIndexed { index, chapter ->
|
||||
RecentSubChapterItemBinding.bind(binding.moreChaptersLayout.getChildAt(index))
|
||||
.configureView(chapter, item)
|
||||
}
|
||||
if (isUpdates && binding.moreChaptersLayout.children.any { view ->
|
||||
!RecentSubChapterItemBinding.bind(view).subtitle.text.isNullOrBlank()
|
||||
}
|
||||
) {
|
||||
showScanlatorInBody(moreVisible, item)
|
||||
} else {
|
||||
addMoreUpdatesText(!moreVisible, item)
|
||||
val binding =
|
||||
RecentSubChapterItemBinding.bind(binding.moreChaptersLayout.getChildAt(index))
|
||||
binding.configureView(chapter, item)
|
||||
if (isUpdates && !binding.subtitle.text.isNullOrBlank() && !hasSameChapter) {
|
||||
showScanlatorInBody(moreVisible, item)
|
||||
hasSameChapter = true
|
||||
}
|
||||
}
|
||||
addMoreUpdatesText(!moreVisible, item)
|
||||
} else {
|
||||
binding.moreChaptersLayout.removeAllViews()
|
||||
var hasSameChapter = false
|
||||
|
@ -255,16 +254,9 @@ class RecentMangaHolder(
|
|||
true,
|
||||
)
|
||||
binding.configureView(chapter, item)
|
||||
if (isUpdates && chapter.isRecognizedNumber &&
|
||||
chapter.chapter_number == item.chapter.chapter_number &&
|
||||
!chapter.scanlator.isNullOrBlank()
|
||||
) {
|
||||
binding.subtitle.text = chapter.scanlator
|
||||
binding.subtitle.isVisible = true
|
||||
if (!hasSameChapter) {
|
||||
showScanlatorInBody(moreVisible, item)
|
||||
hasSameChapter = true
|
||||
}
|
||||
if (isUpdates && !binding.subtitle.text.isNullOrBlank() && !hasSameChapter) {
|
||||
showScanlatorInBody(moreVisible, item)
|
||||
hasSameChapter = true
|
||||
}
|
||||
}
|
||||
addMoreUpdatesText(!moreVisible, item)
|
||||
|
@ -348,6 +340,12 @@ class RecentMangaHolder(
|
|||
context.timeSpanFromNow(R.string.read_, dateRead)
|
||||
.takeIf { date - dateRead < TimeUnit.DAYS.toMillis(1) }
|
||||
} ?: ""
|
||||
if (isUpdates && chapter.isRecognizedNumber &&
|
||||
chapter.chapter_number == item.chapter.chapter_number &&
|
||||
!chapter.scanlator.isNullOrBlank()
|
||||
) {
|
||||
subtitle.text = chapter.scanlator
|
||||
}
|
||||
subtitle.isVisible = subtitle.text.isNotBlank()
|
||||
title.textSize = (if (subtitle.isVisible) 14f else 14.5f)
|
||||
root.setOnClickListener {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue