diff options
| author | 2024-02-09 18:16:42 +0000 | |
|---|---|---|
| committer | 2024-02-09 18:16:42 +0000 | |
| commit | b2334c20eb3b8742b75ae952f2668d82dd147b61 (patch) | |
| tree | d622b592f7bf68fec25a66d345ba50dfc8eb3ea3 | |
| parent | 645cc44c12ec0ce4c978a1c8ca5a23b3ad97279a (diff) | |
| parent | 3a46f95ab0c2438bb9652690db46977e42df0793 (diff) | |
Merge "Drag and drop a new widget should place it before CTA tile" into main
| -rw-r--r-- | packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/DragAndDropTargetState.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/DragAndDropTargetState.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/DragAndDropTargetState.kt index 22aa8378cdd0..881947ed6534 100644 --- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/DragAndDropTargetState.kt +++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/DragAndDropTargetState.kt @@ -161,9 +161,9 @@ internal class DragAndDropTargetState( private var isOnRemoveButton = false fun onStarted() { - // assume item will be added to the end. - contentListState.list.add(placeHolder) + // assume item will be added to the second to last position before CTA tile. placeHolderIndex = contentListState.list.size - 1 + placeHolderIndex?.let { contentListState.list.add(it, placeHolder) } } fun onMoved(event: DragAndDropEvent) { |