Is there any way to make a card long-clickable whi...
# compose
p
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.
2
l
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
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
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
I would actually prefer that.
👀 1
k
Is there any progress on this? I would like to know how can we create a custom
Card
which respects the ripple animation on long click events.