Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Grid incorrectly overscroll's beyond last item #66

@venkat230278

Description

@venkat230278

Occurs on master commit b81c1c6

Video can be found here: http://dai.ly/x1dj5iy

Test App to reproduce is at https://github.com/venkat230278/AndroidStaggeredGridViewOverscrollBug.git

Place app at same level as "library", "sample", import into Android studio and build.

Test App has a StaggeredGridView with 2 columns. Its adapter supplies 3 text views. Eventually, the three text views are laid out by the GridView as below.

A B
C

All text views (A, B, C) are of equal height H. H is greater than screen height. In above layout, A and B are clipped by the screen.

Slowly start scrolling towards and beyond C. Note that it is possible to scroll beyond C. Scroll in reverse towards A. Notice that B has disappeared. Notice after a while that A too disappears.

This issue is also encountered if the user flings on A or B towards C.

It appears that the grid view considers empty columns in scroll math. We tried to put in a quick hack fix for this issue for our product.

Patch can be found here: https://github.com/venkat230278/AndroidStaggeredGridViewOverscrollBug/blob/master/patch/sg.patch

Apply patch as follows:

[Some dir]/AndroidStaggeredGrid/library/src/main$ patch -p1 < sg.patch

Things to note about the above patch:

  1. Tested only for 2 columns.
  2. Not tested with other staggered grid features such as headers or footers.
  3. Might introduce other bugs.
  4. No guarantee / warranty of any kind. Use at your own risk.
  5. Might make the staggered grid less efficient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions