From da5e2f9c47c3874762d069964eed56cb3c8df48b Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 25 Aug 2019 22:51:34 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt | 2 ++ .../main/java/io/legado/app/ui/widget/page/TextPageFactory.kt | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt index 8ed5a17d2..762a02ac0 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt @@ -304,11 +304,13 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_rea } override fun moveToNextChapter() { + viewModel.durPageIndex = 0 viewModel.moveToNextChapter() curChapterChange() } override fun moveToPrevChapter() { + viewModel.durPageIndex = viewModel.prevTextChapter?.lastIndex() ?: 0 viewModel.moveToPrevChapter() curChapterChange() } 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 d681f2b58..ba5ce5153 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 @@ -42,7 +42,6 @@ class TextPageFactory private constructor(dataSource: DataSource) : return if (hasNext()) { if (dataSource.getCurrentChapter()?.isLastIndex(index) == true) { dataSource.moveToNextChapter() - dataSource.setPageIndex(0) } else { dataSource.setPageIndex(index.plus(1)) } @@ -57,7 +56,6 @@ class TextPageFactory private constructor(dataSource: DataSource) : dataSource.setPageIndex(index.minus(1)) } else { dataSource.moveToPrevChapter() - dataSource.setPageIndex(dataSource.getPreviousChapter()?.lastIndex() ?: 0) } true } else