简体   繁体   中英

Button focused state getting lost : Google TV

In my Google TV application, there are around 6 buttons with all that pressed, focused, enabled etc. states with them.

All buttons have got same pressed, focused, enabled etc. states in a xml file as below.

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:drawable="@drawable/default_bt" android:state_enabled="true" android:state_pressed="true"/> <!-- pressed -->
<item android:drawable="@drawable/default_bt" android:state_enabled="false" /> <!-- disabled -->
<item android:drawable="@drawable/default_bt_hvr" android:state_focused="true"/> <!-- focused -->
<item android:drawable="@drawable/default_bt_hvr"/> <!-- default -->

</selector>

Using Google TV remote, if I start moving to the left side, buttons shifting their focus and when I reach the leftmost button, focus remains on the leftmost button.

From that position (leftmost), if I start moving right, focus is coming till rightmost button but goes missing after that.

Is it accepted behavior or something wrong with it?

Any help is greatly appreciated.

It was not a general case.

So, I managed to bring the focus back with view.requestFocus() wherever required;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM