alaershov
03/03/2023, 5:48 AMjames
03/03/2023, 6:14 AMval modifier = Modifier
.fillMaxWidth()
.graphicsLayer { alpha = if (invisible) 0f else 1f }
val maybeClickableModifier = if (invisible) {
modifier
} else {
modifier.clickable { /* your click event */ }
}
alaershov
03/03/2023, 6:29 AMjames
03/03/2023, 6:37 AMjames
03/03/2023, 6:38 AMjames
03/03/2023, 6:42 AMPointerEventPass.Initial
which allows you to take a peek at the events before child composables
in that example they’re calling onInteracted.invoke()
because they’re tracking interactions, but I’m pretty sure you would just consume
every eventalaershov
03/03/2023, 6:44 AMAlbert Chang
03/03/2023, 9:22 AM