4
I wonder if it is possible, in a Button, to have that click effect, that is, it "sink" and "return to normal". Is that a property or should I use an Imagebutton with the images of this "effect"? Below is my control XML I created in drawable:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<solid android:color="@color/cardview_dark_background" />
<padding android:bottom="3dp" android:left="3dp" android:right="3dp" android:top="3dp" />
</shape>
</item>
<item android:state_focused="true">
<shape>
<solid android:color="@android:color/transparent" />
<padding android:bottom="3dp" android:left="3dp" android:right="3dp" android:top="3dp" />
</shape>
</item>
<item android:state_enabled="false">
<shape>
<solid android:color="@android:color/transparent" />
<padding android:bottom="3dp" android:left="3dp" android:right="3dp" android:top="3dp" />
</shape>
</item>
<item>
<shape>
<solid android:color="@android:color/darker_gray" />
<padding android:bottom="3dp" android:left="3dp" android:right="3dp" android:top="3dp" />
</shape>
</item>
</selector>