I am developing app for the google tv and i have to use left navigation bar
in my app. I downloaded the google tv examples and am playing with the leftnavbar to make it work as per my requirements. I want it to behave like the one tv & movies OR youtube app for Google TV. It should expand when focus is moved to its tabs by LEFT D-Pad key and collapse when I move focus from it using RIGHT D-Pad key.
I did't know if there are any properties which will help me achieve this functionality.
So I tried by registering the setOnFocusChangeListener
listener and calling flipOption(LeftNavBar.DISPLAY_AUTO_EXPAND)
function in it as follows to force it to behave the way i want:
private LeftNavBar getLeftNavBar() {
if (mLeftNavBar == null) {
-------
-------
mLeftNavBar.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
flipOption(LeftNavBar.DISPLAY_AUTO_EXPAND);
}
});
}
return mLeftNavBar;
}
Now the above code works fine when there is nothing in leftNavBar. It shows/hides upon receiving/loosing focus. But it does not work when I add some tabs in it.
Any Idea how to achieve it?