Did you know, that you can set RecyclerView layoutManager directly in XML, instead of always set RecyclerView layoutManager in the code?
Paste one of this attribute in your RecyclerView in XML.
And for StaggeredGridLayoutManager:
Top comments (3)
This is neat! I wonder if it'd work with a custom
Hmmm...I didn't use a custom layout manager, so I can't say anything, but I think it should. If you going to do it, could you leave a result?
So it looks like you can; as long as your layout manager defines the 4 parameter constructor:
Then in the xml layout, you just have to fully qualify your LayoutManager, so mine was
I just had my layout manager extend grid layout manager and set the column count to 3 when the layout manager is created.