DEV Community

Discussion on: Small RecyclerView XML feature

Collapse
 
johnson_cor profile image
Corey Johnson • Edited

So it looks like you can; as long as your layout manager defines the 4 parameter constructor:

public YourLayoutManager(Context context, AttributeSet attrs, int defStyleAttr,int defStyleRes)

Then in the xml layout, you just have to fully qualify your LayoutManager, so mine was

com.corey.testrecyclerview.ThreeColumnGridLayoutManager

I just had my layout manager extend grid layout manager and set the column count to 3 when the layout manager is created.