From 9d6d051e12cfd4347e169ec47070e0cbfa6bd35f Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 8 Nov 2019 17:26:12 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/ui/audio/AudioPlayActivity.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt index 5fadc7be7..b0677197b 100644 --- a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt +++ b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt @@ -26,6 +26,7 @@ import io.legado.app.ui.main.MainActivity import io.legado.app.utils.applyTint import io.legado.app.utils.getViewModel import io.legado.app.utils.observeEvent +import io.legado.app.utils.observeEventSticky import kotlinx.android.synthetic.main.activity_audio_play.* import kotlinx.android.synthetic.main.view_title_bar.* import org.apache.commons.lang3.time.DateFormatUtils @@ -182,13 +183,13 @@ class AudioPlayActivity : VMBaseActivity(R.layout.activity_a fab_play_stop.setImageResource(R.drawable.ic_play_24dp) } } - observeEvent(Bus.AUDIO_PROGRESS) { + observeEventSticky(Bus.AUDIO_PROGRESS) { viewModel.durPageIndex = it if (!adjustProgress) player_progress.progress = it tv_dur_time.text = DateFormatUtils.format(it.toLong(), "mm:ss") viewModel.saveProgress() } - observeEvent(Bus.AUDIO_SIZE) { + observeEventSticky(Bus.AUDIO_SIZE) { player_progress.max = it tv_all_time.text = DateFormatUtils.format(it.toLong(), "mm:ss") }