medyo / Fancybuttons

Icons, Borders, Radius ... for Android buttons
1.77k stars 397 forks source link

`Clickable` attribute doesn't work #100

Closed F0RIS closed 6 years ago

F0RIS commented 6 years ago

When I set android:clickable and android:focusable attributes to false it doesn't work how it works in standart button. It must pass click event to parent view and not prevent it from further processing. This can be usefull when necessary to set up one clicklistener at whole item like this one: image

Of course I can set all this in my code, but any way, it should copy this behavior from native android button

pishguy commented 6 years ago

@F0RIS could you paste your xml layout here to check that?

F0RIS commented 6 years ago

@MahdiPishguy https://pastebin.com/HfnvSH5h

pishguy commented 6 years ago

@F0RIS Thanks, in your layout parent xml as Linearlayout i see this attributes:

   android:clickable="false"
   android:focusable="false"
   android:focusableInTouchMode="false"

did you try to change them and test again?

F0RIS commented 6 years ago

@MahdiPishguy yes, FancyButton doesn't read clickable attribute from xml, it just set it here https://github.com/medyo/Fancybuttons/blob/master/fancybuttons_library/src/main/java/mehdi/sakout/fancybuttons/FancyButton.java#L509 Probably that's why it doesnt pass touch to parent view

pishguy commented 6 years ago

@F0RIS yes you right, set that by default that cause of this problem, please let me to commenting them, thanks in advance

pishguy commented 6 years ago

@F0RIS did you try to commenting them on source code and use that on your project? instead of using gradle to install?

F0RIS commented 6 years ago

@MahdiPishguy Checked it now, with commenting next lines

this.setClickable(true); this.setFocusable(true);

It works as it should

pishguy commented 6 years ago

@F0RIS ok, thanks, i commented them