diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 6a2a00e19..f0bb7ab2a 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -375,7 +375,6 @@ class ReadBookActivity : BaseActivity(R.layout.activity_book_read), */ override fun moveToNextChapter(upContent: Boolean): Boolean { return if (ReadBookViewModel.durChapterIndex < ReadBookViewModel.chapterSize - 1) { - ReadBookViewModel.durPageIndex = 0 ReadBookViewModel.moveToNextChapter(upContent) ReadBookViewModel.saveRead() curChapterChanged() diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt index 0dd83e4ed..e2d581b13 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt @@ -115,21 +115,24 @@ object ReadBookViewModel { } fun moveToNextChapter(upContent: Boolean) { - durChapterIndex++ - prevTextChapter = curTextChapter - curTextChapter = nextTextChapter - nextTextChapter = null - book?.let { - if (curTextChapter == null) { - loadContent(durChapterIndex) - } else if (upContent) { - callBack?.upContent() - } - loadContent(durChapterIndex.plus(1)) - GlobalScope.launch(IO) { - for (i in 2..10) { - delay(100) - download(durChapterIndex + i) + if (durChapterIndex < chapterSize - 1) { + durPageIndex = 0 + durChapterIndex++ + prevTextChapter = curTextChapter + curTextChapter = nextTextChapter + nextTextChapter = null + book?.let { + if (curTextChapter == null) { + loadContent(durChapterIndex) + } else if (upContent) { + callBack?.upContent() + } + loadContent(durChapterIndex.plus(1)) + GlobalScope.launch(IO) { + for (i in 2..10) { + delay(100) + download(durChapterIndex + i) + } } } }