maurycyw / StaggeredGridView

A modified version of Android's experimental StaggeredGridView. Includes own OnItemClickListener and OnItemLongClickListener, selector, and fixed position restore.

Home Page:https://github.com/maurycyw/StaggeredGridViewDemo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sample app is buggy : shows empty spaces and has bad scrolling

AndroidDeveloperLB opened this issue · comments

I've tested the sample app, and sadly I've noticed some weird bugs, which include presenting empty cells (sometimes tall ones) and sometimes the scrolling barely scroll anything.

All that I know is that it occurs more frequently when I change the orientation frequently.

Has anyone else got those weird bugs?
Is there a workaround or alternative to this library?

EDIT: it seems it is caused because the sample doesn't set the size of the items right away, but only after the images were loaded.
however, it doesn't explain the empty cells issue.
i've used Volley library instead of what is used in the sample, and i've used a constant height for the cells depending on their position on the array (for example, 1/5 of the screen height in case it's even, or 1/3 in case it's not).

Would also like the empty cells issue to be investigated. Currently causing me grief, but that also could be because I'm switching between child view types when I switch column counts.

Is this the issue mentioned by @maurycyw in the ToDo?

"currently restoring position can result in the views to be slightly offset when user flings to the top. This is corrected by checking the offsets when position 0 is reached. Would like to dig deeper into the issue."

I'd like to know where to correct.

In my test, the speed while flinging back to top is so laggy compared to flinging down. If I scroll down & up several times the whole app will hang.

@psyren89 are your empty cell image views with lazy loading images?

@briangriffey Yes the lazy loading images don't always load. @cyberrob I have the same scrolling issue as you have, driving me crazy. The HashSet solution has improved performance and fixed some of the layout issues.