I want just 3 items centered along with horizontal scroll for remaining items, Also I want the centered item to get highlighted on scroll or tap. Here is what i want
I am using flexboxlayout manager and here is what i did
flexboxLayoutManager=new FlexboxLayoutManager(getContext());
flexboxLayoutManager.setJustifyContent(JustifyContent.SPACE_AROUND);
flexboxLayoutManager.setFlexDirection(FlexDirection.COLUMN);
flexboxLayoutManager.setFlexWrap(FlexWrap.WRAP);
recyclerView_stats_list.setLayoutManager(flexboxLayoutManager);
and in the adapter viewholder
ViewGroup.LayoutParams lp = itemView.getLayoutParams();
if (lp instanceof FlexboxLayoutManager.LayoutParams) {
FlexboxLayoutManager.LayoutParams flexboxLp =
(FlexboxLayoutManager.LayoutParams) itemView.getLayoutParams();
flexboxLp.setFlexGrow(1.0f);
}
If i change the flex direction from column to row it centeres my 3 items but then it starts to scroll vertically, I need that same but with horizontal scrolling.