diff --git a/frameworks/core/components_ng/pattern/list/list_item_group_pattern.cpp b/frameworks/core/components_ng/pattern/list/list_item_group_pattern.cpp index d05a62821137784ea0163c424e73f6a27dff1a83..e3e9bf97456cdbe0d247d104a32a4f25b1267ca0 100644 --- a/frameworks/core/components_ng/pattern/list/list_item_group_pattern.cpp +++ b/frameworks/core/components_ng/pattern/list/list_item_group_pattern.cpp @@ -33,6 +33,23 @@ void ListItemGroupPattern::OnAttachToFrameNode() } } +void ListItemGroupPattern::OnColorConfigurationUpdate() +{ + if (listItemGroupStyle_ != V2::ListItemGroupStyle::CARD) { + return; + } + auto itemGroupNode = GetHost(); + CHECK_NULL_VOID(itemGroupNode); + auto renderContext = itemGroupNode->GetRenderContext(); + CHECK_NULL_VOID(renderContext); + auto pipeline = itemGroupNode->GetContext(); + CHECK_NULL_VOID(pipeline); + auto listItemGroupTheme = pipeline->GetTheme(); + CHECK_NULL_VOID(listItemGroupTheme); + + renderContext->UpdateBackgroundColor(listItemGroupTheme->GetItemGroupDefaultColor()); +} + void ListItemGroupPattern::SetListItemGroupDefaultAttributes(const RefPtr& itemGroupNode) { auto renderContext = itemGroupNode->GetRenderContext(); diff --git a/frameworks/core/components_ng/pattern/list/list_item_group_pattern.h b/frameworks/core/components_ng/pattern/list/list_item_group_pattern.h index b8acb640ccf8f3a44cb98bd47c582fb8742805f3..4c3e8e57528f0ff67292a5e27ffe9f0ffdc64edf 100644 --- a/frameworks/core/components_ng/pattern/list/list_item_group_pattern.h +++ b/frameworks/core/components_ng/pattern/list/list_item_group_pattern.h @@ -212,6 +212,7 @@ private: bool OnDirtyLayoutWrapperSwap(const RefPtr& dirty, const DirtySwapConfig& config) override; void OnAttachToFrameNode() override; void SetListItemGroupDefaultAttributes(const RefPtr& itemGroupNode); + void OnColorConfigurationUpdate() override; void CheckListDirectionInCardStyle(); RefPtr shallowBuilder_; RefPtr posMap_; diff --git a/frameworks/core/components_ng/pattern/list/list_item_pattern.cpp b/frameworks/core/components_ng/pattern/list/list_item_pattern.cpp index 75e84c4327d0ce5eea97c6ac75936a16cb5af8a5..03c9b343636e6b0d63de75f6513ed8607852408c 100644 --- a/frameworks/core/components_ng/pattern/list/list_item_pattern.cpp +++ b/frameworks/core/components_ng/pattern/list/list_item_pattern.cpp @@ -53,6 +53,23 @@ void ListItemPattern::OnAttachToFrameNode() } } +void ListItemPattern::OnColorConfigurationUpdate() +{ + if (listItemStyle_ != V2::ListItemStyle::CARD) { + return; + } + auto listItemNode = GetHost(); + CHECK_NULL_VOID(listItemNode); + auto renderContext = listItemNode->GetRenderContext(); + CHECK_NULL_VOID(renderContext); + auto pipeline = listItemNode->GetContext(); + CHECK_NULL_VOID(pipeline); + auto listItemTheme = pipeline->GetTheme(); + CHECK_NULL_VOID(listItemTheme); + + renderContext->UpdateBackgroundColor(listItemTheme->GetItemDefaultColor()); +} + void ListItemPattern::SetListItemDefaultAttributes(const RefPtr& listItemNode) { auto renderContext = listItemNode->GetRenderContext(); diff --git a/frameworks/core/components_ng/pattern/list/list_item_pattern.h b/frameworks/core/components_ng/pattern/list/list_item_pattern.h index ee1b12f0fee174176ce0703ab57aa599e6b62994..c566399bb3e70537a32907dc5d3dd93a9eab7ff6 100644 --- a/frameworks/core/components_ng/pattern/list/list_item_pattern.h +++ b/frameworks/core/components_ng/pattern/list/list_item_pattern.h @@ -236,6 +236,7 @@ private: void StartSpringMotion(float start, float end, float velocity, bool isCloseAllSwipeActions = false); void OnAttachToFrameNode() override; void SetListItemDefaultAttributes(const RefPtr& listItemNode); + void OnColorConfigurationUpdate() override; void InitListItemCardStyleForList(); void UpdateListItemAlignToCenter(); Color GetBlendGgColor();