From 8ac340eff0451e59a1fdfeb3577c38db5eb7da00 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Sun, 4 Jul 2021 16:43:07 -0400 Subject: [PATCH] Fixed double page layout showing pages from other chapters --- .../tachiyomi/ui/reader/viewer/pager/PagerViewerAdapter.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewerAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewerAdapter.kt index 7f26c85fc3..9990b916de 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewerAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewerAdapter.kt @@ -182,6 +182,9 @@ class PagerViewerAdapter(private val viewer: PagerViewer) : ViewPagerAdapter() { // Step 1: segment the pages and transition pages subItems.forEach { if (it is ReaderPage) { + if (pagedItems.last().lastOrNull()?.chapter?.chapter?.id != it.chapter.chapter.id) { + pagedItems.add(mutableListOf()) + } pagedItems.last().add(it) } else { otherItems.add(it)