diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/DragController.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/DragController.ets index ea1144a59a13d5257bda375fba0513f8e04d9f19..6a0ce9a1a6b6f4b5ec4133f501423d502eb36139 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/DragController.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/DragController.ets @@ -64,9 +64,9 @@ struct DragController1 { } dragController.executeDrag(dragItemInfo, dragInfo) .then(({event, extraParams}) => { - if (event.getResult() == DragRet.DRAG_SUCCESS) { + if (event.getResult() == DragResult.DRAG_SUCCESSFUL) { // ... - } else if (event.getResult() == DragRet.DRAG_FAILED) { + } else if (event.getResult() == DragResult.DRAG_FAILED) { // ... } }) diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/DragEvent.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/DragEvent.ets index 4c610d7c1dc786106bc4b3f5c9a206501da78038..3fbd20881a9e065b23f0871a176d4a1823339216 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/DragEvent.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/DragEvent.ets @@ -29,7 +29,7 @@ struct DragEvent { @State abstractContent: string = "abstract"; @State textContent: string = ""; @State dragBehavior: string = "dragBehavior"; - @State dragRet: string = "dragRet"; + @State dragResult: string = "dragResult"; @State useCustomDropAnimation1: string = "useCustomDropAnimation"; @State imgState: Visibility = Visibility.Visible; @@ -46,7 +46,7 @@ struct DragEvent { Row() { Column() { Text(this.dragBehavior).id("dragBehavior").margin(5) - Text(this.dragRet).id("dragRet").margin(5) + Text(this.dragResult).id("dragResult").margin(5) Text(this.useCustomDropAnimation1).id("useCustomDropAnimation").margin(5) Image($r('app.media.icon')).margin(5) @@ -57,8 +57,7 @@ struct DragEvent { .visibility(this.imgState) .onDragStart((event)=>{ event.dragBehavior = DragBehavior.COPY - event.setResult(DragRet.DRAG_SUCCESS); - + event.setResult(DragResult.DRAG_SUCCESSFUL); }) .onDragEnd((event)=>{ event.dragBehavior = DragBehavior.MOVE @@ -68,18 +67,18 @@ struct DragEvent { this.useCustomDropAnimation1 = "true" promptAction.showToast({duration: 100, message: 'useCustomDropAnimation==true'}); } - if (event.getResult() === DragRet.DRAG_SUCCESS) { - promptAction.showToast({duration: 100, message: 'Drag Success'}); - } else if (event.getResult() === DragRet.DRAG_FAILED) { + if (event.getResult() === DragResult.DRAG_SUCCESSFUL) { + promptAction.showToast({duration: 100, message: 'Drag DRAG_SUCCESSFUL'}); + } else if (event.getResult() === DragResult.DRAG_FAILED) { promptAction.showToast({duration: 100, message: 'Drag Failed'}); - } else if (event.getResult() === DragRet.DRAG_CANCELED) { + } else if (event.getResult() === DragResult.DRAG_CANCELED) { promptAction.showToast({duration: 100, message: 'Drag Canceled'}); - } else if (event.getResult() === DragRet.DROP_DISABLED) { + } else if (event.getResult() === DragResult.DROP_DISABLED) { promptAction.showToast({duration: 100, message: 'Drop Disabled'}); - }else if (event.getResult() === DragRet.DROP_ENABLED) { + }else if (event.getResult() === DragResult.DROP_ENABLED) { promptAction.showToast({duration: 100, message: 'Drop Enabled'}); } - this.dragRet = event.getResult().toString() + this.dragResult = event.getResult().toString() }) Button('touch to execute drag') @@ -93,9 +92,9 @@ struct DragEvent { extraParams: '' } dragController.executeDrag(this.DraggingBuilder.bind(this), dragInfo, (err, {event, extraParams}) => { - if (event.getResult() == DragRet.DRAG_SUCCESS) { + if (event.getResult() == DragResult.DRAG_SUCCESSFUL) { // ... - } else if (event.getResult() == DragRet.DRAG_FAILED) { + } else if (event.getResult() == DragResult.DRAG_FAILED) { // ... } }) diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/dragAdd.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/dragAdd.ets index a710cd146fe3a728e5bb9eaedc8080ca38fa4d95..7447fcdaad913b893521fbe184953d14f3f0e833 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/dragAdd.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/dragAdd.ets @@ -57,9 +57,9 @@ struct Index { .margin({left: 15}) .visibility(this.imgState) .onDragEnd((event)=>{ - if (event.getResult() === DragRet.DRAG_SUCCESS) { + if (event.getResult() === DragResult.DRAG_SUCCESSFUL) { promptAction.showToast({duration: 100, message: 'Drag Success'}); - } else if (event.getResult() === DragRet.DRAG_FAILED) { + } else if (event.getResult() === DragResult.DRAG_FAILED) { promptAction.showToast({duration: 100, message: 'Drag failed'}); } }) @@ -130,7 +130,7 @@ struct Index { this.imageHeight = 100; this.imgState = Visibility.None; }) - event.setResult(DragRet.DRAG_SUCCESS); + event.setResult(DragResult.DRAG_SUCCESSFUL); }) })