I had an XML layout for CardView that I changed to Jetpack Compose Card. This Card is included in another clickable larger XML layout that has other items around that card.
In the old CardView layout the onClick wasn't handled, and clicking on the card was just like clicking anywhere else on the larger layout.
Now when the card is Jetpack Compose, the click is separated from the larger layout, and by default the card is not clickable at all. when I add clickable modifier, then the card is clickable but separated from the larger layout and is not handled by that layout.
How can I make the Jetpack Compose Card behave the same as a regular CardView that has no click action of its own? I want the entire layout be clickable no matter if the click is on the card or anywhere else.
I tried setting
Modifier.clickable(
interactionSource = MutableInteractionSource(),
indication = null,
onClick = {}
)
But it didn't help, the card is still not clickable, only when clicking outside the card then the desired action is triggered.
Using onClick = { }
makes the card clickable, but separated from the rest of the layout.
I can't put it inside Box, because the card is included in an XML layout