|
|
@ -115,21 +115,24 @@ object ReadBookViewModel { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun moveToNextChapter(upContent: Boolean) { |
|
|
|
fun moveToNextChapter(upContent: Boolean) { |
|
|
|
durChapterIndex++ |
|
|
|
if (durChapterIndex < chapterSize - 1) { |
|
|
|
prevTextChapter = curTextChapter |
|
|
|
durPageIndex = 0 |
|
|
|
curTextChapter = nextTextChapter |
|
|
|
durChapterIndex++ |
|
|
|
nextTextChapter = null |
|
|
|
prevTextChapter = curTextChapter |
|
|
|
book?.let { |
|
|
|
curTextChapter = nextTextChapter |
|
|
|
if (curTextChapter == null) { |
|
|
|
nextTextChapter = null |
|
|
|
loadContent(durChapterIndex) |
|
|
|
book?.let { |
|
|
|
} else if (upContent) { |
|
|
|
if (curTextChapter == null) { |
|
|
|
callBack?.upContent() |
|
|
|
loadContent(durChapterIndex) |
|
|
|
} |
|
|
|
} else if (upContent) { |
|
|
|
loadContent(durChapterIndex.plus(1)) |
|
|
|
callBack?.upContent() |
|
|
|
GlobalScope.launch(IO) { |
|
|
|
} |
|
|
|
for (i in 2..10) { |
|
|
|
loadContent(durChapterIndex.plus(1)) |
|
|
|
delay(100) |
|
|
|
GlobalScope.launch(IO) { |
|
|
|
download(durChapterIndex + i) |
|
|
|
for (i in 2..10) { |
|
|
|
|
|
|
|
delay(100) |
|
|
|
|
|
|
|
download(durChapterIndex + i) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|