Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hover State with Google TV Dpad

I have a side navigation menu that I want to be able to utilize the dpad with. I am coding in java. I have xml document for states of the buttons and can't get the state to show when my dpad is on the item, but not selected (press ok). I can navigate down to the next, state stays same, then press okay and the new screen associated with this tab displays. I want to show the user they are hovered on the next item. How?

like image 945
taraloca Avatar asked Feb 07 '26 19:02

taraloca


1 Answers

Not sure if its different on Google TV, but android:state_focused="true" should be what you want in your state list.

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/buttonpressed"
          android:state_pressed="true" />

    <item android:drawable="@drawable/buttonfocused"
          android:state_focused="true" />

    <item android:drawable="@drawable/button" 
    />
</selector>
like image 55
FunkTheMonk Avatar answered Feb 09 '26 11:02

FunkTheMonk