I am working on an app which slideshows the images using RecyclerView. I used the below code to horizontally scroll the recycler view.
RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(activity, LinearLayout.HORIZONTAL, false);
imageListRecyclerView.setLayoutManager(mLayoutManager);
Also, I am using the below code to scroll one item at a time.
SnapHelper snapHelper = new PagerSnapHelper();
snapHelper.attachToRecyclerView(imageListRecyclerView);
The problem is that I want to get the position of current visible item using
holder.getAdapterPosition()
but it is not working. Can anyone tell how to do it?