Showing name of chapters that are oneshots or just weird

This commit is contained in:
Jay 2020-03-09 21:11:09 -07:00
parent 1966dd594f
commit 8134d4c2fa
2 changed files with 14 additions and 10 deletions

View File

@ -157,15 +157,17 @@ class MangaHeaderHolder(
visibleIf(nextChapter != null && !item.isLocked) visibleIf(nextChapter != null && !item.isLocked)
if (nextChapter != null) { if (nextChapter != null) {
val number = adapter.decimalFormat.format(nextChapter.chapter_number.toDouble()) val number = adapter.decimalFormat.format(nextChapter.chapter_number.toDouble())
text = resources.getString( text = if (nextChapter.chapter_number > 0) resources.getString(
when { if (nextChapter.last_page_read > 0) R.string.continue_reading_chapter
nextChapter.last_page_read > 0 && nextChapter.chapter_number <= 0 -> else R.string.start_reading_chapter, number
R.string.continue_reading
nextChapter.chapter_number <= 0 -> R.string.start_reading
nextChapter.last_page_read > 0 -> R.string.continue_reading_chapter
else -> R.string.start_reader_chapter
}, number
) )
else {
val name = nextChapter.name
resources.getString(
if (nextChapter.last_page_read > 0) R.string.continue_reading_x
else R.string.start_reading_x, name
)
}
} }
} }
@ -173,7 +175,7 @@ class MangaHeaderHolder(
chapters_title.text = itemView.resources.getQuantityString(R.plurals.chapters, count, count) chapters_title.text = itemView.resources.getQuantityString(R.plurals.chapters, count, count)
top_view.updateLayoutParams<ConstraintLayout.LayoutParams> { top_view.updateLayoutParams<ConstraintLayout.LayoutParams> {
height = adapter.coverListener.topCoverHeight() ?: 0 height = adapter.coverListener.topCoverHeight()
} }
manga_status.text = (itemView.context.getString( when (manga.status) { manga_status.text = (itemView.context.getString( when (manga.status) {

View File

@ -515,7 +515,9 @@
<!-- Manga chapters fragment --> <!-- Manga chapters fragment -->
<string name="start_reading">Start reading</string> <string name="start_reading">Start reading</string>
<string name="start_reader_chapter">Start reading Chapter %1$s</string> <string name="start_reading_x">Start reading %1$s</string>
<string name="continue_reading_x">Continue reading %1$s</string>
<string name="start_reading_chapter">Start reading Chapter %1$s</string>
<string name="continue_reading_chapter">Continue reading Chapter %1$s</string> <string name="continue_reading_chapter">Continue reading Chapter %1$s</string>
<string name="continue_reading">Continue reading</string> <string name="continue_reading">Continue reading</string>
<string name="manga_chapters_tab">Chapters</string> <string name="manga_chapters_tab">Chapters</string>