pull/32/head
kunfei 5 years ago
parent 100f002edf
commit da5e2f9c47
  1. 2
      app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt
  2. 2
      app/src/main/java/io/legado/app/ui/widget/page/TextPageFactory.kt

@ -304,11 +304,13 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_rea
} }
override fun moveToNextChapter() { override fun moveToNextChapter() {
viewModel.durPageIndex = 0
viewModel.moveToNextChapter() viewModel.moveToNextChapter()
curChapterChange() curChapterChange()
} }
override fun moveToPrevChapter() { override fun moveToPrevChapter() {
viewModel.durPageIndex = viewModel.prevTextChapter?.lastIndex() ?: 0
viewModel.moveToPrevChapter() viewModel.moveToPrevChapter()
curChapterChange() curChapterChange()
} }

@ -42,7 +42,6 @@ class TextPageFactory private constructor(dataSource: DataSource) :
return if (hasNext()) { return if (hasNext()) {
if (dataSource.getCurrentChapter()?.isLastIndex(index) == true) { if (dataSource.getCurrentChapter()?.isLastIndex(index) == true) {
dataSource.moveToNextChapter() dataSource.moveToNextChapter()
dataSource.setPageIndex(0)
} else { } else {
dataSource.setPageIndex(index.plus(1)) dataSource.setPageIndex(index.plus(1))
} }
@ -57,7 +56,6 @@ class TextPageFactory private constructor(dataSource: DataSource) :
dataSource.setPageIndex(index.minus(1)) dataSource.setPageIndex(index.minus(1))
} else { } else {
dataSource.moveToPrevChapter() dataSource.moveToPrevChapter()
dataSource.setPageIndex(dataSource.getPreviousChapter()?.lastIndex() ?: 0)
} }
true true
} else } else

Loading…
Cancel
Save