How would you go for finger "hover" detection? I h...
# compose
a
How would you go for finger "hover" detection? I have a grid of boxes and I want the user to hold their finger and drag onto the boxes, all the boxes that have been touched by the finger should be notified.
The problem is if I handle the touch event inside one box, it would get eaten by that box and no one else will be notified.
I was thinking of an API (modifier) that would allow me to determine if a composable contains a point in screen. Or Simple put, gives me it's bounding box (position and width and height).
a
Modifier.onGloballyPositioned()
a
I'm not sure if the second approach is best though, I'm aiming to create a modifier like
onHover {}
a
You can try but I don’t think handling a single gesture in multiple places makes sense.
a
It's not handling, that's the point. It's about notification of it