Increase next chapter preload threshold to last 5 pages

This commit is contained in:
arkon 2020-04-29 23:04:15 -04:00
parent 916c1c9de2
commit 5059c6295f
2 changed files with 4 additions and 4 deletions

View File

@ -158,8 +158,8 @@ abstract class PagerViewer(val activity: ReaderActivity) : BaseViewer {
Timber.d("onReaderPageSelected: ${page.number}/${pages.size}")
activity.onPageSelected(page)
// Preload next chapter once we're within the last 3 pages of the current chapter
val inPreloadRange = pages.size - page.number < 3
// Preload next chapter once we're within the last 5 pages of the current chapter
val inPreloadRange = pages.size - page.number < 5
if (inPreloadRange && allowPreload && page.chapter == adapter.currentChapter) {
Timber.d("Request preload next chapter because we're at page ${page.number} of ${pages.size}")
adapter.nextTransition?.to?.let {

View File

@ -167,8 +167,8 @@ class WebtoonViewer(val activity: ReaderActivity, val isContinuous: Boolean = tr
Timber.d("onPageSelected: ${page.number}/${pages.size}")
activity.onPageSelected(page)
// Preload next chapter once we're within the last 3 pages of the current chapter
val inPreloadRange = pages.size - page.number < 3
// Preload next chapter once we're within the last 5 pages of the current chapter
val inPreloadRange = pages.size - page.number < 5
if (inPreloadRange && allowPreload && page.chapter == adapter.currentChapter) {
Timber.d("Request preload next chapter because we're at page ${page.number} of ${pages.size}")
val nextItem = adapter.items.getOrNull(adapter.items.size - 1)