pull/32/head
kunfei 5 years ago
parent 784550853c
commit aa329a4667
  1. 2
      app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt
  2. 8
      app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt

@ -355,9 +355,9 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_rea
tv_chapter_url.visible() tv_chapter_url.visible()
} }
read_menu.upReadProgress(it.pageSize().minus(1), viewModel.durPageIndex) read_menu.upReadProgress(it.pageSize().minus(1), viewModel.durPageIndex)
curPageChanged()
tv_pre.isEnabled = viewModel.durChapterIndex != 0 tv_pre.isEnabled = viewModel.durChapterIndex != 0
tv_next.isEnabled = viewModel.durChapterIndex != viewModel.chapterSize - 1 tv_next.isEnabled = viewModel.durChapterIndex != viewModel.chapterSize - 1
curPageChanged()
} }
} }

@ -114,7 +114,11 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
curTextChapter = nextTextChapter curTextChapter = nextTextChapter
nextTextChapter = null nextTextChapter = null
bookData.value?.let { bookData.value?.let {
if (curTextChapter == null) {
loadContent(it, durChapterIndex) loadContent(it, durChapterIndex)
} else {
callBack?.upContent()
}
loadContent(it, durChapterIndex.plus(1)) loadContent(it, durChapterIndex.plus(1))
launch(IO) { launch(IO) {
for (i in 2..10) { for (i in 2..10) {
@ -133,7 +137,11 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
curTextChapter = prevTextChapter curTextChapter = prevTextChapter
prevTextChapter = null prevTextChapter = null
bookData.value?.let { bookData.value?.let {
if (curTextChapter == null) {
loadContent(it, durChapterIndex) loadContent(it, durChapterIndex)
} else {
callBack?.upContent()
}
loadContent(it, durChapterIndex.minus(1)) loadContent(it, durChapterIndex.minus(1))
launch(IO) { launch(IO) {
for (i in -5..-2) { for (i in -5..-2) {

Loading…
Cancel
Save