I need to be able to make a bi-directional RecyclerView
. Basically, it would scroll vertically, but each row would be a horizontal list of tiles that could scroll. The initial scroll position would be at the top and left. The user could scroll down, and scroll to the right with each row.
Any ideas on how to do this? (e.g. with a custom LayoutManager
or touch event interception).
I was able to solve the issue using a custom view implementation.
At the root, I have a custom
ScrollView
; whenonMeasure
is called, theScrollView
tells its children how tall they should. In this case, they are half the height of theScrollView
. The width matches the height so they display as square tiles.Each of the
ScrollView
children areRecyclerView
's with a horizontalLinearLayoutManager
. Since theScrollView
tells each child how tall to be, there's no issues with measurement and they actually scroll very well in both directions (vertically and horizontally).