pull/32/head
kunfei 5 years ago
parent fdf12315f4
commit 729979f763
  1. 6
      app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt
  2. 5
      app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt

@ -236,9 +236,9 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_rea
private fun bookLoadFinish() {
viewModel.bookData.value?.let {
viewModel.loadContent(it, it.durChapterIndex)
viewModel.loadContent(it, it.durChapterIndex + 1)
viewModel.loadContent(it, it.durChapterIndex - 1)
viewModel.loadContent(it, viewModel.durChapterIndex)
viewModel.loadContent(it, viewModel.durChapterIndex + 1)
viewModel.loadContent(it, viewModel.durChapterIndex - 1)
}
}

@ -59,6 +59,9 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
toast(R.string.error_load_toc)
} ?: autoChangeSource()
} else {
if (durChapterIndex > count - 1) {
durChapterIndex = count - 1
}
chapterMaxIndex.postValue(count)
}
}
@ -81,6 +84,8 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
loadingChapters.remove(index)
}
} ?: download(book, chapter)
} ?: synchronized(loadingLock) {
loadingChapters.remove(index)
}
}.onError {
synchronized(loadingLock) {

Loading…
Cancel
Save