fix manga chapter number tile display

This commit is contained in:
Finnley Somdahl 2023-12-05 02:39:44 -06:00
parent 393ab1e513
commit c1a0eeb361

View file

@ -238,7 +238,20 @@ class MangaReadAdapter(
0
)
}
chip.text = "${names[limit * (position)]} - ${names[last - 1]}"
val startChapter = MangaNameAdapter.findChapterNumber(names[limit * (position)])
val endChapter = MangaNameAdapter.findChapterNumber(names[last - 1])
val startChapterString = if (startChapter != null) {
"Ch.$startChapter"
} else {
names[limit * (position)]
}
val endChapterString = if (endChapter != null) {
"Ch.$endChapter"
} else {
names[last - 1]
}
//chip.text = "${names[limit * (position)]} - ${names[last - 1]}"
chip.text = "$startChapterString - $endChapterString"
chip.setTextColor(
ContextCompat.getColorStateList(
fragment.requireContext(),