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 {