From 50435663b1066396a050984f4b873120e1b0e35d Mon Sep 17 00:00:00 2001 From: yyuanche Date: Tue, 14 May 2024 15:35:29 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90NDK=E3=80=91swiper&water&refresh=206to?= =?UTF-8?q?D=E6=8E=A5=E5=8F=A3=E5=A3=B0=E6=98=8E=E6=8F=90=E4=BA=A4=20Signe?= =?UTF-8?q?d-off-by:=20yyuanche=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arkui/ace_engine/native/libace.ndk.json | 12 +++++++-- arkui/ace_engine/native/native_node.h | 34 +++++++++++++++++++++++++ arkui/ace_engine/native/native_type.h | 20 +++++++++++++++ 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index e880238e0..83c5e90ce 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -594,11 +594,11 @@ { "first_introduced": "12", "name": "OH_ArkUI_WaterFlowSectionOption_SetSize" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_WaterFlowSectionOption_SetItemCount" - }, + }, { "first_introduced": "12", "name": "OH_ArkUI_WaterFlowSectionOption_SetCrossCount" @@ -615,6 +615,10 @@ "first_introduced": "12", "name": "OH_ArkUI_WaterFlowSectionOption_SetMargin" }, + { + "first_introduced": "12", + "name": "OH_ArkUI_WaterFlowSectionOption_GetSize" + }, { "first_introduced": "12", "name": "OH_ArkUI_WaterFlowSectionOption_GetItemCount" @@ -635,6 +639,10 @@ "first_introduced": "12", "name": "OH_ArkUI_WaterFlowSectionOption_GetMargin" }, + { + "first_introduced": "12", + "name": "OH_ArkUI_WaterFlowSectionOption_RegisterGetItemMainSizeCallbackByIndex" + }, { "first_introduced": "12", "name": "OH_ArkUI_AnimateOption_Create" diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 2e089f3e4..79cb25f4b 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -5437,6 +5437,31 @@ typedef enum { * start position of the swiper along the main axis. \n */ NODE_SWIPER_EVENT_ON_GESTURE_SWIPE, + /** + * @brief Define the ARKUI_NODE_SWIPER to listen for Swiper page slide events. + * Instruction: \n + * 1. If the {@link ArkUI_SwiperDisplayModeType} attribute is set to \n + * ARKUI_SWIPER_DISPLAY_MODE_AUTO_LINEAR, the interface does not take effect. \n + * 2, circular scenario, set prevMargin and nextMargin attributes, \n + * so that Swiper front and back end display the same page, the interface does not take effect. \n + * 3. During page sliding, the ContentDidScrollCallback callback is \n + * triggered frame-by-frame for all pages in the window. \n + * For example, when there are two pages in the window with subscripts 0 and 1, \n + * callbacks with index values 0 and 1 are triggered twice per frame. \n + * 4, set the swipeByGroup parameter of the displayCount property to \n + * true if at least one page in the same group is in the window, \n + * A callback is triggered for all pages in the group. \n + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * {@link ArkUI_NodeComponentEvent} contains four parameters:\n + * ArkUI_NodeComponentEvent.data[0].i32 : indicates the index of the Swiper component, \n + * which is consistent with the index change in the onChange event. \n + * ArkUI_NodeComponentEvent.data[1].i32 : The index of a page in the window. \n + * ArkUI_NodeComponentEvent.data[2].f32 : The proportion of page movement relative to \n + * the start position of the Swiper spindle (selectedIndex corresponds to the start position of the page). \n + * ArkUI_NodeComponentEvent.data[3].f32 : The length of the page in the axis direction. \n + */ + NODE_SWIPER_EVENT_ON_CONTENT_DID_SCROLL, /** * @brief Defines the event triggered when the ARKUI_NODE_SCROLL component scrolls. @@ -5636,6 +5661,15 @@ typedef enum { * {@link ArkUI_NodeComponentEvent} does not contain parameters:\n */ NODE_REFRESH_ON_REFRESH, + /** + * @brief Defines the event that is triggered when the ARKUI_NODE_REFRESH drop-down distance changes. + * + * 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 + * ArkUI_NodeComponentEvent.data[0].f32: Pull-down distance. \n + */ + NODE_REFRESH_ON_OFFSET_CHANGE, /** * @brief Defines the event triggered when the ARKUI_NODE_SCROLL component is about to scroll. diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 71a268f5e..f99cbe59e 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -1946,6 +1946,15 @@ void OH_ArkUI_WaterFlowSectionOption_Dispose(ArkUI_WaterFlowSectionOption* optio */ void OH_ArkUI_WaterFlowSectionOption_SetSize(ArkUI_WaterFlowSectionOption* option, int32_t size); +/** +* @brief Gets the FlowItem grouping configuration information array length. +* +* @param option FlowItem Indicates the packet configuration. +* @return array size. +* @since 12 +*/ +int32_t OH_ArkUI_WaterFlowSectionOption_GetSize(ArkUI_WaterFlowSectionOption* option); + /** * @brief Sets the number of items in a water flow section. * @@ -2064,6 +2073,17 @@ ArkUI_Margin OH_ArkUI_WaterFlowSectionOption_GetMargin(ArkUI_WaterFlowSectionOpt * @since 12 */ int32_t OH_ArkUI_WaterFlowSectionOption_GetItemCount(ArkUI_WaterFlowSectionOption* option, int32_t index); +/** +* @brief The FlowItem grouping configuration information getsthe spindle size of +* the specified Item based on flowItemIndex. +* +* @param option Indicates the pointer to a water flow section configuration. +* @param index Indicates the index of the target water flow section. +* @param callback Gets the spindle size of the specified Item based on index. +* @since 12 +*/ +void OH_ArkUI_WaterFlowSectionOption_RegisterGetItemMainSizeCallbackByIndex(ArkUI_WaterFlowSectionOption* option, + int32_t index, float(*callback)(int32_t itemIndex)); /** * @brief Creates a navigation indicator. -- Gitee