From 1393e271a453984a90c2a6a4271ffb41a7db7d4d Mon Sep 17 00:00:00 2001 From: happy Date: Wed, 20 Aug 2025 17:03:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BB=A3=E7=A0=81=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: happy Change-Id: Ibb7d362c20ba6c1e7266123ab61dc2affadbfad6 --- adapter/ohos/osal/log_wrapper.cpp | 2 +- frameworks/base/error/error_code.h | 2 +- .../theme_manager/src/theme/ArkThemeImpl.ts | 4 ++-- .../src/theme/ArkThemeScopeManager.ts | 10 +++++----- .../declarative_frontend/engine/arkTheme.js | 4 ++-- .../core/components/indexer/indexer_theme.h | 2 +- .../core/components/slider/slider_theme.h | 19 ++++++++++--------- .../render/adapter/rosen_animation_utils.cpp | 1 - .../ui_session/ui_content_service_interface.h | 2 +- interfaces/napi/kits/observer/ui_observer.h | 6 ++++-- .../kits/observer/ui_observer_listener.cpp | 2 +- interfaces/native/native_node_napi.h | 3 ++- interfaces/native/node/node_model.h | 2 +- 13 files changed, 31 insertions(+), 28 deletions(-) diff --git a/adapter/ohos/osal/log_wrapper.cpp b/adapter/ohos/osal/log_wrapper.cpp index 0f4a7d82be1..851044ebac0 100644 --- a/adapter/ohos/osal/log_wrapper.cpp +++ b/adapter/ohos/osal/log_wrapper.cpp @@ -126,8 +126,8 @@ const std::unordered_map g_DOMAIN_CONTENTS_MAP = { { AceLogTag::ACE_SELECT_OVERLAY, "AceSelectOverlay" }, { AceLogTag::ACE_CLIPBOARD, "AceClipBoard" }, { AceLogTag::ACE_SECURITY_COMPONENT, "AceSecurityComponent" }, - { AceLogTag::ACE_LAYOUT_INSPECTOR, "AceLayoutInspector" }, { AceLogTag::ACE_MEDIA_QUERY, "AceMediaQuery" }, + { AceLogTag::ACE_LAYOUT_INSPECTOR, "AceLayoutInspector" }, { AceLogTag::ACE_LAYOUT, "AceLayout" }, { AceLogTag::ACE_STYLUS, "AceStylus" }, { AceLogTag::ACE_BADGE, "AceBadge" }, diff --git a/frameworks/base/error/error_code.h b/frameworks/base/error/error_code.h index fca33362699..7ae23e52c34 100644 --- a/frameworks/base/error/error_code.h +++ b/frameworks/base/error/error_code.h @@ -76,9 +76,9 @@ constexpr int32_t ERROR_CODE_NATIVE_IMPL_NODE_EVENT_NO_RETURN = 106109; constexpr int32_t ERROR_CODE_NATIVE_IMPL_NODE_INDEX_INVALID = 106200; constexpr int32_t ERROR_CODE_NATIVE_IMPL_GET_INFO_FAILED = 106201; constexpr int32_t ERROR_CODE_NATIVE_IMPL_BUFFER_SIZE_ERROR = 106202; -constexpr int32_t ERROR_CODE_NATIVE_IMPL_NOT_MAIN_THREAD = 106301; constexpr int32_t ERROR_CODE_NATIVE_IMPL_NODE_NOT_ON_MAIN_TREE = 106203; constexpr int32_t ERROR_CODE_NATIVE_IMPL_NODE_ON_INVALID_THREAD = 106204; +constexpr int32_t ERROR_CODE_NATIVE_IMPL_NOT_MAIN_THREAD = 106301; constexpr int32_t ERROR_CODE_NATIVE_IMPL_FORCE_DARK_CONFIG_INVALID = 106205; // C-API RenderNode errors diff --git a/frameworks/bridge/declarative_frontend/ark_theme/theme_manager/src/theme/ArkThemeImpl.ts b/frameworks/bridge/declarative_frontend/ark_theme/theme_manager/src/theme/ArkThemeImpl.ts index 7dbd4072cfd..b4ea62daf36 100644 --- a/frameworks/bridge/declarative_frontend/ark_theme/theme_manager/src/theme/ArkThemeImpl.ts +++ b/frameworks/bridge/declarative_frontend/ark_theme/theme_manager/src/theme/ArkThemeImpl.ts @@ -26,13 +26,13 @@ class ArkThemeImpl extends ArkThemeBase { new ArkColorsImpl(undefined, baselineTheme.colors), new ArkColorsImpl(undefined, baselineTheme.darkColors), new ArkShapesImpl(undefined, baselineTheme.shapes), - new ArkTypographyImpl(undefined, baselineTheme.typography)) + new ArkTypographyImpl(undefined, baselineTheme.typography)); return; } super(baselineTheme.id, customTheme, colorMode, new ArkColorsImpl(customTheme.colors, baselineTheme.colors), new ArkColorsImpl(customTheme.darkColors, baselineTheme.darkColors), new ArkShapesImpl(customTheme.shapes, baselineTheme.shapes), - new ArkTypographyImpl(customTheme.typography, baselineTheme.typography)) + new ArkTypographyImpl(customTheme.typography, baselineTheme.typography)); } } \ No newline at end of file diff --git a/frameworks/bridge/declarative_frontend/ark_theme/theme_manager/src/theme/ArkThemeScopeManager.ts b/frameworks/bridge/declarative_frontend/ark_theme/theme_manager/src/theme/ArkThemeScopeManager.ts index 52a45817882..b899249ab63 100644 --- a/frameworks/bridge/declarative_frontend/ark_theme/theme_manager/src/theme/ArkThemeScopeManager.ts +++ b/frameworks/bridge/declarative_frontend/ark_theme/theme_manager/src/theme/ArkThemeScopeManager.ts @@ -238,7 +238,7 @@ class ArkThemeScopeManager { return false; } return true; - }) + }); } /** @@ -372,7 +372,7 @@ class ArkThemeScopeManager { * or previously set Default Theme or System Theme */ getFinalTheme(ownerComponent: ViewPuInternal): Theme { - return ownerComponent.themeScope_?.getTheme() ?? this.defaultTheme ?? ArkThemeScopeManager.SystemTheme; + return ownerComponent.themeScope_?.getTheme() ?? this.defaultTheme ?? ArkThemeScopeManager.SystemTheme; } /** @@ -435,8 +435,8 @@ class ArkThemeScopeManager { if (scope === undefined) { return; } - const theme: Theme = scope?.getTheme() ?? this.defaultTheme ?? ArkThemeScopeManager.SystemTheme - scope.componentsInScope()?.forEach((item) => this.notifyScopeThemeChanged(item, theme, scope.isColorModeChanged())) + const theme: Theme = scope?.getTheme() ?? this.defaultTheme ?? ArkThemeScopeManager.SystemTheme; + scope.componentsInScope()?.forEach((item) => this.notifyScopeThemeChanged(item, theme, scope.isColorModeChanged())); } /** @@ -521,7 +521,7 @@ class ArkThemeScopeManager { this.defaultTheme?.unbindFromScope(0); this.defaultTheme = ArkThemeScopeManager.SystemTheme; const cloneTheme = ArkThemeScopeManager.cloneCustomThemeWithExpand(customTheme); - this.defaultTheme = this.makeTheme(customTheme, ThemeColorMode.SYSTEM); + this.defaultTheme = this.makeTheme(cloneTheme, ThemeColorMode.SYSTEM); // bind new default theme to 0 theme scope this.defaultTheme.bindToScope(0); diff --git a/frameworks/bridge/declarative_frontend/engine/arkTheme.js b/frameworks/bridge/declarative_frontend/engine/arkTheme.js index cd715a9c15a..82dac5e0023 100644 --- a/frameworks/bridge/declarative_frontend/engine/arkTheme.js +++ b/frameworks/bridge/declarative_frontend/engine/arkTheme.js @@ -179,7 +179,7 @@ class ArkThemeCache { } remove(theme) { const index = this.cache.indexOf(theme); - if (index == -1) { + if (index === -1) { return; } this.cache.splice(index, 1); @@ -270,7 +270,7 @@ class ArkThemeBase { } unbindFromScope(themeScopeId) { const index = this.bindedThemeScopesIds.indexOf(themeScopeId); - if (index == -1) { + if (index === -1) { return; } this.scopesCounter--; diff --git a/frameworks/core/components/indexer/indexer_theme.h b/frameworks/core/components/indexer/indexer_theme.h index 707cb7f7770..0709d134669 100644 --- a/frameworks/core/components/indexer/indexer_theme.h +++ b/frameworks/core/components/indexer/indexer_theme.h @@ -299,9 +299,9 @@ private: ParseDimensionAttributes(indexerPattern, theme); ParseTextStyleAttributes(indexerPattern, theme); theme->accessibilityExpand_ = indexerPattern->GetAttr("filter_accessibility_expand", ""); + theme->accessibilityCollapsed_ = indexerPattern->GetAttr("filter_accessibility_expanded", ""); theme->accessibilityExpanded_ = indexerPattern->GetAttr("filter_accessibility_collapse", ""); theme->accessibilityCollapse_ = indexerPattern->GetAttr("filter_accessibility_collapsed", ""); - theme->accessibilityCollapsed_ = indexerPattern->GetAttr("filter_accessibility_expanded", ""); if (Container::GreatOrEqualAPITargetVersion(PlatformVersion::VERSION_TWELVE)) { theme->popupBackgroundColor_ = indexerPattern->GetAttr( "popup_background_color_api_twelve", Color(POPUP_BACKGROUND_COLOR_API_TWELVE)); diff --git a/frameworks/core/components/slider/slider_theme.h b/frameworks/core/components/slider/slider_theme.h index 586ab3d9853..e42fe8c2b26 100644 --- a/frameworks/core/components/slider/slider_theme.h +++ b/frameworks/core/components/slider/slider_theme.h @@ -69,14 +69,14 @@ public: const double defaultMarkColorAplpa = 0.1; theme->trackBgColor_ = pattern->GetAttr("track_bg_color", Color::RED); theme->trackSelectedColor_ = pattern->GetAttr("track_color_selected", Color::RED); - theme->markerColor_ = - pattern->GetAttr("marker_color", Color::RED) + theme->markerColor_ = pattern->GetAttr("marker_color", Color::RED) .BlendOpacity(pattern->GetAttr("marker_color_alpha", defaultMarkColorAplpa)); theme->tipTextColor_ = pattern->GetAttr("tip_text_color", Color::RED); theme->tipColor_ = pattern->GetAttr("tip_color", Color::RED); theme->blockHoverColor_ = pattern->GetAttr("block_color_hovered", Color::RED); theme->blockPressedColor_ = pattern->GetAttr("block_color_pressed", BLOCK_COLOR_PRESSED); - theme->blockOuterEdgeColor_ = pattern->GetAttr("block_outer_edge_color", BLOCK_OUTER_EDGE_COLOR); + theme->blockOuterEdgeColor_ = + pattern->GetAttr("block_outer_edge_color", BLOCK_OUTER_EDGE_COLOR); theme->bubbleToCircleCenterDistance_ = pattern->GetAttr("bubble_to_circle_center_distance", BUBBLE_TO_CIRCLE_CENTER_DISTANCE); theme->measureContentDefaultWidth_ = @@ -85,13 +85,14 @@ public: pattern->GetAttr("outset_hot_block_shadow_width", OUTSET_HOT_BLOCK_SHADOW_WIDTH); theme->insetHotBlockShadowWidth_ = pattern->GetAttr("inset_hot_block_shadow_width", INSET_HOT_BLOCK_SHADOW_WIDTH); - theme->focusSideDistance_ = pattern->GetAttr("focus_side_distance", FOCUS_SIDE_DISTANCE); + theme->focusSideDistance_ = + pattern->GetAttr("focus_side_distance", FOCUS_SIDE_DISTANCE); theme->layoutMaxLength_ = pattern->GetAttr("slider_max_length", .0_vp); theme->hoverAnimationDuration_ = pattern->GetAttr("hover_animation_duration", 0.0); theme->pressAnimationDuration_ = pattern->GetAttr("press_animation_duration", 0.0); theme->moveAnimationDuration_ = pattern->GetAttr("move_animation_duration", 0.0); - theme->disabledAlpha_ = pattern->GetAttr("slider_disable_alpha", 0.0); theme->sliderPPI_ = pattern->GetAttr("slider_pixels_per_inch", DEFAULT_SLIDER_PPI); + theme->disabledAlpha_ = pattern->GetAttr("slider_disable_alpha", 0.0); theme->outsetBlockSize_ = pattern->GetAttr("outset_block_size", 16.0_vp); theme->outsetBlockHotSize_ = pattern->GetAttr("outset_block_hot_region_size", 40.0_vp); theme->blockColor_ = pattern->GetAttr("block_color", Color(0xffffffff)); @@ -279,14 +280,14 @@ public: return moveAnimationDuration_; } - double GetDisabledAlpha() const + double GetSliderPPI() const { - return disabledAlpha_; + return sliderPPI_; } - double GetSliderPPI() const + double GetDisabledAlpha() const { - return sliderPPI_; + return disabledAlpha_; } std::string GetSelectedTxt() const diff --git a/frameworks/core/components_ng/render/adapter/rosen_animation_utils.cpp b/frameworks/core/components_ng/render/adapter/rosen_animation_utils.cpp index f918f3e6e62..87c83ee04e8 100644 --- a/frameworks/core/components_ng/render/adapter/rosen_animation_utils.cpp +++ b/frameworks/core/components_ng/render/adapter/rosen_animation_utils.cpp @@ -147,7 +147,6 @@ CancelAnimationStatus AnimationUtils::CloseImplicitCancelAnimationReturnStatus(c bool AnimationUtils::IsImplicitAnimationOpen(const RefPtr& context) { auto rsUIContext = GetRSUIContext(context); - CHECK_NULL_RETURN(rsUIContext, false); return Rosen::RSNode::IsImplicitAnimationOpen(rsUIContext); } diff --git a/interfaces/inner_api/ui_session/ui_content_service_interface.h b/interfaces/inner_api/ui_session/ui_content_service_interface.h index 64688074907..3c94fbaeaf4 100644 --- a/interfaces/inner_api/ui_session/ui_content_service_interface.h +++ b/interfaces/inner_api/ui_session/ui_content_service_interface.h @@ -55,9 +55,9 @@ public: END_WEB_TRANSLATE, GET_CURRENT_SHOWING_IMAGE, GET_CURRENT_PAGE_NAME, + GET_VISIBLE_TREE, SENDCOMMAND_ASYNC_EVENT, SENDCOMMAND_EVENT, - GET_VISIBLE_TREE, SEND_COMMAND, EXE_APP_AI_FUNCTION, }; diff --git a/interfaces/napi/kits/observer/ui_observer.h b/interfaces/napi/kits/observer/ui_observer.h index d1a5224558c..54fb0855977 100644 --- a/interfaces/napi/kits/observer/ui_observer.h +++ b/interfaces/napi/kits/observer/ui_observer.h @@ -186,8 +186,7 @@ private: static std::unordered_map infosForRouterPage_; static std::unordered_map>> specifiedDensityListeners_; - static std::unordered_map>> specifiedDrawListeners_; - static std::unordered_map>> specifiedLayoutListeners_; + static std::unordered_map>> abilityContextWillClickListeners_; static std::unordered_map>> @@ -217,6 +216,9 @@ private: specifiedAfterPanEndListeners_; static std::unordered_map> specifiedNodeRenderStateListeners_; + + static std::unordered_map>> specifiedDrawListeners_; + static std::unordered_map>> specifiedLayoutListeners_; static std::unordered_map abilityUIContextNavDesSwitchListeners_; static std::unordered_map uiContextNavDesSwitchListeners_; diff --git a/interfaces/napi/kits/observer/ui_observer_listener.cpp b/interfaces/napi/kits/observer/ui_observer_listener.cpp index 536fca61680..d37f2d6cb3d 100644 --- a/interfaces/napi/kits/observer/ui_observer_listener.cpp +++ b/interfaces/napi/kits/observer/ui_observer_listener.cpp @@ -791,8 +791,8 @@ void UIObserverListener::AddGestureEventInfoThree(napi_value objValueEvent, cons napi_set_named_property(env_, objValueEvent, "deviceId", napiDeviceId); napi_create_double(env_, gestureEventInfo.GetTargetDisplayId(), &napiTargetDisplayId); napi_set_named_property(env_, objValueEvent, "targetDisplayId", napiTargetDisplayId); - AddFingerInfosInfo(objValueEvent, gestureEventInfo); AddFingerListInfo(objValueEvent, gestureEventInfo); + AddFingerInfosInfo(objValueEvent, gestureEventInfo); napi_close_handle_scope(env_, scope); } diff --git a/interfaces/native/native_node_napi.h b/interfaces/native/native_node_napi.h index 4075ed953f0..9b06fd8680f 100644 --- a/interfaces/native/native_node_napi.h +++ b/interfaces/native/native_node_napi.h @@ -346,7 +346,8 @@ int32_t OH_ArkUI_PostFrameCallback(ArkUI_ContextHandle uiContext, void* userData void (*callback)(uint64_t nanoTimestamp, uint32_t frameCount, void* userData)); /** - * @brief Register a callback to be executed at the end of the next idle frame.If there is no next frame, will request one automatically. + * @brief Register a callback to be executed at the end of the next idle frame. + If there is no next frame, will request one automatically. * * @param uiContext ArkUI_ContextHandle. * @param userData Indicates the custom data to be saved. diff --git a/interfaces/native/node/node_model.h b/interfaces/native/node/node_model.h index 0ee7d24b3c9..27e556bd12b 100644 --- a/interfaces/native/node/node_model.h +++ b/interfaces/native/node/node_model.h @@ -47,8 +47,8 @@ struct ArkUI_Node { void* alignRuleOption = nullptr; void* userData = nullptr; void* swiperIndicator = nullptr; - void* imageFrameInfos = nullptr; void* drawableDescriptor = nullptr; + void* imageFrameInfos = nullptr; int32_t linearGradientDirection = -1; void* customEventListeners = nullptr; void* altDrawableDescriptor = nullptr; -- Gitee