未验证 提交 70f8d642 编写于 作者: O openharmony_ci 提交者: Gitee

!9517 change dragRet to DragResult

Merge pull request !9517 from 卡哥/master
......@@ -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) {
// ...
}
})
......
......@@ -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) {
// ...
}
})
......
......@@ -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);
})
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册