Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff1ea8f8 authored by Lucas Silva's avatar Lucas Silva
Browse files

Update drag-drop collision detection

Items will now swap places if either element intersects with the center
of the other.

Bug: 374212953
Test: manually by dragging widgets of different sizes
Flag: com.android.systemui.communal_widget_resizing
Change-Id: I06545b555e511bc81ef9281dc5adf9f87dad3f3f
parent 2afb8e4a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -182,7 +182,8 @@ internal constructor(
                    val itemBoundingBox = IntRect(item.offset, item.size)
                    draggingItemKey != item.key &&
                        contentListState.isItemEditable(item.index) &&
                        draggingBoundingBox.contains(itemBoundingBox.center)
                        (draggingBoundingBox.contains(itemBoundingBox.center) ||
                            itemBoundingBox.contains(draggingBoundingBox.center))
                }
            } else {
                state.layoutInfo.visibleItemsInfo