pull/32/head
kunfei 5 years ago
parent 04a22911f4
commit c5837f74fd
  1. 8
      app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt

@ -234,9 +234,11 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
durChapterIndex++
prevTextChapter = curTextChapter
curTextChapter = nextTextChapter
nextTextChapter = null
bookData.value?.let {
loadContent(it, durChapterIndex.plus(1))
launch(IO) {
for (i in 0..10) {
for (i in 2..10) {
delay(100)
bookData.value?.let { book ->
download(book, durChapterIndex + i)
@ -250,9 +252,11 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
durChapterIndex--
nextTextChapter = curTextChapter
curTextChapter = prevTextChapter
prevTextChapter = null
bookData.value?.let {
loadContent(it, durChapterIndex.minus(1))
launch(IO) {
for (i in -5..0) {
for (i in -5..-2) {
delay(100)
bookData.value?.let { book ->
download(book, durChapterIndex + i)

Loading…
Cancel
Save