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