Collision Detection in Jetpack Compose

25 Views Asked by At

I have a LazyVerticalGrid that will create a grid with 2 columns with the Boxes from a list. Every Box is draggable. How can I trigger some action while onDrag() if the box I'm currently dragging is overlapping another box

e.g.: When I drag a box around the screen, every time I overlap with another box, the color of the border of the box overlapped to change to red.

Overlap Example

Like in this image (Item 2 is still onDrag, is not dropped), I will like to perform some action on item1, which is bellow item2 while is overlapped

0

There are 0 best solutions below