I'm using FlexboxLayoutManager.
How to change space between rows, and space between items on the first row?
class FlexboxLayoutManagerImpl(context: Context, flexDirection: Int) :
FlexboxLayoutManager(context, flexDirection) {
override fun generateLayoutParams(lp: ViewGroup.LayoutParams): RecyclerView.LayoutParams {
return LayoutParams(lp)
}
}
And call from my adapter:
contentParent.getChildAt(i).setOnClickListener(v1 -> {
FlexboxLayoutManagerImpl flexboxLayoutManager = new FlexboxLayoutManagerImpl(context, FlexDirection.ROW);
holder.recycleListView.setLayoutManager(flexboxLayoutManager);
});