From 53cfcce85e6c50cb1a6aa0b4eccf36ad7a7894ef Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 4 Nov 2019 16:00:09 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/audio/AudioPlayActivity.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 907df608d..efe599857 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 @@ -16,6 +16,7 @@ import io.legado.app.utils.observeEvent import kotlinx.android.synthetic.main.activity_audio_play.* import kotlinx.android.synthetic.main.view_title_bar.* import org.jetbrains.anko.sdk27.listeners.onClick +import org.jetbrains.anko.sdk27.listeners.onLongClick class AudioPlayActivity : VMBaseActivity(R.layout.activity_audio_play), AudioPlayViewModel.CallBack { @@ -44,6 +45,10 @@ class AudioPlayActivity : VMBaseActivity(R.layout.activity_a } } } + fab_play_stop.onLongClick { + AudioPlay.stop(this) + true + } iv_skip_next.onClick { } @@ -97,6 +102,11 @@ class AudioPlayActivity : VMBaseActivity(R.layout.activity_a } observeEvent(Bus.AUDIO_STATE) { status = it + if (status == Status.PLAY) { + fab_play_stop.setImageResource(R.drawable.ic_pause_24dp) + } else { + fab_play_stop.setImageResource(R.drawable.ic_play_24dp) + } } observeEvent(Bus.AUDIO_PROGRESS) { if (!adjustProgress) player_progress.progress = it