It is possible to have something like the `.clicka...
# compose
n
It is possible to have something like the
.clickable
modifier but with information of the position where the user clicked?
b
You should be able to get that from
InteractionState
. Here’s how
Ripple
gets the press position to place the Ripple correctly: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]ompose/material/ripple/Ripple.kt;l=177-181?q=rippleindication
l
Note that the InteractionState API will likely be changing soon, but also that it is intended for the use case of building components / indication that reacts to states. If you are building your own component and not a generic indication, you can use
Modifier.pointerInput
instead, with
detectTapGestures
n
Thanks a lot. I ended up using
InteractionState
because it was clearer to me how to use it.