kopia lustrzana https://github.com/ge0rg/aprsdroid
FireTV: switch focus to menu bar on play/pause key
rodzic
8b50531f5c
commit
898e1bc1ff
|
@ -9,6 +9,7 @@
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
/>
|
/>
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
style="@android:style/Widget.ProgressBar.Large.Inverse"
|
style="@android:style/Widget.ProgressBar.Large.Inverse"
|
||||||
|
|
|
@ -58,6 +58,7 @@ class MapAct extends MapActivity with MapMenuHelper {
|
||||||
setKeepScreenOn()
|
setKeepScreenOn()
|
||||||
setVolumeControls()
|
setVolumeControls()
|
||||||
checkPermissions(Array(Manifest.permission.WRITE_EXTERNAL_STORAGE), RELOAD_MAP)
|
checkPermissions(Array(Manifest.permission.WRITE_EXTERNAL_STORAGE), RELOAD_MAP)
|
||||||
|
mapview.requestFocus()
|
||||||
}
|
}
|
||||||
|
|
||||||
override def onConfigurationChanged(c : Configuration) = {
|
override def onConfigurationChanged(c : Configuration) = {
|
||||||
|
@ -141,6 +142,13 @@ class MapAct extends MapActivity with MapMenuHelper {
|
||||||
KeyEvent.KEYCODE_MEDIA_PREVIOUS =>
|
KeyEvent.KEYCODE_MEDIA_PREVIOUS =>
|
||||||
changeZoom(-1)
|
changeZoom(-1)
|
||||||
true
|
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)
|
case _ => super.onKeyDown(keyCode, event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue