title: Get x/y positions of nth item in RecyclerView
body: <p>I would like to know how to get the X or Y position of nth item in RecyclerView. This is easy to do if the item is currently within the visible range. However, when the view is currently off the screen (e.g., current visible items range on the RecyclerView is 4 to 7, while the item I am interested in is, say, 1 or 10), there seems to be no way to get that value.</p>
  
  <p>Here's what I have tried. I have the following three fields:</p>
  
  <pre><code>private RecyclerView rv;
  
  /* The Layout Manager of rv */
  private LinearLayoutManager llm;
  
  /* The data to be shown in the RecyclerView. */
  private String[] data = {"0","1","2",...,"9"};
  </code></pre>
  
  <p>I have the items "2" to "5" shown on the screen, and I want to get the X/Y position of the item "9", which is currently off the screen. So I tried the following:</p>
  
  <pre><code>int index = 9;
  View v = rv.getChildAt(index);
  View v2 = llm.getChildAt(index);
  </code></pre>
  
  <p>Unfortunately, both <code>v</code> and <code>v2</code> are null. The reason for it seems to be that while the size of <code>data</code> is 10, the childCount of <code>rv</code> and <code>llm</code> is whatever the number of views currently visible on the screen, as evidenced by the following:</p>
  
  <pre><code>int count = rv.getChildCount();
  int count2 = llm.getChildCount();
  </code></pre>
  
  <p>Both variables are 4 (the number of views currently visible; i.e., "2" to "5"). Since the size of the recyclerView is 4, and I want to look up the item at index 9, I get null returned above.</p>