pull/49/head
kunfei 5 years ago
parent 6381b8d1b6
commit f6303cc354
  1. 1
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 3
      app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt

@ -375,7 +375,6 @@ class ReadBookActivity : BaseActivity(R.layout.activity_book_read),
*/ */
override fun moveToNextChapter(upContent: Boolean): Boolean { override fun moveToNextChapter(upContent: Boolean): Boolean {
return if (ReadBookViewModel.durChapterIndex < ReadBookViewModel.chapterSize - 1) { return if (ReadBookViewModel.durChapterIndex < ReadBookViewModel.chapterSize - 1) {
ReadBookViewModel.durPageIndex = 0
ReadBookViewModel.moveToNextChapter(upContent) ReadBookViewModel.moveToNextChapter(upContent)
ReadBookViewModel.saveRead() ReadBookViewModel.saveRead()
curChapterChanged() curChapterChanged()

@ -115,6 +115,8 @@ object ReadBookViewModel {
} }
fun moveToNextChapter(upContent: Boolean) { fun moveToNextChapter(upContent: Boolean) {
if (durChapterIndex < chapterSize - 1) {
durPageIndex = 0
durChapterIndex++ durChapterIndex++
prevTextChapter = curTextChapter prevTextChapter = curTextChapter
curTextChapter = nextTextChapter curTextChapter = nextTextChapter
@ -134,6 +136,7 @@ object ReadBookViewModel {
} }
} }
} }
}
fun moveToPrevChapter(upContent: Boolean) { fun moveToPrevChapter(upContent: Boolean) {
durChapterIndex-- durChapterIndex--

Loading…
Cancel
Save