I've been trying to work out how to calculate the y-position of scrolled content inside an Android ListView. The consensus seems to be that Android simply doesn't give you this information and you have to work it out by doing all sorts of calculations based on the getChildAt(0).top
and getFirstVisiblePosition()
methods.
My question is to try to understand why Android doesn't give you this information. It would seem to that the the list view must actually know this value somehow in order to draw the scrollbars. Or at least know it as a percentage? The ViewPager's onPageScrolled()
method seems to do the same thing. And it's a trivial matter in iOS as well.