|
|
|
@ -60,7 +60,7 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_rea |
|
|
|
|
page_view.callback = this |
|
|
|
|
viewModel.callBack = this |
|
|
|
|
viewModel.bookData.observe(this, Observer { title_bar.title = it.name }) |
|
|
|
|
viewModel.chapterListFinish.observe(this, Observer { bookLoadFinish() }) |
|
|
|
|
viewModel.chapterListFinish.observe(this, Observer { loadContent() }) |
|
|
|
|
viewModel.initData(intent) |
|
|
|
|
savedInstanceState?.let { |
|
|
|
|
changeSourceDialog = |
|
|
|
@ -234,9 +234,9 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_rea |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 书籍加载完成,开始加载章节内容 |
|
|
|
|
* 加载章节内容 |
|
|
|
|
*/ |
|
|
|
|
private fun bookLoadFinish() { |
|
|
|
|
private fun loadContent() { |
|
|
|
|
viewModel.bookData.value?.let { |
|
|
|
|
viewModel.loadContent(it, viewModel.durChapterIndex) |
|
|
|
|
viewModel.loadContent(it, viewModel.durChapterIndex + 1) |
|
|
|
@ -460,6 +460,9 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_rea |
|
|
|
|
page_view.upBg() |
|
|
|
|
content_view.upStyle() |
|
|
|
|
page_view.upStyle() |
|
|
|
|
if (it) { |
|
|
|
|
loadContent() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
observeEvent<Int>(Bus.TTS_START) { chapterStart -> |
|
|
|
|
launch(IO) { |
|
|
|
|