From 2049b88538d4db0f5ae95d03dcb3bc75ba578591 Mon Sep 17 00:00:00 2001 From: zcdqs Date: Fri, 4 Nov 2022 23:26:30 +0800 Subject: [PATCH] fix ng xts Signed-off-by: zcdqs Change-Id: I9083cb430b63f254f67576102f816b7fa56dc0e9 --- .../declarative_frontend/jsview/js_qrcode.cpp | 2 +- .../ng/page_router_manager.cpp | 12 ++- .../core/components_ng/base/frame_node.cpp | 6 +- .../core/components_ng/base/inspector.cpp | 27 ++---- .../core/components_ng/base/ui_node.cpp | 2 +- frameworks/core/components_ng/base/ui_node.h | 2 +- .../core/components_ng/base/view_abstract.cpp | 10 ++- .../pattern/badge/badge_layout_property.cpp | 5 +- .../checkbox/checkbox_paint_property.cpp | 2 +- .../pattern/checkbox/checkbox_pattern.h | 4 +- .../pattern/divider/divider_layout_property.h | 3 +- .../pattern/image/image_layout_property.h | 9 ++ .../linear_layout/linear_layout_pattern.h | 21 ----- .../linear_layout/linear_layout_property.h | 30 +++++++ .../navigation/nav_bar_layout_property.h | 6 +- .../pattern/panel/sliding_panel_view.cpp | 1 + .../pattern/qrcode/qrcode_view.cpp | 7 ++ .../pattern/qrcode/qrcode_view.h | 1 + .../pattern/rating/rating_layout_property.h | 3 +- .../pattern/rating/rating_property_group.h | 12 +++ .../pattern/shape/container_paint_property.h | 19 ++--- .../pattern/shape/shape_abstract_model_ng.cpp | 2 +- .../pattern/slider/slider_layout_property.h | 13 +-- .../pattern/slider/slider_paint_property.h | 23 ++---- .../pattern/swiper/swiper_group_node.cpp | 8 ++ .../pattern/swiper/swiper_group_node.h | 1 + .../pattern/swiper/swiper_model_ng.cpp | 2 +- .../components_ng/pattern/text/span_node.cpp | 9 +- .../components_ng/pattern/text/text_styles.h | 4 - .../text_field/text_field_layout_property.h | 5 -- .../pattern/text_field/text_field_pattern.cpp | 82 ++++++++++++------- .../pattern/text_field/text_field_pattern.h | 5 +- .../pattern/toggle/toggle_model_ng.cpp | 2 +- .../components_ng/property/flex_property.h | 1 + .../property/magic_layout_property.h | 2 - 35 files changed, 190 insertions(+), 153 deletions(-) diff --git a/frameworks/bridge/declarative_frontend/jsview/js_qrcode.cpp b/frameworks/bridge/declarative_frontend/jsview/js_qrcode.cpp index 70750d5653d..f93001db8a8 100644 --- a/frameworks/bridge/declarative_frontend/jsview/js_qrcode.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/js_qrcode.cpp @@ -71,7 +71,7 @@ void JSQRCode::SetBackgroundColor(const JSCallbackInfo& info) } if (Container::IsCurrentUseNewPipeline()) { - NG::ViewAbstract::SetBackgroundColor(backgroundColor); + NG::QRCodeView::SetQRBackgroundColor(backgroundColor); return; } diff --git a/frameworks/bridge/declarative_frontend/ng/page_router_manager.cpp b/frameworks/bridge/declarative_frontend/ng/page_router_manager.cpp index 1bc6478af40..01506ddb868 100644 --- a/frameworks/bridge/declarative_frontend/ng/page_router_manager.cpp +++ b/frameworks/bridge/declarative_frontend/ng/page_router_manager.cpp @@ -311,8 +311,16 @@ void PageRouterManager::GetState(int32_t& index, std::string& name, std::string& CHECK_NULL_VOID(pagePattern); auto pageInfo = pagePattern->GetPageInfo(); CHECK_NULL_VOID(pageInfo); - name = pageInfo->GetPageUrl(); - path = pageInfo->GetPagePath(); + auto url = pageInfo->GetPageUrl(); + auto pos = url.rfind(".js"); + if (pos == url.length() - 3) { + url = url.substr(0, pos); + } + pos = url.rfind("/"); + if (pos != std::string::npos) { + name = url.substr(pos + 1); + path = url.substr(0, pos + 1); + } } std::string PageRouterManager::GetParams() const diff --git a/frameworks/core/components_ng/base/frame_node.cpp b/frameworks/core/components_ng/base/frame_node.cpp index 9bfa87cfe97..4d45bc9082c 100644 --- a/frameworks/core/components_ng/base/frame_node.cpp +++ b/frameworks/core/components_ng/base/frame_node.cpp @@ -181,16 +181,14 @@ void FrameNode::FocusToJsonValue(std::unique_ptr& json) const void FrameNode::ToJsonValue(std::unique_ptr& json) const { + // scrollable in AccessibilityProperty + ACE_PROPERTY_TO_JSON_VALUE(accessibilityProperty_, AccessibilityProperty); ACE_PROPERTY_TO_JSON_VALUE(layoutProperty_, LayoutProperty); ACE_PROPERTY_TO_JSON_VALUE(paintProperty_, PaintProperty); ACE_PROPERTY_TO_JSON_VALUE(pattern_, Pattern); - ACE_PROPERTY_TO_JSON_VALUE(accessibilityProperty_, AccessibilityProperty); if (renderContext_) { renderContext_->ToJsonValue(json); } - if (pattern_) { - pattern_->ToJsonValue(json); - } if (eventHub_) { eventHub_->ToJsonValue(json); } diff --git a/frameworks/core/components_ng/base/inspector.cpp b/frameworks/core/components_ng/base/inspector.cpp index eac3dd0defc..c59d3599cf6 100644 --- a/frameworks/core/components_ng/base/inspector.cpp +++ b/frameworks/core/components_ng/base/inspector.cpp @@ -18,6 +18,7 @@ #include "base/memory/ace_type.h" #include "base/utils/utils.h" #include "core/components_ng/base/group_node.h" +#include "core/components_ng/pattern/text/span_node.h" #include "core/components_v2/inspector/inspector_constants.h" #include "core/pipeline/base/element_register.h" #include "core/pipeline_ng/pipeline_context.h" @@ -36,17 +37,6 @@ const char INSPECTOR_CHILDREN[] = "$children"; const uint32_t LONG_PRESS_DELAY = 1000; -RefPtr GetSwiper(const RefPtr& parent) -{ - if (AceType::InstanceOf(parent) && parent->GetTag() == V2::STACK_ETS_TAG) { - auto child = parent->GetChildAtIndex(0); - if (child && child->GetTag() == V2::SWIPER_ETS_TAG) { - return child; - } - } - return nullptr; -} - RefPtr GetInspectorByKey(const RefPtr& root, const std::string& key) { std::queue> elements; @@ -55,13 +45,10 @@ RefPtr GetInspectorByKey(const RefPtr& root, const std::strin while (!elements.empty()) { auto current = elements.front(); elements.pop(); - inspectorElement = AceType::DynamicCast(current); - if (inspectorElement && inspectorElement->HasInspectorId()) { - if (key == inspectorElement->GetInspectorIdValue()) { - auto swiper = GetSwiper(inspectorElement); - return swiper ? swiper : inspectorElement; - } + if (key == current->GetInspectorId().value_or("")) { + return current; } + const auto& children = current->GetChildren(); for (const auto& child : children) { elements.push(child); @@ -219,11 +206,11 @@ bool Inspector::SendEventByKey(const std::string& key, int action, const std::st .y = (rect.Top() + rect.Height() / 2), .type = TouchType::DOWN, .time = std::chrono::high_resolution_clock::now() }; - context->OnTouchEvent(point); + context->OnTouchEvent(point.UpdatePointers()); switch (action) { case static_cast(AceAction::ACTION_CLICK): { - context->OnTouchEvent(GetUpPoint(point)); + context->OnTouchEvent(GetUpPoint(point).UpdatePointers()); break; } case static_cast(AceAction::ACTION_LONG_CLICK): { @@ -231,7 +218,7 @@ bool Inspector::SendEventByKey(const std::string& key, int action, const std::st auto&& callback = [weak, point]() { auto refPtr = weak.Upgrade(); if (refPtr) { - refPtr->OnTouchEvent(GetUpPoint(point)); + refPtr->OnTouchEvent(GetUpPoint(point).UpdatePointers()); } }; inspectorTimer.Reset(callback); diff --git a/frameworks/core/components_ng/base/ui_node.cpp b/frameworks/core/components_ng/base/ui_node.cpp index 72fb6f0d2e3..e5254f0334d 100644 --- a/frameworks/core/components_ng/base/ui_node.cpp +++ b/frameworks/core/components_ng/base/ui_node.cpp @@ -98,7 +98,7 @@ void UINode::RemoveChildAtIndex(int32_t index) MarkNeedSyncRenderTree(); } -RefPtr UINode::GetChildAtIndex(int32_t index) +RefPtr UINode::GetChildAtIndex(int32_t index) const { if ((index < 0) || (index >= static_cast(children_.size()))) { return nullptr; diff --git a/frameworks/core/components_ng/base/ui_node.h b/frameworks/core/components_ng/base/ui_node.h index 872c4daebb2..57aca33601b 100644 --- a/frameworks/core/components_ng/base/ui_node.h +++ b/frameworks/core/components_ng/base/ui_node.h @@ -60,7 +60,7 @@ public: void GetFocusChildren(std::list>& children) const; void Clean(); void RemoveChildAtIndex(int32_t index); - RefPtr GetChildAtIndex(int32_t index); + RefPtr GetChildAtIndex(int32_t index) const; void AttachToMainTree(); void DetachFromMainTree(); diff --git a/frameworks/core/components_ng/base/view_abstract.cpp b/frameworks/core/components_ng/base/view_abstract.cpp index b507a5b0276..1c7cd213b6a 100644 --- a/frameworks/core/components_ng/base/view_abstract.cpp +++ b/frameworks/core/components_ng/base/view_abstract.cpp @@ -30,6 +30,7 @@ #include "core/components_ng/pattern/menu/menu_view.h" #include "core/components_ng/pattern/option/option_paint_property.h" #include "core/components_ng/pattern/option/option_view.h" +#include "core/components_ng/pattern/text/span_node.h" #include "core/image/image_source_info.h" #include "core/pipeline_ng/pipeline_context.h" #include "core/pipeline_ng/ui_task_scheduler.h" @@ -665,8 +666,13 @@ void ViewAbstract::SetRadialGradient(const NG::Gradient& gradient) void ViewAbstract::SetInspectorId(const std::string& inspectorId) { auto frameNode = ViewStackProcessor::GetInstance()->GetMainFrameNode(); - CHECK_NULL_VOID(frameNode); - frameNode->UpdateInspectorId(inspectorId); + if (frameNode) { + frameNode->UpdateInspectorId(inspectorId); + } else { + auto spanNode = AceType::DynamicCast(ViewStackProcessor::GetInstance()->GetMainElementNode()); + CHECK_NULL_VOID(spanNode); + spanNode->UpdateInspectorId(inspectorId); + } } void ViewAbstract::SetGrid(std::optional span, std::optional offset, GridSizeType type) diff --git a/frameworks/core/components_ng/pattern/badge/badge_layout_property.cpp b/frameworks/core/components_ng/pattern/badge/badge_layout_property.cpp index 975148dca2d..47208a9237b 100644 --- a/frameworks/core/components_ng/pattern/badge/badge_layout_property.cpp +++ b/frameworks/core/components_ng/pattern/badge/badge_layout_property.cpp @@ -30,11 +30,12 @@ const Dimension DEFAULT_CIRCLE_SIZE = 16.0_vp; void BadgeLayoutProperty::ToJsonValue(std::unique_ptr& json) const { + auto position = BadgeLayoutProperty::GetBadgePosition(); + json->Put("position", GetBadgePositionString(position).c_str()); + LayoutProperty::ToJsonValue(json); json->Put("count", std::to_string(GetBadgeCount().value_or(DEFAULT_COUNT)).c_str()); json->Put("maxCount", std::to_string(GetBadgeMaxCount().value_or(DEFAULT_MAX_COUNT)).c_str()); - auto position = BadgeLayoutProperty::GetBadgePosition(); - json->Put("position", GetBadgePositionString(position).c_str()); json->Put("value", GetBadgeValue().value_or("").c_str()); auto jsonValue = JsonUtil::Create(true); diff --git a/frameworks/core/components_ng/pattern/checkbox/checkbox_paint_property.cpp b/frameworks/core/components_ng/pattern/checkbox/checkbox_paint_property.cpp index b2f67691ad0..2c791b418dd 100644 --- a/frameworks/core/components_ng/pattern/checkbox/checkbox_paint_property.cpp +++ b/frameworks/core/components_ng/pattern/checkbox/checkbox_paint_property.cpp @@ -26,7 +26,7 @@ const Color DEFAULT_SELECTED_COLOR = Color(0xFF007DFF); void CheckBoxPaintProperty::ToJsonValue(std::unique_ptr& json) const { PaintProperty::ToJsonValue(json); - json->Put("select", GetCheckBoxSelect().value_or(false) ? "true" : "false"); + json->Put("isOn", GetCheckBoxSelect().value_or(false) ? "true" : "false"); json->Put("selectedColor", GetCheckBoxSelectedColor().value_or(DEFAULT_SELECTED_COLOR).ColorToString().c_str()); } diff --git a/frameworks/core/components_ng/pattern/checkbox/checkbox_pattern.h b/frameworks/core/components_ng/pattern/checkbox/checkbox_pattern.h index d8d62233bc0..81367d38039 100644 --- a/frameworks/core/components_ng/pattern/checkbox/checkbox_pattern.h +++ b/frameworks/core/components_ng/pattern/checkbox/checkbox_pattern.h @@ -103,9 +103,7 @@ public: auto group = checkBoxEventHub ? checkBoxEventHub->GetGroupName() : ""; json->Put("name", name.c_str()); json->Put("group", group.c_str()); - if (host->GetTag() == V2::TOGGLE_ETS_TAG) { - json->Put("type", "ToggleType.Checkbox"); - } + json->Put("type", "ToggleType.Checkbox"); } private: diff --git a/frameworks/core/components_ng/pattern/divider/divider_layout_property.h b/frameworks/core/components_ng/pattern/divider/divider_layout_property.h index 995a9bb1bdd..d0cbe5a6ca3 100644 --- a/frameworks/core/components_ng/pattern/divider/divider_layout_property.h +++ b/frameworks/core/components_ng/pattern/divider/divider_layout_property.h @@ -45,7 +45,8 @@ public: { LayoutProperty::ToJsonValue(json); json->Put("vertical", propVertical_.value_or(true) ? "true" : "false"); - json->Put("strokeWidth", propStrokeWidth_.value_or(Dimension(1, DimensionUnit::VP)).ToString().c_str()); + json->Put( + "strokeWidth", std::to_string(propStrokeWidth_.value_or(Dimension(1, DimensionUnit::VP)).Value()).c_str()); } ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(Vertical, bool, PROPERTY_UPDATE_MEASURE); diff --git a/frameworks/core/components_ng/pattern/image/image_layout_property.h b/frameworks/core/components_ng/pattern/image/image_layout_property.h index 0b6ef924481..ba73b94f4f1 100644 --- a/frameworks/core/components_ng/pattern/image/image_layout_property.h +++ b/frameworks/core/components_ng/pattern/image/image_layout_property.h @@ -77,6 +77,15 @@ public: json->Put("objectFit", OBJECTFITVALUE[static_cast(propImageFit_.value_or(ImageFit::COVER))]); json->Put("syncLoad", propSyncMode_.value_or(false) ? "true" : "false"); json->Put("copyOption", COPYOPTIONSVALUE[static_cast(propCopyOptions_.value_or(CopyOptions::None))]); + std::string src; + if (propImageSourceInfo_.has_value()) { + src = propImageSourceInfo_->GetSrc(); + if (src.find("resources") != std::string::npos) { + auto num = src.find("resources"); + src = src.substr(num); + } + } + json->Put("src", src.c_str()); ACE_PROPERTY_TO_JSON_VALUE(propImageSizeStyle_, ImageSizeStyle); } diff --git a/frameworks/core/components_ng/pattern/linear_layout/linear_layout_pattern.h b/frameworks/core/components_ng/pattern/linear_layout/linear_layout_pattern.h index 1b32df8e98e..ae0da3a5833 100644 --- a/frameworks/core/components_ng/pattern/linear_layout/linear_layout_pattern.h +++ b/frameworks/core/components_ng/pattern/linear_layout/linear_layout_pattern.h @@ -21,7 +21,6 @@ #include "core/components_ng/pattern/linear_layout/linear_layout_algorithm.h" #include "core/components_ng/pattern/linear_layout/linear_layout_property.h" #include "core/components_ng/pattern/pattern.h" -#include "core/components_v2/inspector/utils.h" namespace OHOS::Ace::NG { // PagePattern is the base class for page render node. @@ -57,26 +56,6 @@ public: return { isVertical_, true, ScopeType::FLEX }; } - void ToJsonValue(std::unique_ptr& json) const override - { - auto property = GetLayoutProperty(); - CHECK_NULL_VOID(property); - static const char* HORIZONTALALIGN[] = { "HorizontalAlign.Start", "HorizontalAlign.Center", - "HorizontalAlign.End" }; - static const char* VERTICALALIGN[] = { "VerticalAlign.Top", "VerticalAlign.Center", "VerticalAlign.Bottom" }; - json->Put("space", property->GetSpace().value_or(Dimension(0, DimensionUnit::VP)).ToString().c_str()); - if (isVertical_) { - json->Put("alignItems", - HORIZONTALALIGN[static_cast(property->GetCrossAxisAlign().value_or(FlexAlign::FLEX_START))]); - } else { - json->Put("alignItems", - VERTICALALIGN[static_cast(property->GetCrossAxisAlign().value_or(FlexAlign::FLEX_START))]); - } - std::string result = ""; - result = V2::ConvertFlexAlignToStirng(property->GetMainAxisAlign().value_or(FlexAlign::FLEX_START)); - json->Put("justifyContent", result.c_str()); - } - private: bool isVertical_ = false; diff --git a/frameworks/core/components_ng/pattern/linear_layout/linear_layout_property.h b/frameworks/core/components_ng/pattern/linear_layout/linear_layout_property.h index 434895cddd3..f0b661e491e 100644 --- a/frameworks/core/components_ng/pattern/linear_layout/linear_layout_property.h +++ b/frameworks/core/components_ng/pattern/linear_layout/linear_layout_property.h @@ -22,6 +22,7 @@ #include "core/components_ng/pattern/flex/flex_layout_property.h" #include "core/components_ng/property/flex_property.h" #include "core/components_ng/property/property.h" +#include "core/components_v2/inspector/utils.h" namespace OHOS::Ace::NG { class ACE_EXPORT LinearLayoutProperty : public FlexLayoutProperty { @@ -53,6 +54,35 @@ public: return isVertical_; } + void ToJsonValue(std::unique_ptr& json) const override + { + LayoutProperty::ToJsonValue(json); + std::string alignItems; + auto flexAlignItems = GetCrossAxisAlign().value_or(FlexAlign::CENTER); + if (isVertical_) { + alignItems = "HorizontalAlign::Center"; + if (flexAlignItems == FlexAlign::FLEX_START) { + alignItems = "HorizontalAlign.Start"; + } else if (flexAlignItems == FlexAlign::CENTER) { + alignItems = "HorizontalAlign.Center"; + } else if (flexAlignItems == FlexAlign::FLEX_END) { + alignItems = "HorizontalAlign.End"; + } + } else { + alignItems = "VerticalAlign.Center"; + if (flexAlignItems == FlexAlign::FLEX_START) { + alignItems = "VerticalAlign.Top"; + } else if (flexAlignItems == FlexAlign::CENTER) { + alignItems = "VerticalAlign.Center"; + } else if (flexAlignItems == FlexAlign::FLEX_END) { + alignItems = "VerticalAlign.Bottom"; + } + } + json->Put("alignItems", alignItems.c_str()); + auto justifyContent = V2::ConvertFlexAlignToStirng(GetMainAxisAlign().value_or(FlexAlign::FLEX_START)); + json->Put("justifyContent", justifyContent.c_str()); + } + protected: void Clone(RefPtr property) const override { diff --git a/frameworks/core/components_ng/pattern/navigation/nav_bar_layout_property.h b/frameworks/core/components_ng/pattern/navigation/nav_bar_layout_property.h index 308612810a2..07d725038e1 100644 --- a/frameworks/core/components_ng/pattern/navigation/nav_bar_layout_property.h +++ b/frameworks/core/components_ng/pattern/navigation/nav_bar_layout_property.h @@ -70,9 +70,9 @@ public: void ToJsonValue(std::unique_ptr& json) const override { json->Put("titleMode", GetTitleModeString().c_str()); - json->Put("hideBackButton", GetHideBackButtonValue(false) ? "true" : "false"); - json->Put("hideTitleBar", GetHideTitleBarValue(false) ? "true" : "false"); - json->Put("hideToolBar", GetHideToolBarValue(false) ? "true" : "false"); + json->Put("hideBackButton", GetHideBackButtonValue(false)); + json->Put("hideTitleBar", GetHideTitleBarValue(false)); + json->Put("hideToolBar", GetHideToolBarValue(false)); } ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(TitleMode, NavigationTitleMode, PROPERTY_UPDATE_MEASURE); ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(HideTitleBar, bool, PROPERTY_UPDATE_MEASURE); diff --git a/frameworks/core/components_ng/pattern/panel/sliding_panel_view.cpp b/frameworks/core/components_ng/pattern/panel/sliding_panel_view.cpp index f7edf3330dc..8fa61d539e3 100644 --- a/frameworks/core/components_ng/pattern/panel/sliding_panel_view.cpp +++ b/frameworks/core/components_ng/pattern/panel/sliding_panel_view.cpp @@ -53,6 +53,7 @@ void SlidingPanelView::Create(bool isShow) auto type = isShow ? VisibleType::VISIBLE : VisibleType::GONE; ACE_UPDATE_LAYOUT_PROPERTY(LayoutProperty, Visibility, type); + SetIsShow(isShow); auto renderContext = columnNode->GetRenderContext(); if (renderContext) { renderContext->UpdateBackgroundColor(BG_COLOR); diff --git a/frameworks/core/components_ng/pattern/qrcode/qrcode_view.cpp b/frameworks/core/components_ng/pattern/qrcode/qrcode_view.cpp index 44dfadcc28e..c430b3ab246 100644 --- a/frameworks/core/components_ng/pattern/qrcode/qrcode_view.cpp +++ b/frameworks/core/components_ng/pattern/qrcode/qrcode_view.cpp @@ -32,6 +32,7 @@ void QRCodeView::Create(const std::string& value) ACE_UPDATE_PAINT_PROPERTY(QRCodePaintProperty, Value, value); ACE_UPDATE_PAINT_PROPERTY(QRCodePaintProperty, Color, Color::BLACK); ACE_UPDATE_PAINT_PROPERTY(QRCodePaintProperty, BackgroundColor, Color::WHITE); + ACE_UPDATE_RENDER_CONTEXT(BackgroundColor, Color::WHITE); } void QRCodeView::SetQRCodeColor(Color color) @@ -39,4 +40,10 @@ void QRCodeView::SetQRCodeColor(Color color) ACE_UPDATE_PAINT_PROPERTY(QRCodePaintProperty, Color, color); } +void QRCodeView::SetQRBackgroundColor(Color color) +{ + ACE_UPDATE_PAINT_PROPERTY(QRCodePaintProperty, BackgroundColor, color); + ACE_UPDATE_RENDER_CONTEXT(BackgroundColor, color); +} + } // namespace OHOS::Ace::NG diff --git a/frameworks/core/components_ng/pattern/qrcode/qrcode_view.h b/frameworks/core/components_ng/pattern/qrcode/qrcode_view.h index b582ef48260..66ad66a748a 100644 --- a/frameworks/core/components_ng/pattern/qrcode/qrcode_view.h +++ b/frameworks/core/components_ng/pattern/qrcode/qrcode_view.h @@ -25,6 +25,7 @@ class ACE_EXPORT QRCodeView { public: static void Create(const std::string& value); static void SetQRCodeColor(Color color); + static void SetQRBackgroundColor(Color color); }; } // namespace OHOS::Ace::NG diff --git a/frameworks/core/components_ng/pattern/rating/rating_layout_property.h b/frameworks/core/components_ng/pattern/rating/rating_layout_property.h index 1c333988f6e..a4c4fb475be 100644 --- a/frameworks/core/components_ng/pattern/rating/rating_layout_property.h +++ b/frameworks/core/components_ng/pattern/rating/rating_layout_property.h @@ -49,8 +49,7 @@ public: void ToJsonValue(std::unique_ptr& json) const override { LayoutProperty::ToJsonValue(json); - json->Put("indicator", GetIndicator().value_or(false) ? "true" : "false"); - json->Put("stars", std::to_string(GetStars().value_or(5)).c_str()); + ACE_PROPERTY_TO_JSON_VALUE(propRatingPropertyGroup_, RatingPropertyGroup); } ACE_DEFINE_PROPERTY_GROUP(RatingPropertyGroup, RatingPropertyGroup); diff --git a/frameworks/core/components_ng/pattern/rating/rating_property_group.h b/frameworks/core/components_ng/pattern/rating/rating_property_group.h index d424e9a150f..165eb1ed6fb 100644 --- a/frameworks/core/components_ng/pattern/rating/rating_property_group.h +++ b/frameworks/core/components_ng/pattern/rating/rating_property_group.h @@ -20,6 +20,7 @@ #include "base/resource/internal_resource.h" #include "core/components_ng/property/property.h" #include "core/image/image_source_info.h" +#include "core/pipeline/base/constants.h" namespace OHOS::Ace::NG { struct RatingPropertyGroup { @@ -29,6 +30,17 @@ struct RatingPropertyGroup { ACE_DEFINE_PROPERTY_GROUP_ITEM(ForegroundImageSourceInfo, ImageSourceInfo); ACE_DEFINE_PROPERTY_GROUP_ITEM(SecondaryImageSourceInfo, ImageSourceInfo); ACE_DEFINE_PROPERTY_GROUP_ITEM(BackgroundImageSourceInfo, ImageSourceInfo); + + void ToJsonValue(std::unique_ptr& json) const + { + json->Put("indicator", GetIndicator().value_or(false) ? "true" : "false"); + json->Put("stars", std::to_string(GetStars().value_or(DEFAULT_RATING_STAR_NUM)).c_str()); + auto jsonStarStyle = JsonUtil::Create(true); + jsonStarStyle->Put("backgroundUri", propBackgroundImageSourceInfo.value_or(ImageSourceInfo()).GetSrc().c_str()); + jsonStarStyle->Put("foregroundUri", propForegroundImageSourceInfo.value_or(ImageSourceInfo()).GetSrc().c_str()); + jsonStarStyle->Put("secondaryUri", propSecondaryImageSourceInfo.value_or(ImageSourceInfo()).GetSrc().c_str()); + json->Put("starStyle", jsonStarStyle->ToString().c_str()); + } }; } // namespace OHOS::Ace::NG diff --git a/frameworks/core/components_ng/pattern/shape/container_paint_property.h b/frameworks/core/components_ng/pattern/shape/container_paint_property.h index 0b4b4fbcb34..01df3332c72 100644 --- a/frameworks/core/components_ng/pattern/shape/container_paint_property.h +++ b/frameworks/core/components_ng/pattern/shape/container_paint_property.h @@ -64,21 +64,14 @@ public: void ToJsonValue(std::unique_ptr& json) const override { ShapePaintProperty::ToJsonValue(json); + auto viewBoxJson = JsonUtil::Create(true); if (propShapeViewBox_.has_value()) { - JsonValue viewBoxJson; - viewBoxJson.Put("x", propShapeViewBox_.value().Left().ConvertToPx()); - viewBoxJson.Put("y", propShapeViewBox_.value().Top().ConvertToPx()); - viewBoxJson.Put("width", propShapeViewBox_.value().Width().ConvertToPx()); - viewBoxJson.Put("height", propShapeViewBox_.value().Height().ConvertToPx()); - json->Put("viewPort", viewBoxJson.ToString().c_str()); - } - if (propImageMesh_.has_value()) { - std::string str; - str.insert(str.begin(), propImageMesh_.value().GetMesh().begin(), propImageMesh_.value().GetMesh().end()); - str.append(",").append(std::to_string(propImageMesh_.value().GetColumn())).append(","); - str.append(std::to_string(propImageMesh_.value().GetRow())); - json->Put("mesh", str.c_str()); + viewBoxJson->Put("x", propShapeViewBox_.value().Left().ToString().c_str()); + viewBoxJson->Put("y", propShapeViewBox_.value().Top().ToString().c_str()); + viewBoxJson->Put("width", propShapeViewBox_.value().Width().ToString().c_str()); + viewBoxJson->Put("height", propShapeViewBox_.value().Height().ToString().c_str()); } + json->Put("viewPort", viewBoxJson); } ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(ImageMesh, ImageMesh, PROPERTY_UPDATE_RENDER); diff --git a/frameworks/core/components_ng/pattern/shape/shape_abstract_model_ng.cpp b/frameworks/core/components_ng/pattern/shape/shape_abstract_model_ng.cpp index 9c3ba5bacfa..011c8b64137 100644 --- a/frameworks/core/components_ng/pattern/shape/shape_abstract_model_ng.cpp +++ b/frameworks/core/components_ng/pattern/shape/shape_abstract_model_ng.cpp @@ -61,7 +61,7 @@ void ShapeAbstractModelNG::SetStrokeOpacity(double opacity) void ShapeAbstractModelNG::SetFillOpacity(double opacity) { - ACE_UPDATE_PAINT_PROPERTY(ShapePaintProperty, FillOpacity, opacity); + ACE_UPDATE_PAINT_PROPERTY(ShapePaintProperty, FillOpacity, std::clamp(opacity, 0.0, 1.0)); } void ShapeAbstractModelNG::SetStrokeWidth(const Dimension& lineWidth) diff --git a/frameworks/core/components_ng/pattern/slider/slider_layout_property.h b/frameworks/core/components_ng/pattern/slider/slider_layout_property.h index 7f5e28f9d55..99659b46a8a 100644 --- a/frameworks/core/components_ng/pattern/slider/slider_layout_property.h +++ b/frameworks/core/components_ng/pattern/slider/slider_layout_property.h @@ -44,21 +44,14 @@ public: void ToJsonValue(std::unique_ptr& json) const override { LayoutProperty::ToJsonValue(json); - static const std::array AXIS_TO_STRING = { - "Axis.VERTICAL", - "Axis.HORIZONTAL", - "Axis.FREE", - "Axis.NONE", - }; - json->Put( - "Direction", AXIS_TO_STRING.at(static_cast(GetDirection().value_or(Axis::HORIZONTAL))).c_str()); - json->Put("Thickness", GetThickness().value_or(Dimension(20.0, DimensionUnit::VP)).ToString().c_str()); + json->Put("thickness", GetThickness().value_or(Dimension(20.0, DimensionUnit::VP)).ToString().c_str()); static const std::array SLIDER_MODE_TO_STRING = { "SliderMode.OUTSET", "SliderMode.INSET", "SliderMode.CAPSULE", }; - json->Put("SliderMode", + // should be in constructor + json->Put("style", SLIDER_MODE_TO_STRING.at(static_cast(GetSliderMode().value_or(SliderModel::SliderMode::OUTSET))) .c_str()); } diff --git a/frameworks/core/components_ng/pattern/slider/slider_paint_property.h b/frameworks/core/components_ng/pattern/slider/slider_paint_property.h index 969d7f86bdc..3c223ac4d21 100644 --- a/frameworks/core/components_ng/pattern/slider/slider_paint_property.h +++ b/frameworks/core/components_ng/pattern/slider/slider_paint_property.h @@ -46,20 +46,15 @@ public: void ToJsonValue(std::unique_ptr& json) const override { PaintProperty::ToJsonValue(json); - - json->Put("value", std::to_string(GetValue().value_or(0.0f)).c_str()); - json->Put("min", std::to_string(GetMin().value_or(0.0f)).c_str()); - json->Put("max", std::to_string(GetMax().value_or(100.0f)).c_str()); - json->Put("step", std::to_string(GetStep().value_or(1.0f)).c_str()); - json->Put("reverse", GetReverse().value_or(false) ? "true" : "false"); - static const std::array AXIS_TO_STRING = { - "Axis.VERTICAL", - "Axis.HORIZONTAL", - "Axis.FREE", - "Axis.NONE", - }; - json->Put( - "direction", AXIS_TO_STRING.at(static_cast(GetDirection().value_or(Axis::HORIZONTAL))).c_str()); + auto jsonConstructor = JsonUtil::Create(true); + jsonConstructor->Put("value", std::to_string(GetValue().value_or(0.0f)).c_str()); + jsonConstructor->Put("min", std::to_string(GetMin().value_or(0.0f)).c_str()); + jsonConstructor->Put("max", std::to_string(GetMax().value_or(100.0f)).c_str()); + jsonConstructor->Put("step", std::to_string(GetStep().value_or(1.0f)).c_str()); + jsonConstructor->Put("reverse", GetReverse().value_or(false) ? "true" : "false"); + jsonConstructor->Put("direction", + (GetDirection().value_or(Axis::HORIZONTAL)) == Axis::VERTICAL ? "Axis.Vertical" : "Axis.Horizontal"); + json->Put("constructor", jsonConstructor); json->Put("blockColor", GetBlockColor().value_or(Color(0xffffffff)).ColorToString().c_str()); json->Put( "trackBackgroundColor", GetTrackBackgroundColor().value_or(Color(0xafdbdbdb)).ColorToString().c_str()); diff --git a/frameworks/core/components_ng/pattern/swiper/swiper_group_node.cpp b/frameworks/core/components_ng/pattern/swiper/swiper_group_node.cpp index 5dcd6d4b3c8..8d45f0906e0 100644 --- a/frameworks/core/components_ng/pattern/swiper/swiper_group_node.cpp +++ b/frameworks/core/components_ng/pattern/swiper/swiper_group_node.cpp @@ -52,4 +52,12 @@ void SwiperGroupNode::AddChildToGroup(const RefPtr& child) swiperNode->AddChild(child); } +void SwiperGroupNode::ToJsonValue(std::unique_ptr& json) const +{ + auto swiper = GetChildAtIndex(0); + if (swiper) { + swiper->ToJsonValue(json); + } +} + } // namespace OHOS::Ace::NG \ No newline at end of file diff --git a/frameworks/core/components_ng/pattern/swiper/swiper_group_node.h b/frameworks/core/components_ng/pattern/swiper/swiper_group_node.h index 9922ce51973..b8f7b121d5c 100644 --- a/frameworks/core/components_ng/pattern/swiper/swiper_group_node.h +++ b/frameworks/core/components_ng/pattern/swiper/swiper_group_node.h @@ -40,6 +40,7 @@ public: { return false; } + void ToJsonValue(std::unique_ptr& json) const override; }; } // namespace OHOS::Ace::NG 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 1dec57bb4db..6f1e8b4b34c 100644 --- a/frameworks/core/components_ng/pattern/swiper/swiper_model_ng.cpp +++ b/frameworks/core/components_ng/pattern/swiper/swiper_model_ng.cpp @@ -39,7 +39,7 @@ RefPtr SwiperModelNG::Create() auto* stack = ViewStackProcessor::GetInstance(); int32_t nodeId = (stack == nullptr ? 0 : stack->ClaimNodeId()); auto swiperGroupNode = SwiperGroupNode::GetOrCreateGroupNode( - V2::STACK_ETS_TAG, nodeId, []() { return AceType::MakeRefPtr(); }); + V2::SWIPER_ETS_TAG, nodeId, []() { return AceType::MakeRefPtr(); }); RefPtr swiperNode; if (swiperGroupNode->GetChildren().empty()) { diff --git a/frameworks/core/components_ng/pattern/text/span_node.cpp b/frameworks/core/components_ng/pattern/text/span_node.cpp index b0a1320b19c..0b5cea5f336 100644 --- a/frameworks/core/components_ng/pattern/text/span_node.cpp +++ b/frameworks/core/components_ng/pattern/text/span_node.cpp @@ -31,12 +31,9 @@ namespace { std::string GetDeclaration(const std::optional& color, const std::optional& textDecoration) { auto jsonSpanDeclaration = JsonUtil::Create(true); - if (color) { - jsonSpanDeclaration->Put("color", (color.value().ColorToString()).c_str()); - } - if (textDecoration) { - jsonSpanDeclaration->Put("type", V2::ConvertWrapTextDecorationToStirng(textDecoration.value()).c_str()); - } + jsonSpanDeclaration->Put( + "type", V2::ConvertWrapTextDecorationToStirng(textDecoration.value_or(TextDecoration::NONE)).c_str()); + jsonSpanDeclaration->Put("color", (color.value_or(Color::BLACK).ColorToString()).c_str()); return jsonSpanDeclaration->ToString(); } } // namespace diff --git a/frameworks/core/components_ng/pattern/text/text_styles.h b/frameworks/core/components_ng/pattern/text/text_styles.h index f6f22ea030d..a2210e660c8 100644 --- a/frameworks/core/components_ng/pattern/text/text_styles.h +++ b/frameworks/core/components_ng/pattern/text/text_styles.h @@ -45,10 +45,6 @@ struct TextLineStyle { ACE_DEFINE_PROPERTY_GROUP_ITEM(TextAlign, TextAlign); ACE_DEFINE_PROPERTY_GROUP_ITEM(MaxLength, uint32_t); ACE_DEFINE_PROPERTY_GROUP_ITEM(MaxLines, uint32_t); - void ToJsonValue(std::unique_ptr& json) const - { - json->Put("textAlign", V2::ConvertWrapTextAlignToString(propTextAlign.value_or(TextAlign::START)).c_str()); - } }; TextStyle CreateTextStyleUsingTheme(const std::unique_ptr& fontStyle, diff --git a/frameworks/core/components_ng/pattern/text_field/text_field_layout_property.h b/frameworks/core/components_ng/pattern/text_field/text_field_layout_property.h index 93d07e79295..2a9bd80b785 100644 --- a/frameworks/core/components_ng/pattern/text_field/text_field_layout_property.h +++ b/frameworks/core/components_ng/pattern/text_field/text_field_layout_property.h @@ -96,11 +96,6 @@ public: ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(CopyOptions, CopyOptions, PROPERTY_UPDATE_MEASURE); ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(PreferredLineHeightNeedToUpdate, bool, PROPERTY_UPDATE_MEASURE); - void ToJsonValue(std::unique_ptr& json) const override - { - ACE_PROPERTY_TO_JSON_VALUE(propTextLineStyle_, TextLineStyle); - } - protected: void Clone(RefPtr property) const override { diff --git a/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp b/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp index 275352cfd7f..e2e30905c93 100644 --- a/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp +++ b/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp @@ -1594,40 +1594,40 @@ std::string TextFieldPattern::GetPlaceholderFont() const CHECK_NULL_RETURN(theme, ""); auto jsonValue = JsonUtil::Create(true); if (layoutProperty->GetPlaceholderItalicFontStyle().value_or(Ace::FontStyle::NORMAL) == Ace::FontStyle::NORMAL) { - jsonValue->Put("placeholderItalicFontStyle", "FontStyle.Normal"); + jsonValue->Put("style", "FontStyle.Normal"); } else { - jsonValue->Put("placeholderItalicFontStyle", "FontStyle.Italic"); + jsonValue->Put("style", "FontStyle.Italic"); } // placeholder font size not exist in theme, use normal font size by default - jsonValue->Put("placeholderFontSize", GetFontSize().c_str()); + jsonValue->Put("size", GetFontSize().c_str()); auto weight = layoutProperty->GetPlaceholderFontWeightValue(theme->GetFontWeight()); switch (weight) { case FontWeight::W100: - jsonValue->Put("placeholderFontWeight", "100"); + jsonValue->Put("weight", "100"); break; case FontWeight::W200: - jsonValue->Put("placeholderFontWeight", "200"); + jsonValue->Put("weight", "200"); break; case FontWeight::W300: - jsonValue->Put("placeholderFontWeight", "300"); + jsonValue->Put("weight", "300"); break; case FontWeight::W400: - jsonValue->Put("placeholderFontWeight", "400"); + jsonValue->Put("weight", "400"); break; case FontWeight::W500: - jsonValue->Put("placeholderFontWeight", "500"); + jsonValue->Put("weight", "500"); break; case FontWeight::W600: - jsonValue->Put("placeholderFontWeight", "600"); + jsonValue->Put("weight", "600"); break; case FontWeight::W700: - jsonValue->Put("placeholderFontWeight", "700"); + jsonValue->Put("weight", "700"); break; case FontWeight::W800: - jsonValue->Put("placeholderFontWeight", "800"); + jsonValue->Put("weight", "800"); break; case FontWeight::W900: - jsonValue->Put("placeholderFontWeight", "900"); + jsonValue->Put("weight", "900"); break; default: jsonValue->Put("fontWeight", V2::ConvertWrapFontWeightToStirng(weight).c_str()); @@ -1659,7 +1659,7 @@ std::string TextFieldPattern::GetCaretColor() const { auto theme = GetTheme(); CHECK_NULL_RETURN(theme, ""); - auto paintProperty = GetLayoutProperty(); + auto paintProperty = GetPaintProperty(); CHECK_NULL_RETURN(paintProperty, ""); return paintProperty->GetCursorColorValue(theme->GetCursorColor()).ColorToString(); } @@ -1682,6 +1682,37 @@ std::string TextFieldPattern::GetFontSize() const return layoutProperty->GetFontSizeValue(theme->GetFontSize()).ToString(); } +Ace::FontStyle TextFieldPattern::GetItalicFontStyle() const +{ + auto layoutProperty = GetLayoutProperty(); + CHECK_NULL_RETURN(layoutProperty, Ace::FontStyle::NORMAL); + return layoutProperty->GetItalicFontStyle().value_or(Ace::FontStyle::NORMAL); +} + +FontWeight TextFieldPattern::GetFontWeight() const +{ + auto theme = GetTheme(); + CHECK_NULL_RETURN(theme, FontWeight::NORMAL); + auto layoutProperty = GetLayoutProperty(); + CHECK_NULL_RETURN(layoutProperty, FontWeight::NORMAL); + return layoutProperty->GetFontWeightValue(theme->GetFontWeight()); +} + +std::string TextFieldPattern::GetFontFamily() const +{ + auto layoutProperty = GetLayoutProperty(); + CHECK_NULL_RETURN(layoutProperty, "HarmonyOS Sans"); + auto family = layoutProperty->GetFontFamilyValue({ "HarmonyOS Sans" }); + return ConvertFontFamily(family); +} + +TextAlign TextFieldPattern::GetTextAlign() const +{ + auto layoutProperty = GetLayoutProperty(); + CHECK_NULL_RETURN(layoutProperty, TextAlign::START); + return layoutProperty->GetTextAlign().value_or(TextAlign::START); +} + uint32_t TextFieldPattern::GetMaxLength() const { auto layoutProperty = GetLayoutProperty(); @@ -1704,28 +1735,18 @@ std::string TextFieldPattern::GetInputFilter() const return layoutProperty->GetInputFilterValue(""); } -std::string TextFieldPattern::GetTextAlign() const -{ - auto layoutProperty = GetLayoutProperty(); - CHECK_NULL_RETURN(layoutProperty, "TextAlign::Start"); - switch (layoutProperty->GetTextAlignValue(TextAlign::START)) { - case TextAlign::START: - return "TextAlign.Start"; - case TextAlign::CENTER: - return "TextAlign.Center"; - case TextAlign::END: - return "TextAlign::End"; - default: - return "TextAlign.Start"; - } -} - void TextFieldPattern::ToJsonValue(std::unique_ptr& json) const { - json->Put("placeholder", GetPlaceholderColor().c_str()); + json->Put("placeholder", GetPlaceHolder().c_str()); json->Put("text", textEditingValue_.text.c_str()); json->Put("fontSize", GetFontSize().c_str()); json->Put("fontColor", GetTextColor().c_str()); + json->Put("fontStyle", GetItalicFontStyle() == Ace::FontStyle::NORMAL + ? "FontStyle.Normal" + : "FontStyle.Italic"); + json->Put("fontWeight", V2::ConvertWrapFontWeightToStirng(GetFontWeight()).c_str()); + json->Put("fontFamily", GetFontFamily().c_str()); + json->Put("textAlign", V2::ConvertWrapTextAlignToString(GetTextAlign()).c_str()); json->Put("caretColor", GetCaretColor().c_str()); json->Put("type", TextInputTypeToString().c_str()); json->Put("placeholderColor", GetPlaceholderColor().c_str()); @@ -1734,7 +1755,6 @@ void TextFieldPattern::ToJsonValue(std::unique_ptr& json) const auto maxLength = GetMaxLength(); json->Put("maxLength", GreatOrEqual(maxLength, Infinity()) ? "INF" : std::to_string(maxLength).c_str()); json->Put("inputFilter", GetInputFilter().c_str()); - json->Put("textAlign", GetTextAlign().c_str()); } } // namespace OHOS::Ace::NG \ No newline at end of file diff --git a/frameworks/core/components_ng/pattern/text_field/text_field_pattern.h b/frameworks/core/components_ng/pattern/text_field/text_field_pattern.h index cc2e0315479..3e208480fb1 100644 --- a/frameworks/core/components_ng/pattern/text_field/text_field_pattern.h +++ b/frameworks/core/components_ng/pattern/text_field/text_field_pattern.h @@ -332,10 +332,13 @@ private: std::string GetCaretColor() const; std::string GetPlaceholderColor() const; std::string GetFontSize() const; + Ace::FontStyle GetItalicFontStyle() const; + FontWeight GetFontWeight() const; + std::string GetFontFamily() const; + TextAlign GetTextAlign() const; std::string GetPlaceHolder() const; uint32_t GetMaxLength() const; std::string GetInputFilter() const; - std::string GetTextAlign() const; void Delete(int32_t start, int32_t end); bool OnDirtyLayoutWrapperSwap(const RefPtr& dirty, const DirtySwapConfig& config) override; diff --git a/frameworks/core/components_ng/pattern/toggle/toggle_model_ng.cpp b/frameworks/core/components_ng/pattern/toggle/toggle_model_ng.cpp index 8d05c555121..ebe405ac507 100644 --- a/frameworks/core/components_ng/pattern/toggle/toggle_model_ng.cpp +++ b/frameworks/core/components_ng/pattern/toggle/toggle_model_ng.cpp @@ -111,8 +111,8 @@ void ToggleModelNG::Create(NG::ToggleType toggleType, bool isOn) } if (AceType::InstanceOf(pattern)) { if (toggleType == ToggleType::BUTTON) { - ToggleButtonModelNG::SetIsOn(isOn); stack->Push(childFrameNode); + ToggleButtonModelNG::SetIsOn(isOn); return; } if (toggleType == ToggleType::CHECKBOX) { diff --git a/frameworks/core/components_ng/property/flex_property.h b/frameworks/core/components_ng/property/flex_property.h index 05049e05b96..642517bee4d 100644 --- a/frameworks/core/components_ng/property/flex_property.h +++ b/frameworks/core/components_ng/property/flex_property.h @@ -47,6 +47,7 @@ struct FlexItemProperty { json->Put("flexGrow", propFlexGrow.value_or(0.0)); json->Put("flexShrink", propFlexShrink.value_or(1)); json->Put("alignSelf", ITEM_ALIGN[static_cast(propAlignSelf.value_or(FlexAlign::AUTO))]); + json->Put("displayPriority", propDisplayIndex.value_or(1)); } bool GetTwoHorizontalDirectionAligned() const diff --git a/frameworks/core/components_ng/property/magic_layout_property.h b/frameworks/core/components_ng/property/magic_layout_property.h index fcd9a99527f..1d2462ba729 100644 --- a/frameworks/core/components_ng/property/magic_layout_property.h +++ b/frameworks/core/components_ng/property/magic_layout_property.h @@ -26,13 +26,11 @@ namespace OHOS::Ace::NG { struct MagicItemProperty { ACE_DEFINE_PROPERTY_GROUP_ITEM(LayoutWeight, float); ACE_DEFINE_PROPERTY_GROUP_ITEM(AspectRatio, float); - ACE_DEFINE_PROPERTY_GROUP_ITEM(DisplayPriority, int32_t); void ToJsonValue(std::unique_ptr& json) const { json->Put("layoutWeight", propLayoutWeight.value_or(0)); json->Put("aspectRatio", propAspectRatio.value_or(0.0)); - json->Put("displayPriority", propDisplayPriority.value_or(1)); } }; } // namespace OHOS::Ace::NG -- Gitee