How to add a ripple effect on a layout with rounded corners?

Rabindra Khadka picture Rabindra Khadka · Feb 27, 2017 · Viewed 8.2k times · Source

I want to set a ripple effect on layout with rounded corners. How can I do it?

Answer

Chetan Ashtivkar picture Chetan Ashtivkar · Feb 27, 2017

just set these properties in xml file

android:background="?android:attr/selectableItemBackground"
android:clickable="true"

That should do it.