I am using an infinite scroll for recyclerview with X items which repeats. Also i want am using PagerSnapHelper() to snap the scroll like viewpager.
So initially when the list is loaded the display is like -
As soon as i start scrolling on either side left or right the PageSnapHelper() come in work an snap it like viewpager with center alignment like this -
I want to show recyclerview as like 2nd image when initially loaded. Please tell what to do next to acheive that.
here is the code snipet -
linearLayoutManager = new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false);
this.recyclerView.setLayoutManager(linearLayoutManager);
SnapHelper snapHelper = new PagerSnapHelper();
adapterCarousel = new AdapterCarousel(mContext, glideRequestManager);
adapterCarousel.setViewType(RECYCLER_VIEW_TYPE_NORMAL);
adapterCarousel.setCarousel(carousel);
this.recyclerView.setAdapter(adapterCarousel);
snapHelper.attachToRecyclerView(recyclerView);
linearLayoutManager.scrollToPosition(Integer.MAX_VALUE / 2);