From 94bb5fe57240790749a30d95ee3aadea2b8943b8 Mon Sep 17 00:00:00 2001 From: yangcan18 Date: Tue, 26 Aug 2025 20:18:33 +0800 Subject: [PATCH] =?UTF-8?q?List=E6=94=AF=E6=8C=81=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E7=9A=84ListItem=E7=9A=84swipeAction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangcan18 --- arkui/ace_engine/native/libace.ndk.json | 8 +++++ arkui/ace_engine/native/native_type.h | 48 +++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index a741af70523..fcda5e5b13c 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 f7b72cc37d0..9c69a19d8d0 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. * -- Gitee