I am trying to disable click ripple effect by ```....
# compose
y
I am trying to disable click ripple effect by
Copy code
.clickable(indication = null)
even tho Android Studio autocompletes it, it becomes red instantly and wont build. Any ideas?
l
You also have to give
interactionSource
y
In
clickable
or as a normal modifier?
Once I add both it works but am not sure what I should pass for
interactionSource
l
By default it's
remember { MutableInteractionSource() }
, I would go with that
y
Thank you it works!
👍 1
c
Are you trying to disable the ripple effect on a component that is expected to have it? i.e. Material component
Or you are building a custom component that should register clicks but you don’t want the ripple presentation?
I ask since we intentionally have ripple when
clickable
is used in order to give users/developers consistent visual feedback from touch out-of-the-box.
🙌 1
y
Yeah I know its needed, but I had seen comments about it causing performance issues on Compose now so I tried disabling it for now
😬 1