FireTV: switch focus to menu bar on play/pause key

pull/317/head
Georg Lukas 2021-10-11 09:42:46 +02:00
rodzic 8b50531f5c
commit 898e1bc1ff
2 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -9,6 +9,7 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:focusable="true"
/>
<ProgressBar
style="@android:style/Widget.ProgressBar.Large.Inverse"

Wyświetl plik

@ -58,6 +58,7 @@ class MapAct extends MapActivity with MapMenuHelper {
setKeepScreenOn()
setVolumeControls()
checkPermissions(Array(Manifest.permission.WRITE_EXTERNAL_STORAGE), RELOAD_MAP)
mapview.requestFocus()
}
override def onConfigurationChanged(c : Configuration) = {
@ -141,6 +142,13 @@ class MapAct extends MapActivity with MapMenuHelper {
KeyEvent.KEYCODE_MEDIA_PREVIOUS =>
changeZoom(-1)
true
case KeyEvent.KEYCODE_MEDIA_PLAY |
KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE =>
if (mapview.hasFocus())
mapview.focusSearch(View.FOCUS_FORWARD).requestFocus()
else
mapview.requestFocus()
true
case _ => super.onKeyDown(keyCode, event)
}
}