From 99bb0b1ebb13e607d85381483189a0c5bd8651d7 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 28 Aug 2019 14:32:56 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/readbook/ReadBookActivity.kt | 9 ++++++--- .../legado/app/ui/readbook/config/ReadStyleDialog.kt | 10 +++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt index 7aed7c0ca..989cdad40 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt @@ -60,7 +60,7 @@ class ReadBookActivity : VMBaseActivity(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(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(R.layout.activity_rea page_view.upBg() content_view.upStyle() page_view.upStyle() + if (it) { + loadContent() + } } observeEvent(Bus.TTS_START) { chapterStart -> launch(IO) { diff --git a/app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt b/app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt index a04803537..ff4e6d116 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt @@ -124,31 +124,31 @@ class ReadStyleDialog : DialogFragment() { ReadBookConfig.styleSelect = 0 ReadBookConfig.upBg() upBg() - postEvent(Bus.UP_CONFIG, true) + postEvent(Bus.UP_CONFIG, false) } tv_bg1.onClick { ReadBookConfig.styleSelect = 1 ReadBookConfig.upBg() upBg() - postEvent(Bus.UP_CONFIG, true) + postEvent(Bus.UP_CONFIG, false) } tv_bg2.onClick { ReadBookConfig.styleSelect = 2 ReadBookConfig.upBg() upBg() - postEvent(Bus.UP_CONFIG, true) + postEvent(Bus.UP_CONFIG, false) } tv_bg3.onClick { ReadBookConfig.styleSelect = 3 ReadBookConfig.upBg() upBg() - postEvent(Bus.UP_CONFIG, true) + postEvent(Bus.UP_CONFIG, false) } tv_bg4.onClick { ReadBookConfig.styleSelect = 4 ReadBookConfig.upBg() upBg() - postEvent(Bus.UP_CONFIG, true) + postEvent(Bus.UP_CONFIG, false) } }