From e610f9fd34f75383c235a4e1ade810bcf7cd5524 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 22 Aug 2019 21:46:08 +0800 Subject: [PATCH] up --- .../legado/app/ui/widget/page/TextPageFactory.kt | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 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 6421b788a..16b06e23b 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 @@ -47,21 +47,18 @@ class TextPageFactory private constructor(dataSource: DataSource) : PageFactory< } override fun currentPage(): TextPage? { - return dataSource.getCurrentChapter()?.page(index) ?: TextPage(index, "index:$index") + return dataSource.getCurrentChapter()?.page(index) + ?: TextPage(index, "index:$index") } override fun nextPage(): TextPage? { - return dataSource.getCurrentChapter()?.page(index + 1) ?: TextPage( - index + 1, - "index:${index + 1}" - ) + return dataSource.getCurrentChapter()?.page(index + 1) + ?: TextPage(index + 1, "index:${index + 1}") } override fun previousPage(): TextPage? { - return dataSource.getCurrentChapter()?.page(index - 1) ?: TextPage( - index - 1, - "index:${index - 1}" - ) + return dataSource.getCurrentChapter()?.page(index - 1) + ?: TextPage(index - 1, "index:${index - 1}") }