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. 12
      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()
}
read_menu.upReadProgress(it.pageSize().minus(1), viewModel.durPageIndex)
curPageChanged()
tv_pre.isEnabled = viewModel.durChapterIndex != 0
tv_next.isEnabled = viewModel.durChapterIndex != viewModel.chapterSize - 1
curPageChanged()
}
}

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

Loading…
Cancel
Save