commit | b2334c20eb3b8742b75ae952f2668d82dd147b61 | [log] [tgz] |
---|---|---|
author | Coco Duan <cocod@google.com> | Fri Feb 09 18:16:42 2024 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Fri Feb 09 18:16:42 2024 +0000 |
tree | d622b592f7bf68fec25a66d345ba50dfc8eb3ea3 | |
parent | 645cc44c12ec0ce4c978a1c8ca5a23b3ad97279a [diff] | |
parent | 3a46f95ab0c2438bb9652690db46977e42df0793 [diff] |
Merge "Drag and drop a new widget should place it before CTA tile" into main
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 22aa837..881947e 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 @@ 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) {