correct display of a fully read manga
shows 100% in the details menu if the manga has actually been read in full.
This commit is contained in:
@@ -484,8 +484,10 @@ class DetailsActivity :
|
||||
textViewProgress.textAndVisible = if (info.percent <= 0f) {
|
||||
null
|
||||
} else {
|
||||
getString(R.string.percent_string_pattern, (info.percent * 100f).toInt().toString())
|
||||
val displayPercent = if (info.percent >= 0.999999f) 100 else (info.percent * 100f).toInt()
|
||||
getString(R.string.percent_string_pattern, displayPercent.toString())
|
||||
}
|
||||
|
||||
progress.setProgressCompat(
|
||||
(progress.max * info.percent.coerceIn(0f, 1f)).roundToInt(),
|
||||
true,
|
||||
|
||||
@@ -473,15 +473,9 @@ class ReaderViewModel @Inject constructor(
|
||||
if (chaptersCount == 0 || pagesCount == 0) {
|
||||
return PROGRESS_NONE
|
||||
}
|
||||
val pagePercent = (pageIndex + 1).toFloat() / pagesCount
|
||||
val pagePercent = (pageIndex + 1) / pagesCount.toFloat()
|
||||
val ppc = 1f / chaptersCount
|
||||
var progress = ppc * chapterIndex + ppc * pagePercent
|
||||
|
||||
if (chapterIndex == chaptersCount - 1 && pageIndex + 1 == pagesCount) {
|
||||
progress = 1.0f
|
||||
}
|
||||
|
||||
return progress
|
||||
return ppc * chapterIndex + ppc * pagePercent
|
||||
}
|
||||
|
||||
private fun observeIsWebtoonZoomEnabled() = settings.observeAsFlow(
|
||||
|
||||
Reference in New Issue
Block a user