Has anybody been successful in displaying a Materi...
# compose-android
k
Has anybody been successful in displaying a Material 3 Card composable which supports long clicks, with correct ripple animations just like the ones we get when we use the
onClick
parameter? As per this thread, it seems like the only way to do this is to create your own custom Card composable which handles long click events inside the
Surface
?
z
I usually specify the combinedClickable on my card content, which then would fill the entire card. Im not sure if theres a difference in ripple behavior by doing that though? I certainly havent noticed anything 😮
👍 1
k
Thanks for this tip. When, I put the
combinedClickable
in my Card content the ripple is working on both click and long click.
👍🏽 1
I'm still not able to comprehend how the ripple animation which is a Material thing, is working on core composables like
Column
when wrapped within a
Card
.
z
Afaik, the ripple comes from an indication instance, which material provides (the ripple variant). It gets added via the clickable/combinedClickable modifier. I think the onClick variant of card is simply there because it then adds elevation depending on touch, click, etc.
👍 1