Maybe that's not exactly what you mean by standard, but when you set a background, you end up having to recreate the behavior when the button is clicked. The best way to do it in Android is by using a selector
as your button's background. Create a XML drawable with the selector
in it.
Example:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/button_bg_pressed" />
<item android:drawable="@drawable/button_bg_default" />
</selector>
That way, when your button is clicked, it will change the background to other image that does what you want.
EDIT:
- There are other modifiers such as
focused
, if you need.
- If you want Lollipop's ripple effects, I think you can create a
Layout
and put your button inside it. Change the Layout
background and set the button background to transparent. If that doesn't work, try adding android:background="?android:attr/selectableItemBackground"
to your button.