How to make button show it is clicked (by setting it go down/some change) for buttons using custom background image in Android. I do not want to include more images and set
If you want the default button click effect, you can put your background drawable inside a `ripple' like below.
The example will produce a button with a border, transparent background and the button default click animation like this
create res/drawable/image_btn_border.xml
-
-
add to res/values/dimens.xml
4dp
5dp
set the drawable as the background of an imagebutton
Details
item which is marked with android:id="@android:id/mask" is used by ripple to transition color from @android:color/background_light to ?attr/colorControlHighlight when the button is pressed.item is the actual background we want for button in normal (unpressed) state.android:inset* sets background margins.