Skip to content

Instantly share code, notes, and snippets.

@Audhil
Created August 9, 2021 14:25
Show Gist options
  • Save Audhil/1fe7e638bfdc590ab9e990b3f4270efd to your computer and use it in GitHub Desktop.
Save Audhil/1fe7e638bfdc590ab9e990b3f4270efd to your computer and use it in GitHub Desktop.
adding ripple in rounded corner btns - usage: android:background="@drawable/rounded_corner_ripple_btn"
<?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="@color/black_10"
tools:targetApi="lollipop"><!-- ripple effect color -->
<!-- background color -->
<item android:id="@android:id/background">
<shape android:shape="rectangle">
<solid android:color="@android:color/transparent" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius="360dp" />
<stroke
android:width="1dp"
android:color="@color/colorAppSecondary" />
<padding
android:bottom="2dp"
android:left="8dp"
android:right="8dp"
android:top="2dp" />
</shape>
</item>
</ripple>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment