diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index a741af70523a9894d1e738eaf5f3cb805963710b..fcda5e5b13c8e7000b1464509f24866b1768cdf7 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -4074,5 +4074,13 @@ { "first_introduced": "21", "name": "OH_ArkUI_NativeModule_UnregisterCommonEvent" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_ListItemSwipeAction_Expand" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_ListItemSwipeAction_Collapse" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index f7b72cc37d01d1e2fdf67c70598a42194058fb72..9c69a19d8d06e6a3e5d888ee712356d4edc63813 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -2259,6 +2259,24 @@ typedef enum { ARKUI_LIST_ITEM_SWIPE_EDGE_EFFECT_NONE, } ArkUI_ListItemSwipeEdgeEffect; +/** + * @brief Define the direction to expand the swipe action. + * + * @since 21 + */ +typedef enum { + /** + * When the List direction is vertical, it indicates the left in LTR mode and right in RTL mode. + * When the List direction is horizontal, it indicates the top. + */ + ARKUI_LIST_ITEM_SWIPE_ACTION_DIRECTION_START = 0, + /** + * When the List direction is vertical, it indicates the right in LTR mode and left in RTL mode. + * When the List direction is horizontal, it indicates the bottom. + */ + ARKUI_LIST_ITEM_SWIPE_ACTION_DIRECTION_END = 1, +} ArkUI_ListItemSwipeActionDirection; + /** * @brief Define error code enumeration values. * @@ -2280,6 +2298,11 @@ typedef enum { * @since 15 */ ARKUI_ERROR_CODE_INTERNAL_ERROR = 100001, + /** + * @error Parameter error. + * @since 21 + */ + ARKUI_ERROR_CODE_PARAM_ERROR = 100023, /** * @error The XComponent is in invalid state. * @since 19 @@ -4418,6 +4441,31 @@ void OH_ArkUI_ListItemSwipeActionOption_SetOnOffsetChange(ArkUI_ListItemSwipeAct void OH_ArkUI_ListItemSwipeActionOption_SetOnOffsetChangeWithUserData(ArkUI_ListItemSwipeActionOption* option, void* userData, void (*callback)(float offset, void* userData)); +/** + * @brief Expand the swipe action. + * + * @param node List Item node. + * @param direction expand direction of swipeAction. + * @return Error code. + * {@link ARKUI_ERROR_CODE_NO_ERROR} success. + * {@link ARKUI_ERROR_CODE_PARAM_ERROR} The component type of the node is incorrect. + * {@link ARKUI_ERROR_CODE_NODE_NOT_ON_MAIN_TREE} The node not mounted to component tree. + * @since 21 + */ +int32_t OH_ArkUI_ListItemSwipeAction_Expand(ArkUI_NodeHandle node, ArkUI_ListItemSwipeActionDirection direction); + +/** + * @brief Collapse the swipe action. + * + * @param node List Item node. + * @return Error code. + * {@link ARKUI_ERROR_CODE_NO_ERROR} success. + * {@link ARKUI_ERROR_CODE_PARAM_ERROR} The component type of the node is incorrect. + * {@link ARKUI_ERROR_CODE_NODE_NOT_ON_MAIN_TREE} The node not mounted to component tree. + * @since 21 + */ +int32_t OH_ArkUI_ListItemSwipeAction_Collapse(ArkUI_NodeHandle node); + /** * @brief Create configuration items for the ListChildrenMainSize interface settings. *