Reputation: 9135
I have a webView that I am displaying Google v3 API map inside. I have panControl and zoomControl that I need to navigate with the dPad. From my menu, I navigate right arrow and the dPad enters the webview on the left arrow of the panControl. Focus is seen by a blue hollow rectangle that will reposition on each arrow as I dPad through. A couple questions...
Here is a screen shot so that you can see the rectangle I am speaking of for focus:
Below is code:
mWebView.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
if (event.getAction() == KeyEvent.ACTION_UP) {
switch(keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
Log.i(DEBUG_TAG, "KEYCODE_DPAD_CENTER");
return false;
case KeyEvent.KEYCODE_DPAD_DOWN:
Log.i(DEBUG_TAG, "KEYCODE_DPAD_DOWN");
return false;
case KeyEvent.KEYCODE_DPAD_UP:
Log.i(DEBUG_TAG, "KEYCODE_DPAD_UP");
return false;
case KeyEvent.KEYCODE_DPAD_RIGHT:
Log.i(DEBUG_TAG, "KEYCODE_DPAD_RIGHT");
return false;
case KeyEvent.KEYCODE_DPAD_LEFT:
Log.i(DEBUG_TAG, "KEYCODE_DPAD_LEFT");
return true;
}
return false;
}
return false;
}
});
My ultimate goal is to be able to dpad inside the webview, and then when I reach the (-) of the zoom and press the down on dpad, I'd want to navigate to the "play" button and then right arrow across bottom of screen to other controls. If I left arrow from bottom controls and hit the "play" then I'd want to pop back out to the left navigation "Maps" item.
Upvotes: 0
Views: 1104
Reputation: 7132
Take a look at MapsOnTV sample code at https://code.google.com/p/googletv-android-samples/
Brose the source tree.
Upvotes: 1