From 1eef27eba962ad2220675992ede9d5ec88a0e1a7 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 11 Jan 2020 10:15:38 +0800 Subject: [PATCH] up --- .../legado/app/ui/rss/read/ReadRssActivity.kt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt index 9296537e4..26ede2867 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt @@ -17,6 +17,7 @@ import io.legado.app.utils.getViewModel import io.legado.app.utils.htmlFormat import io.legado.app.utils.shareText import kotlinx.android.synthetic.main.activity_rss_read.* +import kotlinx.coroutines.launch import org.apache.commons.text.StringEscapeUtils import org.jsoup.Jsoup @@ -103,14 +104,16 @@ class ReadRssActivity : VMBaseActivity(R.layout.activity_rss_r } override fun upTtsMenu(isPlaying: Boolean) { - if (isPlaying) { - ttsMenuItem?.setIcon(R.drawable.ic_stop_black_24dp) - ttsMenuItem?.setTitle(R.string.aloud_stop) - } else { - ttsMenuItem?.setIcon(R.drawable.ic_volume_up) - ttsMenuItem?.setTitle(R.string.read_aloud) + launch { + if (isPlaying) { + ttsMenuItem?.setIcon(R.drawable.ic_stop_black_24dp) + ttsMenuItem?.setTitle(R.string.aloud_stop) + } else { + ttsMenuItem?.setIcon(R.drawable.ic_volume_up) + ttsMenuItem?.setTitle(R.string.read_aloud) + } + DrawableUtils.setTint(ttsMenuItem?.icon, primaryTextColor) } - DrawableUtils.setTint(ttsMenuItem?.icon, primaryTextColor) } override fun onKeyLongPress(keyCode: Int, event: KeyEvent?): Boolean {