pull/32/head
kunfei 5 years ago
parent 4843614fb6
commit 24f8f259dd
  1. 14
      app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt

@ -236,10 +236,9 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
curTextChapter = nextTextChapter curTextChapter = nextTextChapter
nextTextChapter = null nextTextChapter = null
bookData.value?.let { bookData.value?.let {
loadContent(it, durChapterIndex.plus(1))
launch(IO) { launch(IO) {
for (i in 2..10) { for (i in 0..10) {
delay(1000L) delay(100)
bookData.value?.let { book -> bookData.value?.let { book ->
download(book, durChapterIndex + i) download(book, durChapterIndex + i)
} }
@ -254,7 +253,14 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
curTextChapter = prevTextChapter curTextChapter = prevTextChapter
prevTextChapter = null prevTextChapter = null
bookData.value?.let { bookData.value?.let {
loadContent(it, durChapterIndex.minus(1)) launch(IO) {
for (i in -5..0) {
delay(100)
bookData.value?.let { book ->
download(book, durChapterIndex + i)
}
}
}
} }
} }

Loading…
Cancel
Save