title: Android - RecyclerView computeHorizontalScrollOffset giving fake scroll-offset
body: <p>Task is to create Player which contains group of images &amp; videos and play with frames as Player-Controller. See the Below image
  <a href="https://i.stack.imgur.com/1dAJO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1dAJO.jpg" alt="enter image description here"></a></p>
  
  <ol>
  <li>Center part is the CustomView which render image/video at the runtime.</li>
  <li>Player-Controller is the recylerview which contains frame of each image/video.</li>
  </ol>
  
  <blockquote>
    <p>Problem - I want to get the Horizontal-Scroll-Pixel on recyclerview scroll</p>
  </blockquote>
  
  <pre><code>private float computeHorizontalScrollOffset() {
      int xOffset = rvHootFrame.computeHorizontalScrollOffset();
      int range = rvHootFrame.computeHorizontalScrollRange();
      int extent = rvHootFrame.computeHorizontalScrollExtent();
  
      float percentage = (xOffset / (float)(range - extent));
      float seekto = percentage * TOTAL_VIDEO_IN_PX;
      Log.d(TAG, "computeHorizontalScrollOffset: (xOffset,range,extent,percentage,seekto) = ("+xOffset+", "+range+", "+extent+", "+(percentage*100)+"%, "+seekto+")");
  
      return seekto;
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/m4LqF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m4LqF.png" alt="enter image description here"></a></p>
  
  <p>See the above screenshot
  I Constantly scroll the recyclerview, but at random scroll it give unproper scrolloffset value (see the highlighted log)</p>
  
  <p>Any Help Guys..</p>