Ripple effect with already colored background of recycler view item

33
February 12, 2019, at 01:30 AM

I know that if I use this

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

to the root element of recycler view item, I will achieve the ripple effect. But the recycler view items have white background.

How should I have red background instead of white?

I can not use android:background attribute to the root element because I am already using to have ripple effect.

I can make a hack, and add some View with match_parent just to hold the background color, but I guess is more proper way to do this.

I am fighting with this whole, days so please can someone just give me a hint?

With this I have the red ripple, but the default background of the items is still white.

<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
        android:color="#F00"> 
  <item
    android:id="@android:id/mask"
    android:drawable="#00F" />
</ripple>

I want red background with red shade of ripple when clicked

READ ALSO
Image Asset requirements

Image Asset requirements

I am trying to create Adaptive Launcher Icons in Android StudioThe result is a my image rendered as a small icon with lots of padding within a circular Launch Icon

58
pi zero w web server / access point - Failed to obtain IP address on android

pi zero w web server / access point - Failed to obtain IP address on android

After a month of trying, i now have a pi zero w as a standalone web server running nginxApple devices can join the AP Wifi (no internet) and using

40
android : How is the default value assigned during insert in room

android : How is the default value assigned during insert in room

I am using Room in my app and while testing migrations i did a direct insert ( not using the Entity class )

50
How to start new activity from recyclerview?

How to start new activity from recyclerview?

I want to start new activity and also passing JSON data to the new activity when i click an item on the recyclerviewi followed a video in youtube: https://www

94