From f333cacc3a497970827ca6932387798c70a5f7d2 Mon Sep 17 00:00:00 2001 From: yyuanche Date: Tue, 28 May 2024 14:15:55 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90NDK=E3=80=916toD=20refresh=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=96=B0=E5=A2=9E=20Signed-off-by:=20yyuanche=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arkui/ace_engine/native/native_node.h | 100 +++++++++++++++++++++++--- arkui/ace_engine/native/native_type.h | 24 +++++++ 2 files changed, 114 insertions(+), 10 deletions(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 969cae564..646f80211 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -515,6 +515,10 @@ typedef enum { * .value[2].f32: height of rectangle.\n * .value[3].f32: width of the rounded corner of the rectangle.\n * .value[4].f32: height of the rounded corner of the rectangle.\n + * .value[5]?.f32: radius of the top left corner of the rectangular shape.\n + * .value[6]?.f32: radius of the bottom left corner of the rectangular shape.\n + * .value[7]?.f32: radius of the top right corner of the rectangular shape.\n + * .value[8]?.f32: radius of the bottom right corner of the rectangular shape.\n * 2. Circle:\n * .value[0].i32: type of shape. The parameter type is {@link ArkUI_ClipType}. * The value is ARKUI_CLIP_TYPE_CIRCLE for the circle shape.\n @@ -539,6 +543,10 @@ typedef enum { * .value[2].f32: height of rectangle.\n * .value[3].f32: width of the rounded corner of the rectangle.\n * .value[4].f32: height of the rounded corner of the rectangle.\n + * .value[5].f32: radius of the top left corner of the rectangular shape; \n + * .value[6].f32: radius of the bottom left corner of the rectangular shape; \n + * .value[7].f32: radius of the top right corner of the rectangular shape; \n + * .value[8].f32: radius of the bottom right corner of the rectangular shape; \n * 2. Circle:\n * .value[0].i32: type of shape. The parameter type is {@link ArkUI_ClipType}. * The value is ARKUI_CLIP_TYPE_CIRCLE for the circle shape.\n @@ -819,10 +827,22 @@ typedef enum { * This attribute can be set, reset, and obtained as required through APIs. * * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n - * value[0].i32: The parameter type is {@link ArkUI_TransitionEdge}. \n + * .value[0].i32: The parameter type is {@link ArkUI_TransitionEdge}. \n + * .value[1].i32: animation duration, in milliseconds.\n + * .value[2].i32: animation curve type. The value is an enum of {@link ArkUI_AnimationCurve}.\n + * .value[3]?.i32: animation delay duration, in milliseconds.\n + * .value[4]?.i32: number of times that the animation is played.\n + * .value[5]?.i32: animation playback mode. The value is an enum of {@link ArkUI_AnimationPlayMode}.\n + * .value[6]?.f32: animation playback speed.\n * \n * Format of the return value {@link ArkUI_AttributeItem}:\n - * value[0].i32: The parameter type is {@link ArkUI_TransitionEdge}. \n + * .value[0].i32: The parameter type is {@link ArkUI_TransitionEdge}. \n + * .value[1].i32: animation duration, in milliseconds.\n + * .value[2].i32: animation curve type. The value is an enum of {@link ArkUI_AnimationCurve}.\n + * .value[3].i32: animation delay duration, in milliseconds. \n + * .value[4].i32: number of times that the animation is played. \n + * .value[5].i32: animation playback mode. The value is an enum of {@link ArkUI_AnimationPlayMode}. \n + * .value[6].f32: animation playback speed. \n * */ NODE_MOVE_TRANSITION, @@ -972,6 +992,10 @@ typedef enum { * .value[5].f32: height of the rectangle.\n * .value[6].f32: width of the rounded corner of the rectangle.\n * .value[7].f32: height of the rounded corner of the rectangle.\n + * .value[8]?.f32: radius of the top left corner of the rectangular shape.\n + * .value[9]?.f32: radius of the bottom left corner of the rectangular shape.\n + * .value[10]?.f32: radius of the top right corner of the rectangular shape.\n + * .value[11]?.f32: radius of the bottom right corner of the rectangular shape.\n * 2. Circle:\n * .value[0].u32 fill color, in 0xARGB format. \n * .value[1].u32: stroke color, in 0xARGB format. \n @@ -1014,6 +1038,10 @@ typedef enum { * .value[5].f32: height of the rectangle.\n * .value[6].f32: width of the rounded corner of the rectangle.\n * .value[7].f32: height of the rounded corner of the rectangle.\n + * .value[8].f32: radius of the top left corner of the rectangular shape.\n + * .value[9].f32: radius of the bottom left corner of the rectangular shape.\n + * .value[10].f32: radius of the top right corner of the rectangular shape.\n + * .value[11].f32: radius of the bottom right corner of the rectangular shape.\n * 2. Circle:\n * .value[0].u32 fill color, in 0xARGB format. \n * .value[1].u32: stroke color, in 0xARGB format. \n @@ -4281,6 +4309,20 @@ typedef enum { */ NODE_LIST_CHILDREN_MAIN_SIZE = 1003007, + /** + * @brief Set the index value of the item displayed at the start of the viewport when the current List is first loaded, + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: index value of the item displayed at + * the start of the viewport when the current List is loaded for the first time. Default value: 0.\n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: index value of the item displayed at + * the start of the viewport when the current List is loaded for the first time. Default value: 0.\n + */ + NODE_LIST_INITIAL_INDEX = 1003008, + /** * @brief Defines whether to enable loop playback for the swiper. * This attribute can be set, reset, and obtained as required through APIs. @@ -4731,6 +4773,32 @@ typedef enum { * */ NODE_REFRESH_PULL_DOWN_RATIO = 1009002, + /** + * @brief Sets the pull-down offset that initiates a refresh. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: pull-down offset, in vp. The default value is 64vp. + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: pull-down offset, in vp. The default value is 64vp. + * + */ + NODE_REFRESH_OFFSET = 1009003, + /** + * @brief Sets whether to initiate a refresh when the pull-down distance exceeds the value of refreshOffset. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: whether to initiate a refresh. The value true means to initiate a refresh, and + * false means the opposite. + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether to initiate a refresh. The value 1 means to initiate a refresh, and + * 0 means the opposite. + * + */ + NODE_REFRESH_PULL_TO_REFRESH = 1009004, /** * @brief Defines the main axis direction of the component layout. @@ -5664,13 +5732,16 @@ typedef enum { * 3. Cross boundary rebound.\n * When an event callback occurs, the union type in the event parameter {@ link ArkUI_NodeEvent} object is * {@link ArkUI_NodeComponentEvent}. \n - * {@link ArkUI_NodeComponentEvent} contains three parameters: \n + * {@link ArkUI_NodeComponentEvent} contains four parameters: \n * ArkUI_NodeComponentEvent.data[0].f32: The offset for each frame of scrolling is positive when scrolling to * the left and negative when scrolling to the right, measured in vp. \n * ArkUI_NodeComponentEvent.data[1].f32: The offset of each frame scrolling, with a positive offset when * scrolling up and a negative offset when scrolling down, measured in vp. \n - * ArkUI_NodeComponentEvent.data[2].i32: Current sliding state,\n - * parameter type is {@link ArkUI_ScrollState}.\n + * ArkUI_NodeComponentEvent.data[2].i32: Current sliding state, \n + * parameter type is {@link ArkUI_ScrollState}. \n + * ArkUI_NodeComponentEvent.data[3].i32: Current scroll source, \n + * parameter type is {@link ArkUI_ScrollSource}. \n + * @return Does not return or returns a number that sets the actual scroll distance of the scroll component. */ NODE_SCROLL_EVENT_ON_WILL_SCROLL, /** @@ -5777,11 +5848,15 @@ typedef enum { * Out-of-bounds rebound. \n * When the event callback occurs, the union type in the {@Link ArkUI_NodeEvent} object is \n * {@Link ArkUI_NodeComponentEvent}. \n - * {@Link ArkUI_NodeComponentEvent} contains two parameters: \n + * {@Link ArkUI_NodeComponentEvent} contains three parameters: \n * ArkUI_NodeComponentEvent.data[0].f32: offset of each frame scrolling. \n * The offset is positive when the list content is scrolled up and \n * is negative when the list content is scrolled down. \n * ArkUI_NodeComponentEvent.data[1].i32: Current sliding state. \n + * parameter type is {@link ArkUI_ScrollState}. \n + * ArkUI_NodeComponentEvent.data[2].i32: Current scroll source, \n + * parameter type is {@link ArkUI_ScrollSource}. \n + * @return Does not return or returns a number that sets the actual scroll distance of the scroll component. \n */ NODE_LIST_ON_WILL_SCROLL, /** @@ -5839,10 +5914,15 @@ typedef enum { * 3. The out-of-bounds bounce effect is supported. \n * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is * {@link ArkUI_NodeComponentEvent}. \n - * {@link ArkUI_NodeComponentEvent} contains two parameters: \n - * ArkUI_NodeComponentEvent.data[0].f32: scroll offset of each frame. The offset is positive when the - * component is scrolled up and negative when the component is scrolled down. \n - * ArkUI_NodeComponentEvent.data[1].i32: current scroll state. \n + * {@Link ArkUI_NodeComponentEvent} contains three parameters: \n + * ArkUI_NodeComponentEvent.data[0].f32: offset of each frame scrolling. \n + * The offset is positive when the list content is scrolled up and \n + * is negative when the list content is scrolled down. \n + * ArkUI_NodeComponentEvent.data[1].i32: Current sliding state. \n + * parameter type is {@link ArkUI_ScrollState}. \n + * ArkUI_NodeComponentEvent.data[2].i32: Current scroll source, \n + * parameter type is {@link ArkUI_ScrollSource}. \n + * @return Does not return or returns a number that sets the actual scroll distance of the scroll component. \n */ NODE_ON_WILL_SCROLL = MAX_NODE_SCOPE_NUM * ARKUI_NODE_WATER_FLOW, /** diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 8c76fb22a..6215e7a35 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -1821,6 +1821,30 @@ typedef enum { ARKUI_LIST_ITEM_SWIPE_EDGE_EFFECT_NONE, } ArkUI_ListItemSwipeEdgeEffect; +/** + * @brief Define the rolling source enumeration value. + * + * @since 12 +*/ +typedef enum { + /** Finger drag. */ + ARKUI_SCROLL_SOURCE_DRAG = 0, + /** Inertial roll after finger drag. */ + ARKUI_SCROLL_SOURCE_FLING, + /** Execute the EdgeEffect.Spring edge effect when crossing the boundary.*/ + ARKUI_SCROLL_SOURCE_EDGE_EFFECT, + /** Other user input other than dragging, such as mouse wheel, keyboard events, etc.*/ + ARKUI_SCROLL_SOURCE_OTHER_USER_INPUT, + /** Drag the scroll bar.*/ + ARKUI_SCROLL_SOURCE_SCROLL_BAR, + /** Inertia scrolling after dragging the scroll bar.*/ + ARKUI_SCROLL_SOURCE_SCROLL_BAR_FLING, + /** The scroll controller causes unanimated scrolling.*/ + ARKUI_SCROLL_SOURCE_SCROLLER, + /** The scroll controller causes the scroll to drive the painting.*/ + ARKUI_SCROLL_SOURCE_ANIMATION, +} ArkUI_ScrollSource; + /** * @brief Creates a size constraint. * -- Gitee