emilsjolander / StickyListHeaders

An android library for section headers that stick to the top
Apache License 2.0
5.51k stars 1.52k forks source link

ExpandableStickyListHeadersListView - performance suffers when collapsed #356

Open asgarddesigns opened 10 years ago

asgarddesigns commented 10 years ago

Because items are hidden rather than recycled, they cause some significant performance degradation.

Is this easily solved?

sarn commented 8 years ago

Any solution for this?

asgarddesigns commented 8 years ago

We mostly moved to recyclerviews and treated the list as a flat list with different view types. when you expand, insert the items after the header item, when collapsed, remove them all.

It's a bit of work, but the only way to maintain performance.

ProfPh commented 7 years ago

@asgarddesigns Do you have the code for your adaptation available online?

The root of the issue is all of the Views in a collapsed header being drawn and handled in ListView.fillGap (this can be seen with the way the scrollbar changes as it scrolls over a collapsed section). If this were skipped somehow, where the Views are not drawn until header expanded again, then performance would improve dramatically.

asgarddesigns commented 7 years ago

Unfortunately not @ProfPh , I've moved on from that job so can't even access it now. From memory it shouldn't be hard to replicate:

Sorry, this is all from memory so I may be missing things, but that was, in essence, the method of doing it. The whole thing was a bit of a PITA but performance improved dramatically and there was far fewer nasty side-effects.