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