|
|
@ -108,7 +108,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun moveToNextChapter() { |
|
|
|
fun moveToNextChapter(upContent: Boolean) { |
|
|
|
durChapterIndex++ |
|
|
|
durChapterIndex++ |
|
|
|
prevTextChapter = curTextChapter |
|
|
|
prevTextChapter = curTextChapter |
|
|
|
curTextChapter = nextTextChapter |
|
|
|
curTextChapter = nextTextChapter |
|
|
@ -116,7 +116,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
bookData.value?.let { |
|
|
|
bookData.value?.let { |
|
|
|
if (curTextChapter == null) { |
|
|
|
if (curTextChapter == null) { |
|
|
|
loadContent(it, durChapterIndex) |
|
|
|
loadContent(it, durChapterIndex) |
|
|
|
} else { |
|
|
|
} else if (upContent) { |
|
|
|
callBack?.upContent() |
|
|
|
callBack?.upContent() |
|
|
|
} |
|
|
|
} |
|
|
|
loadContent(it, durChapterIndex.plus(1)) |
|
|
|
loadContent(it, durChapterIndex.plus(1)) |
|
|
@ -131,7 +131,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun moveToPrevChapter() { |
|
|
|
fun moveToPrevChapter(upContent: Boolean) { |
|
|
|
durChapterIndex-- |
|
|
|
durChapterIndex-- |
|
|
|
nextTextChapter = curTextChapter |
|
|
|
nextTextChapter = curTextChapter |
|
|
|
curTextChapter = prevTextChapter |
|
|
|
curTextChapter = prevTextChapter |
|
|
@ -139,7 +139,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
bookData.value?.let { |
|
|
|
bookData.value?.let { |
|
|
|
if (curTextChapter == null) { |
|
|
|
if (curTextChapter == null) { |
|
|
|
loadContent(it, durChapterIndex) |
|
|
|
loadContent(it, durChapterIndex) |
|
|
|
} else { |
|
|
|
} else if (upContent) { |
|
|
|
callBack?.upContent() |
|
|
|
callBack?.upContent() |
|
|
|
} |
|
|
|
} |
|
|
|
loadContent(it, durChapterIndex.minus(1)) |
|
|
|
loadContent(it, durChapterIndex.minus(1)) |
|
|
|