Enfoque de WebView en Google TV

I'm trying to use a Webview for a Google TV app. The problem I have is that I can't get the focus to move around in the view.

Obviously with a TV app I don't have a touch screen so I'm trying to use the D-Pad on the controller to shift the focus to the different HTML elements in the webview. However, all the D-pad buttons do is pan the view around the screen, which is also another problem I have where the view is much larger than the screen.

¿Alguna idea?

Muchas Gracias

preguntado el 09 de marzo de 12 a las 13:03

Do you have control over the content that is displayed in the WebView, or can the user go to any website they want? -

I don't directly have control, It works in the Chrome browser, I can press 'tab' and the arrow keys and the focus moves but not in the webview. It's like Android puts focus on the webview itself, but won't seem to go any deeper. -

Er, what I'm asking is, do you have control over the HTML (or whatever) that is displayed in the WebView within your application? If you do, you may be able to control the user experience a little better than if you do not. -

Yeah, I can get control, but the content is also for other apps and platforms too, so I don't want to have different HTML/JS depending on the target. I just want it to act the same as if it was viewed in a browser. -

2 Respuestas

Have you looked at the Google TV JQuery / Closure UI Lib Extensions? https://developers.google.com/tv/web/docs/tools_libraries These work. There are issues if you hit the back button, but on the whole you can do what you want as long as your not mixing WebView controls w/ Android controls. Then it's a bit more work.

For more info you can also look at https://developers.google.com/tv/android/articles/moving_web_content_to_android

Respondido 17 Feb 21, 00:02

Agregar tabindex="1" in your element, add tabindex outline in CSS.

Respondido 27 Oct 21, 12:10

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.