How to add Ripple Effect in Android Button
How to add Ripple Effect in Android Button
Add In Your Drawable File
btn_design.xml
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:color="#fff" //Ripple Effect color
tools:targetApi="lollipop">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="#fff" /> //Ripple Effect color
</shape>
</item>
<item android:id="@android:id/background">
<shape android:shape="rectangle">
<solid android:color="#000"/> //Button Color
<corners android:radius="5dp" />
</shape>
</item>
</ripple>
main_acitivity.xml
<Button
android:textColor="@color/white"
android:background="@drawable/btn_design"
android:text="Login"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>