diff --git a/frameworks/core/components_ng/pattern/swiper/swiper_layout_property.h b/frameworks/core/components_ng/pattern/swiper/swiper_layout_property.h index 43b003356d5c38682676bfae104d59f91d455e5e..71f092c05c8c6f9d0307c6f9577cb40d291c4cda 100644 --- a/frameworks/core/components_ng/pattern/swiper/swiper_layout_property.h +++ b/frameworks/core/components_ng/pattern/swiper/swiper_layout_property.h @@ -163,9 +163,9 @@ public: } ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(Direction, Axis, PROPERTY_UPDATE_MEASURE); - ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(Index, int32_t, PROPERTY_UPDATE_MEASURE_SELF); + ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(Index, int32_t, PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(ItemSpace, Dimension, PROPERTY_UPDATE_MEASURE); - ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(CachedCount, int32_t, PROPERTY_UPDATE_MEASURE_SELF); + ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(CachedCount, int32_t, PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(DisplayMode, SwiperDisplayMode, PROPERTY_UPDATE_MEASURE); ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(DisplayCount, int32_t, PROPERTY_UPDATE_MEASURE); ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(MinSize, Dimension, PROPERTY_UPDATE_MEASURE); diff --git a/frameworks/core/components_ng/pattern/swiper/swiper_pattern.cpp b/frameworks/core/components_ng/pattern/swiper/swiper_pattern.cpp index dd1f126d19f9b2e8ca79d2d3f7ae0b64c5825f2d..5dcf33bea08aaa395079cc5b8143e7789d49d4d1 100644 --- a/frameworks/core/components_ng/pattern/swiper/swiper_pattern.cpp +++ b/frameworks/core/components_ng/pattern/swiper/swiper_pattern.cpp @@ -333,7 +333,7 @@ void SwiperPattern::InitSurfaceChangedCallback() swiper->jumpIndex_ = swiper->currentIndex_; auto swiperNode = swiper->GetHost(); CHECK_NULL_VOID(swiperNode); - swiperNode->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + swiperNode->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); for (const auto& child : swiperNode->GetChildren()) { if (child->GetTag() == V2::JS_LAZY_FOR_EACH_ETS_TAG) { auto lazyForEachNode = AceType::DynamicCast(child); @@ -685,7 +685,7 @@ void SwiperPattern::SwipeToWithoutAnimation(int32_t index) auto host = GetHost(); CHECK_NULL_VOID(host); jumpIndex_ = index; - host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); } void SwiperPattern::StopSpringAnimationAndFlushImmediately() @@ -698,7 +698,7 @@ void SwiperPattern::StopSpringAnimationAndFlushImmediately() jumpIndex_ = currentIndex_; auto host = GetHost(); CHECK_NULL_VOID(host); - host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); auto pipeline = PipelineContext::GetCurrentContext(); if (pipeline) { pipeline->FlushUITasks(); @@ -724,7 +724,7 @@ void SwiperPattern::SwipeTo(int32_t index) if (springController_ && !springController_->IsStopped()) { springController_->Stop(); jumpIndex_ = currentIndex_; - host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); auto pipeline = PipelineContext::GetCurrentContext(); if (pipeline) { pipeline->FlushUITasks(); @@ -747,7 +747,7 @@ void SwiperPattern::SwipeTo(int32_t index) return; } - host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); } void SwiperPattern::ShowNext() @@ -792,7 +792,7 @@ void SwiperPattern::ShowNext() if (isVisible_) { targetIndex_ = currentIndex_ + 1; preTargetIndex_ = targetIndex_; - host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); auto pipeline = PipelineContext::GetCurrentContext(); if (pipeline) { pipeline->FlushUITasks(); @@ -845,7 +845,7 @@ void SwiperPattern::ShowPrevious() if (isVisible_) { targetIndex_ = currentIndex_ - 1; preTargetIndex_ = targetIndex_; - host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); auto pipeline = PipelineContext::GetCurrentContext(); if (pipeline) { pipeline->FlushUITasks(); @@ -1230,7 +1230,7 @@ void SwiperPattern::UpdateCurrentOffset(float offset) } auto host = GetHost(); CHECK_NULL_VOID(host); - host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); } void SwiperPattern::CheckMarkDirtyNodeForRenderIndicator(float additionalOffset) @@ -1290,7 +1290,7 @@ void SwiperPattern::UpdateAnimationProperty(float velocity) auto host = GetHost(); CHECK_NULL_VOID(host); - host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); moveDirection_ = velocity <= 0; } @@ -1549,7 +1549,7 @@ void SwiperPattern::PlayPropertyTranslateAnimation(float translate, int32_t next targetIndex_ = targetIndex; auto host = GetHost(); CHECK_NULL_VOID(host); - host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); return; } } @@ -2114,7 +2114,7 @@ int32_t SwiperPattern::CalculateDisplayCount() const swiperLayoutProperty->UpdateDisplayCount(displayCount); auto host = GetHost(); CHECK_NULL_RETURN(host, 1); - host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF | PROPERTY_UPDATE_RENDER); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT | PROPERTY_UPDATE_RENDER); } return displayCount; } else { @@ -2470,7 +2470,7 @@ void SwiperPattern::PostTranslateTask(uint32_t delayTime) swiper->targetIndex_ = swiper->currentIndex_ + 1; auto host = swiper->GetHost(); CHECK_NULL_VOID(host); - host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); auto pipeline = PipelineContext::GetCurrentContext(); if (pipeline) { pipeline->FlushUITasks(); @@ -2607,7 +2607,7 @@ void SwiperPattern::TriggerEventOnFinish(int32_t nextIndex) itemPosition_.clear(); isVoluntarilyClear_ = true; jumpIndex_ = nextIndex; - host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); auto pipeline = PipelineContext::GetCurrentContext(); if (pipeline) { pipeline->FlushUITasks(); @@ -2771,7 +2771,7 @@ void SwiperPattern::OnTranslateFinish(int32_t nextIndex, bool restartAutoPlay, b CHECK_NULL_VOID(indicatorNode); if (indicatorNode->GetTag() == V2::SWIPER_INDICATOR_ETS_TAG) { indicatorNode->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); - host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT); } }