timehop / sticky-headers-recyclerview

[UNMAINTAINED] Sticky Headers decorator for Android's RecyclerView
Apache License 2.0
3.74k stars 755 forks source link

Don't propagate touch to items behind a header (update StickyRecyclerHeadersTouchListener) #73

Closed alexcohn closed 9 years ago

alexcohn commented 9 years ago

When a sticky header is touched, a regular item behind it may receive the ACTION_DOWN event, and display "pressed" state. This commit fixes such undesired behavior by returning true for onInterceptTouchEvent() if it was DOWN inside the borders of a sticky header.

jacobtabak commented 9 years ago

Thanks! I'll test it out and update the sample to demonstrate the fix and then merge sometime soonish.

alexcohn commented 9 years ago

See the "demo" at https://github.com/alexcohn/sticky-headers-recyclerview/commit/73d9e9af231ebccf6e4cfef58b9e878999921895

jacobtabak commented 9 years ago

Thank you so much for pushing the updated sample. It really helps! I verified your fix and it works as expected.

We'll need to fix the indentation to match the rest of the project. Also, I think it would be great to add some javadocs here to explain what's going on. Would you mind doing that? I'm happy to do it if you're busy.

I'm planning on investing some time down the road cleaning this whole project up, adding checkstyle & tests to CI, and enhancing the documentation. So any documentation that we have now will make that process easier.

alexcohn commented 9 years ago

I would prefer if you take care of javadoc, to keep it all styled consistently. Regarding indentation, spaces, etc. feel free to fix

jacobtabak commented 9 years ago

Thank you again! I'll touch up those things and we'll merge & release.