First create the shapes:
Button Shape (normal):
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="270"
android:startColor="#2e8fc2"
android:endColor="#006599"
/>
<stroke
android:width="2dp"
android:color="#00679e"
/>
<corners
android:radius="3dp"
/>
</shape>
And after the button when pressed:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="270"
android:startColor="#254683"
android:endColor="#1f2f61"
/>
<stroke
android:color="#000000"
android:width="2dp"
/>
<corners
android:radius="3dp"
/>
</shape>
Then, create a selector:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:drawable="@drawable/botao_seleccionado"
/>
<item
android:drawable="@drawable/botao"
/>
</selector>
And finally, go to the code (.xml) of the button that will receive these backgrounds and add the following:
android:background="@drawable/seleccionador"