title: Android: How to get the current X offset of RecyclerView?
body: <p>I'm using a <code>Scrollview</code> for an infinite "Time Picker Carousel" and found out, that it is not the best approach (<a href="https://stackoverflow.com/questions/26341587/horizontalscrollview-customadapter-with-getview-doesnt-reuse-convertviews-li">last question</a>)</p>
  
  <p>Now, I found the <a href="https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html" rel="noreferrer">Recycler View</a> but <strong>I am unable to get the current scroll offset in X direction of the recyclerView</strong>? (Let's say each item is 100px width, and the second item is only visible to 50%, so the scroll-offset is 150px)</p>
  
  <ul>
  <li>all items have the same width, but therer is some gap before the first, after the last item</li>
  <li><code>recyclerView.getScrollX()</code> returns <code>0</code> (docs say: initial scroll value)</li>
  <li>the <code>LayoutManager</code> has <code>findFirstVisibleItemPosition</code>, but I cannot calculate the X offset with that</li>
  </ul>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I just found a way to keep tracking the X-Position, while updating the value with the <code>onScrolled</code> callback, but I would prefer getting the actual value instead of tracking it all the time!</p>
  
  <pre><code>private int overallXScroll = 0;
  //...
  mRecyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
          @Override
          public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
              super.onScrolled(recyclerView, dx, dy);
  
              overallXScroll = overallXScroll + dx;
  
              Log.i("check","overallXScroll-&gt;" + overallXScroll);
  
          }
      });
  </code></pre>