I need a simple ripple effect in RecyclerView elements that have a background color. Since they already have a background color (blue), I cannot set the background to drawable / ripple.xml:
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/color_view_pressed">
<item android:drawable="@android:color/white"/>
So, I changed my ripple.xml file to:
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/color_view_pressed">
<item android:drawable="@android:color/blue"/>
It still does not work. :( EDIT: Apparently, the ripple color is hidden behind the background color, so it is almost invisible. But you can see a shade of it in the background (if I set color_view_pressed to dark red). Is there way to achieve this, even otherwise? I tried all possible solutions there. Somehow, it worked fine with ListView. I don’t understand how to do this.