diff --git a/frameworks/core/components_ng/pattern/swiper/swiper_model_ng.cpp b/frameworks/core/components_ng/pattern/swiper/swiper_model_ng.cpp index ef615bbff860fc72923b560a8e58c725828c990e..29b46410053e00109a98a7bb6f84b0b70662f92b 100644 --- a/frameworks/core/components_ng/pattern/swiper/swiper_model_ng.cpp +++ b/frameworks/core/components_ng/pattern/swiper/swiper_model_ng.cpp @@ -395,9 +395,8 @@ void SwiperModelNG::SetDuration(FrameNode* frameNode, uint32_t duration) void SwiperModelNG::SetCachedCount(FrameNode* frameNode, int32_t cachedCount) { - auto swiperNode = ViewStackProcessor::GetInstance()->GetMainFrameNode(); - CHECK_NULL_VOID(swiperNode); - auto pattern = swiperNode->GetPattern(); + CHECK_NULL_VOID(frameNode); + auto pattern = frameNode->GetPattern(); CHECK_NULL_VOID(pattern); pattern->SetCachedCount(cachedCount); diff --git a/frameworks/core/interfaces/arkoala/arkoala_api.h b/frameworks/core/interfaces/arkoala/arkoala_api.h index d2b5fc89c314f32fff6f714428da334cfe96bbed..03ac6e302a7781f7adfdd348601fdd541ade588a 100644 --- a/frameworks/core/interfaces/arkoala/arkoala_api.h +++ b/frameworks/core/interfaces/arkoala/arkoala_api.h @@ -1659,8 +1659,6 @@ struct ArkUISwiperModifier { ArkUI_Int32 (*setNodeAdapter)(ArkUINodeHandle node, ArkUINodeAdapterHandle handle); void (*resetNodeAdapter)(ArkUINodeHandle node); ArkUINodeAdapterHandle (*getNodeAdapter)(ArkUINodeHandle node); - void (*setCachedCount)(ArkUINodeHandle node, ArkUI_Int32 cachedCount); - void (*resetCachedCount)(ArkUINodeHandle node); ArkUI_Int32 (*getCachedCount)(ArkUINodeHandle node); }; diff --git a/frameworks/core/interfaces/native/node/node_swiper_modifier.cpp b/frameworks/core/interfaces/native/node/node_swiper_modifier.cpp index 17479dbe389e36de489195042e152c1b07e21385..a256cacb8e601def24f99172d4e48486716f199d 100644 --- a/frameworks/core/interfaces/native/node/node_swiper_modifier.cpp +++ b/frameworks/core/interfaces/native/node/node_swiper_modifier.cpp @@ -824,20 +824,6 @@ ArkUINodeAdapterHandle GetNodeAdapter(ArkUINodeHandle node) return NodeAdapter::GetNodeAdapterAPI()->getNodeAdapter(node); } -void SetCachedCount(ArkUINodeHandle node, ArkUI_Int32 cachedCount) -{ - auto* frameNode = reinterpret_cast(node); - CHECK_NULL_VOID(frameNode); - SwiperModelNG::SetCachedCount(frameNode, cachedCount); -} - -void ResetCachedCount(ArkUINodeHandle node) -{ - auto* frameNode = reinterpret_cast(node); - CHECK_NULL_VOID(frameNode); - SwiperModelNG::SetCachedCount(frameNode, 1); -} - ArkUI_Int32 GetCachedCount(ArkUINodeHandle node) { auto* frameNode = reinterpret_cast(node); @@ -861,7 +847,7 @@ const ArkUISwiperModifier* GetSwiperModifier() GetSwiperVertical, GetSwiperDuration, GetSwiperDisplayCount, GetSwiperInterval, GetSwiperCurve, GetSwiperDisableSwipe, GetSwiperItemSpace, GetSwiperShowIndicator, GetSwiperShowDisplayArrow, GetSwiperEffectMode, SetIndicatorInteractive, ResetIndicatorInteractive, SetNodeAdapter, ResetNodeAdapter, - GetNodeAdapter, SetCachedCount, ResetCachedCount, GetCachedCount }; + GetNodeAdapter, GetCachedCount }; return &modifier; } diff --git a/interfaces/native/node/style_modifier.cpp b/interfaces/native/node/style_modifier.cpp index dd1f22055a65154daa5fbc8480163b87823fc659..c73e0e1ace2adb942396c8510090b0cc86563c25 100644 --- a/interfaces/native/node/style_modifier.cpp +++ b/interfaces/native/node/style_modifier.cpp @@ -5257,7 +5257,8 @@ int32_t SetSwiperCachedCount(ArkUI_NodeHandle node, const ArkUI_AttributeItem* i if (item->size != 1) { return ERROR_CODE_PARAM_INVALID; } - GetFullImpl()->getNodeModifiers()->getSwiperModifier()->setCachedCount(node->uiNodeHandle, item->value[0].i32); + GetFullImpl()->getNodeModifiers()->getSwiperModifier()->setSwiperCachedCount( + node->uiNodeHandle, item->value[0].i32); return ERROR_CODE_NO_ERROR; } @@ -5266,7 +5267,7 @@ void ResetSwiperCachedCount(ArkUI_NodeHandle node) // already check in entry point. auto* fullImpl = GetFullImpl(); - fullImpl->getNodeModifiers()->getSwiperModifier()->resetCachedCount(node->uiNodeHandle); + fullImpl->getNodeModifiers()->getSwiperModifier()->resetSwiperCachedCount(node->uiNodeHandle); } const ArkUI_AttributeItem* GetSwiperCachedCount(ArkUI_NodeHandle node) @@ -8764,7 +8765,7 @@ void ResetWaterFlowCachedCount(ArkUI_NodeHandle node) // already check in entry point. auto* fullImpl = GetFullImpl(); - fullImpl->getNodeModifiers()->getSwiperModifier()->resetCachedCount(node->uiNodeHandle); + fullImpl->getNodeModifiers()->getWaterFlowModifier()->resetCachedCount(node->uiNodeHandle); } const ArkUI_AttributeItem* GetWaterFlowCachedCount(ArkUI_NodeHandle node) @@ -9941,7 +9942,7 @@ void ResetRefreshAttribute(ArkUI_NodeHandle node, int32_t subTypeId) int32_t SetWaterFlowAttribute(ArkUI_NodeHandle node, int32_t subTypeId, const ArkUI_AttributeItem* item) { static Setter* setters[] = { SetLayoutDirection, SetColumnsTemplate, SetRowsTemplate, SetWaterFlowColumnsGap, - SetWaterFlowRowsGap, SetWaterFlowNodeAdapter, SetWaterFlowCachedCount }; + SetWaterFlowRowsGap, nullptr, SetWaterFlowNodeAdapter, SetWaterFlowCachedCount }; if (subTypeId >= sizeof(setters) / sizeof(Setter*)) { TAG_LOGE(AceLogTag::ACE_NATIVE_NODE, "waterFlow node attribute: %{public}d NOT IMPLEMENT", subTypeId); return ERROR_CODE_NATIVE_IMPL_TYPE_NOT_SUPPORTED; @@ -9952,7 +9953,8 @@ int32_t SetWaterFlowAttribute(ArkUI_NodeHandle node, int32_t subTypeId, const Ar void ResetWaterFlowAttribute(ArkUI_NodeHandle node, int32_t subTypeId) { static Resetter* resetters[] = { ResetLayoutDirection, ResetColumnsTemplate, ResetRowsTemplate, - ResetWaterFlowColumnsGap, ResetWaterFlowRowsGap, ResetWaterFlowNodeAdapter, ResetWaterFlowCachedCount }; + ResetWaterFlowColumnsGap, ResetWaterFlowRowsGap, nullptr, ResetWaterFlowNodeAdapter, + ResetWaterFlowCachedCount }; if (subTypeId >= sizeof(resetters) / sizeof(Resetter*)) { TAG_LOGE(AceLogTag::ACE_NATIVE_NODE, "waterFlow node attribute: %{public}d NOT IMPLEMENT", subTypeId); return; @@ -9963,7 +9965,7 @@ void ResetWaterFlowAttribute(ArkUI_NodeHandle node, int32_t subTypeId) const ArkUI_AttributeItem* GetWaterFlowAttribute(ArkUI_NodeHandle node, int32_t subTypeId) { static Getter* getters[] = { GetLayoutDirection, GetColumnsTemplate, GetRowsTemplate, GetWaterFlowColumnsGap, - GetWaterFlowRowsGap, GetWaterFlowNodeAdapter, GetWaterFlowCachedCount }; + GetWaterFlowRowsGap, nullptr, GetWaterFlowNodeAdapter, GetWaterFlowCachedCount }; if (subTypeId >= sizeof(getters) / sizeof(Getter*)) { TAG_LOGE(AceLogTag::ACE_NATIVE_NODE, "waterFlow node attribute: %{public}d NOT IMPLEMENT", subTypeId); return nullptr;