1

I am developing app for Android TV and I have a vertical RecyclerView, when I scroll the RecyclerView using the DPAD control the RecyclerView scroll down when I get to the last viewable item and then it scroll.

Is there away that the focused item will always stay in the center of the recyclerview while I scroll using the DPAD and only when I get to the last item of the recyclerview the focus will go until the last item.

It seems simple enough to have a build in option inside the RecyclerView but I can't find an answer!!!

Thanks!

6rchid
  • 1,074
  • 14
  • 19
ia244
  • 145
  • 1
  • 10
  • you can put one layout(view) before RecyclerView in a required position make the view visible with the selected item displayed. I think there is no way to freeze certain cell and scroll in recycler view. :) – iamnaran Jul 29 '19 at 08:49

2 Answers2

1

You can use SnapHelper which can snap the item either vertically or horizontally. For example: attach the instance the the recyclerView like this:

LinearSnapHelper snapHelper  = new LinearSnapHelper();
snapHelper.attachToRecyclerView(recyclerView);

Here is more information:

https://blog.mindorks.com/using-snaphelper-in-recyclerview-fc616b6833e8

Maj100
  • 58
  • 6
0

Was fixed using a VerticalGridView

https://corochann.com/verticalgridfragment-android-tv-application-hands-on-tutorial-19-718.html

ia244
  • 145
  • 1
  • 10