From fb2f4406367a2b3cc06be308bff0274f75839376 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 26 Aug 2019 17:49:12 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/readbook/ReadBookActivity.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 3c0129034..df79ef9e1 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 @@ -433,7 +433,18 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_rea override fun observeLiveBus() { super.observeLiveBus() - observeEvent(Bus.ALOUD_STATE) { readAloudStatus = it } + observeEvent(Bus.ALOUD_STATE) { + readAloudStatus = it + if (it == Status.STOP) { + viewModel.curTextChapter?.let { textChapter -> + val page = textChapter.page(viewModel.durPageIndex) + if (page != null && page.text is SpannableStringBuilder) { + page.text.removeSpan(ChapterProvider.readAloudSpan) + page_view.upContent() + } + } + } + } observeEvent(Bus.TIME_CHANGED) { page_view.upTime() } observeEvent(Bus.BATTERY_CHANGED) { page_view.upBattery(it) } observeEvent(Bus.OPEN_CHAPTER) {