diff --git a/common/src/main/ets/default/uicomponents/FolderComponent.ets b/common/src/main/ets/default/uicomponents/FolderComponent.ets index cd8b0137..5038d27a 100644 --- a/common/src/main/ets/default/uicomponents/FolderComponent.ets +++ b/common/src/main/ets/default/uicomponents/FolderComponent.ets @@ -199,6 +199,20 @@ export struct FolderComponent { Log.showInfo(TAG, `getPosition animatePosition x: ${this.animateFolderPositionX}, y: ${this.animateFolderPositionY}`); } + + // dragStart = (event: DragEvent): CustomBuilder => { + // ContextMenu.close(); + // this.dragItemType = CommonConstants.DRAG_FROM_DESKTOP; + // this.folderItem.isDragging = true; + // this.pageDesktopDragItemInfo = this.folderItem; + // const selectAppIndex = PageDesktopDragHandler.getInstance().getItemIndex(event.getWindowX(), event.getWindowY()); + // const startPosition = PageDesktopDragHandler.getInstance().getTouchPosition(event.getWindowX(), event.getWindowY()) + // PageDesktopDragHandler.getInstance().mStartPosition = startPosition; + // AppStorage.setOrCreate('selectAppIndex', selectAppIndex); + // Log.showInfo(TAG, `onDragStart event: [${event.getWindowX()}, ${event.getWindowY()}], selectAppIndex: ${selectAppIndex}`); + // } + + build() { Column() { Column() { @@ -335,10 +349,10 @@ export struct FolderComponent { Log.showInfo(TAG, `onHover isHover:${isHover}`); this.isHover = isHover; }) - .bindContextMenu(this.MenuBuilder, ResponseType.LongPress) .onDragStart((event: DragEvent) => { return this.dragStart(event); }) + .bindContextMenu(this.MenuBuilder, ResponseType.LongPress) .onDragEnd((event: DragEvent, extraParams: string) => { Log.showInfo(TAG, `onDragEnd event: [${event.getWindowX()}, ${event.getWindowY()}]` + event.getResult()); AppStorage.setOrCreate('dragItemInfo', new LauncherDragItemInfo());