-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headers onClick #38
Comments
@amirlatifi The code in the sample is very proof-of-concept and only to show the approach you need to implement in order to detect click on the header views. Implementing the Please, feel free to contribute a better implementation or even a different solution if you'd like. I can guarantee it will be most welcome. :) |
Is it for the onClick purpose that you translate the header view where it will be drawn ? (https://github.com/edubarr/header-decor/blob/master/lib/src/main/java/ca/barrenechea/widget/recyclerview/decoration/StickyHeaderDecoration.java#L155) I can see the library working without this translation, what's his purpose ? Thanks you |
@rafoufoun yes, translation is only there to support |
I tried to get a button as a header the way your library does but the onclick listener was never called. It seems to me that using an item decorator is more appropriate for only drawing than getting views with interactions |
I have found the solution. You have to add touchlistener like this.
code for StickyHeadersTouchListener:
|
@IlyaMyasoedov hi,where can I find the method findHeaderPositionUnder ? |
|
How can I add
onClick
to views in the header? ThefindHeaderViewUnder
seems doesn't work most of the time even in your sample project. Specially after scrolling and having headers overlapped.The text was updated successfully, but these errors were encountered: