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

Paul Woitaschek

04/24/2022, 9:44 PM
Is there any way to make a card long-clickable while maintaining proper ripples? If I use pointerInput or combinedClickable as the modifier instead of the onClick lambda, I either lose the ripple effect or have it not being clipped to the card rounding.
1
l

Louis Pullen-Freilich [G]

04/26/2022, 4:48 PM
Not out of the box, no - you would build a long clickable card in the same way the clickable card is built internally - just a Box with a few modifiers.
combinedClickable
/ long click in general is currently experimental and hence liable to change, so there are no higher level components that directly support long click as of now
p

Paul Woitaschek

04/26/2022, 4:50 PM
Hmm the whole onClick lambda feels wrong for the surface. It always requires you to do a context switch, sometimes you need to use the onClick lambda, sometimes you need to use the modifier
l

Louis Pullen-Freilich [G]

04/26/2022, 4:51 PM
A clickable Surface is a component, in the same way
Button
has an
onClick
parameter - you wouldn’t expect to have to write:
Button(modifier = Modifier.clickable(…))
p

Paul Woitaschek

04/26/2022, 4:51 PM
I would actually prefer that.
👀 1
2 Views