How can I make my button's size to increase slightly when it is pressed and decrease again when it is released? This is for highlighting the pressed button, by using size in addition to a different color.
Regards, Kiki
How can I make my button's size to increase slightly when it is pressed and decrease again when it is released? This is for highlighting the pressed button, by using size in addition to a different color.
Regards, Kiki
button.setOnTouchListener(new View.OnTouchListener() {
In your activity
Make your
Button
a field, and modify its size in theOnTouchListener
associated with it. Using an OnTouchListener you can listen for differentMotionEvents
, such asACTION_DOWN
andACTION_UP
.