mco
mco

Reputation: 1839

Android: Button ripple only shows if there is no background color under it?

I have an ImageView with a ripple selector in the top corner of my screen. The ripple will not work for some reason. Please take a look at my image! https://i.sstatic.net/IwgsT.png (I need 10 reps to post an image -_-)

View B has a dark green background color. Once I remove this background color the ripple will work.

my ripple_selector.xml:

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="@color/button_highlight">
</ripple>

I'm setting the ripple on my ImageView like this: android:background="@drawable/ripple_selector"

If I give the ripple selector a mask or a background it will work as well, but I don't want to mask the ripple. What could be the problem? Ty.

Upvotes: 1

Views: 347

Answers (1)

mco
mco

Reputation: 1839

I dunno if this is a bug or supposed to be intended behavior of a ripple drawable, but I've concluded that if a ripple drawable is placed on top of a background color that's not in its own View/ ViewGroup, it won't be drawn.

Upvotes: 1

Related Questions