title: Get View of RecyclerView by AdapterPosition
body: <p>I have a RecyclerView with video previews in it. 
  When the user is scrolling, the videos should automatically be played on the recyclerView-items which are visible to the user (when scroll-state is IDLE).</p>
  
  <p>So I've written a custom onScrollListener which passes the positions which are visible to the user as an array to the method <code>startVideosOn(int[] positions)</code>. </p>
  
  <p>But the problem is when I want to get the View by the position (the position equals the adapter position). When I try <code>linearLayoutManager.getChildAt(index)</code> I get <code>null</code> when the 3rd item is displayed, because the RecyclerView has only 2 childs, which will be recycled.</p>
  
  <p>So how do I manage to get the <code>View</code> of the RecyclerView by adapter position?</p>
  
  <p>Edit, this is the OnScrollListener:</p>
  
  <pre><code>public abstract class AutoPlayRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
  
      LinearLayoutManager linearLayoutManager;
  
      public AutoPlayRecyclerOnScrollListener(LinearLayoutManager linearLayoutManager) {
          this.linearLayoutManager = linearLayoutManager;
      }
  
      @Override
      public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
          super.onScrollStateChanged(recyclerView, newState);
  
          if (newState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE) {
              int firstVisibleItemPosition = linearLayoutManager.findFirstVisibleItemPosition();
              int lastVisibleItemPosition = linearLayoutManager.findLastVisibleItemPosition();
  
              if (firstVisibleItemPosition != -1 &amp;&amp; lastVisibleItemPosition != -1) {
                  playOn(firstVisibleItemPosition, lastVisibleItemPosition);
              }
          }
      }
  
      private void playOn(int lower, int upper) {
          int[] completelyVisibleItems = new int[upper - lower + 1];
  
          for (int i = lower, j = 0; i &lt;= upper; i++, j++) {
              completelyVisibleItems[j] = i;
          }
  
          playOn(completelyVisibleItems);
      }
  
      public abstract void playOn(int[] items);
  }
  </code></pre>