500px / greedo-layout-for-android

Full aspect ratio grid LayoutManager for Android's RecyclerView
MIT License
1.64k stars 156 forks source link

Fix fast scroll up blank screen issue #41

Open insacc opened 7 years ago

insacc commented 7 years ago

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)

playscforever commented 6 years ago

good