pull/32/head
kunfei 5 years ago
parent c22c45fec4
commit d2c64f9847
  1. 12
      app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt

@ -28,20 +28,16 @@ class MediaButtonReceiver : BroadcastReceiver() {
val keycode = event.keyCode val keycode = event.keyCode
val action = event.action val action = event.action
var command = false
when (keycode) { when (keycode) {
KeyEvent.KEYCODE_MEDIA_STOP, KeyEvent.KEYCODE_MEDIA_STOP,
KeyEvent.KEYCODE_MEDIA_PAUSE, KeyEvent.KEYCODE_MEDIA_PAUSE,
KeyEvent.KEYCODE_MEDIA_PLAY, KeyEvent.KEYCODE_MEDIA_PLAY,
KeyEvent.KEYCODE_HEADSETHOOK, KeyEvent.KEYCODE_HEADSETHOOK,
KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE -> { KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE -> {
command = true if (action == KeyEvent.ACTION_DOWN) {
} readAloud(context)
} return true
if (command) { }
if (action == KeyEvent.ACTION_DOWN) {
readAloud(context)
return true
} }
} }
} }

Loading…
Cancel
Save