The GreedoLayoutManager was not able to fill the screen with views on fast scroll, because the layout manager was assuming that each call to scrollVerticallyBy(), the mFirstVisibleRow value should increase/decrease at most by one, but if you scroll too fast and/or if you are processing some other tasks on the main thread then the calls to the scrollVerticallyBy() might delay and in that case the mFirstVisibleRow might be wrong and it could cause the layout manager to stop filling the screen with views (Because it checks the position of the first visible object on the mFirstVisibleRow and if that position is greater than the screen height than it stops filling the screen)
With this PR the GreedoLayoutManager checks the position of the first visible item and if it is greater than zero than it means that the mFirstVisibleRow should be updated and the GreedoLayoutManager loops through the rows to find the first visible row and updates the mFirstVisibleRow
The
GreedoLayoutManager
was not able to fill the screen with views on fast scroll, because the layout manager was assuming that each call toscrollVerticallyBy()
, themFirstVisibleRow
value should increase/decrease at most by one, but if you scroll too fast and/or if you are processing some other tasks on the main thread then the calls to thescrollVerticallyBy()
might delay and in that case themFirstVisibleRow
might be wrong and it could cause the layout manager to stop filling the screen with views (Because it checks the position of the first visible object on themFirstVisibleRow
and if that position is greater than the screen height than it stops filling the screen)GreedoLayoutManager
checks the position of the first visible item and if it is greater than zero than it means that themFirstVisibleRow
should be updated and theGreedoLayoutManager
loops through the rows to find the first visible row and updates themFirstVisibleRow