0

I am currently trying to port Android mobile app to Android TV. I have a RecyclerView that seems to be displaying correctly in my Android TV app. But I don't seem to be able to navigate inside RecyclerView using dpad controls. P.S i have tried following line.Couldn't find anything else

        android:descendantFocusability="afterDescendants"

Also is it recommended to use recycler view for TV apps ?

Also i have read complete architecture of TV app at developer.android.com and also went through their sample project, But found recycler view nowhere.

Hussnain Azam
  • 358
  • 1
  • 5
  • 14

1 Answers1

0

As @ULazdins stated, you may try to make your RecyclerView focusable. You may refer with this workaround for the bug with RecycleView focus scrolling when navigating with d-pad.

As I can see from source the issue is because GridLayoutManager uses LinearLayoutManager's implementation of onFocusSearchFailed() which is called when focus approaches the inner border of RecyclerView. LinearLayoutManager's implementation just offers first/last (depends on scrolling direction) element. Hence focus jumps to first/last element of new row.

Hope this helps!

abielita
  • 13,147
  • 2
  • 17
  • 59