I need to delete ripple effect on a recycler view item click programmatically. This is because I reuse the adapter in several activities of my app, but there's a particular one where the items shouldn't be clickable, therefore I need to delete the ripple effect, otherwise it looks like it should do something on click, but it is not working.
The only way it works is by removing
android:foreground="?attr/selectableItemBackground"
on the view holder, but as I said, I can't do that because I'm reusing it, and it should show the ripple effect in several other activities. Is there a way to disable it from a particular activity?