2

In order to enable ripple effect, you would have to set the following two lines of code:

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

However, I just realized that the color of the ripple is different if I add the following line of code below which is my default theme for the entire app when you first create a brand new project:

android:theme="style/AppTheme"

I was under the assumption that my default AppTheme created in the XML would set the ripple color under the hood.

I entertained the idea that perhaps in my parent layout I was setting a different style but that is not the case. I have almost no styling done except for whatever is defined in the styles.xml

Can someone explain to me discrepancy, I have a few TextViews where I need a ripple effect and it seems odd I have to explicitly tell it to inherit the base application theme that the app uses.

Belphegor
  • 1,683
  • 4
  • 23
  • 44
  • 4
    Does this answer your question? [How can I modify ripple color when using ?attr/selectableItemBackground as background?](https://stackoverflow.com/questions/33061050/how-can-i-modify-ripple-color-when-using-attr-selectableitembackground-as-backg) – Uuu Uuu Aug 01 '20 at 03:43
  • It does, but I was just find it odd that by default the ripple color is not the same and that it changes color when I explicitly set a theme to it which is my application default theme too. – Belphegor Aug 01 '20 at 05:11

0 Answers0