1

I'm working on a custom media controller. I have it so that the Surface View correctly shows and hides the view. The view is populated with a SeekerBar and about for ImageButtons. However, I can't figure out how to make the D-Pad navigate to these items.

If I use the synaptic touchpad on the remote, I can select the buttons and the seekerbar, but can't use the D-PAD to get to these items. Do I need to catch the events when the view is shown. Is there a good example for google tv on a custom media controller implementation?

kingargyle
  • 1,239
  • 10
  • 15

1 Answers1

1

Yes you will need to catch the key code events and manage the focused items accordingly to make that work.

Krispy
  • 1,098
  • 1
  • 7
  • 11
  • One of the issues I'm seeing is that the MediaController view doesn't seem to be gaining focus. I put a break point in my dispatchKeyEvent in the MediaController where I added the D-Pad navigation and it is never hit. – kingargyle Jan 30 '13 at 19:38
  • Accepting as it gives me what I need, I just need to debug further why my overlays aren't gaining focus. – kingargyle Jan 31 '13 at 16:34
  • I believe you can have the layout request focus and have your activity be an onKeyListener and then bubble down the focus/selection handlers to your surface view elements. – Krispy Jan 31 '13 at 19:24
  • Thanks I need to do some more experimenting with things. – kingargyle Jan 31 '13 at 21:52
  • Found the actual problem. In my custom MediaController I needed to call setFocusable(true). By default the MediaController itself is not focusable. Once I set this, D-Pad navigation events started firing. – kingargyle Feb 18 '13 at 18:17