title: How do I create a circular (endless) RecyclerView?
body: <p>I am trying to make my <code>RecyclerView</code> loop back to the start of my list.</p>
  
  <p>I have searched all over the internet and have managed to detect when I have reached the end of my list, however I am unsure where to proceed from here.</p>
  
  <p>This is what I am currently using to detect the end of the list (found <a href="https://stackoverflow.com/questions/26543131/how-to-implement-endless-list-with-recyclerview">here</a>):</p>
  
  <pre><code> @Override
      public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
  
          visibleItemCount = mLayoutManager.getChildCount();
          totalItemCount = mLayoutManager.getItemCount();
          pastVisiblesItems = mLayoutManager.findFirstVisibleItemPosition();
  
          if (loading) {
              if ( (visibleItemCount+pastVisiblesItems) &gt;= totalItemCount) {
                  loading = false;
                  Log.v("...", ""+visibleItemCount);
              }
          }
   }
  </code></pre>
  
  <p>When scrolled to the end, I would like to views to be visible while the displaying data from the top of the list or when scrolled to the top of the list I would display data from the bottom of the list.</p>
  
  <p>For example:</p>
  
  <blockquote>
    <p>View1 View2 View3 View4 View5</p>
    
    <p>View5 View1 View2 View3 View4</p>
  </blockquote>