mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
!39522 CAPI拖拽发起前的长按交互阶段的变化状态名称
Merge pull request !39522 from Zhang Jinyu/0802
This commit is contained in:
commit
a8147b27e2
@ -78,22 +78,22 @@ typedef enum {
|
||||
*/
|
||||
typedef enum {
|
||||
/** Unknown. */
|
||||
ARKUI_PREVIEW_DRAG_STATUS_UNKNOWN = -1,
|
||||
ARKUI_PRE_DRAG_STATUS_UNKNOWN = -1,
|
||||
/** A drag gesture is being detected. */
|
||||
ARKUI_PREVIEW_DRAG_STATUS_ACTION_DETECTING,
|
||||
ARKUI_PRE_DRAG_STATUS_ACTION_DETECTING,
|
||||
/** The component is ready to be dragged. */
|
||||
ARKUI_PREVIEW_DRAG_STATUS_READY_TO_TRIGGER_DRAG,
|
||||
ARKUI_PRE_DRAG_STATUS_READY_TO_TRIGGER_DRAG,
|
||||
/** A lift animation is started. */
|
||||
ARKUI_PREVIEW_DRAG_STATUS_PREVIEW_LIFT_STARTED,
|
||||
ARKUI_PRE_DRAG_STATUS_PREVIEW_LIFT_STARTED,
|
||||
/** A lift animation is finished. */
|
||||
ARKUI_PREVIEW_DRAG_STATUS_PREVIEW_LIFT_FINISHED,
|
||||
ARKUI_PRE_DRAG_STATUS_PREVIEW_LIFT_FINISHED,
|
||||
/** A drop animation is started. */
|
||||
ARKUI_PREVIEW_DRAG_STATUS_PREVIEW_LANDING_STARTED,
|
||||
ARKUI_PRE_DRAG_STATUS_PREVIEW_LANDING_STARTED,
|
||||
/** A drop animation is finished. */
|
||||
ARKUI_PREVIEW_DRAG_STATUS_PREVIEW_LANDING_FINISHED,
|
||||
ARKUI_PRE_DRAG_STATUS_PREVIEW_LANDING_FINISHED,
|
||||
/** A drop animation is terminated. */
|
||||
ARKUI_PREVIEW_DRAG_STATUS_CANCELED_BEFORE_DRAG,
|
||||
} ArkUI_PreviewDragStatus;
|
||||
ARKUI_PRE_DRAG_STATUS_CANCELED_BEFORE_DRAG,
|
||||
} ArkUI_PreDragStatus;
|
||||
|
||||
/**
|
||||
* @brief Defines an enum for drag preview scale modes.
|
||||
@ -204,7 +204,7 @@ ArkUI_DragEvent* OH_ArkUI_NodeEvent_GetDragEvent(ArkUI_NodeEvent* nodeEvent);
|
||||
* @return Returns the interaction state prior to the drop and drop operation.
|
||||
* @since 12
|
||||
*/
|
||||
ArkUI_PreviewDragStatus OH_ArkUI_NodeEvent_GetPreviewDragStatus(ArkUI_NodeEvent* nodeEvent);
|
||||
ArkUI_PreDragStatus OH_ArkUI_NodeEvent_GetPreDragStatus(ArkUI_NodeEvent* nodeEvent);
|
||||
|
||||
/**
|
||||
* @brief Sets whether to disable the default drop animation.
|
||||
|
@ -313,16 +313,16 @@ int32_t OH_ArkUI_StartDrag(ArkUI_DragAction* dragAction)
|
||||
return ARKUI_ERROR_CODE_NO_ERROR;
|
||||
}
|
||||
|
||||
ArkUI_PreviewDragStatus OH_ArkUI_NodeEvent_GetPreviewDragStatus(ArkUI_NodeEvent* nodeEvent)
|
||||
ArkUI_PreDragStatus OH_ArkUI_NodeEvent_GetPreDragStatus(ArkUI_NodeEvent* nodeEvent)
|
||||
{
|
||||
if (!nodeEvent || nodeEvent->category != static_cast<int32_t>(NODE_EVENT_CATEGORY_COMPONENT_EVENT)) {
|
||||
return ArkUI_PreviewDragStatus::ARKUI_PREVIEW_DRAG_STATUS_UNKNOWN;
|
||||
return ArkUI_PreDragStatus::ARKUI_PRE_DRAG_STATUS_UNKNOWN;
|
||||
}
|
||||
const auto* originNodeEvent = reinterpret_cast<ArkUINodeEvent*>(nodeEvent->origin);
|
||||
if (!originNodeEvent) {
|
||||
return ArkUI_PreviewDragStatus::ARKUI_PREVIEW_DRAG_STATUS_UNKNOWN;
|
||||
return ArkUI_PreDragStatus::ARKUI_PRE_DRAG_STATUS_UNKNOWN;
|
||||
}
|
||||
auto status = static_cast<ArkUI_PreviewDragStatus>(originNodeEvent->componentAsyncEvent.data[0].i32);
|
||||
auto status = static_cast<ArkUI_PreDragStatus>(originNodeEvent->componentAsyncEvent.data[0].i32);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -1769,7 +1769,7 @@
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkUI_NodeEvent_GetPreviewDragStatus"
|
||||
"name": "OH_ArkUI_NodeEvent_GetPreDragStatus"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
|
@ -5344,7 +5344,7 @@ typedef enum {
|
||||
* When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is
|
||||
* {@link ArkUI_NodeComponentEvent}. \n
|
||||
* {@link ArkUI_NodeComponentEvent} contains one parameter:\n
|
||||
* <b>ArkUI_NodeComponentEvent.data[0].i32</b>: corresponds to {@link ArkUI_PreViewDragStatus}. \n
|
||||
* <b>ArkUI_NodeComponentEvent.data[0].i32</b>: corresponds to {@link ArkUI_PreDragStatus}. \n
|
||||
*/
|
||||
NODE_ON_PRE_DRAG = 14,
|
||||
/**
|
||||
|
@ -172,7 +172,7 @@ HWTEST_F(DragAndDropTest, DragAndDropTest004, TestSize.Level1)
|
||||
|
||||
/**
|
||||
* @tc.name: DragAndDropTest005
|
||||
* @tc.desc: Test the OH_ArkUI_NodeEvent_GetPreviewDragStatus.
|
||||
* @tc.desc: Test the OH_ArkUI_NodeEvent_GetPreDragStatus.
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(DragAndDropTest, DragAndDropTest005, TestSize.Level1)
|
||||
@ -188,33 +188,33 @@ HWTEST_F(DragAndDropTest, DragAndDropTest005, TestSize.Level1)
|
||||
static_cast<ArkUI_Int32>(OHOS::Ace::PreDragStatus::READY_TO_TRIGGER_DRAG_ACTION);
|
||||
nodeEvent.origin = &event;
|
||||
nodeEvent.category = NodeEventCategory::NODE_EVENT_CATEGORY_COMPONENT_EVENT;
|
||||
auto ret1 = OH_ArkUI_NodeEvent_GetPreviewDragStatus(&nodeEvent);
|
||||
auto ret1 = OH_ArkUI_NodeEvent_GetPreDragStatus(&nodeEvent);
|
||||
|
||||
/**
|
||||
* @tc.steps: step2.set DragEvent is nullptr, related function is called.
|
||||
*/
|
||||
auto ret2 = OH_ArkUI_NodeEvent_GetPreviewDragStatus(nullptr);
|
||||
auto ret2 = OH_ArkUI_NodeEvent_GetPreDragStatus(nullptr);
|
||||
|
||||
/**
|
||||
* @tc.steps: step3.set category to other type, related function is called.
|
||||
*/
|
||||
nodeEvent.category = NodeEventCategory::NODE_EVENT_CATEGORY_INPUT_EVENT;
|
||||
auto ret3 = OH_ArkUI_NodeEvent_GetPreviewDragStatus(&nodeEvent);
|
||||
auto ret3 = OH_ArkUI_NodeEvent_GetPreDragStatus(&nodeEvent);
|
||||
|
||||
/**
|
||||
* @tc.steps: step4.set origin to nullptr, related function is called.
|
||||
*/
|
||||
nodeEvent.category = NodeEventCategory::NODE_EVENT_CATEGORY_COMPONENT_EVENT;
|
||||
nodeEvent.origin = nullptr;
|
||||
auto ret4 = OH_ArkUI_NodeEvent_GetPreviewDragStatus(&nodeEvent);
|
||||
auto ret4 = OH_ArkUI_NodeEvent_GetPreDragStatus(&nodeEvent);
|
||||
|
||||
/**
|
||||
* @tc.expected: Return expected results.
|
||||
*/
|
||||
EXPECT_EQ(ret1, ArkUI_PreviewDragStatus::ARKUI_PREVIEW_DRAG_STATUS_READY_TO_TRIGGER_DRAG);
|
||||
EXPECT_EQ(ret2, ArkUI_PreviewDragStatus::ARKUI_PREVIEW_DRAG_STATUS_UNKNOWN);
|
||||
EXPECT_EQ(ret3, ArkUI_PreviewDragStatus::ARKUI_PREVIEW_DRAG_STATUS_UNKNOWN);
|
||||
EXPECT_EQ(ret4, ArkUI_PreviewDragStatus::ARKUI_PREVIEW_DRAG_STATUS_UNKNOWN);
|
||||
EXPECT_EQ(ret1, ArkUI_PreDragStatus::ARKUI_PRE_DRAG_STATUS_READY_TO_TRIGGER_DRAG);
|
||||
EXPECT_EQ(ret2, ArkUI_PreDragStatus::ARKUI_PRE_DRAG_STATUS_UNKNOWN);
|
||||
EXPECT_EQ(ret3, ArkUI_PreDragStatus::ARKUI_PRE_DRAG_STATUS_UNKNOWN);
|
||||
EXPECT_EQ(ret4, ArkUI_PreDragStatus::ARKUI_PRE_DRAG_STATUS_UNKNOWN);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user