bgogetap / StickyHeaders

Easily add Sticky Headers to your RecyclerView
Apache License 2.0
521 stars 88 forks source link

System Hang on boundary check #92

Open ramirod opened 5 years ago

ramirod commented 5 years ago

I wanted to make a sticky header that stayed only for three items of my recyclerView then remove it after. To do so I added a "Terminator" item which would replace the sticky header with an empty view. Testing the view, scrolling up and down the boundary about 4 or so times really bogs down phone performance and causes hangs.

Is there another way where I can only make the sticky header valid for only a set number of items? All I can see now is that the header will remain for all screens below the first.

bgogetap commented 5 years ago

That would be what I would have recommended, but I never thought of this scenario.

I didn't verify the perf issue yet, but I'm looking into adding a new marker interface to disable the sticky header all together as that seems cleaner overall.

The tricky part is having an item in the dataset that the adapter shouldn't care about. It would require custom adapter work, which this library has purposefully avoided in the past.