https://kotlinlang.org logo
#compose
Title
# compose
t

Travis Griggs

12/11/2023, 8:55 PM
When I add a .clickable modifier to a Card component, the ripple doesn't seem to respect the shape. Is there a good way to get past that?
d

Davide Lanza

12/11/2023, 9:01 PM
the quickest way is to add a
.clip
modifier with the desired shape
t

Travis Griggs

12/11/2023, 9:08 PM
if i do it before the clickable modifier, then yes the ripple is constrained to the card shape. Unfortunately, it kills the shadow as well. 😞
f

Francesc

12/11/2023, 9:41 PM
there is a variant of
Card
that accepts a click lambda, did you try that? https://www.composables.com/material3/card
👍 1
t

Travis Griggs

12/11/2023, 10:13 PM
Thanks @Francesc
I wish the IDE would show the variants of the function when you hover over it.
2 Views