pull/71/head^2^2
kunfei 5 years ago
parent 39ce729ac2
commit 1eef27eba9
  1. 17
      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.htmlFormat
import io.legado.app.utils.shareText import io.legado.app.utils.shareText
import kotlinx.android.synthetic.main.activity_rss_read.* import kotlinx.android.synthetic.main.activity_rss_read.*
import kotlinx.coroutines.launch
import org.apache.commons.text.StringEscapeUtils import org.apache.commons.text.StringEscapeUtils
import org.jsoup.Jsoup import org.jsoup.Jsoup
@ -103,14 +104,16 @@ class ReadRssActivity : VMBaseActivity<ReadRssViewModel>(R.layout.activity_rss_r
} }
override fun upTtsMenu(isPlaying: Boolean) { override fun upTtsMenu(isPlaying: Boolean) {
if (isPlaying) { launch {
ttsMenuItem?.setIcon(R.drawable.ic_stop_black_24dp) if (isPlaying) {
ttsMenuItem?.setTitle(R.string.aloud_stop) ttsMenuItem?.setIcon(R.drawable.ic_stop_black_24dp)
} else { ttsMenuItem?.setTitle(R.string.aloud_stop)
ttsMenuItem?.setIcon(R.drawable.ic_volume_up) } else {
ttsMenuItem?.setTitle(R.string.read_aloud) 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 { override fun onKeyLongPress(keyCode: Int, event: KeyEvent?): Boolean {

Loading…
Cancel
Save