Android Question How to make a nice click effect on the button.

Lakhtin_V

Active Member
Licensed User
Longtime User
While I'm new. I can not find a full and detailed example. How to make a beautiful effect for button when I click button. I like using a gradient fill please. I did not use in my work designer, all views I make manually.
 

Lakhtin_V

Active Member
Licensed User
Longtime User
Sanks, I watched this example but it wrote in Java. I do not know Java. In the Beginners Guide there is a similar example for the drawing, but I do not understand how to do this for the button.
 
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
I wanted to use a gradient fill. When the button is pressed, the fill becomes darker. I need this simple option. excuse me
 
Upvote 0

ronell

Well-Known Member
Licensed User
Longtime User
I wanted to use a gradient fill. When the button is pressed, the fill becomes darker. I need this simple option. excuse me
B4X:
dim btnlabel as label

Dim gd As GradientDrawable
Dim Clrs(2) As Int
Clrs(0) = Colors.red
Clrs(1) = Colors.blue
gd.Initialize("TOP_BOTTOM", Clrs)

sub btnlabel_click

btnlabel.background = gd

end sub
'not tested

edit: much better if you use a label
 
Upvote 0
Top