-
Notifications
You must be signed in to change notification settings - Fork 675
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
How could I implement an OnClickListener for the header image? #8
Comments
That's a good idea, let me look into it. |
I managed to get the header completely selectable by changing one line in
The last boolean value switches "isSelectable" feature of the applied header. That works. But would be nicer if that was a possibility from "the outside" without changing your code. :-) |
Absolutely, I'll try to add that to the next version of the lib. |
+1 |
did you add this feature ???? |
Also interested to know. If it was added (in one way or another) could you tell us how to use it? |
Hi guys. I didn't implement this for v3, sorry. I'll give it a try over the next few days, please stay tuned. |
@Zordid That would work for the list view but what about the other views? Seems more scalable to have an overall method by allowing the class to implement a View.OnClickListener like you stated first. cc: @ManuelPeinado |
@Zordid I changed isSelectable parameter like you described and it do make the header clickable but sadly not my button inside the header view. Is there any way of enable childs of the header to be clickable? |
Would love to have this feature implemented for other layouts than listview. Currently I am using your library with a relativelayout in a scrollview. Has anyone figured out how to make the header clickable in these layouts? Thanks |
this was quite easy... feel free to implement: https://gist.github.com/iGio90/8828996 |
See #64 for my solution. Extended @iGio90's idea but allows for the header view to handle touch events if it wants (by setting an OnClickListener on the background image view or button that may exist). Otherwise, the content view will scroll as expected. @ManuelPeinado, thoughts? |
@deRonbrown thank you, this works perfectly! |
I struggle with getting the OnClick event of my header view. Tried to set the image that I got in my header layout as clickable and assigned a listener - but that does not work, apparently because the layout is more complex at the end and other elements obstruct the way and are on top of my ImageView?
Could you extend your library, your
FadingActionBarHelper
, to allow adding of a listener via a simplesetOnHeaderClickListener(OnClickListener)
helper method?Thanks!
The text was updated successfully, but these errors were encountered: