Search code examples
androidripple-effect

Ripple effect with attribute selectableItemBackgroundBorderless not working with Android 13 and newer


I want to add Ripple Effect to a view but it seems not working when I added

android:background=”?android:attr/selectableItemBackgroundBorderless”

and it is working as usual when I added

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

It works with android 12 and older but not work with android 13 and newer. With android 13 and newer only android:background=”?android:attr/selectableItemBackground” is working, But I want the Ripple behavior of android:background=”?android:attr/selectableItemBackgroundBorderless”.

Please help.

Thanks You!


Solution

  • Use this android:background="?android:selectableItemBackgroundBorderless" instead of android:background="?android:attr/selectableItemBackground"