I\'m using a Scrollview
for an infinite \"Time Picker Carousel\" and found out, that it is not the best approach (last question)
Now, I found the Recycl
Thanks to @umar-qureshi for the right lead! It appears that you can determine the scroll percentage with Offset
, Extent
, and Range
such that
percentage = 100 * offset / (range - extent)
For example (to be put in an OnScrollListener
):
int offset = recyclerView.computeVerticalScrollOffset();
int extent = recyclerView.computeVerticalScrollExtent();
int range = recyclerView.computeVerticalScrollRange();
int percentage = (int)(100.0 * offset / (float)(range - extent));
Log.i("RecyclerView, "scroll percentage: "+ percentage + "%");