pull/48/head
kunfei 5 years ago
parent efdb0f7744
commit b2409a0439
  1. 12
      app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt

@ -158,17 +158,17 @@ class AudioPlayActivity : VMBaseActivity<AudioPlayViewModel>(R.layout.activity_a
fab_play_stop.setImageResource(R.drawable.ic_play_24dp) fab_play_stop.setImageResource(R.drawable.ic_play_24dp)
} }
} }
observeEventSticky<Int>(Bus.AUDIO_PROGRESS) { observeEventSticky<String>(Bus.AUDIO_SUB_TITLE) {
AudioPlay.durPageIndex = it tv_sub_title.text = it
if (!adjustProgress) player_progress.progress = it
tv_dur_time.text = DateFormatUtils.format(it.toLong(), "mm:ss")
} }
observeEventSticky<Int>(Bus.AUDIO_SIZE) { observeEventSticky<Int>(Bus.AUDIO_SIZE) {
player_progress.max = it player_progress.max = it
tv_all_time.text = DateFormatUtils.format(it.toLong(), "mm:ss") tv_all_time.text = DateFormatUtils.format(it.toLong(), "mm:ss")
} }
observeEventSticky<String>(Bus.AUDIO_SUB_TITLE) { observeEventSticky<Int>(Bus.AUDIO_PROGRESS) {
tv_sub_title.text = it AudioPlay.durPageIndex = it
if (!adjustProgress) player_progress.progress = it
tv_dur_time.text = DateFormatUtils.format(it.toLong(), "mm:ss")
} }
} }

Loading…
Cancel
Save