From 6038d2cb56c446ca276410399cc62434b3306b54 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 21 Oct 2019 09:35:25 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/widget/page/TextPageFactory.kt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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}") }