pull/46/head
kunfei 5 years ago
parent af316f411e
commit 53cfcce85e
  1. 10
      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.activity_audio_play.*
import kotlinx.android.synthetic.main.view_title_bar.* import kotlinx.android.synthetic.main.view_title_bar.*
import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.sdk27.listeners.onClick
import org.jetbrains.anko.sdk27.listeners.onLongClick
class AudioPlayActivity : VMBaseActivity<AudioPlayViewModel>(R.layout.activity_audio_play), class AudioPlayActivity : VMBaseActivity<AudioPlayViewModel>(R.layout.activity_audio_play),
AudioPlayViewModel.CallBack { AudioPlayViewModel.CallBack {
@ -44,6 +45,10 @@ class AudioPlayActivity : VMBaseActivity<AudioPlayViewModel>(R.layout.activity_a
} }
} }
} }
fab_play_stop.onLongClick {
AudioPlay.stop(this)
true
}
iv_skip_next.onClick { iv_skip_next.onClick {
} }
@ -97,6 +102,11 @@ class AudioPlayActivity : VMBaseActivity<AudioPlayViewModel>(R.layout.activity_a
} }
observeEvent<Int>(Bus.AUDIO_STATE) { observeEvent<Int>(Bus.AUDIO_STATE) {
status = it 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<Int>(Bus.AUDIO_PROGRESS) { observeEvent<Int>(Bus.AUDIO_PROGRESS) {
if (!adjustProgress) player_progress.progress = it if (!adjustProgress) player_progress.progress = it

Loading…
Cancel
Save