medyo / Fancybuttons

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

Can't set focus to a button #56

Closed goldmont closed 8 years ago

goldmont commented 8 years ago

Hi, I want to set the borderColor when the button is focused but it does nothing. Nothing change. It's like your library doesn't support focus listener. Could you help me? Thanks

medyo commented 8 years ago

Hi @peppe130,

Fancybuttons doesn't implement any custom callback internally. For your case I think you should enable the focus feature by calling :

myButton.setFocusable(true);
myButton.setFocusableInTouchMode(true);
goldmont commented 8 years ago

I solved using setOnTouchListener method. Thank you man!

medyo commented 8 years ago

Okay, I thought you were talking about Focus Listener, Sorry your listener setOnTouchListener should work perfectly.

goldmont commented 8 years ago

It's OK! Keep up the good work!