medyo / Fancybuttons

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

Ripple effect not working when defaultColor is set to transparent #49

Closed ugurcany closed 8 years ago

ugurcany commented 8 years ago

Ripple effect feature that comes with the version 1.6 is not working when we set the fb_defaultColor to @android:color/transparent. In other words, the color to which we set fb_focusColor, has no effect if default color is transparent. Previous versions do not have such problem. In v1.5, even if default color is set to transparent, focus color has still an effect.

Could you please solve this problem that occurs in v1.6?

medyo commented 8 years ago

Hi @ugurcany,

Normally fb_defaultColor is made to host a 'Visible' color, if you're trying to have a transparent background with a border color, use the tag fb_ghost

ugurcany commented 8 years ago

I set fb_ghost to true, but nothing changed. My button does not have border by the way.

medyo commented 8 years ago

I'm using right now fb_ghost on a new project and it works perfectly, please check if you've done all necessary attributes like fb_borderWidth and fb_borderColor ...

ugurcany commented 8 years ago

My button has no border. For what does fb_ghost exist? I don't get its purpose. What is it doing?

medyo commented 8 years ago

fb_ghost needs a border to work perfectly, If it's defined the focus state will be applied to it instead of button background. Please run the sample project to figure out more : https://github.com/medyo/Fancybuttons#demo-application--download-apk

Edit: I just tested with a transparent color and you're right, Ripple effect seems not working. While waiting for a fix, you could hack it by using the same color as your background, like fb_defaultColor="@android:color/white" if your background is white.

ugurcany commented 8 years ago

Thanks. I am using that workaround right now. Waiting for a fix.

medyo commented 8 years ago

This issue is now fixed, thanks to @sushant23