pull/78/head
kunfei 5 years ago
parent d40cc7691f
commit 95e6537fef
  1. 4
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt

@ -479,7 +479,9 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_boo
requestCodeEditSource -> viewModel.upBookSource()
requestCodeChapterList ->
data?.getIntExtra("index", ReadBook.durChapterIndex)?.let { index ->
viewModel.openChapter(index, data?.getIntExtra("pageIndex", ReadBook.durPageIndex))
if (index != ReadBook.durChapterIndex) {
viewModel.openChapter(index)
}
}
requestCodeReplace -> ReadBook.loadContent()
}

@ -154,7 +154,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
}
}
fun openChapter(index: Int, pageIndex: Int) {
fun openChapter(index: Int, pageIndex: Int = 0) {
ReadBook.prevTextChapter = null
ReadBook.curTextChapter = null
ReadBook.nextTextChapter = null

Loading…
Cancel
Save