|
|
@ -214,6 +214,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
durChapterIndex++ |
|
|
|
durChapterIndex++ |
|
|
|
prevTextChapter = curTextChapter |
|
|
|
prevTextChapter = curTextChapter |
|
|
|
curTextChapter = nextTextChapter |
|
|
|
curTextChapter = nextTextChapter |
|
|
|
|
|
|
|
nextTextChapter = null |
|
|
|
bookData.value?.let { |
|
|
|
bookData.value?.let { |
|
|
|
loadContent(it, durChapterIndex.plus(1)) |
|
|
|
loadContent(it, durChapterIndex.plus(1)) |
|
|
|
} |
|
|
|
} |
|
|
@ -223,18 +224,17 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
durChapterIndex-- |
|
|
|
durChapterIndex-- |
|
|
|
nextTextChapter = curTextChapter |
|
|
|
nextTextChapter = curTextChapter |
|
|
|
curTextChapter = prevTextChapter |
|
|
|
curTextChapter = prevTextChapter |
|
|
|
|
|
|
|
prevTextChapter = null |
|
|
|
bookData.value?.let { |
|
|
|
bookData.value?.let { |
|
|
|
loadContent(it, durChapterIndex.minus(1)) |
|
|
|
loadContent(it, durChapterIndex.minus(1)) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun refreshContent() { |
|
|
|
fun refreshContent(book: Book) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
bookData.value?.let { book -> |
|
|
|
App.db.bookChapterDao().getChapter(book.bookUrl, durChapterIndex)?.let { chapter -> |
|
|
|
App.db.bookChapterDao().getChapter(book.bookUrl, durChapterIndex)?.let { chapter -> |
|
|
|
BookHelp.delContent(book, chapter) |
|
|
|
BookHelp.delContent(book, chapter) |
|
|
|
loadContent(book, durChapterIndex) |
|
|
|
loadContent(book, durChapterIndex) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|