From 100f002edfcb74963afe9d8b6e82ee7967f63461 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 25 Aug 2019 22:38:40 +0800 Subject: [PATCH] up --- .../legado/app/ui/readbook/ReadBookActivity.kt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 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 ea59fb2e5..8ed5a17d2 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 @@ -59,7 +59,8 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_rea viewModel.chapterListFinish.observe(this, Observer { bookLoadFinish() }) viewModel.initData(intent) savedInstanceState?.let { - changeSourceDialog = supportFragmentManager.findFragmentByTag(ChangeSourceDialog.tag) as? ChangeSourceDialog + changeSourceDialog = + supportFragmentManager.findFragmentByTag(ChangeSourceDialog.tag) as? ChangeSourceDialog changeSourceDialog?.callBack = this } setScreenBrightness(getPrefInt("brightness", 100)) @@ -114,6 +115,9 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_rea override fun skipToPage(page: Int) { viewModel.durPageIndex = page page_view.upContent() + if (readAloudStatus == Status.PLAY) { + readAloud() + } } override fun skipPreChapter() { @@ -230,12 +234,12 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_rea curChapterChange() } viewModel.durChapterIndex - 1 -> { - viewModel.prevTextChapter = ChapterProvider.getTextChapter(content_text_view, bookChapter, content) - page_view.upContent() + viewModel.prevTextChapter = + ChapterProvider.getTextChapter(content_text_view, bookChapter, content) } viewModel.durChapterIndex + 1 -> { - viewModel.nextTextChapter = ChapterProvider.getTextChapter(content_text_view, bookChapter, content) - page_view.upContent() + viewModel.nextTextChapter = + ChapterProvider.getTextChapter(content_text_view, bookChapter, content) } } } @@ -250,6 +254,9 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_rea tv_chapter_url.visible() } read_menu.upReadProgress(it.pageSize(), viewModel.durPageIndex) + if (readAloudStatus == Status.PLAY) { + readAloud() + } } }