I'm working on a project where I have a Main Menu with buttons that have image and text under the image, they are already done:
To achieve that button layout with rounded corners, I put as background an xml called border_button:
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="3dp" />
<solid android:color="@color/colorPrimary" />
</shape>
And to keep background image and text with rounded corners, my button xml is like that:
<Button
android:id="@+id/buttonMeusDados"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="2sp"
android:layout_weight="1"
android:background="@drawable/border_button"
android:drawableTop="@drawable/button_image_icon_meus_dados"
android:text="@string/my_data"
android:textColor="@android:color/white" />
The problem now is that those buttons don't return any feedback to the user when pressed, they are static, no pressed animation
I found a lot of ways how to do that, but I'm not being able to mix them with what I already have, if I make the pressed effect animation, I lose all my retangle layout with rounded corners and etc
For the pressed effect I mainly followed @Ljdawson answer from this topic: click effect on button in Android but no success, as I explained above
How can I do it?