I'm trying to add ripple effect to a custom button. But the only solution I found is adding a background which I have already done for achieving rounded corners for that button. Now I want to add the ripple effect. This is how my button tag looks so far:
<Button
android:text="PLAY"
android:id="@+id/button"
android:textSize="20dp"
android:layout_width="75dp"
android:layout_height="75dp"
android:background="@drawable/roundedbutton"
android:onClick="gotomainpage"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="200dp" />
use this code in your button
android:foreground="?attr/selectableItemBackground"