title: Snap center onItemClick in cyclic Recyclerview android
body: <p><strong>Description:</strong> I am working on one demo with the functionality that user can select an option from the item of horizontal <code>Recyclerview</code>. In this, I got stuck in below queries.</p>
  
  <p><strong>Queries:</strong></p>
  
  <p><strong>1:</strong>  <em>How to make <code>Recyclerview</code> cyclic?</em></p>
  
  <p>For example, I have 10 items named 1,2,3,4,5,6,7,8,9,10. Now if user scrolls the recyclerview then he/she will be able to scroll it endlessly. i.e 1,2,3,4,5...9,10,1,2...9,10,1,2,3..9,10 like this.
  To achieve this I have used <a href="https://stackoverflow.com/a/45114415/7874047">this answer</a>. Somehow it worked but only in forward direction.</p>
  
  <p><strong>2:</strong> <em>How to give Snap center to the particular item which is selected by the user?</em></p>
  
  <p>For example: <strong>As shown in the image</strong>, if the user clicks on '15' then that item will come to the center. Same as if the user clicks on '07' then it should come to the center position.
  I have implemented <a href="https://github.com/MindorksOpenSource/SnapHelperExample" rel="nofollow noreferrer">this demo</a>. But it doesn't work on click on the item.</p>
  
  <p>The code which I have done so far is as below:</p>
  
  <p>Layout Manager:</p>
  
  <pre><code>final CenterZoomLayoutManager mLayoutManager = new CenterZoomLayoutManager(mContext,
              CenterZoomLayoutManager.HORIZONTAL, false);// To get centered item zoom
  recyclerview.setLayoutManager(mLayoutManager);
  </code></pre>
  
  <p>Adapter object:</p>
  
  <pre><code>mAdapter = new CustomAdapter(mContext, arrayList, new RecyclerViewClickListener() {
          @Override
          public void recyclerViewListClicked(View v, int position) {
  
          }
      });
      recyclerview.setAdapter(mAdapter);
  </code></pre>
  
  <p>Any help is appreciated!
  Thanks.</p>
  
  <p><a href="https://i.stack.imgur.com/BGySe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BGySe.png" alt="Horizontal Recylerview in which user can select item as an option"></a></p>