@@ -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,
|
||||
|
||||
@@ -154,10 +154,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() }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user