Search code examples
androidandroid-listviewandroid-recyclerviewandroid-scrollview

Sync al horizontal RecyclerView inside vertical list view


Hi I have vertical list (Custom ArrayAdapter) where each element has a horizontal RecyclerView, to give me a table like format. What I want to do is, if one row is scrolled horizontally, rest rows too should be. I tried putting them just inside horizontal scroll view and various tricks available, but got no luck.

If possible, I would also like this synchronization keeping first element fixed. Out of sync horizontal RecyclerViews inside a list


Solution

  • Make an instance of RecyclerView.OnScrollListener. This instance will be common to all your horizontal recycler views. When onScrolled( ) gets called, scroll all the views except the one on which this got called.