bgogetap / StickyHeaders

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

Headers paint not header views after few scrolls. #91

Closed vlytvyne closed 5 years ago

vlytvyne commented 5 years ago

Before scrolling:

image

After few scrolls:

image

bgogetap commented 5 years ago

Do you have a project that I can look at? Sample app in repo still looks fine so I'd need to see how the library is used in your case.

vlytvyne commented 5 years ago

Do you have a project that I can look at? Sample app in repo still looks fine so I'd need to see how the library is used in your case.

You can look at the code here: https://github.com/vlytvyne/StickyHeader

bgogetap commented 5 years ago

https://github.com/vlytvyne/StickyHeader/blob/master/app/src/main/java/com/example/stickyheader/Adapter.java#L31

You are changing the background color if it's a header, but not changing it back when that view holder is re-bound for a non-header.

Remember, onBindViewHolder can be called on the same view holder multiple times. With your setup as it is, it could be sometimes binding a header, then later binding a non-header.

This isn't an issue with the library.