I'm trying to add press effect to my button I have a button with android:drawableStart="@drawable/my_image"
and I've added
android:background="?attr/selectableItemBackgroundBorderless" android:foreground="?attr/selectableItemBackgroundBorderless"
lines but didn't worked. Also I created a drawalbe for ripple effect with below code
<?xml version="1.0" encoding="utf-8"?>
<selector>
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/solid_red">
<item android:state_pressed="true">
<item android:drawable="@android:color/white" />
</item>
</ripple>
</selector>
android:background="@drawable/ripple_effect"
android:foreground="@drawable/ripple_effect"
but this is supports only if api under 21 and even if it's works it's now showing up because of image and also I want to add to foreground but when I added it It's covering whole image I just want to create a simple button press effect like ios default button press effect. Is there any way to do it without duplicate it and no using any library? Thanks.