How do I change ripple color on `Surface/Card` whi...
# compose
u
How do I change ripple color on
Surface/Card
which is clickable, using the new 1.7.6? I used to do it via
LocalRippleTheme provides HighlightRippleTheme,
but that no longer works
u
Okay so the Surface overload that takes
onClick
is effed?
c
no, as
Surface
is a Material component you just can’t override the ripple effect. If you want to have a custom “Surface”, just create one 😉
l
You can use LocalRippleConfiguration
today i learned 1
u
Would simply not using the
onClick
Surface overload and calling
Modifier.clickable(...)
directly where I can setup the ripple color be preferred? (over the composition local)
l
It won't work properly, since you need to apply the clickable modifier before the clip, and some other things that are different between non-clickable and clickable surface. Local ripple configuration is intended for changing behaviour of a specific component, if you are trying to do something more advanced it would be better to build your own clickable surface
u
Okay yea now I see the ripple is not clipped, thanks!