pull/32/head
kunfei 5 years ago
parent 37a039e794
commit 5a3c039d3e
  1. 8
      app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt
  2. 8
      app/src/main/java/io/legado/app/ui/widget/page/PageView.kt

@ -397,13 +397,17 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_rea
page_view.upStyle()
}
observeEvent<Int>(Bus.TTS_START) {
viewModel.curTextChapter?.let {
}
}
observeEvent<Boolean>(Bus.TTS_NEXT) {
if (it) {
moveToNextChapter()
} else {
viewModel.durPageIndex += viewModel.durPageIndex + 1
page_view.upContent()
viewModel.saveRead()
}
}
}

@ -184,6 +184,14 @@ class PageView(context: Context, attrs: AttributeSet) : FrameLayout(context, att
return true
}
fun upContent() {
callback?.let {
it.textChapter()?.let { textChapter ->
curPage?.setContent(textChapter.page(it.durChapterIndex()))
}
}
}
fun upStyle() {
curPage?.upStyle()
prevPage?.upStyle()

Loading…
Cancel
Save