From 24f8f259dd3f0c3027079b5e683c81622edd98d0 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 27 Aug 2019 17:22:00 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/readbook/ReadBookViewModel.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt index 009c88979..841b06199 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt +++ b/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) + } + } + } } }