Trying to update to `1.2.0-alpha08` and one of the...
# compose
t
Trying to update to
1.2.0-alpha08
and one of the
Card
composables that was being used earlier with
onClick
and
indication
as params is deprecated with this error:
This API is deprecated with the introduction a newer Card function overload that accepts an onClick()
But, the newer
Card
function that accepts
onClick
doesn’t offer a way to customize
indication
🤔 is there any other way to customize this?
l
No, not without building your own
Card
- Material components are opinionated and show ripples, it’s not something that should be able to be customized on a component like this. For example, there is no way to change the indication for a
Button
-
Card
is the same here now. If you want something custom, similar to if you wanted a custom
Button
with different indication, you can fork it and make the necessary changes
t
I see, thank you! As a stopgap, would it also work to attach a
Modifier.clickable
to the
Card
overload that does not have
onClick
as parameter? (Reason being, we want to move forward with the upgrade but we are blocked from creating a custom component at the moment)
l
Not really, I mean it will kinda work, but the ripple and the input events won’t be clipped to the card, so if the card is not perfectly rectangular then it will go outside the boundaries of the card
👍🏼 1
🙏 1
t
Makes sense, thank you!
c
FWIW creating a "card" in compose is dead simple at least. Just a box with a few modifiers. my team was doing this first before we realized there was a card component. lol
👍 1
👍🏼 1
t
I ended up creating a custom card, and yeah exactly it was so simple 🙈
1