Material Design Android Ripple Effect

Here’s on how to add a neat Ripple effect for your UI components. I’ll take a button for this.

Create new folder res/drawable-v21 and create a new XML ripple.xml

<ripple xmlns:android=""
    <item android:drawable="@color/primary_500" />

Add this to your button layout:  android:background="@drawable/ripple"

Note that the Android ripple effect only works on Lollipop versions and above. So you might want to use a normal color selector for previous versions as a fallback.

So set your background to be a regular color selector, and for Lollipop handle it like this in your




Android developer and tech enthusiast. Love creating apps with good UI UX design. I also like to sketch and listen to Chillstep.