diff --git a/app/src/main/java/io/legado/app/ui/widget/page/TextPageFactory.kt b/app/src/main/java/io/legado/app/ui/widget/page/TextPageFactory.kt index 544049bdc..ee237dc02 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/TextPageFactory.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/TextPageFactory.kt @@ -69,35 +69,29 @@ class TextPageFactory(dataSource: DataSource) : PageFactory(dataSource getCurrentChapter()?.scrollPage() } else { getCurrentChapter()?.page(pageIndex) - } ?: TextPage(index = pageIndex, title = "index:${pageIndex}") + } } override fun nextPage(): TextPage? = with(dataSource) { if (isScrollDelegate) { return getNextChapter()?.scrollPage() - ?: TextPage(index = pageIndex + 1, title = "index:${pageIndex + 1}") } getCurrentChapter()?.let { if (pageIndex < it.pageSize() - 1) { return getCurrentChapter()?.page(pageIndex + 1)?.removePageAloudSpan() - ?: TextPage(index = pageIndex + 1, title = "index:${pageIndex + 1}") } } return getNextChapter()?.page(0)?.removePageAloudSpan() - ?: TextPage(index = pageIndex + 1, title = "index:${pageIndex + 1}") } override fun previousPage(): TextPage? = with(dataSource) { if (isScrollDelegate) { return getPreviousChapter()?.scrollPage() - ?: TextPage(index = pageIndex + 1, title = "index:${pageIndex + 1}") } if (pageIndex > 0) { return getCurrentChapter()?.page(pageIndex - 1)?.removePageAloudSpan() - ?: TextPage(index = pageIndex - 1, title = "index:${pageIndex - 1}") } return getPreviousChapter()?.lastPage()?.removePageAloudSpan() - ?: TextPage(index = pageIndex - 1, title = "index:${pageIndex - 1}") }