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() {
viewModel.durPageIndex = 0
viewModel.moveToNextChapter()
curChapterChange()
}
override fun moveToPrevChapter() {
viewModel.durPageIndex = viewModel.prevTextChapter?.lastIndex() ?: 0
viewModel.moveToPrevChapter()
curChapterChange()
}

@ -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

Loading…
Cancel
Save