"Check mark" fix on cover
if the manga has been read in full, the "check mark" will be displayed correctly on the cover
This commit is contained in:
@@ -145,10 +145,11 @@ class HistoryRepository @Inject constructor(
|
||||
|
||||
suspend fun getProgress(mangaId: Long, mode: ProgressIndicatorMode): ReadingProgress? {
|
||||
val entity = db.getHistoryDao().find(mangaId) ?: return null
|
||||
val fixedPercent = if (entity.percent >= 0.999999f) 1f else entity.percent
|
||||
return ReadingProgress(
|
||||
percent = entity.percent,
|
||||
percent = fixedPercent,
|
||||
totalChapters = entity.chaptersCount,
|
||||
mode = mode,
|
||||
mode = mode
|
||||
).takeIf { it.isValid() }
|
||||
}
|
||||
|
||||
|
||||
@@ -473,9 +473,15 @@ class ReaderViewModel @Inject constructor(
|
||||
if (chaptersCount == 0 || pagesCount == 0) {
|
||||
return PROGRESS_NONE
|
||||
}
|
||||
val pagePercent = (pageIndex + 1) / pagesCount.toFloat()
|
||||
val pagePercent = (pageIndex + 1).toFloat() / pagesCount
|
||||
val ppc = 1f / chaptersCount
|
||||
return ppc * chapterIndex + ppc * pagePercent
|
||||
var progress = ppc * chapterIndex + ppc * pagePercent
|
||||
|
||||
if (chapterIndex == chaptersCount - 1 && pageIndex + 1 == pagesCount) {
|
||||
progress = 1.0f
|
||||
}
|
||||
|
||||
return progress
|
||||
}
|
||||
|
||||
private fun observeIsWebtoonZoomEnabled() = settings.observeAsFlow(
|
||||
|
||||
Reference in New Issue
Block a user