Signed-off-by: let it rot <gaojiaqi7@huawei.com>
This commit is contained in:
let it rot 2024-10-29 04:00:21 +00:00 committed by Gitee
commit 24cbd3968f
302 changed files with 10059 additions and 2842 deletions

View File

@ -186,7 +186,7 @@ advanced_ui_component/editabletitlebar/ @hanyujia1
advanced_ui_component/exceptionprompt/ @hanyujia1
advanced_ui_component/filter/ @hanyujia1
advanced_ui_component/foldsplitcontainer/ @arkuilayout
advanced_ui_component/formmenu/
advanced_ui_component/formmenu/
advanced_ui_component/fullscreenlaunchcomponent/ @arkuiabilitygroup
advanced_ui_component/gridobjectsortcomponent/ @hanyujia1
advanced_ui_component/interstitialdialogaction/ @giteewzp
@ -203,9 +203,9 @@ advanced_ui_component/toolbar/ @hanyujia1
advanced_ui_component/treeview/ @hanyujia1
[Extend UI Components]
component_ext/arc_swiper/
component_ext/arc_swiper/
component_ext/BUILD.gn @arkui_architecture
component_ext/ext_common/
component_ext/ext_common/
component_ext/movingphoto/ @hanyujia1
[Examples]
@ -281,7 +281,7 @@ frameworks/base/window/foldable_window.h @arkuipopupwindow
[Frameworks Bridge]
frameworks/bridge/BUILD.gn @arkui_architecture
frameworks/bridge/card_frontend/ @arkuiframework
frameworks/bridge/cj_frontend/
frameworks/bridge/cj_frontend/
frameworks/bridge/codec/ @arkuiframework
frameworks/bridge/common/accessibility/ @arkuiabilitygroup
frameworks/bridge/common/BUILD.gn @arkui_architecture
@ -525,7 +525,7 @@ frameworks/bridge/declarative_frontend/ark_component/src/ArkNavigation.ts @arkui
frameworks/bridge/declarative_frontend/ark_component/src/ArkNavigator.ts @arkui_superman
frameworks/bridge/declarative_frontend/ark_component/src/ArkNavRouter.ts @arkui_superman
frameworks/bridge/declarative_frontend/ark_component/src/ArkPanel.ts @arkui_superman
frameworks/bridge/declarative_frontend/ark_component/src/ArkParticle.ts @arkuiframework
frameworks/bridge/declarative_frontend/ark_component/src/ArkParticle.ts @arkui_superman
frameworks/bridge/declarative_frontend/ark_component/src/ArkPath.ts @arkuilayout
frameworks/bridge/declarative_frontend/ark_component/src/ArkPatternLock.ts @arkui_image
frameworks/bridge/declarative_frontend/ark_component/src/ArkPluginComponent.ts @arkuilayout
@ -660,7 +660,7 @@ frameworks/bridge/declarative_frontend/ark_modifier/tsconfig.json @arkui_archite
frameworks/bridge/declarative_frontend/ark_mock/ @arkuiframework
frameworks/bridge/declarative_frontend/ark_node/ @arkuiframework
frameworks/bridge/declarative_frontend/ark_prefetcher/ @arkuistatemgmt
frameworks/bridge/declarative_frontend/ark_shape/ @arkuiframework
frameworks/bridge/declarative_frontend/ark_shape/ @arkui_superman
frameworks/bridge/declarative_frontend/ark_theme/ @hanyujia1
frameworks/bridge/declarative_frontend/BUILD.gn @arkui_architecture
frameworks/bridge/declarative_frontend/declarative_frontend.cpp @arkuiframework
@ -677,8 +677,8 @@ frameworks/bridge/declarative_frontend/engine/bindings_implementation.inl @arkui
frameworks/bridge/declarative_frontend/engine/bindings.inl @arkuistatemgmt
frameworks/bridge/declarative_frontend/engine/declarative_engine_loader.cpp @arkuiframework
frameworks/bridge/declarative_frontend/engine/declarative_engine_loader.h @arkuiframework
frameworks/bridge/declarative_frontend/engine/functions/js_animator_function.cpp @arkuiframework
frameworks/bridge/declarative_frontend/engine/functions/js_animator_function.h @arkuiframework
frameworks/bridge/declarative_frontend/engine/functions/js_animator_function.cpp @arkui_superman
frameworks/bridge/declarative_frontend/engine/functions/js_animator_function.h @arkui_superman
frameworks/bridge/declarative_frontend/engine/functions/js_click_function.cpp @arkuievent
frameworks/bridge/declarative_frontend/engine/functions/js_click_function.h @arkuievent
frameworks/bridge/declarative_frontend/engine/functions/js_clipboard_function.cpp @huawei_g_five
@ -730,8 +730,8 @@ frameworks/bridge/declarative_frontend/engine/jsEnumStyle.js
frameworks/bridge/declarative_frontend/engine/js_execution_scope_defines.h @arkuistatemgmt
frameworks/bridge/declarative_frontend/engine/jsi/BUILD.gn @arkui_architecture
frameworks/bridge/declarative_frontend/engine/jsi/js_converter.cpp @arkuistatemgmt
frameworks/bridge/declarative_frontend/engine/jsi/jsi_animator_model_ng_build_impl.cpp @arkuiframework
frameworks/bridge/declarative_frontend/engine/jsi/jsi_animator_model_ng_impl.cpp @arkuiframework
frameworks/bridge/declarative_frontend/engine/jsi/jsi_animator_model_ng_build_impl.cpp @arkui_superman
frameworks/bridge/declarative_frontend/engine/jsi/jsi_animator_model_ng_impl.cpp @arkui_superman
frameworks/bridge/declarative_frontend/engine/jsi/jsi_bindings.h @arkuistatemgmt
frameworks/bridge/declarative_frontend/engine/jsi/jsi_bindings.inl @arkuistatemgmt
frameworks/bridge/declarative_frontend/engine/jsi/jsi_declarative_engine.cpp @arkuiframework
@ -759,10 +759,10 @@ frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_app_module.cpp @ar
frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_app_module.h @arkuiframework
frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_context_module.cpp @arkuiframework
frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_context_module.h @arkuiframework
frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_curves_module.cpp @arkuiframework
frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_curves_module.h @arkuiframework
frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_matrix4_module.cpp @arkuiframework
frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_matrix4_module.h @arkuiframework
frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_curves_module.cpp @arkui_superman
frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_curves_module.h @arkui_superman
frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_matrix4_module.cpp @arkui_superman
frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_matrix4_module.h @arkui_superman
frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_module_manager.cpp @arkuiframework
frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_module_manager.h @arkuiframework
frameworks/bridge/declarative_frontend/engine/jsi/modules/jsi_router_module.cpp @arkui_superman
@ -863,8 +863,8 @@ frameworks/bridge/declarative_frontend/engine/jsi/nativeModule/arkts_native_node
frameworks/bridge/declarative_frontend/engine/jsi/nativeModule/arkts_native_node_container_bridge.h @arkuiframework
frameworks/bridge/declarative_frontend/engine/jsi/nativeModule/arkts_native_panel_bridge.cpp @arkui_superman
frameworks/bridge/declarative_frontend/engine/jsi/nativeModule/arkts_native_panel_bridge.h @arkui_superman
frameworks/bridge/declarative_frontend/engine/jsi/nativeModule/arkts_native_particle_bridge.cpp @arkuiframework
frameworks/bridge/declarative_frontend/engine/jsi/nativeModule/arkts_native_particle_bridge.h @arkuiframework
frameworks/bridge/declarative_frontend/engine/jsi/nativeModule/arkts_native_particle_bridge.cpp @arkui_superman
frameworks/bridge/declarative_frontend/engine/jsi/nativeModule/arkts_native_particle_bridge.h @arkui_superman
frameworks/bridge/declarative_frontend/engine/jsi/nativeModule/arkts_native_path_bridge.cpp @arkuilayout
frameworks/bridge/declarative_frontend/engine/jsi/nativeModule/arkts_native_path_bridge.h @arkuilayout
frameworks/bridge/declarative_frontend/engine/jsi/nativeModule/arkts_native_pattern_lock_bridge.cpp @arkui_image
@ -983,8 +983,8 @@ frameworks/bridge/declarative_frontend/jsview/js_ability_component_controller.h
frameworks/bridge/declarative_frontend/jsview/js_ability_component.cpp @arkuilayout
frameworks/bridge/declarative_frontend/jsview/js_ability_component.h @arkuilayout
frameworks/bridge/declarative_frontend/jsview/js_animatable_arithmetic.h @arkuiframework
frameworks/bridge/declarative_frontend/jsview/js_animator.cpp @arkuiframework
frameworks/bridge/declarative_frontend/jsview/js_animator.h @arkuiframework
frameworks/bridge/declarative_frontend/jsview/js_animator.cpp @arkui_superman
frameworks/bridge/declarative_frontend/jsview/js_animator.h @arkui_superman
frameworks/bridge/declarative_frontend/jsview/js_badge.cpp @arkui_image
frameworks/bridge/declarative_frontend/jsview/js_badge.h @arkui_image
frameworks/bridge/declarative_frontend/jsview/js_base_node.cpp @arkuiframework
@ -1154,8 +1154,8 @@ frameworks/bridge/declarative_frontend/jsview/js_page_transition.cpp @arkui_supe
frameworks/bridge/declarative_frontend/jsview/js_page_transition.h @arkui_superman
frameworks/bridge/declarative_frontend/jsview/js_pan_handler.cpp @arkuievent
frameworks/bridge/declarative_frontend/jsview/js_pan_handler.h @arkuievent
frameworks/bridge/declarative_frontend/jsview/js_particle.cpp @arkuiframework
frameworks/bridge/declarative_frontend/jsview/js_particle.h @arkuiframework
frameworks/bridge/declarative_frontend/jsview/js_particle.cpp @arkui_superman
frameworks/bridge/declarative_frontend/jsview/js_particle.h @arkui_superman
frameworks/bridge/declarative_frontend/jsview/js_paste_button.cpp @harylee
frameworks/bridge/declarative_frontend/jsview/js_paste_button.h @harylee
frameworks/bridge/declarative_frontend/jsview/js_path.cpp @arkuilayout
@ -1297,8 +1297,8 @@ frameworks/bridge/declarative_frontend/jsview/js_view_abstract.cpp @arkuievent
frameworks/bridge/declarative_frontend/jsview/js_view_abstract.h @arkuievent
frameworks/bridge/declarative_frontend/jsview/js_view_common_def.h @arkuievent
frameworks/bridge/declarative_frontend/jsview/js_view_common_def.inl @arkuievent
frameworks/bridge/declarative_frontend/jsview/js_view_context.cpp @arkuiframework
frameworks/bridge/declarative_frontend/jsview/js_view_context.h @arkuiframework
frameworks/bridge/declarative_frontend/jsview/js_view_context.cpp @arkui_superman
frameworks/bridge/declarative_frontend/jsview/js_view_context.h @arkui_superman
frameworks/bridge/declarative_frontend/jsview/js_view.cpp @arkuistatemgmt
frameworks/bridge/declarative_frontend/jsview/js_view_functions.cpp @arkuistatemgmt
frameworks/bridge/declarative_frontend/jsview/js_view_functions.h @arkuistatemgmt
@ -1329,8 +1329,8 @@ frameworks/bridge/declarative_frontend/jsview/models/action_sheet_model_impl.cpp
frameworks/bridge/declarative_frontend/jsview/models/action_sheet_model_impl.h @arkuipopupwindow
frameworks/bridge/declarative_frontend/jsview/models/alert_dialog_model_impl.cpp @arkuipopupwindow
frameworks/bridge/declarative_frontend/jsview/models/alert_dialog_model_impl.h @arkuipopupwindow
frameworks/bridge/declarative_frontend/jsview/models/animator_model_impl.cpp @arkuiframework
frameworks/bridge/declarative_frontend/jsview/models/animator_model_impl.h @arkuiframework
frameworks/bridge/declarative_frontend/jsview/models/animator_model_impl.cpp @arkui_superman
frameworks/bridge/declarative_frontend/jsview/models/animator_model_impl.h @arkui_superman
frameworks/bridge/declarative_frontend/jsview/models/badge_model_impl.cpp @arkui_image
frameworks/bridge/declarative_frontend/jsview/models/badge_model_impl.h @arkui_image
frameworks/bridge/declarative_frontend/jsview/models/blank_model_impl.cpp @arkuilayout
@ -1506,8 +1506,8 @@ frameworks/bridge/declarative_frontend/jsview/models/video_model_impl.cpp @arkui
frameworks/bridge/declarative_frontend/jsview/models/video_model_impl.h @arkuilayout
frameworks/bridge/declarative_frontend/jsview/models/view_abstract_model_impl.cpp @arkuievent
frameworks/bridge/declarative_frontend/jsview/models/view_abstract_model_impl.h @arkuievent
frameworks/bridge/declarative_frontend/jsview/models/view_context_model_impl.cpp @arkuiframework
frameworks/bridge/declarative_frontend/jsview/models/view_context_model_impl.h @arkuiframework
frameworks/bridge/declarative_frontend/jsview/models/view_context_model_impl.cpp @arkui_superman
frameworks/bridge/declarative_frontend/jsview/models/view_context_model_impl.h @arkui_superman
frameworks/bridge/declarative_frontend/jsview/models/view_full_update_model_impl.cpp @arkuistatemgmt
frameworks/bridge/declarative_frontend/jsview/models/view_full_update_model_impl.h @arkuistatemgmt
frameworks/bridge/declarative_frontend/jsview/models/view_partial_update_model_impl.cpp @arkuistatemgmt
@ -1522,7 +1522,7 @@ frameworks/bridge/declarative_frontend/jsview/models/web_model_impl.h @arkwebina
frameworks/bridge/declarative_frontend/jsview/models/xcomponent_model_impl.cpp @arkuilayout
frameworks/bridge/declarative_frontend/jsview/models/xcomponent_model_impl.h @arkuilayout
frameworks/bridge/declarative_frontend/jsview/scroll_bar/ @arkuiscroll
frameworks/bridge/declarative_frontend/jsview/window_scene/
frameworks/bridge/declarative_frontend/jsview/window_scene/
frameworks/bridge/declarative_frontend/ng/declarative_frontend_ng.cpp @arkuiframework
frameworks/bridge/declarative_frontend/ng/declarative_frontend_ng.h @arkuiframework
frameworks/bridge/declarative_frontend/ng/entry_page_info.h @arkui_superman
@ -1539,8 +1539,8 @@ frameworks/bridge/declarative_frontend/view_stack_processor.cpp @arkuistatemgmt
frameworks/bridge/declarative_frontend/view_stack_processor.h @arkuistatemgmt
frameworks/bridge/js_frontend/BUILD.gn @arkui_architecture
frameworks/bridge/js_frontend/engine/BUILD.gn @arkui_architecture
frameworks/bridge/js_frontend/engine/common/base_animation_bridge.cpp @arkuiframework
frameworks/bridge/js_frontend/engine/common/base_animation_bridge.h @arkuiframework
frameworks/bridge/js_frontend/engine/common/base_animation_bridge.cpp @arkui_superman
frameworks/bridge/js_frontend/engine/common/base_animation_bridge.h @arkui_superman
frameworks/bridge/js_frontend/engine/common/base_canvas_bridge.h @arkuilayout
frameworks/bridge/js_frontend/engine/common/base_xcomponent_bridge.h @arkuilayout
frameworks/bridge/js_frontend/engine/common/group_js_bridge.h @arkuiframework
@ -1558,10 +1558,10 @@ frameworks/bridge/js_frontend/engine/jsi/ark_js_runtime.h @arkuiframework
frameworks/bridge/js_frontend/engine/jsi/ark_js_value.cpp @arkuiframework
frameworks/bridge/js_frontend/engine/jsi/ark_js_value.h @arkuiframework
frameworks/bridge/js_frontend/engine/jsi/BUILD.gn @arkuiframework
frameworks/bridge/js_frontend/engine/jsi/jsi_animation_bridge.cpp @arkuiframework
frameworks/bridge/js_frontend/engine/jsi/jsi_animation_bridge.h @arkuiframework
frameworks/bridge/js_frontend/engine/jsi/jsi_animator_bridge.cpp @arkuiframework
frameworks/bridge/js_frontend/engine/jsi/jsi_animator_bridge.h @arkuiframework
frameworks/bridge/js_frontend/engine/jsi/jsi_animation_bridge.cpp @arkui_superman
frameworks/bridge/js_frontend/engine/jsi/jsi_animation_bridge.h @arkui_superman
frameworks/bridge/js_frontend/engine/jsi/jsi_animator_bridge.cpp @arkui_superman
frameworks/bridge/js_frontend/engine/jsi/jsi_animator_bridge.h @arkui_superman
frameworks/bridge/js_frontend/engine/jsi/jsi_badge_bridge.cpp @arkui_image
frameworks/bridge/js_frontend/engine/jsi/jsi_badge_bridge.h @arkui_image
frameworks/bridge/js_frontend/engine/jsi/jsi_base_utils.cpp @arkuiframework
@ -1580,8 +1580,8 @@ frameworks/bridge/js_frontend/engine/jsi/jsi_engine_loader.cpp @arkuiframework
frameworks/bridge/js_frontend/engine/jsi/jsi_engine_loader.h @arkuiframework
frameworks/bridge/js_frontend/engine/jsi/jsi_group_js_bridge.cpp @arkuiframework
frameworks/bridge/js_frontend/engine/jsi/jsi_group_js_bridge.h @arkuiframework
frameworks/bridge/js_frontend/engine/jsi/jsi_image_animator_bridge.cpp @arkuiframework
frameworks/bridge/js_frontend/engine/jsi/jsi_image_animator_bridge.h @arkuiframework
frameworks/bridge/js_frontend/engine/jsi/jsi_image_animator_bridge.cpp @arkui_superman
frameworks/bridge/js_frontend/engine/jsi/jsi_image_animator_bridge.h @arkui_superman
frameworks/bridge/js_frontend/engine/jsi/jsi_input_bridge.cpp @huawei_g_five
frameworks/bridge/js_frontend/engine/jsi/jsi_input_bridge.h @huawei_g_five
frameworks/bridge/js_frontend/engine/jsi/jsi_list_bridge.cpp @arkuiscroll
@ -1719,8 +1719,8 @@ frameworks/core/accessibility/js_inspector/inspect_toolbar_item.cpp
frameworks/core/accessibility/js_inspector/inspect_toolbar_item.h
frameworks/core/accessibility/js_inspector/inspect_video.cpp @arkuilayout
frameworks/core/accessibility/js_inspector/inspect_video.h @arkuilayout
frameworks/core/animation/ @arkuiframework
frameworks/core/animation/test/ @arkuiframework
frameworks/core/animation/ @arkui_superman
frameworks/core/animation/test/ @arkui_superman
frameworks/core/BUILD.gn @arkui_architecture
frameworks/core/common/ace_application_info.cpp @arkuiframework
frameworks/core/common/ace_application_info.h @arkuiframework
@ -1887,12 +1887,12 @@ frameworks/core/components/common/properties/border_image.cpp @arkui_image
frameworks/core/components/common/properties/border_image_edge.cpp @arkui_image
frameworks/core/components/common/properties/border_image_edge.h @arkui_image
frameworks/core/components/common/properties/border_image.h @arkui_image
frameworks/core/components/common/properties/clip_path.cpp @arkuiframework
frameworks/core/components/common/properties/clip_path.h @arkuiframework
frameworks/core/components/common/properties/color.cpp @arkuiframework
frameworks/core/components/common/properties/color_factory.cpp @arkuiframework
frameworks/core/components/common/properties/color_factory.h @arkuiframework
frameworks/core/components/common/properties/color.h @arkuiframework
frameworks/core/components/common/properties/clip_path.cpp @arkui_superman
frameworks/core/components/common/properties/clip_path.h @arkui_superman
frameworks/core/components/common/properties/color.cpp @arkui_superman
frameworks/core/components/common/properties/color_factory.cpp @arkui_superman
frameworks/core/components/common/properties/color_factory.h @arkui_superman
frameworks/core/components/common/properties/color.h @arkui_superman
frameworks/core/components/common/properties/common_decoration.h @arkuievent
frameworks/core/components/common/properties/decoration.cpp @arkuievent
frameworks/core/components/common/properties/decoration.h @arkuievent
@ -1914,11 +1914,11 @@ frameworks/core/components/common/properties/progress_data.h @arkui_image
frameworks/core/components/common/properties/radius.h @arkuilayout
frameworks/core/components/common/properties/scroll_bar.cpp @arkuiscroll
frameworks/core/components/common/properties/scroll_bar.h @arkuiscroll
frameworks/core/components/common/properties/shadow_config.cpp @arkuiframework
frameworks/core/components/common/properties/shadow_config.h @arkuiframework
frameworks/core/components/common/properties/shadow.cpp @arkuiframework
frameworks/core/components/common/properties/shadow.h @arkuiframework
frameworks/core/components/common/properties/shared_transition_option.h @arkuiframework
frameworks/core/components/common/properties/shadow_config.cpp @arkui_superman
frameworks/core/components/common/properties/shadow_config.h @arkui_superman
frameworks/core/components/common/properties/shadow.cpp @arkui_superman
frameworks/core/components/common/properties/shadow.h @arkui_superman
frameworks/core/components/common/properties/shared_transition_option.h @arkui_superman
frameworks/core/components/common/properties/state_attributes.h @arkuiframework
frameworks/core/components/common/properties/svg_paint_state.h @arkui_image
frameworks/core/components/common/properties/swiper_indicator.h @arkuiscroll
@ -1929,7 +1929,7 @@ frameworks/core/components/common/properties/text_style.h @huawei_g_five
frameworks/core/components/common/properties/text_style_parser.cpp @huawei_g_five
frameworks/core/components/common/properties/text_style_parser.h @huawei_g_five
frameworks/core/components/common/properties/tween_option.h @arkuiframework
frameworks/core/components/common/rotation/ @arkuiframework
frameworks/core/components/common/rotation/ @arkui_superman
frameworks/core/components/components.gni @arkui_architecture
frameworks/core/components/container_modal/ @arkuievent
frameworks/core/components/counter/ @arkui_image
@ -1964,7 +1964,7 @@ frameworks/core/components/dialog_tween/ @arkuipopupwindow
frameworks/core/components/display/ @arkuievent
frameworks/core/components/divider/ @arkuilayout
frameworks/core/components/drag_bar/ @arkuipopupwindow
frameworks/core/components/drop_filter/
frameworks/core/components/drop_filter/
frameworks/core/components/flex/ @arkuilayout
frameworks/core/components/focusable/ @arkuievent
frameworks/core/components/focus_animation/ @arkuievent
@ -2004,10 +2004,10 @@ frameworks/core/components/qrcode/ @arkui_image
frameworks/core/components/rating/ @arkuipopupwindow
frameworks/core/components/refresh/ @arkuiscroll
frameworks/core/components/relative_container/ @arkuilayout
frameworks/core/components/remote_window/
frameworks/core/components/remote_window/
frameworks/core/components/rich_text/ @arkwebinarkuireview
frameworks/core/components/root/ @arkuievent
frameworks/core/components/scene_viewer/
frameworks/core/components/scene_viewer/
frameworks/core/components/scoring/ @arkuiframework
frameworks/core/components/scroll_bar/ @arkuiscroll
frameworks/core/components/scroll/ @arkuiscroll
@ -2015,9 +2015,9 @@ frameworks/core/components/search/ @huawei_g_five
frameworks/core/components/select_popup/ @arkuipopupwindow
frameworks/core/components/select/ @arkuipopupwindow
frameworks/core/components/semi_modal/ @arkui_superman
frameworks/core/components/shadow/ @arkuiframework
frameworks/core/components/shadow/ @arkui_superman
frameworks/core/components/shape/ @arkuilayout
frameworks/core/components/shared_transition/ @arkuiframework
frameworks/core/components/shared_transition/ @arkui_superman
frameworks/core/components/sheet/ @arkui_superman
frameworks/core/components/side_bar/ @arkui_superman
frameworks/core/components/slider/ @arkuipopupwindow
@ -2039,16 +2039,16 @@ frameworks/core/components/theme/ @arkuiframework
frameworks/core/components/tip/ @arkuipopupwindow
frameworks/core/components/toast/ @arkuipopupwindow
frameworks/core/components/toggle/ @arkuipopupwindow
frameworks/core/components/tool_bar/
frameworks/core/components/tool_bar/
frameworks/core/components/touch_listener/ @arkuievent
frameworks/core/components/track/ @arkuipopupwindow
frameworks/core/components/transform/ @arkuiframework
frameworks/core/components/transition/ @arkuiframework
frameworks/core/components/transform/ @arkui_superman
frameworks/core/components/transition/ @arkui_superman
frameworks/core/components/triangle/ @arkuipopupwindow
frameworks/core/components/tween/ @arkuiframework
frameworks/core/components/video/ @arkuilayout
frameworks/core/components/watch_slider/ @arkuipopupwindow
frameworks/core/components/web/ @arkwebinarkuireview
frameworks/core/components/web/ @arkwebinarkuireview
frameworks/core/components/wrap/ @arkuilayout
frameworks/core/components/xcomponent/ @arkuilayout
frameworks/core/components_v2/ability_component/ @arkuilayout
@ -2249,7 +2249,7 @@ frameworks/core/pipeline/pipeline_context.h @arkuiframework
frameworks/core/text/ @huawei_g_five
[Frameworks Core NG Abilities]
frameworks/core/components_ng/animation/ @arkuiframework
frameworks/core/components_ng/animation/ @arkui_superman
frameworks/core/components_ng/base/BUILD.gn @arkuiframework
frameworks/core/components_ng/base/common_configuration.h @arkuiframework
frameworks/core/components_ng/base/distributed_ui.cpp @arkuiframework
@ -2317,7 +2317,7 @@ frameworks/core/components_ng/manager/select_overlay/ @huawei_g_five
frameworks/core/components_ng/manager/shared_overlay/ @arkuiframework
frameworks/core/components_ng/pattern/ability_component/ @arkuilayout
frameworks/core/components_ng/pattern/action_sheet/ @arkuipopupwindow
frameworks/core/components_ng/pattern/animator/ @arkuiframework
frameworks/core/components_ng/pattern/animator/ @arkui_superman
frameworks/core/components_ng/pattern/app_bar/ @arkuievent
frameworks/core/components_ng/pattern/badge/ @arkui_image
frameworks/core/components_ng/pattern/blank/ @arkuilayout
@ -2337,7 +2337,7 @@ frameworks/core/components_ng/pattern/custom_frame_node/ @arkuiframework
frameworks/core/components_ng/pattern/data_panel/ @arkui_image
frameworks/core/components_ng/pattern/dialog/ @arkuipopupwindow
frameworks/core/components_ng/pattern/divider/ @arkuilayout
frameworks/core/components_ng/pattern/effect_component/
frameworks/core/components_ng/pattern/effect_component/
frameworks/core/components_ng/pattern/flex/ @arkuilayout
frameworks/core/components_ng/pattern/folder_stack/ @arkuilayout
frameworks/core/components_ng/pattern/form/ @arondave
@ -2359,7 +2359,7 @@ frameworks/core/components_ng/pattern/list/ @arkuiscroll
frameworks/core/components_ng/pattern/loading_progress/ @arkui_image
frameworks/core/components_ng/pattern/marquee/ @huawei_g_five
frameworks/core/components_ng/pattern/menu/ @arkuipopupwindow
frameworks/core/components_ng/pattern/model/
frameworks/core/components_ng/pattern/model/
frameworks/core/components_ng/pattern/navigation/ @arkui_superman
frameworks/core/components_ng/pattern/navigator/ @arkui_superman
frameworks/core/components_ng/pattern/navrouter/ @arkui_superman
@ -2400,7 +2400,7 @@ frameworks/core/components_ng/pattern/overlay/sheet_wrapper_layout_algorithm.h @
frameworks/core/components_ng/pattern/overlay/sheet_wrapper_layout_algorithm.cpp @arkui_superman
frameworks/core/components_ng/pattern/overlay/sheet_wrapper_pattern.h @arkui_superman
frameworks/core/components_ng/pattern/panel/ @arkui_superman
frameworks/core/components_ng/pattern/particle/ @arkuiframework
frameworks/core/components_ng/pattern/particle/ @arkui_superman
frameworks/core/components_ng/pattern/pattern.h @arkui_architecture
frameworks/core/components_ng/pattern/patternlock/ @arkui_image
frameworks/core/components_ng/pattern/picker/ @arkuipopupwindow
@ -2410,10 +2410,10 @@ frameworks/core/components_ng/pattern/progress/ @arkui_image
frameworks/core/components_ng/pattern/qrcode/ @arkui_image
frameworks/core/components_ng/pattern/radio/ @arkuipopupwindow
frameworks/core/components_ng/pattern/rating/ @arkuipopupwindow
frameworks/core/components_ng/pattern/recycle_view/
frameworks/core/components_ng/pattern/recycle_view/
frameworks/core/components_ng/pattern/refresh/ @arkuiscroll
frameworks/core/components_ng/pattern/relative_container/ @arkuilayout
frameworks/core/components_ng/pattern/remote_window/
frameworks/core/components_ng/pattern/remote_window/
frameworks/core/components_ng/pattern/render_node/ @arkuiframework
frameworks/core/components_ng/pattern/rich_editor/ @zhuweifeng94
frameworks/core/components_ng/pattern/rich_editor_drag/ @zhuweifeng94
@ -2452,7 +2452,7 @@ frameworks/core/components_ng/pattern/video/ @arkuilayout
frameworks/core/components_ng/pattern/view_context/ @arkuiframework
frameworks/core/components_ng/pattern/waterflow/ @arkuiscroll
frameworks/core/components_ng/pattern/web/ @arkwebinarkuireview
frameworks/core/components_ng/pattern/window_scene/
frameworks/core/components_ng/pattern/window_scene/
frameworks/core/components_ng/pattern/xcomponent/ @arkuilayout
frameworks/core/components_ng/svg/ @arkui_image
frameworks/core/components_ng/syntax/ @arkuistatemgmt
@ -2468,8 +2468,8 @@ frameworks/core/components_ng/property/constraint_flags.cpp @arkuilayout
frameworks/core/components_ng/property/constraint_flags.h @arkuilayout
frameworks/core/components_ng/property/flex_property.h @arkuilayout
frameworks/core/components_ng/property/geometry_property.h @arkuievent
frameworks/core/components_ng/property/gradient_property.cpp @arkuiframework
frameworks/core/components_ng/property/gradient_property.h @arkuiframework
frameworks/core/components_ng/property/gradient_property.cpp @arkui_superman
frameworks/core/components_ng/property/gradient_property.h @arkui_superman
frameworks/core/components_ng/property/grid_property.cpp @arkuilayout
frameworks/core/components_ng/property/grid_property.h @arkuilayout
frameworks/core/components_ng/property/layout_constraint.h @arkuilayout
@ -2480,25 +2480,25 @@ frameworks/core/components_ng/property/measure_utils.cpp @arkuilayout
frameworks/core/components_ng/property/measure_utils.h @arkuilayout
frameworks/core/components_ng/property/menu_property.h @arkuipopupwindow
frameworks/core/components_ng/property/overlay_property.h @arkuipopupwindow
frameworks/core/components_ng/property/particle_property_animation.h @arkuiframework
frameworks/core/components_ng/property/particle_property.h @arkuiframework
frameworks/core/components_ng/property/position_property.h @arkuiframework
frameworks/core/components_ng/property/progress_mask_property.h @arkuiframework
frameworks/core/components_ng/property/particle_property_animation.h @aarkui_superman
frameworks/core/components_ng/property/particle_property.h @aarkui_superman
frameworks/core/components_ng/property/position_property.h @arkui_superman
frameworks/core/components_ng/property/progress_mask_property.h @arkui_superman
frameworks/core/components_ng/property/property.cpp @arkuievent
frameworks/core/components_ng/property/property.h @arkuievent
frameworks/core/components_ng/property/safe_area_insets.cpp @arkuilayout
frameworks/core/components_ng/property/safe_area_insets.h @arkuilayout
frameworks/core/components_ng/property/templates_parser.cpp @arkuievent
frameworks/core/components_ng/property/templates_parser.h @arkuievent
frameworks/core/components_ng/property/transition_property.h @arkuiframework
frameworks/core/components_ng/render/adapter/animated_image.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/animated_image.h @arkuiframework
frameworks/core/components_ng/property/transition_property.h @arkui_superman
frameworks/core/components_ng/render/adapter/animated_image.cpp @arkui_image
frameworks/core/components_ng/render/adapter/animated_image.h @arkui_image
frameworks/core/components_ng/render/adapter/background_modifier.h @arkuievent
frameworks/core/components_ng/render/adapter/border_image_modifier.h @arkui_image
frameworks/core/components_ng/render/adapter/component_snapshot.cpp @arkuievent
frameworks/core/components_ng/render/adapter/component_snapshot.h @arkuievent
frameworks/core/components_ng/render/adapter/debug_boundary_modifier.h @arkuilayout
frameworks/core/components_ng/render/adapter/fake_animation_utils.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/fake_animation_utils.cpp @arkui_superman
frameworks/core/components_ng/render/adapter/fake_modifier_adapter.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/focus_animation_modifier.cpp @arkuievent
frameworks/core/components_ng/render/adapter/focus_animation_modifier.h @arkuievent
@ -2507,21 +2507,21 @@ frameworks/core/components_ng/render/adapter/focus_state_modifier.cpp @arkuieven
frameworks/core/components_ng/render/adapter/focus_state_modifier.h @arkuievent
frameworks/core/components_ng/render/adapter/form_render_window.cpp @arondave
frameworks/core/components_ng/render/adapter/form_render_window.h @arondave
frameworks/core/components_ng/render/adapter/gradient_style_modifier.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/gradient_style_modifier.h @arkuiframework
frameworks/core/components_ng/render/adapter/graphic_modifier.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/graphic_modifier.h @arkuiframework
frameworks/core/components_ng/render/adapter/gradient_style_modifier.cpp @arkui_superman
frameworks/core/components_ng/render/adapter/gradient_style_modifier.h @arkui_superman
frameworks/core/components_ng/render/adapter/graphic_modifier.cpp @arkui_superman
frameworks/core/components_ng/render/adapter/graphic_modifier.h @arkui_superman
frameworks/core/components_ng/render/adapter/image_painter_utils.cpp @arkui_image
frameworks/core/components_ng/render/adapter/image_painter_utils.h @arkui_image
frameworks/core/components_ng/render/adapter/matrix2d.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/matrix2d.h @arkuiframework
frameworks/core/components_ng/render/adapter/matrix2d.cpp @arkui_superman
frameworks/core/components_ng/render/adapter/matrix2d.h @arkui_superman
frameworks/core/components_ng/render/adapter/media_player_impl.cpp @arkuilayout
frameworks/core/components_ng/render/adapter/media_player_impl.h @arkuilayout
frameworks/core/components_ng/render/adapter/moon_progress_modifier.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/moon_progress_modifier.h @arkuiframework
frameworks/core/components_ng/render/adapter/moon_progress_modifier.cpp @arkui_superman
frameworks/core/components_ng/render/adapter/moon_progress_modifier.h @arkui_superman
frameworks/core/components_ng/render/adapter/mouse_select_modifier.h @arkuievent
frameworks/core/components_ng/render/adapter/overlay_modifier.h @arkuievent
frameworks/core/components_ng/render/adapter/path_painter.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/path_painter.cpp @arkui_superman
frameworks/core/components_ng/render/adapter/pixelmap_image.cpp @arkui_image
frameworks/core/components_ng/render/adapter/pixelmap_image.h @arkui_image
frameworks/core/components_ng/render/adapter/rendering_context.cpp @arkuiframework
@ -2530,9 +2530,9 @@ frameworks/core/components_ng/render/adapter/render_surface_impl.cpp @arkuilayou
frameworks/core/components_ng/render/adapter/render_surface_impl.h @arkuilayout
frameworks/core/components_ng/render/adapter/render_texture_impl.cpp @arkuilayout
frameworks/core/components_ng/render/adapter/render_texture_impl.h @arkuilayout
frameworks/core/components_ng/render/adapter/rosen_animation_utils.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/rosen/drawing_decoration_painter.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/rosen/drawing_decoration_painter.h @arkuiframework
frameworks/core/components_ng/render/adapter/rosen_animation_utils.cpp @arkui_superman
frameworks/core/components_ng/render/adapter/rosen/drawing_decoration_painter.cpp @arkui_superman
frameworks/core/components_ng/render/adapter/rosen/drawing_decoration_painter.h @arkui_superman
frameworks/core/components_ng/render/adapter/rosen/drawing_image.cpp @arkui_image
frameworks/core/components_ng/render/adapter/rosen/drawing_image.h @arkui_image
frameworks/core/components_ng/render/adapter/rosen/drawing_painter.cpp @arkui_image
@ -2543,26 +2543,26 @@ frameworks/core/components_ng/render/adapter/rosen_modifier_adapter.cpp @arkuifr
frameworks/core/components_ng/render/adapter/rosen_modifier_adapter.h @arkuiframework
frameworks/core/components_ng/render/adapter/rosen_modifier_property.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/rosen_modifier_property.h @arkuiframework
frameworks/core/components_ng/render/adapter/rosen_particle_context.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/rosen_particle_context.h @arkuiframework
frameworks/core/components_ng/render/adapter/rosen_particle_context.cpp @arkui_superman
frameworks/core/components_ng/render/adapter/rosen_particle_context.h @arkui_superman
frameworks/core/components_ng/render/adapter/rosen_render_context.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/rosen_render_context.h @arkuiframework
frameworks/core/components_ng/render/adapter/rosen_render_surface.cpp @arkuilayout
frameworks/core/components_ng/render/adapter/rosen_render_surface.h @arkuilayout
frameworks/core/components_ng/render/adapter/rosen_render_surface_mingw.cpp @arkuilayout
frameworks/core/components_ng/render/adapter/rosen_transition_effect.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/rosen_transition_effect.h @arkuiframework
frameworks/core/components_ng/render/adapter/rosen_transition_effect_impl.h @arkuiframework
frameworks/core/components_ng/render/adapter/rosen_transition_effect.cpp @arkui_superman
frameworks/core/components_ng/render/adapter/rosen_transition_effect.h @arkui_superman
frameworks/core/components_ng/render/adapter/rosen_transition_effect_impl.h @arkui_superman
frameworks/core/components_ng/render/adapter/rosen_window.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/rosen_window.h @arkuiframework
frameworks/core/components_ng/render/adapter/skia_color_filter.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/skia_color_filter.h @arkuiframework
frameworks/core/components_ng/render/adapter/skia_decoration_painter.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/skia_decoration_painter.h @arkuiframework
frameworks/core/components_ng/render/adapter/skia_color_filter.cpp @arkui_superman
frameworks/core/components_ng/render/adapter/skia_color_filter.h @arkui_superman
frameworks/core/components_ng/render/adapter/skia_decoration_painter.cpp @arkui_superman
frameworks/core/components_ng/render/adapter/skia_decoration_painter.h @arkui_superman
frameworks/core/components_ng/render/adapter/skia_image.cpp @arkui_image
frameworks/core/components_ng/render/adapter/skia_image.h @arkui_image
frameworks/core/components_ng/render/adapter/sk_painter.cpp @arkuiframework
frameworks/core/components_ng/render/adapter/sk_painter.h @arkuiframework
frameworks/core/components_ng/render/adapter/sk_painter.cpp @arkui_superman
frameworks/core/components_ng/render/adapter/sk_painter.h @arkui_superman
frameworks/core/components_ng/render/adapter/span_model_adapter.cpp @huawei_g_five
frameworks/core/components_ng/render/adapter/svg_canvas_image.cpp @arkui_image
frameworks/core/components_ng/render/adapter/svg_canvas_image.h @arkui_image
@ -2570,14 +2570,14 @@ frameworks/core/components_ng/render/adapter/txt_font_collection.cpp @huawei_g_f
frameworks/core/components_ng/render/adapter/txt_font_collection.h @huawei_g_five
frameworks/core/components_ng/render/adapter/txt_paragraph.cpp @huawei_g_five
frameworks/core/components_ng/render/adapter/txt_paragraph.h @huawei_g_five
frameworks/core/components_ng/render/animation_utils.h @arkuiframework
frameworks/core/components_ng/render/animation_utils.h @arkui_superman
frameworks/core/components_ng/render/border_image_painter.cpp @arkui_image
frameworks/core/components_ng/render/border_image_painter.h @arkui_image
frameworks/core/components_ng/render/BUILD.gn @arkui_architecture
frameworks/core/components_ng/render/canvas_image.h @arkui_image
frameworks/core/components_ng/render/circle_painter.cpp @arkuilayout
frameworks/core/components_ng/render/circle_painter.h @arkuilayout
frameworks/core/components_ng/render/color_filter.h @arkuiframework
frameworks/core/components_ng/render/color_filter.h @arkui_superman
frameworks/core/components_ng/render/debug_boundary_painter.cpp @arkuilayout
frameworks/core/components_ng/render/debug_boundary_painter.h @arkuilayout
frameworks/core/components_ng/render/divider_painter.cpp @arkuilayout
@ -2769,8 +2769,8 @@ frameworks/core/interfaces/native/node/node_xcomponent_modifier.cpp @arkuilayout
frameworks/core/interfaces/native/node/node_xcomponent_modifier.h @arkuilayout
frameworks/core/interfaces/native/node/panel_modifier.cpp @arkui_superman
frameworks/core/interfaces/native/node/panel_modifier.h @arkui_superman
frameworks/core/interfaces/native/node/particle_modifier.cpp @arkuiframework
frameworks/core/interfaces/native/node/particle_modifier.h @arkuiframework
frameworks/core/interfaces/native/node/particle_modifier.cpp @arkui_superman
frameworks/core/interfaces/native/node/particle_modifier.h @arkui_superman
frameworks/core/interfaces/native/node/path_modifier.cpp @arkuilayout
frameworks/core/interfaces/native/node/path_modifier.h @arkuilayout
frameworks/core/interfaces/native/node/pattern_lock_modifier.cpp @arkui_image
@ -2837,7 +2837,7 @@ interfaces/native/event/drag_and_drop_impl.cpp @arkuievent
interfaces/native/event/ui_input_event.cpp @arkuievent
interfaces/native/event/ui_input_event_impl.h @arkuievent
interfaces/native/libace.ndk.json @arkui_architecture
interfaces/native/native_animate.h @arkuiframework
interfaces/native/native_animate.h @arkui_superman
interfaces/native/native_dialog.h @arkuipopupwindow
interfaces/native/native_gesture.h @arkuievent
interfaces/native/native_interface.h @arkuiframework
@ -2848,8 +2848,8 @@ interfaces/native/native_node_napi.h @arkuiframework
interfaces/native/native_styled_string.h @huawei_g_five
interfaces/native/native_type.h @arkui_architecture
interfaces/native/native_xcomponent_key_event.h @arkuilayout
interfaces/native/node/animate_impl.cpp @arkuiframework
interfaces/native/node/animate_impl.h @arkuiframework
interfaces/native/node/animate_impl.cpp @arkui_superman
interfaces/native/node/animate_impl.h @arkui_superman
interfaces/native/node/dialog_model.cpp @arkuipopupwindow
interfaces/native/node/dialog_model.h @arkuipopupwindow
interfaces/native/node/drawable_descriptor.cpp @arkui_image
@ -2868,15 +2868,15 @@ interfaces/native/node/native_impl.cpp @arkui_architecture
interfaces/native/node/native_node_extented.cpp @arkuiframework
interfaces/native/node/native_node_napi.cpp @arkuiframework
interfaces/native/node/node_adapter_impl.cpp @arkuiframework
interfaces/native/node/node_animate.cpp @arkuiframework
interfaces/native/node/node_animate.cpp @arkui_superman
interfaces/native/node/node_extened.cpp @arkuiframework
interfaces/native/node/node_extened.h @arkuiframework
interfaces/native/node/node_model.cpp @arkuiframework
interfaces/native/node/node_model.h @arkuiframework
interfaces/native/node/node_node_relative_container.cpp @arkuilayout
interfaces/native/node/node_transition.cpp @arkuiframework
interfaces/native/node/node_transition.h @arkuiframework
interfaces/native/node/node_transition_imp.cpp @arkuiframework
interfaces/native/node/node_transition.cpp @arkui_superman
interfaces/native/node/node_transition.h @arkui_superman
interfaces/native/node/node_transition_imp.cpp @arkui_superman
interfaces/native/node/node_utils.cpp @arkuiframework
interfaces/native/node/resource.h @arkuiframework
interfaces/native/node/styled_string.h @huawei_g_five
@ -2893,7 +2893,7 @@ interfaces/inner_api/ace/ai/data_detector_interface.h
interfaces/inner_api/ace/ai/image_analyzer.h
interfaces/inner_api/ace/ai/image_analyzer_interface.h
interfaces/inner_api/ace/arkui_log.h @arkuiframework
interfaces/inner_api/ace/arkui_rect.h @arkuiframework
interfaces/inner_api/ace/arkui_rect.h @arkui_superman
interfaces/inner_api/ace/BUILD.gn @arkui_architecture
interfaces/inner_api/ace/constants.h @arkuiframework
interfaces/inner_api/ace/declarative_module_preloader.cpp @arkuiframework
@ -2928,7 +2928,7 @@ interfaces/inner_api/ui_session/ @arkuiframework
interfaces/inner_api/xcomponent_controller/ @arkuilayout
[NAPI Interfaces]
interfaces/napi/kits/animator/ @arkuiframework
interfaces/napi/kits/animator/ @arkui_superman
interfaces/napi/kits/atomic_service_bar/ @arkuievent
interfaces/napi/kits/BUILD.gn @arkui_architecture
interfaces/napi/kits/component_snapshot/ @arkuievent
@ -2959,7 +2959,7 @@ interfaces/napi/kits/utils/ @arkuiframework
test/mock/ @chenjiafeng-openharmony
test/mock/core/event/ @arkuievent
test/mock/core/accessibility/ @arkuiabilitygroup
test/mock/core/animation/ @arkuiframework
test/mock/core/animation/ @arkui_superman
test/mock/core/image_provider/ @arkui_image
test/mock/core/svg/ @arkui_image
test/mock/interfaces/ @arkui_architecture
@ -2972,7 +2972,7 @@ test/mock/core/animation/mock_implicit_animation.cpp @zhoutianer
test/unittest/ @chenjiafeng-openharmony
test/unittest/core/accessibility/ @arkuiabilitygroup
test/unittest/core/animation/ @arkuiframework
test/unittest/core/animation/ @aarkui_superman
test/unittest/core/common/ace_engine/ @arkuiframework
test/unittest/core/common/asset/ @arkuiframework
test/unittest/core/common/clipboard/ @huawei_g_five
@ -2987,15 +2987,15 @@ test/unittest/core/common/sharedata/ @arkuiframework
test/unittest/core/common/storage/ @arkuistatemgmt
test/unittest/core/common/task/ @arkuiframework
test/unittest/core/common/vibrator/ @arkuiframework
test/unittest/core/event/ @arkuievent
test/unittest/core/gestures/ @arkuievent
test/unittest/core/image_file_cache/ @arkui_image
test/unittest/core/image_provider/ @arkui_image
test/unittest/core/event/ @arkuievent
test/unittest/core/gestures/ @arkuievent
test/unittest/core/image_file_cache/ @arkui_image
test/unittest/core/image_provider/ @arkui_image
test/unittest/core/layout/ @arkuilayout
test/unittest/core/layout/safe_area/ @arkuilayout
test/unittest/core/manager/ @arkuievent
test/unittest/core/manager/navigation_manager_test_ng.cpp @arkui_superman
test/unittest/core/pattern/animator/ @arkuiframework
test/unittest/core/pattern/animator/ @arkui_superman
test/unittest/core/pattern/app_bar/ @arkuievent
test/unittest/core/pattern/badge/ @arkui_image
test/unittest/core/pattern/blank/ @arkuilayout
@ -3052,14 +3052,14 @@ test/unittest/core/pattern/radio/ @arkuipopupwindow
test/unittest/core/pattern/rating/ @arkuipopupwindow
test/unittest/core/pattern/recycle_node/ @Divanolin
test/unittest/core/pattern/refresh/ @arkuiscroll
test/unittest/core/pattern/relative_container/
test/unittest/core/pattern/relative_container/
test/unittest/core/pattern/render_node/ @arkuilayout
test/unittest/core/pattern/rich_editor/ @zhuweifeng94
test/unittest/core/pattern/rich_editor_drag/ @zhuweifeng94
test/unittest/core/pattern/scroll/ @arkuiscroll
test/unittest/core/pattern/scroll_bar/ @arkuiscroll
test/unittest/core/pattern/scrollable/ @arkuiscroll
test/unittest/core/pattern/search/ @huawei_g_five
test/unittest/core/pattern/scroll/ @arkuiscroll
test/unittest/core/pattern/scroll_bar/ @arkuiscroll
test/unittest/core/pattern/scrollable/ @arkuiscroll
test/unittest/core/pattern/search/ @huawei_g_five
test/unittest/core/pattern/security_component/ @harylee
test/unittest/core/pattern/security_component/mock/ @harylee
test/unittest/core/pattern/select/ @arkuipopupwindow
@ -3092,7 +3092,7 @@ test/unittest/core/pattern/xcomponent/ @arkuilayout
test/unittest/core/pipeline/ @arkuiframework
test/unittest/core/property/ @chenjiafeng-openharmony
test/unittest/core/render/ @arkuiframework
test/unittest/core/rosen/ @arkuiframework
test/unittest/core/rosen/ @arkuiframework
test/unittest/core/svg/ @arkui_image
test/unittest/core/syntax/ @arkuistatemgmt
test/unittest/interfaces/ @arkui_architecture

View File

@ -61,7 +61,8 @@
"https://gitee.com/Armstrong15",
"https://gitee.com/fredtt",
"https://gitee.com/futurescape",
"https://gitee.com/luoying_ace_admin"
"https://gitee.com/luoying_ace_admin",
"https://gitee.com/houguobiao"
],
"https://gitee.com/huawei_g_five": [
"https://gitee.com/kangshihui",
@ -267,6 +268,10 @@
"info": "Dialog相关 luoying",
"group": "https://gitee.com/arkuipopupwindow"
},
"https://gitee.com/houguobiao": {
"info": "[Picker类组件 houguobiao]",
"group": "https://gitee.com/arkuipopupwindow"
},
"https://gitee.com/kangshihui": {
"info": "[AutoFill&文本菜单 kangshihui]",
"group": "https://gitee.com/huawei_g_five"

View File

@ -431,10 +431,9 @@ void ClipboardImpl::GetDataAsync(const std::function<void(const std::string&)>&
return;
}
std::string resText;
bool hasPlainRecord = false;
for (const auto& pasteDataRecord : pasteData.AllRecords()) {
if (clip->ProcessPasteDataRecord(pasteDataRecord, resText)) {
break;
}
clip->ProcessPasteDataRecord(pasteDataRecord, resText, hasPlainRecord);
}
if (resText.empty()) {
TAG_LOGW(AceLogTag::ACE_CLIPBOARD, "Get SystemKeyboardTextData fail from MiscServices");
@ -451,13 +450,26 @@ void ClipboardImpl::GetDataAsync(const std::function<void(const std::string&)>&
TaskExecutor::TaskType::BACKGROUND, "ArkUIClipboardGetTextDataAsync");
}
bool ClipboardImpl::ProcessPasteDataRecord(const std::shared_ptr<MiscServices::PasteDataRecord>& pasteDataRecord,
std::string& resText)
void ClipboardImpl::ProcessPasteDataRecord(const std::shared_ptr<MiscServices::PasteDataRecord>& pasteDataRecord,
std::string& resText, bool& hasPlainRecord)
{
if (pasteDataRecord == nullptr) {
return false;
return;
}
TAG_LOGI(AceLogTag::ACE_CLIPBOARD, "mimeType:%{public}s", pasteDataRecord->GetMimeType().c_str());
if (pasteDataRecord->GetPlainText() != nullptr) {
auto textData = pasteDataRecord->GetPlainText();
if (!hasPlainRecord) {
resText = "";
}
TAG_LOGI(AceLogTag::ACE_CLIPBOARD, "textData:%{private}s, length:%{public}zu", textData->c_str(),
textData->length());
resText.append(*textData);
hasPlainRecord = true;
}
if (hasPlainRecord) {
return;
}
if (pasteDataRecord->GetHtmlText() != nullptr) {
auto htmlText = pasteDataRecord->GetHtmlText();
TAG_LOGI(AceLogTag::ACE_CLIPBOARD, "htmlText:%{private}s, length=%{public}zu", htmlText->c_str(),
@ -466,7 +478,7 @@ bool ClipboardImpl::ProcessPasteDataRecord(const std::shared_ptr<MiscServices::P
auto spanStr = toSpan.ToSpanString(*htmlText);
if (spanStr) {
resText = spanStr->GetString();
return true;
return;
}
}
if (pasteDataRecord->GetCustomData() != nullptr) {
@ -475,17 +487,10 @@ bool ClipboardImpl::ProcessPasteDataRecord(const std::shared_ptr<MiscServices::P
auto spanStr = SpanString::DecodeTlv(itemData[SPAN_STRING_TAG]);
if (spanStr) {
resText = spanStr->GetString();
return true;
return;
}
}
}
if (pasteDataRecord->GetPlainText() != nullptr) {
auto textData = pasteDataRecord->GetPlainText();
TAG_LOGI(AceLogTag::ACE_CLIPBOARD, "textData:%{private}s, length:%{public}zu", textData->c_str(),
textData->length());
resText.append(*textData);
}
return false;
}
void ClipboardImpl::GetDataSync(const std::function<void(const std::string&, bool isLastRecord)>& textCallback,
@ -625,7 +630,8 @@ void ClipboardImpl::ProcessSpanStringData(std::vector<std::vector<uint8_t>>& arr
}
#ifdef SYSTEM_CLIPBOARD_SUPPORTED
std::vector<std::string> types = { SPAN_STRING_TAG, OHOS::MiscServices::MIMETYPE_TEXT_URI,
OHOS::MiscServices::MIMETYPE_PIXELMAP, OHOS::MiscServices::MIMETYPE_TEXT_PLAIN };
OHOS::MiscServices::MIMETYPE_PIXELMAP, OHOS::MiscServices::MIMETYPE_TEXT_PLAIN,
OHOS::MiscServices::MIMETYPE_TEXT_HTML };
auto validTypes = pasteDataRecord->GetValidMimeTypes(types);
if (validTypes.size() > 1) {
isMultiTypeRecord = true;
@ -640,7 +646,7 @@ void ClipboardImpl::ProcessSpanStringData(std::vector<std::vector<uint8_t>>& arr
arrays.emplace_back(*spanStringBuffer);
hasSpanString = true;
}
if (pasteDataRecord->GetHtmlText() != nullptr && hasSpanString) {
if (pasteDataRecord->GetHtmlText() != nullptr && !hasSpanString) {
auto htmlText = pasteDataRecord->GetHtmlText();
HtmlToSpan toSpan;
auto spanStr = toSpan.ToSpanString(*htmlText);

View File

@ -65,8 +65,8 @@ private:
void GetDataAsync(const std::function<void(const std::string&, bool isLastRecord)>& textCallback,
const std::function<void(const RefPtr<PixelMap>&, bool isLastRecord)>& pixelMapCallback,
const std::function<void(const std::string&, bool isLastRecord)>& urlCallback);
bool ProcessPasteDataRecord(const std::shared_ptr<MiscServices::PasteDataRecord>& pasteDataRecord,
std::string& resText);
void ProcessPasteDataRecord(const std::shared_ptr<MiscServices::PasteDataRecord>& pasteDataRecord,
std::string& resText, bool& hasPlainRecord);
void GetPixelMapDataSync(const std::function<void(const RefPtr<PixelMap>&)>& callback);
void GetPixelMapDataAsync(const std::function<void(const RefPtr<PixelMap>&)>& callback);
void GetSpanStringDataHelper(

View File

@ -935,14 +935,6 @@ void AceContainer::InitializeCallback()
const std::shared_ptr<Rosen::RSTransaction>& rsTransaction) {
ContainerScope scope(id);
ACE_SCOPED_TRACE("ViewChangeCallback(%d, %d)", width, height);
if (type != WindowSizeChangeReason::ROTATION) {
context->SetSurfaceChangeMsg(width, height, type, rsTransaction);
context->RequestFrame();
return;
}
context->ResetSurfaceChangeMsg();
auto callback = [context, width, height, type, rsTransaction, id]() {
context->OnSurfaceChanged(width, height, type, rsTransaction);
if (type == WindowSizeChangeReason::ROTATION) {

View File

@ -24,6 +24,14 @@ namespace {
const std::string APS_CLIENT_SO = "libaps_client.z.so";
}
ApsMonitorImpl::~ApsMonitorImpl()
{
if (loadfilehandle_ != nullptr) {
dlclose(loadfilehandle_);
loadfilehandle_ = nullptr;
}
}
const set<string> ApsMonitorImpl::apsScenes = {
PerfConstants::ABILITY_OR_PAGE_SWITCH,
};
@ -36,7 +44,7 @@ void ApsMonitorImpl::SetApsScene(const string& sceneName, bool onOff)
}
#ifdef APS_ENABLE
LoadApsFuncOnce();
if (!setFunc_) {
if (setFunc_ == nullptr) {
LOGE("[ApsMonitorImpl]ApsManager setFunction failed!");
return;
}
@ -52,16 +60,16 @@ void ApsMonitorImpl::LoadApsFuncOnce()
return;
}
auto handle = dlopen(APS_CLIENT_SO.c_str(), RTLD_NOW);
if (!handle) {
loadfilehandle_ = dlopen(APS_CLIENT_SO.c_str(), RTLD_NOW);
if (loadfilehandle_ == nullptr) {
LOGE("[ApsMonitorImpl]ApsManager handle loaded failed!");
return;
}
setFunc_ = reinterpret_cast<SetSceneFunc>(dlsym(handle, "SetApsScene"));
if (!setFunc_) {
setFunc_ = reinterpret_cast<SetSceneFunc>(dlsym(loadfilehandle_, "SetApsScene"));
if (setFunc_ == nullptr) {
LOGE("[ApsMonitorImpl]ApsManager Function loaded failed!");
dlclose(handle);
dlclose(loadfilehandle_);
return;
}
isloadapsfunc_ = true;

View File

@ -22,15 +22,16 @@ using SetSceneFunc = void (*)(std::string pkgName, std::string sceneName, uint32
class ApsMonitorImpl final : public ApsMonitor {
public:
ApsMonitorImpl() = default;
~ApsMonitorImpl() override = default;
~ApsMonitorImpl() override;
void SetApsScene(const std::string& sceneName, bool onOff) override;
private:
void LoadApsFuncOnce();
static const std::set<std::string> apsScenes;
void* loadfilehandle_ = nullptr;
SetSceneFunc setFunc_ = nullptr;
bool isloadapsfunc_ = false;
};
} // namespace OHOS::Ace
#endif // FOUNDATION_ACE_ACE_ENGINE_ADAPTER_OHOS_ENTRANCE_APS_MONITOR_H
#endif // FOUNDATION_ACE_ACE_ENGINE_ADAPTER_OHOS_ENTRANCE_APS_MONITOR_IMPL_H

View File

@ -1615,6 +1615,8 @@ void SubwindowOhos::OpenCustomDialog(const PromptDialogAttr& dialogAttr, std::fu
void SubwindowOhos::CloseCustomDialog(const int32_t dialogId)
{
TAG_LOGI(AceLogTag::ACE_SUB_WINDOW, "close custom dialog with id, childContainerId_ is %{public}d",
childContainerId_);
auto aceContainer = Platform::AceContainer::GetContainer(childContainerId_);
CHECK_NULL_VOID(aceContainer);
auto context = DynamicCast<NG::PipelineContext>(aceContainer->GetPipelineContext());
@ -1627,6 +1629,8 @@ void SubwindowOhos::CloseCustomDialog(const int32_t dialogId)
void SubwindowOhos::CloseCustomDialog(const WeakPtr<NG::UINode>& node, std::function<void(int32_t)>&& callback)
{
TAG_LOGI(AceLogTag::ACE_SUB_WINDOW, "close custom dialog with node, childContainerId_ is %{public}d",
childContainerId_);
auto aceContainer = Platform::AceContainer::GetContainer(childContainerId_);
CHECK_NULL_VOID(aceContainer);
auto context = DynamicCast<NG::PipelineContext>(aceContainer->GetPipelineContext());

View File

@ -2169,6 +2169,24 @@ void UIContentImpl::Destroy()
Platform::AceContainer::DestroyContainer(instanceId_);
}
ContainerScope::RemoveAndCheck(instanceId_);
UnregisterDisplayManagerCallback();
}
void UIContentImpl::UnregisterDisplayManagerCallback()
{
auto& manager = Rosen::DisplayManager::GetInstance();
if (foldStatusListener_) {
manager.UnregisterFoldStatusListener(foldStatusListener_);
foldStatusListener_ = nullptr;
}
if (foldDisplayModeListener_) {
manager.UnregisterDisplayModeListener(foldDisplayModeListener_);
foldDisplayModeListener_ = nullptr;
}
if (availableAreaChangedListener_) {
manager.UnregisterAvailableAreaListener(availableAreaChangedListener_);
availableAreaChangedListener_ = nullptr;
}
}
void UIContentImpl::OnNewWant(const OHOS::AAFwk::Want& want)
@ -2932,18 +2950,6 @@ void UIContentImpl::SetFrameLayoutFinishCallback(std::function<void()>&& callbac
moduleName_.c_str(), instanceId_);
}
void UIContentImpl::SetLastestFrameLayoutFinishCallback(std::function<void()>&& callback)
{
CHECK_NULL_VOID(callback);
auto container = Platform::AceContainer::GetContainer(instanceId_);
CHECK_NULL_VOID(container);
auto pipelineContext = AceType::DynamicCast<NG::PipelineContext>(container->GetPipelineContext());
CHECK_NULL_VOID(pipelineContext);
pipelineContext->AddLastestFrameLayoutFinishTask(std::move(callback));
LOGI("[%{public}s][%{public}s][%{public}d]: SetLastestFrameLayoutFinishCallback", bundleName_.c_str(),
moduleName_.c_str(), instanceId_);
}
void UIContentImpl::NotifyMemoryLevel(int32_t level)
{
LOGI("[%{public}s][%{public}s][%{public}d]: NotifyMemoryLevel: %{public}d",

View File

@ -132,9 +132,6 @@ public:
// Set UIContent callback after layout finish
void SetFrameLayoutFinishCallback(std::function<void()>&& callback) override;
// Set UIContent callback after lastest layout finish
void SetLastestFrameLayoutFinishCallback(std::function<void()>&& callback) override;
// Receive memory level notification
void NotifyMemoryLevel(int32_t level) override;
@ -384,6 +381,7 @@ private:
void AddWatchSystemParameter();
void StoreConfiguration(const std::shared_ptr<OHOS::AppExecFwk::Configuration>& config);
void UnregisterDisplayManagerCallback();
std::weak_ptr<OHOS::AbilityRuntime::Context> context_;
void* runtime_ = nullptr;

View File

@ -104,6 +104,7 @@ void InputMethodManager::ProcessKeyboard(const RefPtr<NG::FrameNode>& curFocusNo
}
auto pipeline = curFocusNode->GetContextRefPtr();
CHECK_NULL_VOID(pipeline);
ACE_LAYOUT_SCOPED_TRACE("ProcessKeyboard [node:%s]", curFocusNode->GetTag().c_str());
if (windowFocus_.has_value() && windowFocus_.value()) {
TAG_LOGI(AceLogTag::ACE_KEYBOARD, "Normal Window focus first, set focus flag to window.");
windowFocus_.reset();

View File

@ -1377,6 +1377,7 @@ void JsAccessibilityManager::UpdateAccessibilityElementInfo(
void JsAccessibilityManager::UpdateWebAccessibilityElementInfo(
const std::shared_ptr<NWeb::NWebAccessibilityNodeInfo>& node, AccessibilityElementInfo& nodeInfo, int32_t treeId)
{
CHECK_NULL_VOID(node);
nodeInfo.SetContent(node->GetContent());
nodeInfo.SetAccessibilityText(node->GetContent());
RangeInfo rangeInfo(node->GetRangeInfoMin(), node->GetRangeInfoMax(), node->GetRangeInfoCurrent());
@ -1546,21 +1547,78 @@ void JsAccessibilityManager::UpdateVirtualNodeAccessibilityElementInfo(
}
namespace {
NG::RectF GetFinalRealRect(const RefPtr<NG::FrameNode>& node)
{
auto offset = node->GetPositionToWindowWithTransform(false);
auto offseBottom = node->GetPositionToWindowWithTransform(true);
return {
offset.GetX() < offseBottom.GetX() ? offset.GetX() : offseBottom.GetX(),
offset.GetY() < offseBottom.GetY() ? offset.GetY() : offseBottom.GetY(),
offset.GetX() < offseBottom.GetX()
? offseBottom.GetX() - offset.GetX()
: offset.GetX() - offseBottom.GetX(),
offset.GetY() < offseBottom.GetY()
? offseBottom.GetY() - offset.GetY()
: offset.GetY() - offseBottom.GetY()
};
NG::RectF GetFinalRealRect(const RefPtr<NG::FrameNode>& node)
{
auto offset = node->GetPositionToWindowWithTransform(false);
auto offsetBottom = node->GetPositionToWindowWithTransform(true);
return {
LessNotEqual(offset.GetX(), offsetBottom.GetX()) ? offset.GetX() : offsetBottom.GetX(),
LessNotEqual(offset.GetY(), offsetBottom.GetY()) ? offset.GetY() : offsetBottom.GetY(),
LessNotEqual(offset.GetX(), offsetBottom.GetX())
? offsetBottom.GetX() - offset.GetX()
: offset.GetX() - offsetBottom.GetX(),
LessNotEqual(offset.GetY(), offsetBottom.GetY())
? offsetBottom.GetY() - offset.GetY()
: offset.GetY() - offsetBottom.GetY()
};
}
void UpdateWindowSceneRect(const RefPtr<NG::FrameNode>& node, int32_t& left, int32_t& top)
{
// update windowScene node commonProperty left, top position
auto parent = node->GetAncestorNodeOfFrame(true);
if (node->GetTag() == V2::WINDOW_SCENE_ETS_TAG) {
parent = node;
}
while (parent) {
if (parent->GetTag() != V2::WINDOW_SCENE_ETS_TAG) {
parent = parent->GetAncestorNodeOfFrame(true);
continue;
}
auto type = parent->GetWindowPatternType();
TAG_LOGD(AceLogTag::ACE_ACCESSIBILITY,
"windowScene node tag: %{public}s, windowPatternType: %{public}d, nodeId: %{public}" PRId64,
parent->GetTag().c_str(), type, parent->GetAccessibilityId());
auto accessibilityProperty = parent->GetAccessibilityProperty<NG::AccessibilityProperty>();
if (accessibilityProperty) {
accessibilityProperty->GetWindowScenePosition(left, top);
}
TAG_LOGD(AceLogTag::ACE_ACCESSIBILITY,
"windowScene nodeId: %{public}" PRId64 ", left: %{public}d, top: %{public}d",
parent->GetAccessibilityId(), left, top);
break;
}
}
void SetRectInScreen(const RefPtr<NG::FrameNode>& node, AccessibilityElementInfo& nodeInfo,
const CommonProperty& commonProperty, const float& scaleX, const float& scaleY)
{
int32_t window_scene_left = 0;
int32_t window_scene_top = 0;
if (node->IsAccessibilityVirtualNode()) {
auto rect = node->GetVirtualNodeTransformRectRelativeToWindow();
auto left = rect.Left() + commonProperty.windowLeft;
auto top = rect.Top() + commonProperty.windowTop;
auto right = rect.Right() + commonProperty.windowLeft;
auto bottom = rect.Bottom() + commonProperty.windowTop;
Accessibility::Rect bounds { left, top, right, bottom };
nodeInfo.SetRectInScreen(bounds);
} else if (node->IsVisible()) {
auto rect = GetFinalRealRect(node);
if ((scaleX != 0) && (scaleY != 0)) {
rect.SetRect(rect.GetX() * scaleX, rect.GetY() * scaleY,
rect.Width() * scaleX, rect.Height() * scaleY);
}
UpdateWindowSceneRect(node, window_scene_left, window_scene_top);
auto left = rect.Left() + commonProperty.windowLeft + window_scene_left;
auto top = rect.Top() + commonProperty.windowTop + window_scene_top;
auto right = rect.Right() + commonProperty.windowLeft + window_scene_left;
auto bottom = rect.Bottom() + commonProperty.windowTop + window_scene_top;
Accessibility::Rect bounds { left, top, right, bottom };
nodeInfo.SetRectInScreen(bounds);
}
}
}
void JsAccessibilityManager::UpdateAccessibilityVisible(
@ -1599,10 +1657,8 @@ void JsAccessibilityManager::UpdateAccessibilityElementInfo(
CHECK_NULL_VOID(node);
nodeInfo.SetParent(GetParentId(node));
UpdateChildrenOfAccessibilityElementInfo(node, commonProperty, nodeInfo);
nodeInfo.SetAccessibilityId(node->GetAccessibilityId());
nodeInfo.SetComponentType(node->GetTag());
nodeInfo.SetEnabled(node->GetFocusHub() ? node->GetFocusHub()->IsEnabled() : true);
nodeInfo.SetFocused(node->GetFocusHub() ? node->GetFocusHub()->IsCurrentFocus() : false);
nodeInfo.SetAccessibilityFocus(node->GetRenderContext()->GetAccessibilityFocus().value_or(false));
@ -1610,27 +1666,7 @@ void JsAccessibilityManager::UpdateAccessibilityElementInfo(
nodeInfo.SetInspectorKey(node->GetInspectorId().value_or(""));
nodeInfo.SetVisible(node->IsVisible());
nodeInfo.SetIsActive(node->IsActive());
if (node->IsAccessibilityVirtualNode()) {
auto rect = node->GetVirtualNodeTransformRectRelativeToWindow();
auto left = rect.Left() + commonProperty.windowLeft;
auto top = rect.Top() + commonProperty.windowTop;
auto right = rect.Right() + commonProperty.windowLeft;
auto bottom = rect.Bottom() + commonProperty.windowTop;
Accessibility::Rect bounds { left, top, right, bottom };
nodeInfo.SetRectInScreen(bounds);
} else if (node->IsVisible()) {
auto rect = GetFinalRealRect(node);
if ((scaleX_ != 0) && (scaleY_ != 0)) {
rect.SetRect(rect.GetX() * scaleX_, rect.GetY() * scaleY_,
rect.Width() * scaleX_, rect.Height() * scaleY_);
}
auto left = rect.Left() + commonProperty.windowLeft;
auto top = rect.Top() + commonProperty.windowTop;
auto right = rect.Right() + commonProperty.windowLeft;
auto bottom = rect.Bottom() + commonProperty.windowTop;
Accessibility::Rect bounds { left, top, right, bottom };
nodeInfo.SetRectInScreen(bounds);
}
SetRectInScreen(node, nodeInfo, commonProperty, scaleX_, scaleY_);
nodeInfo.SetWindowId(commonProperty.windowId);
nodeInfo.SetPageId(node->GetPageId());
nodeInfo.SetPagePath(commonProperty.pagePath);
@ -4713,15 +4749,26 @@ void JsAccessibilityManager::SearchWebElementInfoByAccessibilityId(const int64_t
"SearchWebElementInfo GetOnFocus, elementId: %{public}" PRId64
", requestId: %{public}d, mode: %{public}d, windowId: %{public}d",
elementId, requestId, mode, windowId);
SetSearchElementInfoByAccessibilityIdResult(callback, std::move(infos), requestId);
return;
}
CHECK_NULL_VOID(webPattern);
auto webNode = webPattern->GetHost();
bool webActive = webPattern->GetActiveStatus();
if (!webActive) {
TAG_LOGD(AceLogTag::ACE_WEB,
"SearchWebElementinfo webActive false, elementId: %{public}" PRId64
", requestId: %{public}d, mode: %{public}d, windowId: %{public}d",
elementId, requestId, mode, windowId);
SetSearchElementInfoByAccessibilityIdResult(callback, std::move(infos), requestId);
return;
}
if (!IsNodeInRoot(webNode, ngPipeline)) {
TAG_LOGD(AceLogTag::ACE_WEB,
"SearchWebElementInfo IsNodeInRoot, elementId: %{public}" PRId64
", requestId: %{public}d, mode: %{public}d, windowId: %{public}d",
elementId, requestId, mode, windowId);
SetSearchElementInfoByAccessibilityIdResult(callback, std::move(infos), requestId);
return;
}

View File

@ -129,6 +129,9 @@ const std::unordered_map<AceLogTag, const char*> g_DOMAIN_CONTENTS_MAP = {
{ AceLogTag::ACE_MEDIA_QUERY, "AceMediaQuery" },
{ AceLogTag::ACE_LAYOUT, "AceLayout" },
{ AceLogTag::ACE_STYLUS, "AceStylus"},
{ AceLogTag::ACE_BADGE, "AceBadge"},
{ AceLogTag::ACE_QRCODE, "AceQRCode"},
{ AceLogTag::ACE_PROGRESS, "ACE_PROGRESS"},
};
// initial static member object
LogLevel LogWrapper::level_ = LogLevel::DEBUG;

View File

@ -112,6 +112,8 @@ bool InjectingExecutor::InjectOnePonterEvent(
activingItem.SetDisplayX(activingPointer.x);
activingItem.SetDisplayY(activingPointer.y);
activingItem.SetPointerId(activingPointer.finger);
activingItem.SetPressed(true);
activingItem.SetOriginPointerId(activingPointer.finger);
pointerEvent->AddPointerItem(activingItem);
// 3. pack all other pointers into items
for (auto& otherPointer : allOtherInjectings) {
@ -119,6 +121,8 @@ bool InjectingExecutor::InjectOnePonterEvent(
item.SetDisplayX(otherPointer.x);
item.SetDisplayY(otherPointer.y);
item.SetPointerId(otherPointer.finger);
item.SetPressed(true);
item.SetOriginPointerId(otherPointer.finger);
pointerEvent->AddPointerItem(item);
}
// 4. inject

View File

@ -28,10 +28,10 @@ const IMAGE_SIZE = '64vp';
const MAX_DIALOG = '256vp';
const MIN_DIALOG = '216vp';
class ComposeTitleBar extends ViewPU {
constructor(o10, p10, q10, r10 = -1, s10 = undefined, t10) {
super(o10, q10, r10, t10);
if (typeof s10 === 'function') {
this.paramsGenerator_ = s10;
constructor(k10, l10, m10, n10 = -1, o10 = undefined, p10) {
super(k10, m10, n10, p10);
if (typeof o10 === 'function') {
this.paramsGenerator_ = o10;
}
this.item = undefined;
this.title = '';
@ -39,34 +39,34 @@ class ComposeTitleBar extends ViewPU {
this.menuItems = [];
this.__titleMaxWidth = new ObservedPropertySimplePU(0, this, 'titleMaxWidth');
this.__fontSize = new ObservedPropertySimplePU(1, this, 'fontSize');
this.setInitiallyProvidedValue(p10);
this.setInitiallyProvidedValue(l10);
this.finalizeConstruction();
}
setInitiallyProvidedValue(n10) {
if (n10.item !== undefined) {
this.item = n10.item;
setInitiallyProvidedValue(j10) {
if (j10.item !== undefined) {
this.item = j10.item;
}
if (n10.title !== undefined) {
this.title = n10.title;
if (j10.title !== undefined) {
this.title = j10.title;
}
if (n10.subtitle !== undefined) {
this.subtitle = n10.subtitle;
if (j10.subtitle !== undefined) {
this.subtitle = j10.subtitle;
}
if (n10.menuItems !== undefined) {
this.menuItems = n10.menuItems;
if (j10.menuItems !== undefined) {
this.menuItems = j10.menuItems;
}
if (n10.titleMaxWidth !== undefined) {
this.titleMaxWidth = n10.titleMaxWidth;
if (j10.titleMaxWidth !== undefined) {
this.titleMaxWidth = j10.titleMaxWidth;
}
if (n10.fontSize !== undefined) {
this.fontSize = n10.fontSize;
if (j10.fontSize !== undefined) {
this.fontSize = j10.fontSize;
}
}
updateStateVars(m10) {
updateStateVars(i10) {
}
purgeVariableDependenciesOnElmtId(l10) {
this.__titleMaxWidth.purgeDependencyOnElmtId(l10);
this.__fontSize.purgeDependencyOnElmtId(l10);
purgeVariableDependenciesOnElmtId(h10) {
this.__titleMaxWidth.purgeDependencyOnElmtId(h10);
this.__fontSize.purgeDependencyOnElmtId(h10);
}
aboutToBeDeleted() {
this.__titleMaxWidth.aboutToBeDeleted();
@ -77,19 +77,19 @@ class ComposeTitleBar extends ViewPU {
get titleMaxWidth() {
return this.__titleMaxWidth.get();
}
set titleMaxWidth(k10) {
this.__titleMaxWidth.set(k10);
set titleMaxWidth(g10) {
this.__titleMaxWidth.set(g10);
}
get fontSize() {
return this.__fontSize.get();
}
set fontSize(i10) {
this.__fontSize.set(i10);
set fontSize(f10) {
this.__fontSize.set(f10);
}
initialRender() {
PUV2ViewBase.contextStack && PUV2ViewBase.contextStack.push(this);
this.observeComponentCreation((b10, c10) => {
ViewStackProcessor.StartGetAccessRecordingFor(b10);
this.observeComponentCreation((y9, z9) => {
ViewStackProcessor.StartGetAccessRecordingFor(y9);
Flex.create({
justifyContent: FlexAlign.SpaceBetween,
alignItems: ItemAlign.Stretch
@ -97,18 +97,18 @@ class ComposeTitleBar extends ViewPU {
Flex.width('100%');
Flex.height(ComposeTitleBar.totalHeight);
Flex.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_background'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
Flex.onAreaChange((e10, f10) => {
let g10 = Number(f10.width);
Flex.onAreaChange((b10, c10) => {
let d10 = Number(c10.width);
if (this.menuItems !== undefined) {
let h10 = this.menuItems.length;
if (h10 >= CollapsibleMenuSection.maxCountOfVisibleItems) {
g10 = g10 - ImageMenuItem.imageHotZoneWidth * CollapsibleMenuSection.maxCountOfVisibleItems;
let e10 = this.menuItems.length;
if (e10 >= CollapsibleMenuSection.maxCountOfVisibleItems) {
d10 = d10 - ImageMenuItem.imageHotZoneWidth * CollapsibleMenuSection.maxCountOfVisibleItems;
}
else if (h10 > 0) {
g10 = g10 - ImageMenuItem.imageHotZoneWidth * h10;
else if (e10 > 0) {
d10 = d10 - ImageMenuItem.imageHotZoneWidth * e10;
}
}
this.titleMaxWidth = g10;
this.titleMaxWidth = d10;
this.titleMaxWidth -= ComposeTitleBar.leftPadding;
this.titleMaxWidth -= ImageMenuItem.imageHotZoneWidth;
if (this.item !== undefined) {
@ -118,31 +118,31 @@ class ComposeTitleBar extends ViewPU {
}
this.titleMaxWidth -= ComposeTitleBar.rightPadding;
});
if (!c10) {
if (!z9) {
Flex.pop();
}
ViewStackProcessor.StopGetAccessRecording();
});
this.observeComponentCreation((z9, a10) => {
ViewStackProcessor.StartGetAccessRecordingFor(z9);
this.observeComponentCreation((w9, x9) => {
ViewStackProcessor.StartGetAccessRecordingFor(w9);
Row.create();
Row.margin({ left: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_default_padding_start'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } });
if (!a10) {
if (!x9) {
Row.pop();
}
ViewStackProcessor.StopGetAccessRecording();
});
{
this.observeComponentCreation((r9, s9) => {
ViewStackProcessor.StartGetAccessRecordingFor(r9);
if (s9) {
let t9 = new ImageMenuItem(this, { item: {
this.observeComponentCreation((q9, r9) => {
ViewStackProcessor.StartGetAccessRecordingFor(q9);
if (r9) {
let s9 = new ImageMenuItem(this, { item: {
value: PUBLIC_BACK,
isEnabled: true,
action: () => this.getUIContext()?.getRouter()?.back()
}, index: -1 }, undefined, r9, () => { }, { page: 'library/src/main/ets/components/mainpage/MainPage.ets', line: 64, col: 9 });
ViewPU.create(t9);
let u9 = () => {
}, index: -1 }, undefined, q9, () => { }, { page: 'library/src/main/ets/components/mainpage/MainPage.ets', line: 60, col: 9 });
ViewPU.create(s9);
let t9 = () => {
return {
item: {
value: PUBLIC_BACK,
@ -152,21 +152,21 @@ class ComposeTitleBar extends ViewPU {
index: -1
};
};
t9.paramsGenerator_ = u9;
s9.paramsGenerator_ = t9;
}
else {
this.updateStateVarsOfChildByElmtId(r9, {});
this.updateStateVarsOfChildByElmtId(q9, {});
}
ViewStackProcessor.StopGetAccessRecording();
});
}
this.observeComponentCreation((j9, k9) => {
ViewStackProcessor.StartGetAccessRecordingFor(j9);
this.observeComponentCreation((i9, j9) => {
ViewStackProcessor.StartGetAccessRecordingFor(i9);
If.create();
if (this.item !== undefined) {
this.ifElseBranchUpdateFunction(0, () => {
this.observeComponentCreation((o9, p9) => {
ViewStackProcessor.StartGetAccessRecordingFor(o9);
this.observeComponentCreation((n9, o9) => {
ViewStackProcessor.StartGetAccessRecordingFor(n9);
Image.create(this.item.value);
Image.width(ComposeTitleBar.portraitImageSize);
Image.height(ComposeTitleBar.portraitImageSize);
@ -176,7 +176,7 @@ class ComposeTitleBar extends ViewPU {
});
Image.focusable(false);
Image.borderRadius(ImageMenuItem.buttonBorderRadius);
if (!p9) {
if (!o9) {
Image.pop();
}
ViewStackProcessor.StopGetAccessRecording();
@ -187,39 +187,39 @@ class ComposeTitleBar extends ViewPU {
this.ifElseBranchUpdateFunction(1, () => {
});
}
if (!k9) {
if (!j9) {
If.pop();
}
ViewStackProcessor.StopGetAccessRecording();
});
If.pop();
this.observeComponentCreation((h9, i9) => {
ViewStackProcessor.StartGetAccessRecordingFor(h9);
this.observeComponentCreation((g9, h9) => {
ViewStackProcessor.StartGetAccessRecordingFor(g9);
Column.create();
Column.justifyContent(FlexAlign.Start);
Column.alignItems(HorizontalAlign.Start);
Column.constraintSize({ maxWidth: this.titleMaxWidth });
if (!i9) {
if (!h9) {
Column.pop();
}
ViewStackProcessor.StopGetAccessRecording();
});
this.observeComponentCreation((x8, y8) => {
ViewStackProcessor.StartGetAccessRecordingFor(x8);
this.observeComponentCreation((w8, x8) => {
ViewStackProcessor.StartGetAccessRecordingFor(w8);
If.create();
if (this.title !== undefined) {
this.ifElseBranchUpdateFunction(0, () => {
this.observeComponentCreation((f9, g9) => {
ViewStackProcessor.StartGetAccessRecordingFor(f9);
this.observeComponentCreation((e9, f9) => {
ViewStackProcessor.StartGetAccessRecordingFor(e9);
Row.create();
Row.justifyContent(FlexAlign.Start);
if (!g9) {
if (!f9) {
Row.pop();
}
ViewStackProcessor.StopGetAccessRecording();
});
this.observeComponentCreation((d9, e9) => {
ViewStackProcessor.StartGetAccessRecordingFor(d9);
this.observeComponentCreation((c9, d9) => {
ViewStackProcessor.StartGetAccessRecordingFor(c9);
Text.create(this.title);
Text.fontWeight(FontWeight.Medium);
Text.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline8'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
@ -227,7 +227,7 @@ class ComposeTitleBar extends ViewPU {
Text.maxLines(this.subtitle !== undefined ? 1 : 2);
Text.textOverflow({ overflow: TextOverflow.Ellipsis });
Text.constraintSize({ maxWidth: this.titleMaxWidth });
if (!e9) {
if (!d9) {
Text.pop();
}
ViewStackProcessor.StopGetAccessRecording();
@ -240,35 +240,35 @@ class ComposeTitleBar extends ViewPU {
this.ifElseBranchUpdateFunction(1, () => {
});
}
if (!y8) {
if (!x8) {
If.pop();
}
ViewStackProcessor.StopGetAccessRecording();
});
If.pop();
this.observeComponentCreation((n8, o8) => {
ViewStackProcessor.StartGetAccessRecordingFor(n8);
this.observeComponentCreation((m8, n8) => {
ViewStackProcessor.StartGetAccessRecordingFor(m8);
If.create();
if (this.subtitle !== undefined) {
this.ifElseBranchUpdateFunction(0, () => {
this.observeComponentCreation((v8, w8) => {
ViewStackProcessor.StartGetAccessRecordingFor(v8);
this.observeComponentCreation((u8, v8) => {
ViewStackProcessor.StartGetAccessRecordingFor(u8);
Row.create();
Row.justifyContent(FlexAlign.Start);
if (!w8) {
if (!v8) {
Row.pop();
}
ViewStackProcessor.StopGetAccessRecording();
});
this.observeComponentCreation((t8, u8) => {
ViewStackProcessor.StartGetAccessRecordingFor(t8);
this.observeComponentCreation((s8, t8) => {
ViewStackProcessor.StartGetAccessRecordingFor(s8);
Text.create(this.subtitle);
Text.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_over_line'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
Text.fontColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_titlebar_subtitle_text'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
Text.maxLines(1);
Text.textOverflow({ overflow: TextOverflow.Ellipsis });
Text.constraintSize({ maxWidth: this.titleMaxWidth });
if (!u8) {
if (!t8) {
Text.pop();
}
ViewStackProcessor.StopGetAccessRecording();
@ -281,7 +281,7 @@ class ComposeTitleBar extends ViewPU {
this.ifElseBranchUpdateFunction(1, () => {
});
}
if (!o8) {
if (!n8) {
If.pop();
}
ViewStackProcessor.StopGetAccessRecording();
@ -289,27 +289,27 @@ class ComposeTitleBar extends ViewPU {
If.pop();
Column.pop();
Row.pop();
this.observeComponentCreation((c8, d8) => {
ViewStackProcessor.StartGetAccessRecordingFor(c8);
this.observeComponentCreation((b8, c8) => {
ViewStackProcessor.StartGetAccessRecordingFor(b8);
If.create();
if (this.menuItems !== undefined && this.menuItems.length > 0) {
this.ifElseBranchUpdateFunction(0, () => {
{
this.observeComponentCreation((h8, i8) => {
ViewStackProcessor.StartGetAccessRecordingFor(h8);
if (i8) {
let j8 = new CollapsibleMenuSection(this, { menuItems: this.menuItems, index: 1 + ComposeTitleBar.instanceCount++ }, undefined, h8, () => { }, { page: 'library/src/main/ets/components/mainpage/MainPage.ets', line: 114, col: 9 });
ViewPU.create(j8);
let k8 = () => {
this.observeComponentCreation((g8, h8) => {
ViewStackProcessor.StartGetAccessRecordingFor(g8);
if (h8) {
let i8 = new CollapsibleMenuSection(this, { menuItems: this.menuItems, index: 1 + ComposeTitleBar.instanceCount++ }, undefined, g8, () => { }, { page: 'library/src/main/ets/components/mainpage/MainPage.ets', line: 110, col: 9 });
ViewPU.create(i8);
let j8 = () => {
return {
menuItems: this.menuItems,
index: 1 + ComposeTitleBar.instanceCount++
};
};
j8.paramsGenerator_ = k8;
i8.paramsGenerator_ = j8;
}
else {
this.updateStateVarsOfChildByElmtId(h8, {});
this.updateStateVarsOfChildByElmtId(g8, {});
}
ViewStackProcessor.StopGetAccessRecording();
});
@ -320,7 +320,7 @@ class ComposeTitleBar extends ViewPU {
this.ifElseBranchUpdateFunction(1, () => {
});
}
if (!d8) {
if (!c8) {
If.pop();
}
ViewStackProcessor.StopGetAccessRecording();
@ -583,7 +583,7 @@ class CollapsibleMenuSection extends ViewPU {
this.observeComponentCreation((h6, i6) => {
ViewStackProcessor.StartGetAccessRecordingFor(h6);
if (i6) {
let j6 = new ImageMenuItem(this, { item: f6, index: this.index * 1000 + e6 + 1 }, undefined, h6, () => { }, { page: 'library/src/main/ets/components/mainpage/MainPage.ets', line: 238, col: 15 });
let j6 = new ImageMenuItem(this, { item: f6, index: this.index * 1000 + e6 + 1 }, undefined, h6, () => { }, { page: 'library/src/main/ets/components/mainpage/MainPage.ets', line: 239, col: 15 });
ViewPU.create(j6);
let k6 = () => {
return {
@ -620,7 +620,7 @@ class CollapsibleMenuSection extends ViewPU {
this.observeComponentCreation((r5, s5) => {
ViewStackProcessor.StartGetAccessRecordingFor(r5);
if (s5) {
let t5 = new ImageMenuItem(this, { item: p5, index: this.index * 1000 + o5 + 1 }, undefined, r5, () => { }, { page: 'library/src/main/ets/components/mainpage/MainPage.ets', line: 243, col: 17 });
let t5 = new ImageMenuItem(this, { item: p5, index: this.index * 1000 + o5 + 1 }, undefined, r5, () => { }, { page: 'library/src/main/ets/components/mainpage/MainPage.ets', line: 244, col: 17 });
ViewPU.create(t5);
let u5 = () => {
return {
@ -791,7 +791,7 @@ class CollapsibleMenuSection extends ViewPU {
ViewStackProcessor.StartGetAccessRecordingFor(w3);
if (x3) {
let y3 = new ImageMenuItem(this, { item: u3, index: this.index * 1000 +
CollapsibleMenuSection.maxCountOfVisibleItems + t3, isPopup: true }, undefined, w3, () => { }, { page: 'library/src/main/ets/components/mainpage/MainPage.ets', line: 341, col: 13 });
CollapsibleMenuSection.maxCountOfVisibleItems + t3, isPopup: true }, undefined, w3, () => { }, { page: 'library/src/main/ets/components/mainpage/MainPage.ets', line: 342, col: 13 });
ViewPU.create(y3);
let z3 = () => {
return {
@ -868,7 +868,7 @@ class ImageMenuItem extends ViewPU {
itemComposeTitleDialog: this.item,
composeTitleBarDialog: this.item.label ? this.item.label : this.textDialog(),
fontSize: this.fontSize,
}, undefined, -1, () => { }, { page: 'library/src/main/ets/components/mainpage/MainPage.ets', line: 378, col: 14 });
}, undefined, -1, () => { }, { page: 'library/src/main/ets/components/mainpage/MainPage.ets', line: 381, col: 14 });
c3.setController(this.dialogController);
ViewPU.create(c3);
let d3 = () => {
@ -1032,6 +1032,7 @@ class ImageMenuItem extends ViewPU {
this.observeComponentCreation((u1, v1) => {
ViewStackProcessor.StartGetAccessRecordingFor(u1);
Row.create();
Row.enabled(this.item.isEnabled);
Row.width(ImageMenuItem.imageHotZoneWidth);
Row.height(ImageMenuItem.imageHotZoneWidth);
Row.borderRadius(ImageMenuItem.buttonBorderRadius);

View File

@ -459,6 +459,7 @@ struct ImageMenuItem {
.key(ImageMenuItem.focusablePrefix + this.index)
.fillColor($r('sys.color.ohos_id_color_text_primary'))
}
.enabled(this.item.isEnabled)
.width(ImageMenuItem.imageHotZoneWidth)
.height(ImageMenuItem.imageHotZoneWidth)
.borderRadius(ImageMenuItem.buttonBorderRadius)

View File

@ -0,0 +1,284 @@
/*
* Copyright (c) 2024 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Drawer } from 'common/src/main/ets/components/Drawer';
import { RadioBlock, ColorBlock, SliderBlock, useEnabled } from 'common';
@Component
export struct ColumnBootcamp {
@Require @Prop title: ResourceStr;
@State showParameters: boolean = false;
@State enableSpace: boolean = false;
@State space: number = 0;
@State enableAlignItems: boolean = false;
@State alignItems: HorizontalAlign = HorizontalAlign.Center;
@State enableJustifyContent: boolean = false;
@State justifyContent: FlexAlign = FlexAlign.Start;
@State enableIsReversed: boolean = false;
@State isReversed: boolean = true;
@State enableCompWidth: boolean = false;
@State compWidth: Length = 'auto';
@State enableCompHeight: boolean = false;
@State compHeight: Length = 'auto';
@State enableCompPadding: boolean = false;
@State compPadding: number = 0;
@State enableCompMargin: boolean = false;
@State compMargin: number = 0;
@State enableCompBackgroundColor: boolean = false;
@State compBackgroundColor: ResourceColor = '#ff000000';
@State enableCompBorderWidth: boolean = false;
@State compBorderWidth: number = 0;
@State enableCompBorderColor: boolean = false;
@State compBorderColor: ResourceColor = Color.Black;
@State enableCompBorderRadius: boolean = false;
@State compBorderRadius: number = 0;
@State enableCompBorderStyle: boolean = false;
@State compBorderStyle: BorderStyle = BorderStyle.Solid;
@State enableCompFlexBasis: boolean = false;
@State compFlexBasis: number | string = 'auto';
@State enableCompOpacity: boolean = false;
@State compOpacity: number = 1;
@State enableCompVisibility: boolean = false;
@State compVisibility: Visibility = Visibility.Visible;
@State enableCompDirection: boolean = false;
@State compDirection: Direction = Direction.Auto;
build() {
NavDestination() {
Drawer({
title: this.title,
showParameters: $showParameters,
content: () => {
this.Content()
},
parameters: () => {
this.Parameters()
}
})
}
.backgroundColor('#f1f3f5')
.hideTitleBar(true)
}
@Builder
Content() {
Column({ space: 5 }) {
Column({
space: useEnabled(this.enableSpace, this.space)
}) {
Column().width('100%').height(20).backgroundColor(0xAFEEEE)
Column().width('100%').height(20).backgroundColor(0x00FFFF)
Column().width('90%').height(20).backgroundColor(0xAFEEEE)
Column().width('90%').height(20).backgroundColor(0x00FFFF)
Column().width('50%').height(20).backgroundColor(0xAFEEEE)
Column().width('50%').height(20).backgroundColor(0x00FFFF)
}
.alignItems(useEnabled(this.enableAlignItems, this.alignItems))
.justifyContent(useEnabled(this.enableJustifyContent, this.justifyContent))
.reverse(useEnabled(this.enableIsReversed, this.isReversed))
.width(useEnabled(this.enableCompWidth, this.compWidth))
.height(useEnabled(this.enableCompHeight, this.compHeight))
.padding(useEnabled(this.enableCompPadding, this.compPadding))
.margin(useEnabled(this.enableCompMargin, this.compMargin))
.backgroundColor(useEnabled(this.enableCompBackgroundColor, this.compBackgroundColor))
.borderWidth(useEnabled(this.enableCompBorderWidth, this.compBorderWidth))
.borderColor(useEnabled(this.enableCompBorderColor, this.compBorderColor))
.borderRadius(useEnabled(this.enableCompBorderRadius, this.compBorderRadius))
.borderStyle(useEnabled(this.enableCompBorderStyle, this.compBorderStyle))
.flexBasis(useEnabled(this.enableCompFlexBasis, this.compFlexBasis))
.opacity(useEnabled(this.enableCompOpacity, this.compOpacity))
.visibility(useEnabled(this.enableCompVisibility, this.compVisibility))
.direction(useEnabled(this.enableCompDirection, this.compDirection))
}.width('100%').padding({ top: 5 })
}
@Builder
Parameters() {
Scroll() {
Column({ space: 8 }) {
SliderBlock({
title: '纵向布局元素垂直方向间距单位vp',
isEnabled: $enableSpace,
value: $space,
min: 0,
max: 10
})
RadioBlock({
title: '子组件在水平方向上的对齐格式',
isEnabled: $enableAlignItems,
value: $alignItems,
dataSource: [
{ label: '首部对齐', value: HorizontalAlign.Start },
{ label: '居中对齐', value: HorizontalAlign.Center },
{ label: '尾部对齐', value: HorizontalAlign.End }
]
})
RadioBlock({
title: '子组件在Column容器主轴上的对齐格式',
isEnabled: $enableJustifyContent,
value: $justifyContent,
dataSource: [
{ label: '首端对齐', value: FlexAlign.Start },
{ label: '居中对齐', value: FlexAlign.Center },
{ label: '尾端对齐', value: FlexAlign.End },
{ label: '均分容器布局,第一个子组件与行首对齐,最后一个子组件与行尾对齐', value: FlexAlign.SpaceBetween },
{
label: '均分容器布局,第一个子组件到行首的距离和最后一个子组件到行尾的距离是相邻子组件之间距离的一半',
value: FlexAlign.SpaceAround
},
{
label: '均分容器布局,子组件之间的距离与第一子组件到行首、最后一个子组件到行尾的距离相等',
value: FlexAlign.SpaceEvenly
}
]
})
RadioBlock({
title: '子组件在主轴(即竖直方向)上的排列是否反转',
isEnabled: $enableIsReversed,
value: $isReversed,
dataSource: [
{ label: '反转', value: true },
{ label: '不反转', value: false }
]
})
SliderBlock({
title: '组件宽度',
isEnabled: $enableCompWidth,
value: $compWidth,
min: 100,
max: 600
})
SliderBlock({
title: '组件高度',
isEnabled: $enableCompHeight,
value: $compHeight,
min: 50,
max: 400
})
SliderBlock({
title: '组件内边距',
isEnabled: $enableCompPadding,
value: $compPadding,
min: 0,
max: 50
})
SliderBlock({
title: '组件外边距',
isEnabled: $enableCompMargin,
value: $compMargin,
min: 0,
max: 100
})
ColorBlock({
title: '组件背景颜色',
isEnabled: $enableCompBackgroundColor,
color: $compBackgroundColor
})
SliderBlock({
title: '边框宽度',
isEnabled: $enableCompBorderWidth,
value: $compBorderWidth,
min: 0,
max: 20
})
ColorBlock({
title: '边框颜色',
isEnabled: $enableCompBorderColor,
color: $compBorderColor
})
SliderBlock({
title: '边框圆角',
isEnabled: $enableCompBorderRadius,
value: $compBorderRadius,
min: 0,
max: 100
})
RadioBlock({
title: '边框线条样式',
isEnabled: $enableCompBorderStyle,
value: $compBorderStyle,
dataSource: [
{ label: '实线', value: BorderStyle.Solid },
{ label: '圆点虚线', value: BorderStyle.Dotted },
{ label: '线段虚线', value: BorderStyle.Dashed },
]
})
SliderBlock({
title: '组件在父容器主轴方向上的基准尺寸',
isEnabled: $enableCompFlexBasis,
value: $compFlexBasis,
min: 10,
max: 200
})
SliderBlock({
title: '组件的不透明度',
isEnabled: $enableCompOpacity,
value: $compOpacity,
min: 0,
max: 1,
step: 0.1
})
RadioBlock({
title: '组件的显隐',
isEnabled: $enableCompVisibility,
value: $compVisibility,
dataSource: [
{ label: '隐藏不参与占位', value: Visibility.None },
{ label: '隐藏参与占位', value: Visibility.Hidden },
{ label: '正常显示', value: Visibility.Visible }
]
})
RadioBlock({
title: '子组件左右排列的方向',
isEnabled: $enableCompDirection,
value: $compDirection,
dataSource: [
{ label: '从左到右', value: Direction.Ltr },
{ label: '从右到左', value: Direction.Rtl }
]
})
}
.width('100%')
}
.align(Alignment.Top)
.height('50%')
}
}
@Preview
@Component
struct ColumnBootcampPreviewer {
build() {
ColumnBootcamp({
title: '纵向布局/Column'
})
}
}

View File

@ -21,6 +21,7 @@ import { CalendarPickerDialogBootcamp } from './CalendarPickerDialogBootcamp';
import { ListItemGroupBootcamp } from './ListItemGroupBootcamp';
import { ListBootcamp } from './ListBootcamp';
import { GridBootcamp } from './GridBootcamp';
import { ColumnBootcamp } from './ColumnBootcamp';
import { ScrollBootcamp } from './ScrollBootcamp';
import { WaterFlowBootcamp } from './WaterFlowBootcamp';
@ -35,6 +36,7 @@ export const containersRoute: RouteGroup = {
{ name: 'list-item-group', label: '分组列表/ListItemGroup'},
{ name: 'list', label: '列表/List'},
{ name: 'grid', label: '网格/Grid' },
{ name: 'column', label: '纵向布局/Column' },
{ name: 'scroll', label: '滚动容器/Scroll' },
{ name: 'waterFlow', label: '瀑布流容器/WaterFlow' }
]
@ -56,6 +58,8 @@ export function ContainersDestination(name: string, route: Route) {
ListBootcamp({ title: route.label })
} else if (name === 'containers/grid') {
GridBootcamp({ title: route.label })
} else if (name === 'containers/column') {
ColumnBootcamp({ title: route.label })
} else if (name === 'containers/scroll') {
ScrollBootcamp({ title: route.label })
} else if (name === 'containers/waterFlow') {

View File

@ -48,6 +48,20 @@ export struct SelectBootcamp {
@State enableDividerColor: boolean = false;
@State enableDividerStrokeWidth: boolean = false;
@State dividerConfig: boolean = false;
@State selectBorderColor: ResourceColor = Color.Black;
@State enableSelectBorderColor: boolean = false;
@State selectBorderWidth: number = 1;
@State enableSelectBorderWidth: boolean = false;
@State selectBorderStyle: BorderStyle = BorderStyle.Solid;
@State enableSelectBorderStyle: boolean = false;
@State selectOpacity: number = 1;
@State enableSelectOpacity: boolean = false;
@State selectVisibility: Visibility = Visibility.Visible;
@State enableSelectVisibility: boolean = false;
@State selectPadding: number = 8;
@State enableSelectPadding: boolean = false;
@State selectMargin: number = 8;
@State enableSelectMargin: boolean = false;
build() {
NavDestination() {
@ -84,6 +98,13 @@ export struct SelectBootcamp {
style: useEnabled(this.enableFontStyle, this.compFontStyle),
})
.borderRadius(useEnabled(this.enableBorderRadius, this.customBorderRadius))
.borderColor(useEnabled(this.enableSelectBorderColor, this.selectBorderColor))
.borderWidth(useEnabled(this.enableSelectBorderWidth, this.selectBorderWidth))
.borderStyle(useEnabled(this.enableSelectBorderStyle, this.selectBorderStyle))
.opacity(useEnabled(this.enableSelectOpacity, this.selectOpacity))
.visibility(useEnabled(this.enableSelectVisibility, this.selectVisibility))
.margin(useEnabled(this.enableSelectMargin, this.selectMargin))
.padding(useEnabled(this.enableSelectPadding, this.selectPadding))
}
}
@ -157,6 +178,7 @@ export struct SelectBootcamp {
{ label: 'false', value: false }
]
})
ColorBlock({
title: 'backgroundColor',
isEnabled: this.enableBackgroundColor,
@ -183,6 +205,68 @@ export struct SelectBootcamp {
]
})
RadioBlock({
title: '显隐控制',
isEnabled: $enableSelectVisibility,
value: $selectVisibility,
dataSource: [
{ label: '显示', value: Visibility.Visible },
{ label: '隐藏', value: Visibility.Hidden },
]
})
SliderBlock({
title: '边框宽度',
isEnabled: $enableSelectBorderWidth,
value: $selectBorderWidth,
min: 1,
max: 5
})
ColorBlock({
title: '边框颜色',
isEnabled: $enableSelectBorderColor,
color: $selectBorderColor
})
RadioBlock({
title: '边框样式',
isEnabled: $enableSelectBorderStyle,
value: $selectBorderStyle,
dataSource: [
{ label: '原点', value: BorderStyle.Dotted },
{ label: '虚线', value: BorderStyle.Dashed },
{ label: '实线', value: BorderStyle.Solid },
]
})
SliderBlock({
title: '透明度',
isEnabled: $enableSelectOpacity,
value: $selectOpacity,
step: 0.1,
min: 0,
max: 1
})
SliderBlock({
title: '内边距',
isEnabled: $enableSelectPadding,
value: $selectPadding,
step: 0.1,
min: 0,
max: 1
})
SliderBlock({
title: '外边距',
isEnabled: $enableSelectMargin,
value: $selectMargin,
step: 0.1,
min: 0,
max: 1
})
if (this.dividerConfig) {
ColorBlock({
title: 'dividercolor',

View File

@ -206,6 +206,9 @@ enum AceLogTag : uint8_t {
ACE_LAYOUT = 89, // C03959
ACE_STYLUS = 90, // C0395A
ACE_INDICATOR = 91, // C0395B
ACE_BADGE = 92, // C0395C
ACE_QRCODE = 93, // C0395D
ACE_PROGRESS = 94, // C0395E
FORM_RENDER = 255, // C039FF FormRenderer, last domain, do not add
};

View File

@ -150,6 +150,7 @@ void SubwindowManager::DeleteHotAreas(int32_t instanceId, int32_t nodeId)
// get the subwindow which overlay node in, not current
subwindow = GetSubwindow(instanceId >= MIN_SUBCONTAINER_ID ? GetParentContainerId(instanceId) : instanceId);
} else {
TAG_LOGW(AceLogTag::ACE_SUB_WINDOW, "Fail to get the subwindow which overlay node in, so get the current one.");
subwindow = GetCurrentWindow();
}
if (subwindow) {
@ -169,6 +170,8 @@ const RefPtr<Subwindow> SubwindowManager::GetSubwindow(int32_t instanceId)
if (result != subwindowMap_.end()) {
return result->second;
} else {
TAG_LOGW(AceLogTag::ACE_SUB_WINDOW, "Fail to find subwindow in subwindowMap_, instanceId is %{public}d.",
instanceId);
return nullptr;
}
}
@ -180,6 +183,8 @@ const RefPtr<Subwindow> SubwindowManager::GetToastSubwindow(int32_t instanceId)
if (result != toastWindowMap_.end()) {
return result->second;
}
TAG_LOGW(AceLogTag::ACE_SUB_WINDOW, "Fail to find subwindow in toastWindowMap_, instanceId is %{public}d.",
instanceId);
return nullptr;
}
@ -190,6 +195,8 @@ const RefPtr<Subwindow> SubwindowManager::GetSystemToastWindow(int32_t instanceI
if (result != systemToastWindowMap_.end()) {
return result->second;
}
TAG_LOGW(AceLogTag::ACE_SUB_WINDOW, "Fail to find subwindow in systemToastWindowMap_, instanceId is %{public}d.",
instanceId);
return nullptr;
}
@ -202,7 +209,7 @@ const RefPtr<Subwindow> SubwindowManager::GetOrCreateSubwindow(int32_t instanceI
subwindow = Subwindow::CreateSubwindow(instanceId);
if (!subwindow) {
TAG_LOGE(AceLogTag::ACE_SUB_WINDOW, "create sub window failed");
TAG_LOGE(AceLogTag::ACE_SUB_WINDOW, "Create sub window failed, instanceId is %{public}d.", instanceId);
return nullptr;
}
AddSubwindow(instanceId, subwindow);
@ -218,6 +225,8 @@ int32_t SubwindowManager::GetDialogSubwindowInstanceId(int32_t SubwindowId)
return it->first;
}
}
TAG_LOGW(AceLogTag::ACE_SUB_WINDOW, "Fail to get parentContainerId of subwindow in subwindowMap_,"
"subwindowId is %{public}d.", SubwindowId);
return 0;
}
@ -407,6 +416,7 @@ void SubwindowManager::HidePopupNG(int32_t targetId, int32_t instanceId)
// get the subwindow which overlay node in, not current
subwindow = GetSubwindow(instanceId >= MIN_SUBCONTAINER_ID ? GetParentContainerId(instanceId) : instanceId);
} else {
TAG_LOGW(AceLogTag::ACE_SUB_WINDOW, "Fail to get the subwindow which overlay node in, so get the current one.");
subwindow = GetCurrentWindow();
}
@ -491,6 +501,7 @@ void SubwindowManager::SetHotAreas(const std::vector<Rect>& rects, int32_t nodeI
// get the subwindow which overlay node in, not current
subwindow = GetSubwindow(instanceId >= MIN_SUBCONTAINER_ID ? GetParentContainerId(instanceId) : instanceId);
} else {
TAG_LOGW(AceLogTag::ACE_SUB_WINDOW, "Fail to get the subwindow which overlay node in, so get the current one.");
subwindow = GetCurrentWindow();
}
@ -624,6 +635,8 @@ const RefPtr<Subwindow> SubwindowManager::GetDialogSubwindow(int32_t instanceId)
if (result != dialogSubwindowMap_.end()) {
return result->second;
} else {
TAG_LOGW(AceLogTag::ACE_SUB_WINDOW, "Fail to get subwindow in dialogSubwindowMap_, instanceId is %{public}d",
instanceId);
return nullptr;
}
}
@ -1015,6 +1028,8 @@ void SubwindowManager::HideSubWindowNG()
}
if (subwindow) {
subwindow->HideSubWindowNG();
} else {
TAG_LOGW(AceLogTag::ACE_SUB_WINDOW, "fail to hide subwindow, subwindow is null.");
}
}
@ -1034,6 +1049,8 @@ void SubwindowManager::HideToastSubWindowNG()
}
if (subwindow) {
subwindow->HideSubWindowNG();
} else {
TAG_LOGW(AceLogTag::ACE_SUB_WINDOW, "fail to hide toast subwindow, subwindow is null.");
}
}
@ -1104,7 +1121,7 @@ void SubwindowManager::HideSystemTopMostWindow()
if (subwindow) {
subwindow->HideSubWindowNG();
} else {
TAG_LOGD(AceLogTag::ACE_SUB_WINDOW, "can not find systemTopMost window when hide window");
TAG_LOGW(AceLogTag::ACE_SUB_WINDOW, "can not find systemTopMost window when hide window");
}
}
@ -1124,7 +1141,7 @@ void SubwindowManager::ClearToastInSystemSubwindow()
if (subwindow) {
subwindow->ClearToast();
} else {
TAG_LOGD(AceLogTag::ACE_SUB_WINDOW, "can not find systemTopMost window when clear system toast");
TAG_LOGW(AceLogTag::ACE_SUB_WINDOW, "can not find systemTopMost window when clear system toast");
}
}
void SubwindowManager::OnWindowSizeChanged(int32_t instanceId, Rect windowRect, WindowSizeChangeReason reason)

View File

@ -12,8 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FOUNDATION_ACE_FRAMEWORKS_BASE_UTILS_APS_MONITOR_IMPL_H
#define FOUNDATION_ACE_FRAMEWORKS_BASE_UTILS_APS_MONITOR_IMPL_H
#ifndef FOUNDATION_ACE_FRAMEWORKS_BASE_UTILS_APS_MONITOR
#define FOUNDATION_ACE_FRAMEWORKS_BASE_UTILS_APS_MONITOR
#include <string>
#include <set>
@ -28,4 +28,4 @@ public:
};
} // namespace OHOS::Ace
#endif // FOUNDATION_ACE_FRAMEWORKS_BASE_UTILS_APS_MONITOR_IMPL_H
#endif // FOUNDATION_ACE_FRAMEWORKS_BASE_UTILS_APS_MONITOR

View File

@ -14,14 +14,228 @@
*/
#include "view_abstract.h"
#include <regex>
#include "base/geometry/calc_dimension.h"
#include "base/geometry/dimension.h"
#include "core/components_ng/base/view_abstract.h"
#include "core/components_ng/base/view_abstract_model.h"
#include "core/components_ng/base/view_stack_processor.h"
#include "core/components_v2/extensions/events/on_area_change_extension.h"
#include "core/gestures/long_press_gesture.h"
#include "core/pipeline/base/constants.h"
using namespace OHOS::Ace;
using namespace OHOS::Ace::Framework;
namespace OHOS::Ace::Framework {
RefPtr<ThemeConstants> ViewAbstract::GetThemeConstants()
namespace {
const char DEFAULT_HAR_BUNDLE_NAME[] = "__harDefaultBundleName__";
const char DEFAULT_HAR_MODULE_NAME[] = "__harDefaultModuleName__";
const std::regex RESOURCE_APP_STRING_PLACEHOLDER(R"(\%((\d+)(\$)){0,1}([dsf]))", std::regex::icase);
const std::regex FLOAT_PATTERN(R"(-?(0|[1-9]\d*)(\.\d+))", std::regex::icase);
const std::string RESOURCE_TOKEN_PATTERN = "(app|sys|\\[.+?\\])\\.(\\S+?)\\.(\\S+)";
const std::string RESOURCE_NAME_PATTERN = "\\[(.+?)\\]";
constexpr int32_t UNKNOWN_RESOURCE_ID = -1;
constexpr int32_t UNKNOWN_RESOURCE_TYPE = -1;
constexpr uint32_t COLOR_ALPHA_OFFSET = 24;
constexpr uint32_t COLOR_ALPHA_VALUE = 0xFF000000;
uint32_t ColorAlphaAdapt(uint32_t origin)
{
uint32_t result = origin;
if ((origin >> COLOR_ALPHA_OFFSET) == 0) {
result = origin | COLOR_ALPHA_VALUE;
}
return result;
}
std::string GetBundleNameFromContainer()
{
auto container = Container::Current();
CHECK_NULL_RETURN(container, "");
return container->GetBundleName();
}
std::string GetModuleNameFromContainer()
{
auto container = Container::Current();
CHECK_NULL_RETURN(container, "");
return container->GetModuleName();
}
void CompleteResourceObjectFromParams(
int32_t resId, NativeResourceObject& obj, std::string& targetModule, ResourceType& resType, std::string& resName)
{
auto params = JsonUtil::ParseJsonString(obj.paramsJsonStr);
if (!params->IsArray()) {
LOGE("Resource params type error.");
return;
}
if (resId != UNKNOWN_RESOURCE_ID) {
return;
}
auto identityValue = params->GetArrayItem(0);
if (!identityValue->IsString()) {
return;
}
auto identity = identityValue->GetString();
if (!ViewAbstract::ParseDollarResource(
identity,
targetModule,
resType,
resName,
obj.type == UNKNOWN_RESOURCE_TYPE)) {
return;
}
std::regex resNameRegex(RESOURCE_NAME_PATTERN);
std::smatch resNameResults;
if (std::regex_match(targetModule, resNameResults, resNameRegex)) {
obj.moduleName = std::string(resNameResults[1]).c_str();
}
if (obj.type == UNKNOWN_RESOURCE_TYPE) {
obj.type = static_cast<int32_t>(resType);
}
}
std::string GetReplaceContentStr(
int pos, const std::string& type, std::unique_ptr<JsonValue>& params, int32_t containCount)
{
auto index = pos + containCount;
if (index < 0) {
return std::string();
}
auto item = params->GetArrayItem(index);
if (type == "d") {
if (item->IsNumber()) {
return std::to_string(item->GetInt());
}
} else if (type == "s") {
if (item->IsString()) {
return item->GetString();
}
} else if (type == "f") {
if (item->IsNumber()) {
return std::to_string(item->GetDouble());
}
}
return std::string();
}
void ReplaceHolder(std::string& originStr, std::unique_ptr<JsonValue>& params, int32_t containCount)
{
auto size = params->GetArraySize();
if (containCount == size) {
return;
}
std::string::const_iterator start = originStr.begin();
std::string::const_iterator end = originStr.end();
std::smatch matches;
bool shortHolderType = false;
bool firstMatch = true;
int searchTime = 0;
while (std::regex_search(start, end, matches, RESOURCE_APP_STRING_PLACEHOLDER)) {
std::string pos = matches[2];
std::string type = matches[4];
if (firstMatch) {
firstMatch = false;
shortHolderType = pos.length() == 0;
} else {
if (shortHolderType ^ (pos.length() == 0)) {
return;
}
}
std::string replaceContentStr;
if (shortHolderType) {
replaceContentStr = GetReplaceContentStr(searchTime, type, params, containCount);
} else {
replaceContentStr = GetReplaceContentStr(StringUtils::StringToInt(pos) - 1, type, params, containCount);
}
originStr.replace(matches[0].first - originStr.begin(), matches[0].length(), replaceContentStr);
start = originStr.begin() + matches.prefix().length() + replaceContentStr.length();
end = originStr.end();
searchTime++;
}
}
} // namespace
RefPtr<ResourceObject> GetResourceObject(const NativeResourceObject& obj)
{
auto params = JsonUtil::ParseJsonString(obj.paramsJsonStr);
if (!params->IsArray()) {
return nullptr;
}
std::vector<ResourceObjectParams> resObjParamsList;
auto size = params->GetArraySize();
for (int32_t i = 0; i < size; i++) {
auto item = params->GetArrayItem(i);
ResourceObjectParams resObjParams {};
if (item->IsString()) {
resObjParams.value = item->GetString();
resObjParams.type = ResourceObjectParamType::STRING;
} else if (item->IsNumber()) {
if (std::regex_match(std::to_string(item->GetDouble()), FLOAT_PATTERN)) {
resObjParams.value = std::to_string(item->GetDouble());
resObjParams.type = ResourceObjectParamType::FLOAT;
} else {
resObjParams.value = std::to_string(item->GetInt());
resObjParams.type = ResourceObjectParamType::INT;
}
}
resObjParamsList.push_back(resObjParams);
}
auto resourceObject =
AceType::MakeRefPtr<ResourceObject>(obj.id, obj.type, resObjParamsList, obj.bundleName, obj.moduleName);
return resourceObject;
}
RefPtr<ResourceObject> GetResourceObjectByBundleAndModule(const NativeResourceObject& obj)
{
auto resourceObject = AceType::MakeRefPtr<ResourceObject>(obj.bundleName, obj.moduleName);
return resourceObject;
}
RefPtr<ResourceWrapper> CreateResourceWrapper(const NativeResourceObject& obj, RefPtr<ResourceObject>& resourceObject)
{
RefPtr<ResourceAdapter> resourceAdapter = nullptr;
RefPtr<ThemeConstants> themeConstants = nullptr;
if (SystemProperties::GetResourceDecoupling()) {
resourceAdapter = ResourceManager::GetInstance().GetOrCreateResourceAdapter(resourceObject);
if (!resourceAdapter) {
return nullptr;
}
} else {
themeConstants = ViewAbstract::GetThemeConstants(obj.bundleName, obj.moduleName);
if (!themeConstants) {
return nullptr;
}
}
auto resourceWrapper = AceType::MakeRefPtr<ResourceWrapper>(themeConstants, resourceAdapter);
return resourceWrapper;
}
RefPtr<ResourceWrapper> CreateResourceWrapper()
{
RefPtr<ResourceAdapter> resourceAdapter = nullptr;
RefPtr<ThemeConstants> themeConstants = nullptr;
if (SystemProperties::GetResourceDecoupling()) {
resourceAdapter = ResourceManager::GetInstance().GetResourceAdapter();
if (!resourceAdapter) {
return nullptr;
}
} else {
themeConstants = ViewAbstract::GetThemeConstants();
if (!themeConstants) {
return nullptr;
}
}
auto resourceWrapper = AceType::MakeRefPtr<ResourceWrapper>(themeConstants, resourceAdapter);
return resourceWrapper;
}
RefPtr<ThemeConstants> ViewAbstract::GetThemeConstants(const std::string& bundleName, const std::string& moduleName)
{
auto currentObj = Container::Current();
if (!currentObj) {
@ -38,7 +252,7 @@ RefPtr<ThemeConstants> ViewAbstract::GetThemeConstants()
LOGE("theme manager is null!");
return nullptr;
}
return themeManager->GetThemeConstants();
return themeManager->GetThemeConstants(bundleName, moduleName);
}
void ViewAbstract::CjEnabled(bool enabled)
@ -46,4 +260,454 @@ void ViewAbstract::CjEnabled(bool enabled)
ViewAbstractModel::GetInstance()->SetEnabled(enabled);
}
void ViewAbstract::CompleteResourceObject(NativeResourceObject& obj)
{
std::string bundleName;
std::string moduleName;
int32_t resId = UNKNOWN_RESOURCE_ID;
CompleteResourceObjectInner(obj, bundleName, moduleName, resId);
}
void ViewAbstract::CompleteResourceObjectWithBundleName(
NativeResourceObject& obj, std::string& bundleName, std::string& moduleName, int32_t& resId)
{
CompleteResourceObjectInner(obj, bundleName, moduleName, resId);
}
void ViewAbstract::CompleteResourceObjectInner(
NativeResourceObject& obj, std::string& bundleName, std::string& moduleName, int32_t& resIdValue)
{
ResourceType resType;
std::string targetModule;
std::string resName;
resIdValue = obj.id;
if (resIdValue == UNKNOWN_RESOURCE_ID) {
CompleteResourceObjectFromParams(resIdValue, obj, targetModule, resType, resName);
}
bundleName = obj.bundleName;
moduleName = obj.moduleName;
if ((bundleName.empty() && !moduleName.empty()) || bundleName == DEFAULT_HAR_BUNDLE_NAME) {
bundleName = GetBundleNameFromContainer();
obj.bundleName = bundleName.c_str();
}
if (moduleName == DEFAULT_HAR_MODULE_NAME) {
moduleName = GetModuleNameFromContainer();
obj.moduleName = moduleName.c_str();
}
}
bool ViewAbstract::ConvertResourceType(const std::string& typeName, ResourceType& resType)
{
static const std::unordered_map<std::string, ResourceType> resTypeMap {
{ "color", ResourceType::COLOR },
{ "media", ResourceType::MEDIA },
{ "float", ResourceType::FLOAT },
{ "string", ResourceType::STRING },
{ "plural", ResourceType::PLURAL },
{ "pattern", ResourceType::PATTERN },
{ "boolean", ResourceType::BOOLEAN },
{ "integer", ResourceType::INTEGER },
{ "strarray", ResourceType::STRARRAY },
{ "intarray", ResourceType::INTARRAY },
};
auto it = resTypeMap.find(typeName);
if (it == resTypeMap.end()) {
return false;
}
resType = it->second;
return true;
}
bool ViewAbstract::ParseDollarResource(const std::string& resPath, std::string& targetModule, ResourceType& resType,
std::string& resName, bool isParseType)
{
std::smatch results;
std::regex tokenRegex(RESOURCE_TOKEN_PATTERN);
if (!std::regex_match(resPath, results, tokenRegex)) {
return false;
}
targetModule = results[1];
std::string typeName = results[2];
if (isParseType && !ConvertResourceType(typeName, resType)) {
return false;
}
resName = resPath;
return true;
}
bool ViewAbstract::ParseCjString(NativeResourceObject& obj, std::string& result)
{
CompleteResourceObject(obj);
if (obj.type == UNKNOWN_RESOURCE_TYPE) {
return false;
}
auto resourceObject = GetResourceObjectByBundleAndModule(obj);
auto resourceWrapper = CreateResourceWrapper(obj, resourceObject);
if (!resourceWrapper) {
return false;
}
auto params = JsonUtil::ParseJsonString(obj.paramsJsonStr);
if (!params->IsArray()) {
LOGE("Resource params type error.");
return false;
}
if (obj.id == UNKNOWN_RESOURCE_ID) {
if (!obj.paramsJsonStr) {
return false;
}
auto param = params->GetArrayItem(0);
if (obj.type == static_cast<int32_t>(ResourceType::STRING)) {
auto originStr = resourceWrapper->GetStringByName(param->GetString());
ReplaceHolder(originStr, params, 1);
result = originStr;
} else if (obj.type == static_cast<int32_t>(ResourceType::PLURAL)) {
auto countVal = params->GetArrayItem(1);
if (!countVal->IsNumber()) {
return false;
}
int count = countVal->GetInt();
auto pluralStr = resourceWrapper->GetPluralStringByName(param->GetString(), count);
ReplaceHolder(pluralStr, params, 2);
result = pluralStr;
} else {
return false;
}
return true;
}
if (obj.type == static_cast<int32_t>(ResourceType::STRING)) {
auto originStr = resourceWrapper->GetString(static_cast<uint32_t>(obj.id));
ReplaceHolder(originStr, params, 0);
result = originStr;
} else if (obj.type == static_cast<int32_t>(ResourceType::PLURAL)) {
auto countVal = params->GetArrayItem(0);
if (!countVal->IsNumber()) {
return false;
}
int count = countVal->GetInt();
auto pluralStr = resourceWrapper->GetPluralString(static_cast<uint32_t>(obj.id), count);
ReplaceHolder(pluralStr, params, 1);
result = pluralStr;
} else if (obj.type == static_cast<int32_t>(ResourceType::FLOAT)) {
result = std::to_string(resourceWrapper->GetDouble(static_cast<uint32_t>(obj.id)));
} else if (obj.type == static_cast<int32_t>(ResourceType::INTEGER)) {
result = std::to_string(resourceWrapper->GetInt(static_cast<uint32_t>(obj.id)));
} else {
return false;
}
return true;
}
bool ViewAbstract::ParseCjMedia(NativeResourceObject& obj, std::string& result)
{
CompleteResourceObject(obj);
return ParseCjMediaInternal(obj, result);
}
bool ViewAbstract::ParseCjMediaInternal(NativeResourceObject& obj, std::string& result)
{
if (obj.type == UNKNOWN_RESOURCE_TYPE) {
return false;
}
auto resourceObject = GetResourceObjectByBundleAndModule(obj);
auto resourceWrapper = CreateResourceWrapper(obj, resourceObject);
if (!resourceWrapper) {
return false;
}
if (obj.type == static_cast<int32_t>(ResourceType::RAWFILE)) {
auto params = JsonUtil::ParseJsonString(obj.paramsJsonStr);
if (!params->IsArray()) {
return false;
}
auto param = params->GetArrayItem(0);
if (!param->IsString()) {
return false;
}
auto fileName = param->GetString();
result = resourceWrapper->GetRawfile(fileName);
return true;
}
if (obj.id == -1) {
if (!obj.paramsJsonStr) {
return false;
}
auto params = JsonUtil::ParseJsonString(obj.paramsJsonStr);
if (!params->IsArray()) {
return false;
}
auto param = params->GetArrayItem(0);
if (obj.type == static_cast<int32_t>(ResourceType::MEDIA)) {
result = resourceWrapper->GetMediaPathByName(param->GetString());
return true;
}
if (obj.type == static_cast<int32_t>(ResourceType::STRING)) {
result = resourceWrapper->GetStringByName(param->GetString());
return true;
}
return false;
} else if (obj.type == static_cast<int32_t>(ResourceType::MEDIA)) {
result = resourceWrapper->GetMediaPath(static_cast<uint32_t>(obj.id));
return true;
} else if (obj.type == static_cast<int32_t>(ResourceType::STRING)) {
result = resourceWrapper->GetString(static_cast<uint32_t>(obj.id));
return true;
}
return false;
}
bool ViewAbstract::ParseCjColor(NativeResourceObject& obj, Color& result)
{
CompleteResourceObject(obj);
if (obj.type == UNKNOWN_RESOURCE_TYPE) {
return false;
}
auto resourceObject = GetResourceObjectByBundleAndModule(obj);
auto resourceWrapper = CreateResourceWrapper(obj, resourceObject);
if (!resourceWrapper) {
return false;
}
if (obj.id == -1) {
if (!obj.paramsJsonStr) {
return false;
}
auto params = JsonUtil::ParseJsonString(obj.paramsJsonStr);
if (!params->IsArray()) {
return false;
}
auto param = params->GetArrayItem(0);
result = resourceWrapper->GetColorByName(param->GetString());
return true;
}
if (obj.type == static_cast<int32_t>(ResourceType::STRING)) {
auto value = resourceWrapper->GetString(static_cast<uint32_t>(obj.id));
return Color::ParseColorString(value, result);
}
if (obj.type == static_cast<int32_t>(ResourceType::INTEGER)) {
auto value = resourceWrapper->GetInt(static_cast<uint32_t>(obj.id));
result = Color(ColorAlphaAdapt(value));
return true;
}
if (obj.type == static_cast<int32_t>(ResourceType::COLOR)) {
result = resourceWrapper->GetColor(static_cast<uint32_t>(obj.id));
result.SetResourceId(static_cast<uint32_t>(obj.id));
return true;
}
return false;
}
bool ViewAbstract::ParseCjDimension(
NativeResourceObject& obj, CalcDimension& result, DimensionUnit defaultUnit, bool isSupportPercent)
{
CompleteResourceObject(obj);
if (obj.type == UNKNOWN_RESOURCE_TYPE) {
return false;
}
auto resourceObject = GetResourceObjectByBundleAndModule(obj);
auto resourceWrapper = CreateResourceWrapper(obj, resourceObject);
if (!resourceWrapper) {
return false;
}
if (obj.id == -1) {
if (!obj.paramsJsonStr) {
return false;
}
auto params = JsonUtil::ParseJsonString(obj.paramsJsonStr);
if (!params->IsArray()) {
return false;
}
auto param = params->GetArrayItem(0);
if (obj.type == static_cast<int32_t>(ResourceType::STRING)) {
auto value = resourceWrapper->GetStringByName(param->GetString());
return StringUtils::StringToCalcDimensionNG(value, result, false, defaultUnit);
}
if (obj.type == static_cast<int32_t>(ResourceType::INTEGER)) {
auto value = std::to_string(resourceWrapper->GetIntByName(param->GetString()));
return StringUtils::StringToDimensionWithUnitNG(value, result, defaultUnit);
}
result = resourceWrapper->GetDimensionByName(param->GetString());
return true;
}
if (obj.type == static_cast<int32_t>(ResourceType::STRING)) {
auto value = resourceWrapper->GetString(static_cast<uint32_t>(obj.id));
return StringUtils::StringToCalcDimensionNG(value, result, false, defaultUnit);
}
if (obj.type == static_cast<int32_t>(ResourceType::INTEGER)) {
auto value = std::to_string(resourceWrapper->GetInt(static_cast<uint32_t>(obj.id)));
return StringUtils::StringToDimensionWithUnitNG(value, result, defaultUnit);
}
if (obj.type == static_cast<int32_t>(ResourceType::FLOAT)) {
result = resourceWrapper->GetDimension(static_cast<uint32_t>(obj.id));
return true;
}
return false;
}
bool ViewAbstract::ParseCjDimensionVP(NativeResourceObject& obj, CalcDimension& result, bool isSupportPercent)
{
return ParseCjDimension(obj, result, DimensionUnit::VP, isSupportPercent);
}
bool ViewAbstract::ParseCjDimensionFP(NativeResourceObject& obj, CalcDimension& result, bool isSupportPercent)
{
return ParseCjDimension(obj, result, DimensionUnit::FP, isSupportPercent);
}
bool ViewAbstract::ParseCjDouble(NativeResourceObject& obj, double& result)
{
CompleteResourceObject(obj);
if (obj.type == UNKNOWN_RESOURCE_TYPE) {
return false;
}
auto resourceObject = GetResourceObjectByBundleAndModule(obj);
auto resourceWrapper = CreateResourceWrapper(obj, resourceObject);
if (!resourceWrapper) {
return false;
}
if (obj.id == -1) {
if (!obj.paramsJsonStr) {
return false;
}
auto params = JsonUtil::ParseJsonString(obj.paramsJsonStr);
if (!params->IsArray()) {
return false;
}
auto param = params->GetArrayItem(0);
if (obj.type == static_cast<int32_t>(ResourceType::STRING)) {
auto value = resourceWrapper->GetStringByName(param->GetString());
return StringUtils::StringToDouble(value, result);
}
if (obj.type == static_cast<int32_t>(ResourceType::FLOAT)) {
result = resourceWrapper->GetDoubleByName(param->GetString());
return true;
}
if (obj.type == static_cast<int32_t>(ResourceType::INTEGER)) {
result = resourceWrapper->GetIntByName(param->GetString());
return true;
}
return false;
}
if (obj.type == static_cast<int32_t>(ResourceType::STRING)) {
auto value = resourceWrapper->GetString(static_cast<uint32_t>(obj.id));
return StringUtils::StringToDouble(value, result);
}
if (obj.type == static_cast<int32_t>(ResourceType::FLOAT)) {
result = resourceWrapper->GetDouble(static_cast<uint32_t>(obj.id));
return true;
}
if (obj.type == static_cast<int32_t>(ResourceType::INTEGER)) {
result = resourceWrapper->GetInt(static_cast<uint32_t>(obj.id));
return true;
}
return false;
}
bool ViewAbstract::ParseCjInteger(NativeResourceObject& obj, int32_t& result)
{
return ParseCjInteger<int32_t>(obj, result);
}
bool ViewAbstract::ParseCjInteger(NativeResourceObject& obj, uint32_t& result)
{
return ParseCjInteger<uint32_t>(obj, result);
}
bool ViewAbstract::ParseCjBool(NativeResourceObject& obj, bool& result)
{
CompleteResourceObject(obj);
if (obj.type == UNKNOWN_RESOURCE_TYPE) {
return false;
}
auto resourceObject = GetResourceObjectByBundleAndModule(obj);
auto resourceWrapper = CreateResourceWrapper(obj, resourceObject);
if (!resourceWrapper) {
return false;
}
if (obj.id == -1) {
if (!obj.paramsJsonStr) {
return false;
}
auto params = JsonUtil::ParseJsonString(obj.paramsJsonStr);
if (!params->IsArray()) {
return false;
}
auto param = params->GetArrayItem(0);
if (obj.type == static_cast<int32_t>(ResourceType::BOOLEAN)) {
result = resourceWrapper->GetBooleanByName(param->GetString());
return true;
}
return false;
}
if (obj.type == static_cast<int32_t>(ResourceType::BOOLEAN)) {
result = resourceWrapper->GetBoolean(static_cast<uint32_t>(obj.id));
return true;
}
return false;
}
bool ViewAbstract::ParseCjIntegerArray(NativeResourceObject& obj, std::vector<uint32_t>& result)
{
CompleteResourceObject(obj);
if (obj.type == UNKNOWN_RESOURCE_TYPE) {
return false;
}
auto resourceObject = GetResourceObjectByBundleAndModule(obj);
auto resourceWrapper = CreateResourceWrapper(obj, resourceObject);
if (!resourceWrapper) {
return false;
}
if (obj.id == -1) {
if (!obj.paramsJsonStr) {
return false;
}
auto params = JsonUtil::ParseJsonString(obj.paramsJsonStr);
if (!params->IsArray()) {
return false;
}
auto param = params->GetArrayItem(0);
if (obj.type == static_cast<int32_t>(ResourceType::INTARRAY)) {
result = resourceWrapper->GetIntArrayByName(param->GetString());
return true;
}
return false;
}
if (obj.type == static_cast<int32_t>(ResourceType::INTARRAY)) {
result = resourceWrapper->GetIntArray(static_cast<uint32_t>(obj.id));
return true;
}
return false;
}
bool ViewAbstract::ParseCjStringArray(NativeResourceObject& obj, std::vector<std::string>& result)
{
CompleteResourceObject(obj);
if (obj.type == UNKNOWN_RESOURCE_TYPE) {
return false;
}
auto resourceObject = GetResourceObjectByBundleAndModule(obj);
auto resourceWrapper = CreateResourceWrapper(obj, resourceObject);
if (!resourceWrapper) {
return false;
}
if (obj.id == -1) {
if (!obj.paramsJsonStr) {
return false;
}
auto params = JsonUtil::ParseJsonString(obj.paramsJsonStr);
if (!params->IsArray()) {
return false;
}
auto param = params->GetArrayItem(0);
if (obj.type == static_cast<int32_t>(ResourceType::STRARRAY)) {
result = resourceWrapper->GetStringArrayByName(param->GetString());
return true;
}
return false;
}
if (obj.type == static_cast<int32_t>(ResourceType::STRARRAY)) {
result = resourceWrapper->GetStringArray(static_cast<uint32_t>(obj.id));
return true;
}
return false;
}
} // namespace OHOS::Ace::Framework

View File

@ -31,6 +31,9 @@
#include "base/utils/macros.h"
#include "bridge/cj_frontend/interfaces/cj_ffi/cj_macro.h"
#include "core/common/container.h"
#include "core/common/resource/resource_manager.h"
#include "core/common/resource/resource_object.h"
#include "core/common/resource/resource_wrapper.h"
#include "core/components/common/properties/decoration.h"
#include "core/components/common/properties/placement.h"
#ifndef __OHOS_NG__
@ -40,11 +43,42 @@
#include "core/components/theme/theme_manager.h"
#include "core/components/transform/transform_component.h"
#endif
#include "core/gestures/tap_gesture.h"
#include "core/pipeline/base/component.h"
#include "ffi_remote_data.h"
#include "core/gestures/tap_gesture.h"
#include "core/pipeline/base/component.h"
extern "C" {
struct NativeResourceObject {
const char* bundleName;
const char* moduleName;
int32_t id;
int32_t type;
const char* paramsJsonStr;
};
}
namespace OHOS::Ace {
enum class ResourceType : uint32_t {
COLOR = 10001,
FLOAT,
STRING,
PLURAL,
BOOLEAN,
INTARRAY,
INTEGER,
PATTERN,
STRARRAY,
MEDIA = 20000,
RAWFILE = 30000
};
}
namespace OHOS::Ace::Framework {
RefPtr<ResourceObject> GetResourceObject(const NativeResourceObject& obj);
RefPtr<ResourceObject> GetResourceObjectByBundleAndModule(const NativeResourceObject& obj);
RefPtr<ResourceWrapper> CreateResourceWrapper(const NativeResourceObject& obj, RefPtr<ResourceObject>& resourceObject);
RefPtr<ResourceWrapper> CreateResourceWrapper();
enum class Align {
TOP_LEFT,
@ -64,7 +98,7 @@ enum class CJResponseType : int32_t {
};
class ACE_EXPORT ViewAbstract : public OHOS::FFI::FFIData {
DECL_TYPE(ViewAbstract, OHOS::FFI::FFIData)
DECL_TYPE(ViewAbstract, OHOS::FFI::FFIData)
public:
ViewAbstract() : FFIData() {}
@ -89,9 +123,69 @@ public:
return themeManager->GetTheme<T>();
}
static RefPtr<ThemeConstants> GetThemeConstants();
static RefPtr<ThemeConstants> GetThemeConstants(
const std::string& bundleName = "", const std::string& moduleName = "");
static void CjEnabled(bool enabled);
static void CompleteResourceObject(NativeResourceObject& obj);
static void CompleteResourceObjectWithBundleName(
NativeResourceObject& obj, std::string& bundleName, std::string& moduleName, int32_t& resId);
static bool ConvertResourceType(const std::string& typeName, ResourceType& resType);
static bool ParseDollarResource(const std::string& resPath, std::string& targetModule, ResourceType& resType,
std::string& resName, bool isParseType);
static bool ParseCjString(NativeResourceObject& obj, std::string& result);
static bool ParseCjMedia(NativeResourceObject& obj, std::string& result);
static bool ParseCjColor(NativeResourceObject& obj, Color& result);
static bool ParseCjDimension(
NativeResourceObject& obj, CalcDimension& result, DimensionUnit defaultUnit, bool isSupportPercent = true);
static bool ParseCjDimensionVP(NativeResourceObject& obj, CalcDimension& result, bool isSupportPercent = true);
static bool ParseCjDimensionFP(NativeResourceObject& obj, CalcDimension& result, bool isSupportPercent = true);
static bool ParseCjDouble(NativeResourceObject& obj, double& result);
static bool ParseCjInteger(NativeResourceObject& obj, uint32_t& result);
static bool ParseCjInteger(NativeResourceObject& obj, int32_t& result);
static bool ParseCjBool(NativeResourceObject& obj, bool& result);
static bool ParseCjIntegerArray(NativeResourceObject& obj, std::vector<uint32_t>& result);
static bool ParseCjStringArray(NativeResourceObject& obj, std::vector<std::string>& result);
template<typename T>
static bool ParseCjInteger(NativeResourceObject& obj, T& result)
{
CompleteResourceObject(obj);
if (obj.type == -1) {
return false;
}
auto resourceObject = GetResourceObjectByBundleAndModule(obj);
auto resourceWrapper = CreateResourceWrapper(obj, resourceObject);
if (!resourceWrapper) {
return false;
}
if (obj.id == -1) {
if (!obj.paramsJsonStr) {
return false;
}
auto params = JsonUtil::ParseJsonString(obj.paramsJsonStr);
if (!params->IsArray()) {
return false;
}
auto param = params->GetArrayItem(0);
if (obj.type == static_cast<int32_t>(ResourceType::INTEGER)) {
result = static_cast<T>(resourceWrapper->GetIntByName(param->GetString()));
return true;
}
return false;
}
if (obj.type == static_cast<int32_t>(ResourceType::INTEGER)) {
result = static_cast<T>(resourceWrapper->GetInt(static_cast<uint32_t>(obj.id)));
return true;
}
return false;
}
private:
static void CompleteResourceObjectInner(
NativeResourceObject& obj, std::string& bundleName, std::string& moduleName, int32_t& resIdValue);
static bool ParseCjMediaInternal(NativeResourceObject& obj, std::string& result);
};
} // namespace OHOS::Ace::Framework
#endif // FRAMEWORKS_BRIDGE_CJ_FRONTEND_CPP_VIEW_VIEW_ABSTRACT_H

View File

@ -113,6 +113,13 @@ struct CJOffset {
double yOffset;
};
struct CJRectResult {
double x;
double y;
double width;
double height;
};
struct CJTouchInfo {
uint8_t type;
int32_t fingerId;

View File

@ -83,7 +83,7 @@ void FfiOHOSAceFrameworkDatePickerCreate(FfiTime startDate, FfiTime endDate, Ffi
ConvertToNoramlDate(parseStartDate);
ConvertToNoramlDate(parseEndDate);
ConvertToNoramlDate(parseSelectedDate);
auto startDays = parseStartDate.ToDays();
auto endDays = parseEndDate.ToDays();
auto selectedDays = parseSelectedDate.ToDays();
@ -107,6 +107,51 @@ void FfiOHOSAceFrameworkDatePickerCreate(FfiTime startDate, FfiTime endDate, Ffi
FfiOHOSAceFrameworkDatePickerSetDefaultAttributes();
}
// create with changeEvent
void FfiOHOSAceFrameworkDatePickerCreateWithChangeEvent(
FfiTime startDate, FfiTime endDate, FfiTime selectedDate, void (*callback)(FfiTime selectedDate))
{
auto theme = GetTheme<PickerTheme>();
CHECK_NULL_VOID(theme);
auto parseStartDate = ParseDate(startDate);
auto parseEndDate = ParseDate(endDate);
auto parseSelectedDate = ParseDate(selectedDate);
ConvertToNoramlDate(parseStartDate);
ConvertToNoramlDate(parseEndDate);
ConvertToNoramlDate(parseSelectedDate);
auto startDays = parseStartDate.ToDays();
auto endDays = parseEndDate.ToDays();
auto selectedDays = parseSelectedDate.ToDays();
if (startDays > endDays) {
parseStartDate = theme->GetDefaultStartDate();
parseEndDate = theme->GetDefaultEndDate();
startDays = parseStartDate.ToDays();
endDays = parseEndDate.ToDays();
}
if (selectedDays > endDays) {
parseSelectedDate = parseEndDate;
}
if (selectedDays < startDays) {
parseSelectedDate = parseStartDate;
}
DatePickerModel::GetInstance()->CreateDatePicker(theme);
DatePickerModel::GetInstance()->SetStartDate(parseStartDate);
DatePickerModel::GetInstance()->SetEndDate(parseEndDate);
DatePickerModel::GetInstance()->SetSelectedDate(parseSelectedDate);
auto changeEvent = [lambda = CJLambda::Create(callback)](const BaseEventInfo* index) -> void {
auto* eventInfo = TypeInfoHelper::DynamicCast<DatePickerChangeEvent>(index);
const auto infoResult = DatePickerChangeEventToFfi(*eventInfo);
lambda(FfiTime { infoResult.year, infoResult.month, infoResult.day });
};
DatePickerModel::GetInstance()->SetChangeEvent(std::move(changeEvent));
FfiOHOSAceFrameworkDatePickerSetDefaultAttributes();
}
void FfiOHOSAceFrameworkDatePickerSetLunar(bool isLunar)
{
DatePickerModel::GetInstance()->SetShowLunar(isLunar);
@ -117,8 +162,7 @@ void FfiOHOSAceFrameworkDatePickerUseMilitaryTime(bool isUseMilitaryTime)
DatePickerModel::GetInstance()->SetHour24(isUseMilitaryTime);
}
void FfiOHOSAceFrameworkDatePickerSetOnChange(
void (*callback)(int32_t year, int32_t month, int32_t day))
void FfiOHOSAceFrameworkDatePickerSetOnChange(void (*callback)(int64_t year, int64_t month, int64_t day))
{
auto onChange = [lambda = CJLambda::Create(callback)](const BaseEventInfo* index) -> void {
auto* eventInfo = TypeInfoHelper::DynamicCast<DatePickerChangeEvent>(index);
@ -135,7 +179,7 @@ void FfiOHOSAceFrameworkDatePickerSetOnChange(
}
void FfiOHOSAceFrameworkDatePickerSetOnDateChange(
void (*callback)(int32_t year, int32_t month, int32_t day))
void (*callback)(int64_t year, int64_t month, int64_t day))
{
auto onDateChange = [lambda = CJLambda::Create(callback)](const BaseEventInfo* index) -> void {
auto* eventInfo = TypeInfoHelper::DynamicCast<DatePickerChangeEvent>(index);

View File

@ -22,9 +22,9 @@
extern "C" {
struct FFiDatePickerResult {
int32_t year;
int32_t month;
int32_t day;
int64_t year;
int64_t month;
int64_t day;
};
struct FfiTime {
@ -38,12 +38,13 @@ struct FfiTime {
};
CJ_EXPORT void FfiOHOSAceFrameworkDatePickerCreate(FfiTime startDate, FfiTime endDate, FfiTime selectedDate);
CJ_EXPORT void FfiOHOSAceFrameworkDatePickerCreateWithChangeEvent(
FfiTime startDate, FfiTime endDate, FfiTime selectedDate, void (*callback)(FfiTime selectedDate));
CJ_EXPORT void FfiOHOSAceFrameworkDatePickerSetLunar(bool isLunar);
CJ_EXPORT void FfiOHOSAceFrameworkDatePickerUseMilitaryTime(bool isUseMilitaryTime);
CJ_EXPORT void FfiOHOSAceFrameworkDatePickerSetBackgroundColor(uint32_t color);
CJ_EXPORT void FfiOHOSAceFrameworkDatePickerSetOnChange(void (*callback)(int32_t year, int32_t month, int32_t day));
CJ_EXPORT void FfiOHOSAceFrameworkDatePickerSetOnDateChange(
void (*callback)(int32_t year, int32_t month, int32_t day));
CJ_EXPORT void FfiOHOSAceFrameworkDatePickerSetOnChange(void (*callback)(int64_t year, int64_t month, int64_t day));
CJ_EXPORT void FfiOHOSAceFrameworkDatePickerSetOnDateChange(void (*callback)(int64_t year, int64_t month, int64_t day));
CJ_EXPORT void FfiOHOSAceFrameworkDatePickerSetDisappearTextStyle(uint32_t color, double size,
int32_t unit, const char* weight, const char* family, uint32_t style);
CJ_EXPORT void FfiOHOSAceFrameworkDatePickerSetTextStyle(uint32_t color, double size, int32_t unit,

View File

@ -25,6 +25,10 @@ using namespace OHOS::FFI;
using namespace OHOS::Ace::Framework;
namespace {
constexpr int32_t SNAP_START_INDEX = 0;
constexpr double DEFAULT_DIMENSION_VALUE = 0.0;
constexpr double DEFAULT_DURATION = 1000.0;
const std::vector<Axis> AXIS = { Axis::VERTICAL, Axis::HORIZONTAL, Axis::FREE, Axis::NONE };
const std::vector<DisplayMode> DISPLAY_MODE = { DisplayMode::OFF, DisplayMode::AUTO, DisplayMode::ON };
const std::vector<ScrollEdgeType> SCROLL_EDGE_TYPES = { ScrollEdgeType::SCROLL_TOP, ScrollEdgeType::SCROLL_NONE,
@ -32,6 +36,21 @@ const std::vector<ScrollEdgeType> SCROLL_EDGE_TYPES = { ScrollEdgeType::SCROLL_T
ScrollEdgeType::SCROLL_BOTTOM };
const std::vector<ScrollAlign> SCROLL_ALIGN_LIST = { ScrollAlign::START, ScrollAlign::CENTER, ScrollAlign::END,
ScrollAlign::AUTO, ScrollAlign::NONE };
bool CheckSnapPagination(const std::vector<Dimension>& snapPagination)
{
CHECK_NULL_RETURN(!snapPagination.empty(), false);
float preValue = (*snapPagination.begin()).Value();
CHECK_NULL_RETURN(!Negative(preValue), false);
auto unit = (*snapPagination.begin()).Unit();
for (auto iter = snapPagination.begin() + 1; iter < snapPagination.end(); ++iter) {
if (Negative((*iter).Value()) || (*iter).Unit() != unit || LessOrEqual((*iter).Value(), preValue)) {
return false;
}
preValue = (*iter).Value();
}
return true;
}
} // namespace
namespace OHOS::Ace::Framework {
@ -41,8 +60,8 @@ NativeNGScroller::NativeNGScroller() : FFIData()
LOGI("Scroller constructed: %{public}" PRId64, GetID());
}
void NativeNGScroller::ScrollTo(
const Dimension& xOffset, const Dimension& yOffset, double duration, const RefPtr<Curve>& curve)
void NativeNGScroller::ScrollTo(const Dimension& xOffset, const Dimension& yOffset, double duration,
const RefPtr<Curve>& curve, bool smooth, bool canOverScroll)
{
if (!controller_) {
LOGE("controller_ is nullptr");
@ -50,8 +69,7 @@ void NativeNGScroller::ScrollTo(
}
auto direction = controller_->GetScrollDirection();
auto position = direction == Axis::VERTICAL ? yOffset : xOffset;
bool smooth = false;
controller_->AnimateTo(position, duration, curve, smooth);
controller_->AnimateTo(position, static_cast<float>(duration), curve, smooth, canOverScroll);
}
void NativeNGScroller::ScrollBy(const Dimension& xOffset, const Dimension& yOffset)
@ -82,31 +100,50 @@ void NativeNGScroller::ScrollBy(const Dimension& xOffset, const Dimension& yOffs
controller_->ScrollBy(deltaX, deltaY, false);
}
void NativeNGScroller::ScrollEdge(ScrollEdgeType edge)
void NativeNGScroller::ScrollEdge(ScrollEdgeType edge, float velocity)
{
if (!controller_) {
LOGE("controller_ is nullptr");
return;
}
if (velocity > 0) {
velocity = Dimension(velocity, DimensionUnit::VP).ConvertToPx();
controller_->ScrollToEdge(edge, velocity);
return;
}
controller_->ScrollToEdge(edge, true);
}
void NativeNGScroller::ScrollPage(bool next)
void NativeNGScroller::ScrollFling(double velocity)
{
if (NearZero(velocity)) {
return;
}
if (!controller_) {
LOGE("controller_ is nullptr");
return;
}
controller_->ScrollPage(!next, true);
velocity = Dimension(velocity, DimensionUnit::VP).ConvertToPx();
controller_->Fling(velocity);
}
void NativeNGScroller::ScrollToIndex(int32_t index, bool smooth, int32_t align)
void NativeNGScroller::ScrollPage(bool next, bool animation)
{
if (!controller_) {
LOGE("controller_ is nullptr");
return;
}
controller_->ScrollToIndex(index, smooth, SCROLL_ALIGN_LIST[align]);
controller_->ScrollPage(!next, animation);
}
void NativeNGScroller::ScrollToIndex(int32_t index, bool smooth, int32_t align, double offset, int32_t unit)
{
if (!controller_) {
LOGE("controller_ is nullptr");
return;
}
auto extraOffset = Dimension(offset, static_cast<DimensionUnit>(unit)).ConvertToPx();
controller_->ScrollToIndex(index, smooth, SCROLL_ALIGN_LIST[align], extraOffset);
}
Offset NativeNGScroller::CurrentOffset()
@ -118,6 +155,44 @@ Offset NativeNGScroller::CurrentOffset()
return controller_->GetCurrentOffset();
}
bool NativeNGScroller::IsAtEnd()
{
if (!controller_) {
LOGE("controller_ is nullptr");
return false;
}
return controller_->IsAtEnd();
}
Rect NativeNGScroller::GetItemRect(int32_t index)
{
if (!controller_) {
LOGE("controller_ is nullptr");
return Rect();
}
return controller_->GetItemRect(index);
}
int32_t NativeNGScroller::GetItemIndex(const Dimension& xOffset, const Dimension& yOffset)
{
if (!controller_) {
LOGE("controller_ is nullptr");
return -1;
}
auto deltaX = xOffset.Value();
auto deltaY = yOffset.Value();
auto container = Container::Current();
if (container) {
auto context = container->GetPipelineContext();
if (context) {
deltaX = context->NormalizeToPx(xOffset);
deltaY = context->NormalizeToPx(yOffset);
}
}
return controller_->GetItemIndex(deltaX, deltaY);
}
} // namespace OHOS::Ace::Framework
extern "C" {
@ -182,11 +257,10 @@ void FfiOHOSAceFrameworkScrollScrollBarColor(uint32_t color)
ScrollModel::GetInstance()->SetScrollBarColor(Color(color));
}
void FfiOHOSAceFrameworkScrollSetOnScrollFrameBegin(double (*callback)(double offset, int32_t state))
{
auto lambda = [callback = CJLambda::Create(callback)](const Dimension& offset, const ScrollState& state)
-> ScrollFrameResult {
auto lambda = [callback = CJLambda::Create(callback)](
const Dimension& offset, const ScrollState& state) -> ScrollFrameResult {
auto res = callback(offset.Value(), static_cast<int32_t>(state));
ScrollFrameResult scrollRes { .offset = Dimension { res, DimensionUnit::VP } };
return scrollRes;
@ -202,11 +276,68 @@ void FfiOHOSAceFrameworkScrollScrollBarWidth(double width, int32_t unit)
void FfiOHOSAceFrameworkScrollNestedScroll(int32_t scrollForward, int32_t scrollBackward)
{
NestedScrollOptions localNestedScrollOptions = {.forward = NestedScrollMode(scrollForward),
.backward = NestedScrollMode(scrollBackward)};
NestedScrollOptions localNestedScrollOptions = { .forward = NestedScrollMode(scrollForward),
.backward = NestedScrollMode(scrollBackward) };
ScrollModel::GetInstance()->SetNestedScroll(localNestedScrollOptions);
}
void FfiOHOSAceFrameworkScrollEnablePaging(bool enablePaging)
{
ScrollModel::GetInstance()->SetEnablePaging(enablePaging);
}
void FfiOHOSAceFrameworkScrollInteraction(bool interaction)
{
ScrollModel::GetInstance()->SetScrollEnabled(interaction);
}
void FfiOHOSAceFrameworkScrollFriction(double friction)
{
ScrollModel::GetInstance()->SetFriction(friction);
}
void FfiOHOSAceFrameworkScrollEdgeEffect(int32_t edgeEffect, bool alwaysEnabled)
{
ScrollModel::GetInstance()->SetEdgeEffect(static_cast<EdgeEffect>(edgeEffect), alwaysEnabled);
}
void FfiOHOSAceFrameworkScrollScrollsnap(ScrollSnapOptionsParams params)
{
const auto& snapValue = *reinterpret_cast<std::vector<float>*>(params.vHandle);
const auto& snapUnit = *reinterpret_cast<std::vector<int32_t>*>(params.pHandle);
std::pair<bool, bool> enableSnapToSide = { params.enableSnapToStart, params.enableSnapToSEnd };
std::vector<Dimension> snapPagination;
CalcDimension intervalSize;
if (params.isArry) {
for (auto i = 0; i < params.size; i++) {
auto pValue = snapValue[i];
auto pUnit = static_cast<DimensionUnit>(snapUnit[i]);
CalcDimension dms = Dimension(pValue, pUnit);
snapPagination.push_back(dms);
}
intervalSize = CalcDimension(DEFAULT_DIMENSION_VALUE);
} else {
auto pValue = snapValue[SNAP_START_INDEX];
auto pUnit = static_cast<DimensionUnit>(snapUnit[SNAP_START_INDEX]);
intervalSize = Dimension(pValue, pUnit);
}
if (!CheckSnapPagination(snapPagination)) {
std::vector<Dimension>().swap(snapPagination);
}
ScrollModel::GetInstance()->SetScrollSnap(
static_cast<ScrollSnapAlign>(params.snapAlign), intervalSize, snapPagination, enableSnapToSide);
}
void FfiOHOSAceFrameworkScrollInitialOffset(float xOffsetValue, int32_t xUnit, float yOffsetValue, int32_t yUnit)
{
CalcDimension xOffset = CalcDimension(xOffsetValue, static_cast<OHOS::Ace::DimensionUnit>(xUnit));
CalcDimension yOffset = CalcDimension(yOffsetValue, static_cast<OHOS::Ace::DimensionUnit>(yUnit));
ScrollModel::GetInstance()->SetInitialOffset(NG::OffsetT(xOffset, yOffset));
}
void FfiOHOSAceFrameworkScrollOnScroll(void (*callback)(CJOffset scrollInfo))
{
ScrollModel::GetInstance()->SetOnScroll(
@ -218,6 +349,30 @@ void FfiOHOSAceFrameworkScrollOnScroll(void (*callback)(CJOffset scrollInfo))
});
}
void FfiOHOSAceFrameworkScrollOnWillScroll(
CJOffset (*callback)(double xOffset, double yOffset, int32_t state, int32_t source))
{
auto lambda = [callback = CJLambda::Create(callback)](const Dimension& xOffset, const Dimension& yOffset,
const ScrollState& state, const ScrollSource& source) -> NG::TwoDimensionScrollResult {
NG::TwoDimensionScrollResult scrollRes { .xOffset = xOffset, .yOffset = yOffset };
CJOffset res =
callback(xOffset.Value(), yOffset.Value(), static_cast<int32_t>(state), static_cast<int32_t>(source));
scrollRes.xOffset = Dimension { res.xOffset, DimensionUnit::VP };
scrollRes.yOffset = Dimension { res.yOffset, DimensionUnit::VP };
return scrollRes;
};
ScrollModel::GetInstance()->SetOnWillScroll(lambda);
}
void FfiOHOSAceFrameworkScrollOnDidScroll(void (*callback)(double xOffset, double yOffset, int32_t state))
{
auto lambda = [callback = CJLambda::Create(callback)](
const Dimension& xOffset, const Dimension& yOffset, const ScrollState& state) {
callback(xOffset.Value(), yOffset.Value(), static_cast<int32_t>(state));
};
ScrollModel::GetInstance()->SetOnDidScroll(lambda);
}
void FfiOHOSAceFrameworkScrollOnScrollEdge(void (*callback)(int32_t edge))
{
ScrollModel::GetInstance()->SetOnScrollEdge(
@ -230,6 +385,16 @@ void FfiOHOSAceFrameworkScrollOnScrollEnd(void (*callback)())
ScrollModel::GetInstance()->SetOnScrollEnd(CJLambda::Create(callback));
}
void FfiOHOSAceFrameworkScrollOnScrollStart(void (*callback)())
{
ScrollModel::GetInstance()->SetOnScrollStart(CJLambda::Create(callback));
}
void FfiOHOSAceFrameworkScrollOnScrollStop(void (*callback)())
{
ScrollModel::GetInstance()->SetOnScrollStop(CJLambda::Create(callback));
}
int64_t FfiOHOSAceFrameworkScrollerCtor()
{
auto nativeScroller = FFIData::Create<NativeNGScroller>();
@ -241,31 +406,55 @@ int64_t FfiOHOSAceFrameworkScrollerCtor()
void FfiOHOSAceFrameworkScrollerScrollTo(int64_t selfID, double xOffset, int32_t xUnit, double yOffset, int32_t yUnit)
{
double duration = 0.0;
bool smooth = false;
bool canOverScroll = false;
RefPtr<Curve> curve = Curves::EASE;
Dimension xValue(xOffset, static_cast<DimensionUnit>(xUnit));
Dimension yValue(yOffset, static_cast<DimensionUnit>(yUnit));
auto self_ = FFIData::GetData<NativeNGScroller>(selfID);
if (self_ != nullptr) {
self_->ScrollTo(xValue, yValue, 0.0, Curves::EASE);
self_->ScrollTo(xValue, yValue, duration, curve, smooth, canOverScroll);
} else {
LOGE("invalid scrollerID");
}
}
void FfiOHOSAceFrameworkScrollerScrollToByCurve(
int64_t selfID, double xOffset, int32_t xUnit, double yOffset, int32_t yUnit, double duration, const char* curve)
void FfiOHOSAceFrameworkScrollerScrollToAnimation(
int64_t selfID, double xOffset, int32_t xUnit, double yOffset, int32_t yUnit, bool smooth)
{
double duration = 0.0;
bool canOverScroll = false;
RefPtr<Curve> curve = Curves::EASE;
Dimension xValue(xOffset, static_cast<DimensionUnit>(xUnit));
Dimension yValue(yOffset, static_cast<DimensionUnit>(yUnit));
auto self_ = FFIData::GetData<NativeNGScroller>(selfID);
if (self_ != nullptr) {
self_->ScrollTo(xValue, yValue, duration, curve, smooth, canOverScroll);
} else {
LOGE("invalid scrollerID");
}
}
void FfiOHOSAceFrameworkScrollerScrollToAnimationOptions(int64_t selfID, double xOffset, int32_t xUnit, double yOffset,
int32_t yUnit, double duration, const char* curve, bool canOverScroll)
{
Dimension xValue(xOffset, static_cast<DimensionUnit>(xUnit));
Dimension yValue(yOffset, static_cast<DimensionUnit>(yUnit));
auto self_ = FFIData::GetData<NativeNGScroller>(selfID);
if (self_ != nullptr) {
self_->ScrollTo(xValue, yValue, duration, CreateCurve(curve, false));
bool hasDuration = true;
if (Negative(duration)) {
duration = DEFAULT_DURATION;
hasDuration = false;
}
self_->ScrollTo(xValue, yValue, duration, CreateCurve(curve, false), !hasDuration, canOverScroll);
} else {
LOGE("invalid scrollerID");
}
}
void FfiOHOSAceFrameworkScrollerScrollBy(
int64_t selfID, double xOffset, int32_t xUnit, double yOffset, int32_t yUnit)
void FfiOHOSAceFrameworkScrollerScrollBy(int64_t selfID, double xOffset, int32_t xUnit, double yOffset, int32_t yUnit)
{
Dimension xValue(xOffset, static_cast<DimensionUnit>(xUnit));
Dimension yValue(yOffset, static_cast<DimensionUnit>(yUnit));
@ -276,17 +465,19 @@ void FfiOHOSAceFrameworkScrollerScrollBy(
LOGE("Scroll controller is null: invalid scrollerID");
}
}
void FfiOHOSAceFrameworkScrollerScrollToIndex(int64_t selfID, int32_t index, bool smooth, int32_t align)
void FfiOHOSAceFrameworkScrollerScrollToIndex(
int64_t selfID, int32_t index, bool smooth, int32_t align, double offset, int32_t unit)
{
auto self_ = FFIData::GetData<NativeNGScroller>(selfID);
if (self_ != nullptr) {
self_->ScrollToIndex(index, smooth, align);
self_->ScrollToIndex(index, smooth, align, offset, unit);
} else {
LOGE("invalid scrollerID");
}
}
void FfiOHOSAceFrameworkScrollerScrollEdge(int64_t selfID, int32_t edge)
void FfiOHOSAceFrameworkScrollerScrollEdge(int64_t selfID, int32_t edge, float velocity)
{
if (!Utils::CheckParamsValid(edge, SCROLL_EDGE_TYPES.size())) {
LOGE("invalid value for DisplayMode");
@ -294,17 +485,27 @@ void FfiOHOSAceFrameworkScrollerScrollEdge(int64_t selfID, int32_t edge)
}
auto self_ = FFIData::GetData<NativeNGScroller>(selfID);
if (self_ != nullptr) {
self_->ScrollEdge(SCROLL_EDGE_TYPES[edge]);
self_->ScrollEdge(SCROLL_EDGE_TYPES[edge], velocity);
} else {
LOGE("invalid scrollerID");
}
}
void FfiOHOSAceFrameworkScrollerScrollPage(int64_t selfID, bool next)
void FfiOHOSAceFrameworkScrollerScrollFling(int64_t selfID, double velocity)
{
auto self_ = FFIData::GetData<NativeNGScroller>(selfID);
if (self_ != nullptr) {
self_->ScrollPage(next);
self_->ScrollFling(velocity);
} else {
LOGE("invalid scrollerID");
}
}
void FfiOHOSAceFrameworkScrollerScrollPage(int64_t selfID, bool next, bool animation)
{
auto self_ = FFIData::GetData<NativeNGScroller>(selfID);
if (self_ != nullptr) {
self_->ScrollPage(next, animation);
} else {
LOGE("invalid scrollerID");
}
@ -323,4 +524,47 @@ CJOffset FfiOHOSAceFrameworkScrollerCurrentOffset(int64_t selfID)
}
return cjOffset;
}
bool FfiOHOSAceFrameworkScrollerIsAtEnd(int64_t selfID)
{
bool isAtEnd = false;
auto self_ = FFIData::GetData<NativeNGScroller>(selfID);
if (self_ != nullptr) {
isAtEnd = self_->IsAtEnd();
} else {
LOGE("invalid scrollerID");
}
return isAtEnd;
}
CJRectResult FfiOHOSAceFrameworkScrollerGetItemRect(int64_t selfID, int32_t index)
{
CJRectResult cjRectResult = { 0.0, 0.0, 0.0, 0.0 };
auto self_ = FFIData::GetData<NativeNGScroller>(selfID);
if (self_ != nullptr) {
auto rectResult = self_->GetItemRect(index);
cjRectResult.x = rectResult.Left();
cjRectResult.y = rectResult.Top();
cjRectResult.width = rectResult.Width();
cjRectResult.height = rectResult.Height();
} else {
LOGE("invalid scrollerID");
}
return cjRectResult;
}
int32_t FfiOHOSAceFrameworkScrollerGetItemIndex(
int64_t selfID, double xOffset, int32_t xUnit, double yOffset, int32_t yUnit)
{
int32_t res = -1;
Dimension xValue(xOffset, static_cast<DimensionUnit>(xUnit));
Dimension yValue(yOffset, static_cast<DimensionUnit>(yUnit));
auto self_ = FFIData::GetData<NativeNGScroller>(selfID);
if (self_ != nullptr) {
res = self_->GetItemIndex(xValue, yValue);
} else {
LOGE("invalid scrollerID");
}
return res;
}
}

View File

@ -22,6 +22,9 @@
#include "core/components_ng/pattern/scroll_bar/proxy/scroll_bar_proxy.h"
#include "ffi_remote_data.h"
using VectorInt32Ptr = void*;
using VectorFloat32Ptr = void*;
namespace OHOS::Ace::Framework {
class ACE_EXPORT NativeNGScroller : public OHOS::FFI::FFIData {
@ -29,13 +32,17 @@ class ACE_EXPORT NativeNGScroller : public OHOS::FFI::FFIData {
public:
NativeNGScroller();
void ScrollTo(
const Dimension& xOffset, const Dimension& yOffset, double duration, const RefPtr<Curve>& curve);
void ScrollEdge(ScrollEdgeType edge);
void ScrollPage(bool next);
void ScrollTo(const Dimension& xOffset, const Dimension& yOffset, double duration, const RefPtr<Curve>& curve,
bool smooth, bool canOverscroll);
void ScrollEdge(ScrollEdgeType edge, float velocity);
void ScrollFling(double velocity);
void ScrollPage(bool next, bool animation);
void ScrollBy(const Dimension& xOffset, const Dimension& yOffset);
void ScrollToIndex(int32_t index, bool smooth, int32_t align);
void ScrollToIndex(int32_t index, bool smooth, int32_t align, double offset, int32_t unit);
Offset CurrentOffset();
bool IsAtEnd();
Rect GetItemRect(int32_t index);
int32_t GetItemIndex(const Dimension& xOffset, const Dimension& yOffset);
RefPtr<ScrollControllerBase>& GetController()
{
@ -65,27 +72,56 @@ private:
} // namespace OHOS::Ace::Framework
extern "C" {
struct ScrollSnapOptionsParams {
int32_t snapAlign;
VectorFloat32Ptr vHandle;
VectorInt32Ptr pHandle;
int32_t size;
bool enableSnapToStart;
bool enableSnapToSEnd;
bool isArry;
};
CJ_EXPORT void FfiOHOSAceFrameworkScrollCreate(int64_t scrollerID);
CJ_EXPORT void FfiOHOSAceFrameworkScrollScrollable(int32_t scrollDirection);
CJ_EXPORT void FfiOHOSAceFrameworkScrollScrollBar(int32_t barState);
CJ_EXPORT void FfiOHOSAceFrameworkScrollScrollBarColor(uint32_t color);
CJ_EXPORT void FfiOHOSAceFrameworkScrollScrollBarWidth(double width, int32_t unit);
CJ_EXPORT void FfiOHOSAceFrameworkScrollNestedScroll(int32_t scrollForward, int32_t scrollBackward);
CJ_EXPORT void FfiOHOSAceFrameworkScrollEnablePaging(bool enablePaging);
CJ_EXPORT void FfiOHOSAceFrameworkScrollInteraction(bool interaction);
CJ_EXPORT void FfiOHOSAceFrameworkScrollFriction(double friction);
CJ_EXPORT void FfiOHOSAceFrameworkScrollEdgeEffect(int32_t edgeEffect, bool alwaysEnabled);
CJ_EXPORT void FfiOHOSAceFrameworkScrollScrollsnap(ScrollSnapOptionsParams params);
CJ_EXPORT void FfiOHOSAceFrameworkScrollInitialOffset(float xOffset, int32_t xUnit, float yOffset, int32_t yUnit);
CJ_EXPORT void FfiOHOSAceFrameworkScrollOnScroll(void (*callback)(CJOffset offset));
CJ_EXPORT void FfiOHOSAceFrameworkScrollOnScrollEdge(void (*callback)(int32_t edge));
CJ_EXPORT void FfiOHOSAceFrameworkScrollOnScrollEnd(void (*callback)());
CJ_EXPORT void FfiOHOSAceFrameworkScrollOnWillScroll(
CJOffset (*callback)(double xOffset, double yOffset, int32_t state, int32_t source));
CJ_EXPORT void FfiOHOSAceFrameworkScrollOnDidScroll(void (*callback)(double xOffset, double yOffset, int32_t state));
CJ_EXPORT void FfiOHOSAceFrameworkScrollOnScrollStart(void (*callback)());
CJ_EXPORT void FfiOHOSAceFrameworkScrollOnScrollStop(void (*callback)());
CJ_EXPORT int64_t FfiOHOSAceFrameworkScrollerCtor();
CJ_EXPORT void FfiOHOSAceFrameworkScrollerScrollTo(
int64_t selfID, double xOffset, int32_t xUnit, double yOffset, int32_t yUnit);
CJ_EXPORT void FfiOHOSAceFrameworkScrollerScrollToByCurve(
int64_t selfID, double xOffset, int32_t xUnit, double yOffset, int32_t yUnit, double duration, const char* curve);
CJ_EXPORT void FfiOHOSAceFrameworkScrollerScrollToAnimation(
int64_t selfID, double xOffset, int32_t xUnit, double yOffset, int32_t yUnit, bool smooth);
CJ_EXPORT void FfiOHOSAceFrameworkScrollerScrollToAnimationOptions(int64_t selfID, double xOffset, int32_t xUnit,
double yOffset, int32_t yUnit, double duration, const char* curve, bool canOverScroll);
CJ_EXPORT void FfiOHOSAceFrameworkScrollerScrollBy(
int64_t selfID, double xOffset, int32_t xUnit, double yOffset, int32_t yUnit);
CJ_EXPORT void FfiOHOSAceFrameworkScrollerScrollEdge(int64_t selfID, int32_t edge);
CJ_EXPORT void FfiOHOSAceFrameworkScrollerScrollToIndex(int64_t selfID, int32_t index, bool smooth, int32_t align);
CJ_EXPORT void FfiOHOSAceFrameworkScrollerScrollPage(int64_t selfID, bool next);
CJ_EXPORT void FfiOHOSAceFrameworkScrollerScrollEdge(int64_t selfID, int32_t edge, float velocity);
CJ_EXPORT void FfiOHOSAceFrameworkScrollerScrollFling(int64_t selfID, double velocity);
CJ_EXPORT void FfiOHOSAceFrameworkScrollerScrollToIndex(
int64_t selfID, int32_t index, bool smooth, int32_t align, double offset, int32_t unit);
CJ_EXPORT void FfiOHOSAceFrameworkScrollerScrollPage(int64_t selfID, bool next, bool animation);
CJ_EXPORT void FfiOHOSAceFrameworkScrollSetOnScrollFrameBegin(double (*callback)(double offset, int32_t state));
CJ_EXPORT CJOffset FfiOHOSAceFrameworkScrollerCurrentOffset(int64_t selfID);
CJ_EXPORT bool FfiOHOSAceFrameworkScrollerIsAtEnd(int64_t selfID);
CJ_EXPORT CJRectResult FfiOHOSAceFrameworkScrollerGetItemRect(int64_t selfID, int32_t index);
CJ_EXPORT int32_t FfiOHOSAceFrameworkScrollerGetItemIndex(
int64_t selfID, double xOffset, int32_t xUnit, double yOffset, int32_t yUnit);
}
#endif // OHOS_ACE_FRAMEWORK_CJ_SCROLL_FFI_H

View File

@ -36,12 +36,8 @@ const std::vector<CopyOptions> COPY_OPTION = {
CopyOptions::Distributed,
};
void handleFont(double fontSize,
int32_t sizeUnit,
const char* fontWeight,
int32_t fontStyle,
const char* fontFamily,
Font& font)
void handleFont(
double fontSize, int32_t sizeUnit, const char* fontWeight, int32_t fontStyle, const char* fontFamily, Font& font)
{
Dimension fontSizeDim(fontSize, static_cast<DimensionUnit>(sizeUnit));
font.fontSize = fontSizeDim;
@ -66,8 +62,8 @@ void FfiOHOSAceFrameworkSearchCreateByIconID(SearchCreateParam value)
} else {
auto self_ = FFIData::GetData<SearchController>(value.controllerID);
if (self_ != nullptr) {
auto controller = SearchModel::GetInstance()->Create(key, tip, src);
self_->SetController(controller);
auto controller = SearchModel::GetInstance()->Create(key, tip, src);
self_->SetController(controller);
} else {
LOGE("invalid scrollerID");
}
@ -77,6 +73,25 @@ void FfiOHOSAceFrameworkSearchCreateByIconID(SearchCreateParam value)
SearchModel::GetInstance()->SetSearchSrcPath(iconUrl, bundleName, moduleName);
}
void FfiOHOSAceFrameworkSearchCreateByIconRes(
const char* value, const char* placeholder, const char* iconUrl, int64_t controllerId)
{
std::optional<std::string> key = value;
std::optional<std::string> tip = placeholder;
std::optional<std::string> src = iconUrl;
if (controllerId == -1) {
SearchModel::GetInstance()->Create(key, tip, src);
} else {
auto nativeController = FFIData::GetData<SearchController>(controllerId);
if (nativeController != nullptr) {
auto controller = SearchModel::GetInstance()->Create(key, tip, src);
nativeController->SetController(controller);
} else {
LOGE("Invalid controller id.");
}
}
}
void FfiOHOSAceFrameworkSearchSetSearchButton(const char* text)
{
SearchModel::GetInstance()->SetSearchButton(text);
@ -117,8 +132,8 @@ void FfiOHOSAceFrameworkSearchSetBorder(SearchSetBorder value)
LOGE("invalid value for style");
return;
}
FfiOHOSAceFrameworkViewAbstractSetBorder(CJBorder({
value.width, value.widthUnit, value.color, value.radius, value.radiusUnit, value.style }));
FfiOHOSAceFrameworkViewAbstractSetBorder(
CJBorder({ value.width, value.widthUnit, value.color, value.radius, value.radiusUnit, value.style }));
SearchModel::GetInstance()->SetBackBorder();
}
@ -177,8 +192,8 @@ void FfiOHOSAceFrameworkSearchOnSubmit(void (*callback)(const char* value))
void FfiOHOSAceFrameworkSearchOnChange(void (*callback)(const char* value))
{
auto onChange = [lambda = CJLambda::Create(callback)](const std::string& value,
PreviewText& previewText) -> void { lambda(value.c_str()); };
auto onChange = [lambda = CJLambda::Create(callback)](
const std::string& value, PreviewText& previewText) -> void { lambda(value.c_str()); };
SearchModel::GetInstance()->SetOnChange(std::move(onChange));
}

View File

@ -59,6 +59,8 @@ CJ_EXPORT void FfiOHOSAceFrameworkSearchOnPaste(void (*callback)(const char* val
CJ_EXPORT int64_t FfiOHOSAceFrameworkSearchController();
CJ_EXPORT void FfiOHOSAceFrameworkSearchCaretPosition(int64_t selfID, int32_t carePosition);
CJ_EXPORT void FfiOHOSAceFrameworkSearchCreateByIconRes(
const char* value, const char* placeholder, const char* iconUrl, int64_t controllerId);
}
#endif // OHOS_ACE_FRAMEWORK_CJ_SCROLLBAR_FFI_H

View File

@ -15,14 +15,14 @@
#include "bridge/cj_frontend/interfaces/cj_ffi/cj_view_abstract_ffi.h"
#include "cj_lambda.h"
#include "bridge/cj_frontend/interfaces/cj_ffi/matrix4/cj_matrix4_ffi.h"
#include "bridge/cj_frontend/cppview/shape_abstract.h"
#include "bridge/cj_frontend/interfaces/cj_ffi/cj_pixel_unit_convert_ffi.h"
#include "bridge/cj_frontend/interfaces/cj_ffi/matrix4/cj_matrix4_ffi.h"
#include "bridge/common/utils/utils.h"
#include "core/components_ng/base/view_abstract_model_ng.h"
#include "core/components_ng/base/view_stack_model.h"
#include "bridge/cj_frontend/cppview/shape_abstract.h"
using namespace OHOS::Ace;
using namespace OHOS::FFI;
@ -79,24 +79,11 @@ const std::vector<Alignment> ALIGNMENT_LIST = { Alignment::TOP_LEFT, Alignment::
Alignment::CENTER_LEFT, Alignment::CENTER, Alignment::CENTER_RIGHT, Alignment::BOTTOM_LEFT,
Alignment::BOTTOM_CENTER, Alignment::BOTTOM_RIGHT };
const std::vector<RenderFit> RENDERFITS = {
RenderFit::CENTER,
RenderFit::TOP,
RenderFit::BOTTOM,
RenderFit::LEFT,
RenderFit::RIGHT,
RenderFit::TOP_LEFT,
RenderFit::TOP_RIGHT,
RenderFit::BOTTOM_LEFT,
RenderFit::BOTTOM_RIGHT,
RenderFit::RESIZE_FILL,
RenderFit::RESIZE_CONTAIN,
RenderFit::RESIZE_CONTAIN_TOP_LEFT,
RenderFit::RESIZE_CONTAIN_BOTTOM_RIGHT,
RenderFit::RESIZE_COVER,
RenderFit::RESIZE_COVER_TOP_LEFT,
RenderFit::RESIZE_COVER_BOTTOM_RIGHT
};
const std::vector<RenderFit> RENDERFITS = { RenderFit::CENTER, RenderFit::TOP, RenderFit::BOTTOM, RenderFit::LEFT,
RenderFit::RIGHT, RenderFit::TOP_LEFT, RenderFit::TOP_RIGHT, RenderFit::BOTTOM_LEFT, RenderFit::BOTTOM_RIGHT,
RenderFit::RESIZE_FILL, RenderFit::RESIZE_CONTAIN, RenderFit::RESIZE_CONTAIN_TOP_LEFT,
RenderFit::RESIZE_CONTAIN_BOTTOM_RIGHT, RenderFit::RESIZE_COVER, RenderFit::RESIZE_COVER_TOP_LEFT,
RenderFit::RESIZE_COVER_BOTTOM_RIGHT };
// Regex for match the placeholder.
const std::regex RESOURCE_APP_STRING_PLACEHOLDER(R"(\%((\d+)(\$)){0,1}([dsf]))", std::regex::icase);
@ -168,9 +155,7 @@ void DealBindPopupParams(bool isShow, const CJBindPopupParams& bindPopupParams,
if (!primaryString.empty()) {
ButtonProperties propertiesPrimary;
propertiesPrimary.value = primaryString;
auto touchPrimaryCallback = [primaryActionFunc](TouchEventInfo&) {
primaryActionFunc();
};
auto touchPrimaryCallback = [primaryActionFunc](TouchEventInfo&) { primaryActionFunc(); };
auto onNewClick = [primaryActionFunc](const GestureEvent& info) -> void { primaryActionFunc(); };
propertiesPrimary.touchFunc = touchPrimaryCallback;
propertiesPrimary.action = AceType::MakeRefPtr<NG::ClickEvent>(onNewClick);
@ -182,9 +167,7 @@ void DealBindPopupParams(bool isShow, const CJBindPopupParams& bindPopupParams,
if (!secondaryString.empty()) {
ButtonProperties propertiesSecondary;
propertiesSecondary.value = secondaryString;
auto touchSecondaryCallback = [secondaryActionFunc](TouchEventInfo&) {
secondaryActionFunc();
};
auto touchSecondaryCallback = [secondaryActionFunc](TouchEventInfo&) { secondaryActionFunc(); };
auto onNewClick = [secondaryActionFunc](const GestureEvent& info) -> void { secondaryActionFunc(); };
propertiesSecondary.touchFunc = touchSecondaryCallback;
propertiesSecondary.action = AceType::MakeRefPtr<NG::ClickEvent>(onNewClick);
@ -661,9 +644,7 @@ void FfiOHOSAceFrameworkViewAbstractSetTranslateY(double translateValue, int32_t
void FfiOHOSAceFrameworkViewAbstractSetTransition()
{
ViewAbstractModel::GetInstance()->SetTransition(
NG::TransitionOptions::GetDefaultTransition(TransitionType::ALL)
);
ViewAbstractModel::GetInstance()->SetTransition(NG::TransitionOptions::GetDefaultTransition(TransitionType::ALL));
}
void FfiOHOSAceFrameworkViewAbstractTransition(int64_t id)
@ -1053,7 +1034,7 @@ void FfiOHOSAceFrameworkViewAbstractBindPopup(bool isShow, CJBindPopupParams bin
}
void FfiOHOSAceFrameworkViewAbstractKeyShortcut(
std::string& value, int32_t *keysArray, int64_t size, void (*callback)(void))
std::string& value, int32_t* keysArray, int64_t size, void (*callback)(void))
{
std::vector<ModifierKey> keys(size);
keys.clear();
@ -1071,7 +1052,7 @@ void FfiOHOSAceFrameworkViewAbstractKeyShortcut(
}
void FfiOHOSAceFrameworkViewAbstractKeyShortcutByFuncKey(
int32_t value, int32_t *keysArray, int64_t size, void (*callback)(void))
int32_t value, int32_t* keysArray, int64_t size, void (*callback)(void))
{
if (size == 0) {
ViewAbstractModel::GetInstance()->SetKeyboardShortcut("", std::vector<ModifierKey>(), nullptr);
@ -1082,7 +1063,7 @@ void FfiOHOSAceFrameworkViewAbstractKeyShortcutByFuncKey(
}
void FfiOHOSAceFrameworkViewAbstractKeyShortcutByChar(
const char* value, int32_t *keysArray, int64_t size, void (*callback)(void))
const char* value, int32_t* keysArray, int64_t size, void (*callback)(void))
{
std::string keyValue(value);
if (size == 0 || keyValue.empty()) {
@ -1097,9 +1078,9 @@ void FfiOHOSAceFrameworkViewAbstractKeyShortcutByChar(
void FfiOHOSAceFrameworkViewAbstractBindCustomPopup(CJBindCustomPopup value)
{
std::function<void(bool)> onStateChangeFunc =
(reinterpret_cast<int64_t>(value.onStateChange) == 0) ?
([](bool) -> void {}) : CJLambda::Create(value.onStateChange);
std::function<void(bool)> onStateChangeFunc = (reinterpret_cast<int64_t>(value.onStateChange) == 0)
? ([](bool) -> void {})
: CJLambda::Create(value.onStateChange);
auto popupParam = AceType::MakeRefPtr<PopupParam>();
popupParam->SetIsShow(value.isShow);
popupParam->SetUseCustomComponent(true);
@ -1139,9 +1120,7 @@ void FfiOHOSAceFrameworkViewAbstractBindMenu(
auto label = vectorValue[i];
params[i].value = label;
LOGD("option #%{public}d is %{public}s", static_cast<int>(i), params[i].value.c_str());
params[i].action = [menuActionHandle, label]() {
menuActionHandle(label);
};
params[i].action = [menuActionHandle, label]() { menuActionHandle(label); };
}
NG::MenuParam options;
ViewAbstractModel::GetInstance()->BindMenu(std::move(params), nullptr, options);
@ -1159,12 +1138,11 @@ void FfiOHOSAceFrameworkViewAbstractBindContextMenu(void (*builder)(), int32_t r
LOGE("bindContextMenu error, invalid value for responseType");
return;
}
NG::MenuParam options {.type = NG::MenuType::CONTEXT_MENU};
NG::MenuParam options { .type = NG::MenuType::CONTEXT_MENU };
auto buildFunc = CJLambda::Create(builder);
auto emptyFunc = std::function([] {});
ViewAbstractModel::GetInstance()->BindContextMenu(
static_cast<OHOS::Ace::ResponseType>(responseType), buildFunc, options, emptyFunc
);
static_cast<OHOS::Ace::ResponseType>(responseType), buildFunc, options, emptyFunc);
}
static void NewGetCjGradientColorStops(NG::Gradient& gradient, CArrCColors cjColors)
@ -1419,12 +1397,11 @@ void FfiOHOSAceFrameworkViewAbstractExpandSafeArea(uint32_t types, uint32_t edge
ViewAbstractModel::GetInstance()->UpdateSafeAreaExpandOpts(opts);
}
void ParseSheetCallback(CJSheetOptions options, std::function<void()>& onAppear,
std::function<void()>& onDisappear, std::function<void()>& shouldDismiss, std::function<void()>& onWillAppear,
std::function<void()>& onWillDisappear)
void ParseSheetCallback(CJSheetOptions options, std::function<void()>& onAppear, std::function<void()>& onDisappear,
std::function<void()>& shouldDismiss, std::function<void()>& onWillAppear, std::function<void()>& onWillDisappear)
{
if (options.onAppear.hasValue) {
onAppear = CJLambda::Create(options.onAppear.value);
onAppear = CJLambda::Create(options.onAppear.value);
}
if (options.onDisappear.hasValue) {
onDisappear = CJLambda::Create(options.onDisappear.value);
@ -1436,7 +1413,7 @@ void ParseSheetCallback(CJSheetOptions options, std::function<void()>& onAppear,
onWillAppear = CJLambda::Create(options.onWillAppear.value);
}
if (options.onWillDisappear.hasValue) {
onWillDisappear = CJLambda::Create(options.onWillDisappear.value);
onWillDisappear = CJLambda::Create(options.onWillDisappear.value);
}
}
@ -1529,8 +1506,7 @@ void ParseSheetStyle(CJSheetOptions option, NG::SheetStyle& sheetStyle)
void ParseSheetTitle(CJSheetOptions option, NG::SheetStyle& sheetStyle, std::function<void()>& titleBuilderFunction)
{
sheetStyle.isTitleBuilder = true;
titleBuilderFunction = option.title.hasValue ? CJLambda::Create(option.title.value)
: ([]() -> void {});
titleBuilderFunction = option.title.hasValue ? CJLambda::Create(option.title.value) : ([]() -> void {});
}
void FfiOHOSAceFrameworkViewAbstractbindSheetParam(bool isShow, void (*builder)(), CJSheetOptions option)
{
@ -1552,16 +1528,15 @@ void FfiOHOSAceFrameworkViewAbstractbindSheetParam(bool isShow, void (*builder)(
std::function<void(const float)> onTypeDidChangeCallback;
std::function<void()> titleBuilderFunction;
std::function<void()> sheetSpringBackFunc;
ParseSheetCallback(option, onAppearCallback, onDisappearCallback, shouldDismissFunc,
onWillAppearCallback, onWillDisappearCallback);
ParseSheetCallback(option, onAppearCallback, onDisappearCallback, shouldDismissFunc, onWillAppearCallback,
onWillDisappearCallback);
ParseSheetStyle(option, sheetStyle);
ParseSheetTitle(option, sheetStyle, titleBuilderFunction);
ViewAbstractModel::GetInstance()->BindSheet(isShow, std::move(callback), std::move(buildFunc),
std::move(titleBuilderFunction), sheetStyle, std::move(onAppearCallback), std::move(onDisappearCallback),
std::move(shouldDismissFunc), std::move(onWillDismissCallback), std::move(onWillAppearCallback),
std::move(onWillDisappearCallback), std::move(onHeightDidChangeCallback),
std::move(onDetentsDidChangeCallback), std::move(onWidthDidChangeCallback),
std::move(onTypeDidChangeCallback), std::move(sheetSpringBackFunc));
std::move(shouldDismissFunc), std::move(onWillDismissCallback), std::move(onWillAppearCallback),
std::move(onWillDisappearCallback), std::move(onHeightDidChangeCallback), std::move(onDetentsDidChangeCallback),
std::move(onWidthDidChangeCallback), std::move(onTypeDidChangeCallback), std::move(sheetSpringBackFunc));
return;
}
@ -1569,22 +1544,22 @@ void FFIOHOSAceFrameworkFocusable(bool isFocusable)
{
ViewAbstractModel::GetInstance()->SetFocusable(isFocusable);
}
void FFIOHOSAceFrameworkTabIndex(int32_t index)
{
ViewAbstractModel::GetInstance()->SetTabIndex(index);
}
void FFIOHOSAceFrameworkDefaultFocus(bool isDefaultFocus)
{
ViewAbstractModel::GetInstance()->SetDefaultFocus(isDefaultFocus);
}
void FFIOHOSAceFrameworkGroupDefaultFocus(bool isGroupDefaultFocus)
{
ViewAbstractModel::GetInstance()->SetGroupDefaultFocus(isGroupDefaultFocus);
}
void FFIOHOSAceFrameworkFocusOnTouch(bool isFocusOnTouch)
{
ViewAbstractModel::GetInstance()->SetFocusOnTouch(isFocusOnTouch);
@ -1632,15 +1607,108 @@ void FFIOHOSAceFrameworkBindContentCover(bool isShow, void (*builder)(), CJConte
NG::ContentCoverParam contentCoverParam;
std::function<void(const int32_t&)> onWillDismissFunc;
// parse callback
std::function<void()> onShowCallback = options.onAppear.hasValue ? CJLambda::Create(options.onAppear.value)
: ([]() -> void {});
std::function<void()> onDismissCallback = options.onDisappear.hasValue ? CJLambda::Create(options.onDisappear.value)
: ([]() -> void {});
std::function<void()> onShowCallback =
options.onAppear.hasValue ? CJLambda::Create(options.onAppear.value) : ([]() -> void {});
std::function<void()> onDismissCallback =
options.onDisappear.hasValue ? CJLambda::Create(options.onDisappear.value) : ([]() -> void {});
ViewAbstractModel::GetInstance()->BindContentCover(isShow, nullptr, std::move(buildFunc), modalStyle,
std::move(onShowCallback), std::move(onDismissCallback), std::move(onWillShowCallback),
std::move(onWillDismissCallback), contentCoverParam);
}
ExternalString FFIGetResourceString(NativeResourceObject obj)
{
std::string result;
if (!ViewAbstract::ParseCjString(obj, result)) {
LOGE("Parse string failed.");
}
return ::Utils::MallocCString(result);
}
ExternalString FFIGetResourceMedia(NativeResourceObject obj)
{
std::string result;
if (!ViewAbstract::ParseCjMedia(obj, result)) {
LOGE("Parse media failed.");
}
return ::Utils::MallocCString(result);
}
uint32_t FFIGetResourceColor(NativeResourceObject obj)
{
Color color;
if (!ViewAbstract::ParseCjColor(obj, color)) {
LOGE("Parse color failed.");
}
return color.GetValue();
}
RetDimension FFIGetResourceDimension(NativeResourceObject obj)
{
CalcDimension result;
RetDimension ret = { .value = 0.0, .unit = 0 };
if (!ViewAbstract::ParseCjDimension(obj, result, DimensionUnit::VP)) {
LOGE("Parse dimension failed.");
}
ret.value = result.Value();
ret.unit = static_cast<int32_t>(result.Unit());
return ret;
}
double FFIGetResourceDouble(NativeResourceObject obj)
{
double result;
if (!ViewAbstract::ParseCjDouble(obj, result)) {
LOGE("Parse double failed.");
}
return result;
}
int32_t FFIGetResourceInt32(NativeResourceObject obj)
{
int32_t result;
if (!ViewAbstract::ParseCjInteger(obj, result)) {
LOGE("Parse int32 failed.");
}
return result;
}
uint32_t FFIGetResourceUInt32(NativeResourceObject obj)
{
uint32_t result;
if (!ViewAbstract::ParseCjInteger(obj, result)) {
LOGE("Parse uint32 failed.");
}
return result;
}
bool FFIGetResourceBool(NativeResourceObject obj)
{
bool result;
if (!ViewAbstract::ParseCjBool(obj, result)) {
LOGE("Parse bool failed.");
}
return result;
}
VectorUInt32Handle FFIGetResourceVectorUInt32(NativeResourceObject obj)
{
auto result = new std::vector<uint32_t>;
if (!ViewAbstract::ParseCjIntegerArray(obj, *result)) {
LOGE("Parse uint32 array failed.");
}
return result;
}
VectorStringHandle FFIGetResourceVectorString(NativeResourceObject obj)
{
auto result = new std::vector<std::string>;
if (!ViewAbstract::ParseCjStringArray(obj, *result)) {
LOGE("Parse string array failed.");
}
return result;
}
}
namespace OHOS::Ace {

View File

@ -16,12 +16,15 @@
#ifndef OHOS_ACE_FRAMEWORK_CJ_VIEW_ABSTRACT_FFI_H
#define OHOS_ACE_FRAMEWORK_CJ_VIEW_ABSTRACT_FFI_H
#include "cj_transitioneffect.h"
#include "bridge/cj_frontend/cppview/view_abstract.h"
#include "bridge/cj_frontend/interfaces/cj_ffi/cj_collection_ffi.h"
#include "bridge/cj_frontend/interfaces/cj_ffi/cj_common_ffi.h"
#include "bridge/cj_frontend/interfaces/cj_ffi/cj_macro.h"
#include "bridge/cj_frontend/interfaces/cj_ffi/utils.h"
#include "core/components/common/properties/color.h"
#include "core/common/container.h"
#include "cj_transitioneffect.h"
#include "core/components/common/properties/color.h"
using VectorMenuValuePtr = void*;
using VectorStringPtr = void*;
@ -45,7 +48,7 @@ static RefPtr<T> GetTheme()
CHECK_NULL_RETURN(themeManager, nullptr);
return themeManager->GetTheme<T>();
}
}
} // namespace OHOS::Ace::Framework
extern "C" {
struct NativeRectangle {
@ -221,8 +224,8 @@ CJ_EXPORT void FfiOHOSAceFrameworkViewAbstractSetMargins(CJEdge params);
CJ_EXPORT void FfiOHOSAceFrameworkViewAbstractSetPadding(double padding, int32_t unit);
CJ_EXPORT void FfiOHOSAceFrameworkViewAbstractSetPaddings(CJEdge params);
CJ_EXPORT void FfiOHOSAceFrameworkViewAbstractSetForegroundBlurStyle(int32_t blurStyle);
CJ_EXPORT void FfiOHOSAceFrameworkViewAbstractSetForegroundBlurStyleOption(int32_t blurStyle,
CJForegroundBlurStyle options);
CJ_EXPORT void FfiOHOSAceFrameworkViewAbstractSetForegroundBlurStyleOption(
int32_t blurStyle, CJForegroundBlurStyle options);
CJ_EXPORT void FfiOHOSAceFrameworkViewAbstractSetForegroundColor(char* strategy);
CJ_EXPORT void FfiOHOSAceFrameworkViewAbstractSetForegroundResourceColor(uint32_t color);
CJ_EXPORT void FfiOHOSAceFrameworkViewAbstractSetBackgroundColor(uint32_t color);
@ -317,9 +320,9 @@ CJ_EXPORT void FfiOHOSAceFrameworkViewAbstractPop();
CJ_EXPORT void FfiOHOSAceFrameworkViewAbstractSetOverlay(const char* title, int32_t align, double x, double y);
CJ_EXPORT void FfiOHOSAceFrameworkViewAbstractBindPopup(bool isShow, CJBindPopupParams bindPopupParams);
CJ_EXPORT void FfiOHOSAceFrameworkViewAbstractKeyShortcutByFuncKey(
int32_t value, int32_t *keysArray, int64_t size, void (*callback)(void));
int32_t value, int32_t* keysArray, int64_t size, void (*callback)(void));
CJ_EXPORT void FfiOHOSAceFrameworkViewAbstractKeyShortcutByChar(
const char* value, int32_t *keysArray, int64_t size, void (*callback)(void));
const char* value, int32_t* keysArray, int64_t size, void (*callback)(void));
struct CJBindCustomPopup {
bool isShow;
@ -412,26 +415,23 @@ struct CJContentCoverOptions {
NativeOptionCallBack onWillDisappear;
};
CJ_EXPORT void FFIOHOSAceFrameworkBindContentCover(bool isShow, void (*builder)(), CJContentCoverOptions options);
CJ_EXPORT ExternalString FFIGetResourceString(NativeResourceObject obj);
CJ_EXPORT ExternalString FFIGetResourceMedia(NativeResourceObject obj);
CJ_EXPORT uint32_t FFIGetResourceColor(NativeResourceObject obj);
CJ_EXPORT RetDimension FFIGetResourceDimension(NativeResourceObject obj);
CJ_EXPORT double FFIGetResourceDouble(NativeResourceObject obj);
CJ_EXPORT int32_t FFIGetResourceInt32(NativeResourceObject obj);
CJ_EXPORT uint32_t FFIGetResourceUInt32(NativeResourceObject obj);
CJ_EXPORT bool FFIGetResourceBool(NativeResourceObject obj);
CJ_EXPORT VectorUInt32Handle FFIGetResourceVectorUInt32(NativeResourceObject obj);
CJ_EXPORT VectorStringHandle FFIGetResourceVectorString(NativeResourceObject obj);
}
namespace OHOS::Ace {
enum class ResourceType : uint32_t {
COLOR = 10001,
FLOAT,
STRING,
PLURAL,
BOOLEAN,
INTARRAY,
INTEGER,
PATTERN,
STRARRAY,
MEDIA = 20000,
RAWFILE = 30000
};
bool ParseCjMedia(int64_t id, ResourceType type, const std::string& params, std::string& result);
bool ParseCjString(int64_t id, ResourceType type, const std::string& params, std::string& result);
bool ParseCjString(
int64_t id, ResourceType type, int64_t count, const std::string& plural, std::string& result);
bool ParseCjString(int64_t id, ResourceType type, int64_t count, const std::string& plural, std::string& result);
bool ParseCjDimension(int64_t id, Dimension& result);
bool ParseColorById(int64_t id, Color& color);
void ParseCJResponseRegion(CJResponseRegion value, std::vector<DimensionRect>& result);

View File

@ -880,15 +880,18 @@ class ArkSearchButton {
value: string | undefined;
fontSize: Length | undefined;
fontColor: ResourceColor | undefined;
autoDisable: boolean | undefined;
constructor() {
this.value = undefined;
this.fontSize = undefined;
this.fontColor = undefined;
this.autoDisable = undefined;
}
isEqual(another: ArkSearchButton): boolean {
return (this.value === another.value) &&
(this.fontSize === another.fontSize) &&
(this.fontColor === another.fontColor);
(this.fontColor === another.fontColor) &&
(this.autoDisable === another.autoDisable);
}
}

View File

@ -119,13 +119,14 @@ class SearchSearchButtonModifier extends ModifierWithKey<ArkSearchButton> {
getUINativeModule().search.resetSearchButton(node);
} else {
getUINativeModule().search.setSearchButton(node, this.value.value,
this.value.fontSize, this.value.fontColor);
this.value.fontSize, this.value.fontColor, this.value.autoDisable);
}
}
checkObjectDiff(): boolean {
return this.stageValue.value !== this.value.value ||
!isBaseOrResourceEqual(this.stageValue.fontSize, this.value.fontSize) ||
!isBaseOrResourceEqual(this.stageValue.fontColor, this.value.fontColor);
!isBaseOrResourceEqual(this.stageValue.fontColor, this.value.fontColor) ||
!isBaseOrResourceEqual(this.stageValue.autoDisable, this.value.autoDisable);
}
}
@ -834,6 +835,7 @@ class ArkSearchComponent extends ArkComponent implements CommonMethod<SearchAttr
searchButton.value = value;
searchButton.fontColor = option?.fontColor;
searchButton.fontSize = option?.fontSize;
searchButton.autoDisable = option?.autoDisable;
modifierWithKey(this._modifiersWithKeys, SearchSearchButtonModifier.identity, SearchSearchButtonModifier, searchButton);
return this;
}

View File

@ -970,6 +970,200 @@ class TextAreaBackgroundColorModifier extends ModifierWithKey<ResourceColor> {
}
}
class TextAreaOutlineColorModifier extends ModifierWithKey<ResourceColor | EdgeColors> {
constructor(value: ResourceColor | EdgeColors) {
super(value);
}
static identity: Symbol = Symbol('textAreaOutlineColor');
applyPeer(node: KNode, reset: boolean): void {
if (reset) {
getUINativeModule().textArea.resetOutlineColor(node);
} else {
const valueType: string = typeof this.value;
if (valueType === 'number' || valueType === 'string' || isResource(this.value)) {
getUINativeModule().textArea.setOutlineColor(node, this.value, this.value, this.value, this.value);
} else {
getUINativeModule().textArea.setOutlineColor(node, (this.value as EdgeColors).left,
(this.value as EdgeColors).right, (this.value as EdgeColors).top,
(this.value as EdgeColors).bottom);
}
}
}
checkObjectDiff(): boolean {
if (isResource(this.stageValue) && isResource(this.value)) {
return !isResourceEqual(this.stageValue, this.value);
} else if (!isResource(this.stageValue) && !isResource(this.value)) {
return !((this.stageValue as EdgeColors).left === (this.value as EdgeColors).left &&
(this.stageValue as EdgeColors).right === (this.value as EdgeColors).right &&
(this.stageValue as EdgeColors).top === (this.value as EdgeColors).top &&
(this.stageValue as EdgeColors).bottom === (this.value as EdgeColors).bottom);
} else {
return true;
}
}
}
class TextAreaOutlineRadiusModifier extends ModifierWithKey<Dimension | OutlineRadiuses> {
constructor(value: Dimension | OutlineRadiuses) {
super(value);
}
static identity: Symbol = Symbol('textAreaOutlineRadius');
applyPeer(node: KNode, reset: boolean): void {
if (reset) {
getUINativeModule().textArea.resetOutlineRadius(node);
} else {
const valueType: string = typeof this.value;
if (valueType === 'number' || valueType === 'string' || isResource(this.value)) {
getUINativeModule().textArea.setOutlineRadius(node, this.value, this.value, this.value, this.value);
} else {
getUINativeModule().textArea.setOutlineRadius(node, (this.value as OutlineRadiuses).topLeft,
(this.value as OutlineRadiuses).topRight, (this.value as OutlineRadiuses).bottomLeft,
(this.value as OutlineRadiuses).bottomRight);
}
}
}
checkObjectDiff(): boolean {
if (isResource(this.stageValue) && isResource(this.value)) {
return !isResourceEqual(this.stageValue, this.value);
} else if (!isResource(this.stageValue) && !isResource(this.value)) {
return !((this.stageValue as BorderRadiuses).topLeft === (this.value as BorderRadiuses).topLeft &&
(this.stageValue as BorderRadiuses).topRight === (this.value as BorderRadiuses).topRight &&
(this.stageValue as BorderRadiuses).bottomLeft === (this.value as BorderRadiuses).bottomLeft &&
(this.stageValue as BorderRadiuses).bottomRight === (this.value as BorderRadiuses).bottomRight);
} else {
return true;
}
}
}
class TextAreaOutlineWidthModifier extends ModifierWithKey<Dimension | EdgeOutlineWidths> {
constructor(value: Dimension | EdgeOutlineWidths) {
super(value);
}
static identity: Symbol = Symbol('textAreaOutlineWidth');
applyPeer(node: KNode, reset: boolean): void {
if (reset) {
getUINativeModule().textArea.resetOutlineWidth(node);
} else {
if (isNumber(this.value) || isString(this.value) || isResource(this.value)) {
getUINativeModule().textArea.setOutlineWidth(node, this.value, this.value, this.value, this.value);
} else {
getUINativeModule().textArea.setOutlineWidth(node,
(this.value as EdgeOutlineWidths).left,
(this.value as EdgeOutlineWidths).right,
(this.value as EdgeOutlineWidths).top,
(this.value as EdgeOutlineWidths).bottom);
}
}
}
checkObjectDiff(): boolean {
if (isResource(this.stageValue) && isResource(this.value)) {
return !isResourceEqual(this.stageValue, this.value);
} else if (!isResource(this.stageValue) && !isResource(this.value)) {
return !((this.stageValue as EdgeOutlineWidths).left === (this.value as EdgeOutlineWidths).left &&
(this.stageValue as EdgeOutlineWidths).right === (this.value as EdgeOutlineWidths).right &&
(this.stageValue as EdgeOutlineWidths).top === (this.value as EdgeOutlineWidths).top &&
(this.stageValue as EdgeOutlineWidths).bottom === (this.value as EdgeOutlineWidths).bottom);
} else {
return true;
}
}
}
class TextAreaOutlineModifier extends ModifierWithKey<OutlineOptions> {
constructor(value: OutlineOptions) {
super(value);
}
static identity: Symbol = Symbol('textAreaOutline');
applyPeer(node: KNode, reset: boolean): void {
if (reset) {
getUINativeModule().textArea.resetOutline(node);
} else {
let widthLeft;
let widthRight;
let widthTop;
let widthBottom;
if (!isUndefined(this.value.width) && this.value.width != null) {
if (isNumber(this.value.width) || isString(this.value.width) || isResource(this.value.width)) {
widthLeft = this.value.width;
widthRight = this.value.width;
widthTop = this.value.width;
widthBottom = this.value.width;
} else {
widthLeft = (this.value.width as EdgeOutlineWidths).left;
widthRight = (this.value.width as EdgeOutlineWidths).right;
widthTop = (this.value.width as EdgeOutlineWidths).top;
widthBottom = (this.value.width as EdgeOutlineWidths).bottom;
}
}
let leftColor;
let rightColor;
let topColor;
let bottomColor;
if (!isUndefined(this.value.color) && this.value.color != null) {
if (isNumber(this.value.color) || isString(this.value.color) || isResource(this.value.color)) {
leftColor = this.value.color;
rightColor = this.value.color;
topColor = this.value.color;
bottomColor = this.value.color;
} else {
leftColor = (this.value.color as EdgeColors).left;
rightColor = (this.value.color as EdgeColors).right;
topColor = (this.value.color as EdgeColors).top;
bottomColor = (this.value.color as EdgeColors).bottom;
}
}
let topLeft;
let topRight;
let bottomLeft;
let bottomRight;
if (!isUndefined(this.value.radius) && this.value.radius != null) {
if (isNumber(this.value.radius) || isString(this.value.radius) || isResource(this.value.radius)) {
topLeft = this.value.radius;
topRight = this.value.radius;
bottomLeft = this.value.radius;
bottomRight = this.value.radius;
} else {
topLeft = (this.value.radius as OutlineRadiuses).topLeft;
topRight = (this.value.radius as OutlineRadiuses).topRight;
bottomLeft = (this.value.radius as OutlineRadiuses).bottomLeft;
bottomRight = (this.value.radius as OutlineRadiuses).bottomRight;
}
}
let styleTop;
let styleRight;
let styleBottom;
let styleLeft;
if (!isUndefined(this.value.style) && this.value.style != null) {
if (isNumber(this.value.style) || isString(this.value.style) || isResource(this.value.style)) {
styleTop = this.value.style;
styleRight = this.value.style;
styleBottom = this.value.style;
styleLeft = this.value.style;
} else {
styleTop = (this.value.style as EdgeOutlineStyles).top;
styleRight = (this.value.style as EdgeOutlineStyles).right;
styleBottom = (this.value.style as EdgeOutlineStyles).bottom;
styleLeft = (this.value.style as EdgeOutlineStyles).left;
}
}
getUINativeModule().textArea.setOutline(node, widthLeft, widthRight, widthTop, widthBottom,
leftColor, rightColor, topColor, bottomColor,
topLeft, topRight, bottomLeft, bottomRight,
styleTop, styleRight, styleBottom, styleLeft);
}
}
checkObjectDiff(): boolean {
return !isBaseOrResourceEqual(this.stageValue.width, this.value.width) ||
!isBaseOrResourceEqual(this.stageValue.color, this.value.color) ||
!isBaseOrResourceEqual(this.stageValue.radius, this.value.radius) ||
!isBaseOrResourceEqual(this.stageValue.style, this.value.style);
}
}
class TextAreaMarginModifier extends ModifierWithKey<ArkPadding> {
constructor(value: ArkPadding) {
super(value);
@ -1435,6 +1629,22 @@ class ArkTextAreaComponent extends ArkComponent implements CommonMethod<TextArea
modifierWithKey(this._modifiersWithKeys, TextAreaBackgroundColorModifier.identity, TextAreaBackgroundColorModifier, value);
return this;
}
outline(value: OutlineOptions): this {
modifierWithKey(this._modifiersWithKeys, TextAreaOutlineModifier.identity, TextAreaOutlineModifier, value);
return this;
}
outlineColor(value: ResourceColor | EdgeColors): this {
modifierWithKey(this._modifiersWithKeys, TextAreaOutlineColorModifier.identity, TextAreaOutlineColorModifier, value);
return this;
}
outlineRadius(value: Dimension | OutlineRadiuses): this {
modifierWithKey(this._modifiersWithKeys, TextAreaOutlineRadiusModifier.identity, TextAreaOutlineRadiusModifier, value);
return this;
}
outlineWidth(value: Dimension | EdgeOutlineWidths): this {
modifierWithKey(this._modifiersWithKeys, TextAreaOutlineWidthModifier.identity, TextAreaOutlineWidthModifier, value);
return this;
}
margin(value: Margin | Length): this {
let arkValue = new ArkPadding();
if (value !== null && value !== undefined) {

View File

@ -1180,6 +1180,199 @@ class TextInputPlaceholderModifier extends ModifierWithKey<ResourceStr> {
}
}
class TextInputOutlineColorModifier extends ModifierWithKey<ResourceColor | EdgeColors> {
constructor(value: ResourceColor | EdgeColors) {
super(value);
}
static identity: Symbol = Symbol('textInputOutlineColor');
applyPeer(node: KNode, reset: boolean): void {
if (reset) {
getUINativeModule().textInput.resetOutlineColor(node);
} else {
const valueType: string = typeof this.value;
if (valueType === 'number' || valueType === 'string' || isResource(this.value)) {
getUINativeModule().textInput.setOutlineColor(node, this.value, this.value, this.value, this.value);
} else {
getUINativeModule().textInput.setOutlineColor(node, (this.value as EdgeColors).left,
(this.value as EdgeColors).right, (this.value as EdgeColors).top,
(this.value as EdgeColors).bottom);
}
}
}
checkObjectDiff(): boolean {
if (isResource(this.stageValue) && isResource(this.value)) {
return !isResourceEqual(this.stageValue, this.value);
} else if (!isResource(this.stageValue) && !isResource(this.value)) {
return !((this.stageValue as EdgeColors).left === (this.value as EdgeColors).left &&
(this.stageValue as EdgeColors).right === (this.value as EdgeColors).right &&
(this.stageValue as EdgeColors).top === (this.value as EdgeColors).top &&
(this.stageValue as EdgeColors).bottom === (this.value as EdgeColors).bottom);
} else {
return true;
}
}
}
class TextInputOutlineRadiusModifier extends ModifierWithKey<Dimension | OutlineRadiuses> {
constructor(value: Dimension | OutlineRadiuses) {
super(value);
}
static identity: Symbol = Symbol('textInputOutlineRadius');
applyPeer(node: KNode, reset: boolean): void {
if (reset) {
getUINativeModule().textInput.resetOutlineRadius(node);
} else {
const valueType: string = typeof this.value;
if (valueType === 'number' || valueType === 'string' || isResource(this.value)) {
getUINativeModule().textInput.setOutlineRadius(node, this.value, this.value, this.value, this.value);
} else {
getUINativeModule().textInput.setOutlineRadius(node, (this.value as OutlineRadiuses).topLeft,
(this.value as OutlineRadiuses).topRight, (this.value as OutlineRadiuses).bottomLeft,
(this.value as OutlineRadiuses).bottomRight);
}
}
}
checkObjectDiff(): boolean {
if (isResource(this.stageValue) && isResource(this.value)) {
return !isResourceEqual(this.stageValue, this.value);
} else if (!isResource(this.stageValue) && !isResource(this.value)) {
return !((this.stageValue as BorderRadiuses).topLeft === (this.value as BorderRadiuses).topLeft &&
(this.stageValue as BorderRadiuses).topRight === (this.value as BorderRadiuses).topRight &&
(this.stageValue as BorderRadiuses).bottomLeft === (this.value as BorderRadiuses).bottomLeft &&
(this.stageValue as BorderRadiuses).bottomRight === (this.value as BorderRadiuses).bottomRight);
} else {
return true;
}
}
}
class TextInputOutlineWidthModifier extends ModifierWithKey<Dimension | EdgeOutlineWidths> {
constructor(value: Dimension | EdgeOutlineWidths) {
super(value);
}
static identity: Symbol = Symbol('textInputOutlineWidth');
applyPeer(node: KNode, reset: boolean): void {
if (reset) {
getUINativeModule().textInput.resetOutlineWidth(node);
} else {
if (isNumber(this.value) || isString(this.value) || isResource(this.value)) {
getUINativeModule().textInput.setOutlineWidth(node, this.value, this.value, this.value, this.value);
} else {
getUINativeModule().textInput.setOutlineWidth(node,
(this.value as EdgeOutlineWidths).left,
(this.value as EdgeOutlineWidths).right,
(this.value as EdgeOutlineWidths).top,
(this.value as EdgeOutlineWidths).bottom);
}
}
}
checkObjectDiff(): boolean {
if (isResource(this.stageValue) && isResource(this.value)) {
return !isResourceEqual(this.stageValue, this.value);
} else if (!isResource(this.stageValue) && !isResource(this.value)) {
return !((this.stageValue as EdgeOutlineWidths).left === (this.value as EdgeOutlineWidths).left &&
(this.stageValue as EdgeOutlineWidths).right === (this.value as EdgeOutlineWidths).right &&
(this.stageValue as EdgeOutlineWidths).top === (this.value as EdgeOutlineWidths).top &&
(this.stageValue as EdgeOutlineWidths).bottom === (this.value as EdgeOutlineWidths).bottom);
} else {
return true;
}
}
}
class TextInputOutlineModifier extends ModifierWithKey<OutlineOptions> {
constructor(value: OutlineOptions) {
super(value);
}
static identity: Symbol = Symbol('textInputOutline');
applyPeer(node: KNode, reset: boolean): void {
if (reset) {
getUINativeModule().textInput.resetOutline(node);
} else {
let widthLeft;
let widthRight;
let widthTop;
let widthBottom;
if (!isUndefined(this.value.width) && this.value.width != null) {
if (isNumber(this.value.width) || isString(this.value.width) || isResource(this.value.width)) {
widthLeft = this.value.width;
widthRight = this.value.width;
widthTop = this.value.width;
widthBottom = this.value.width;
} else {
widthLeft = (this.value.width as EdgeOutlineWidths).left;
widthRight = (this.value.width as EdgeOutlineWidths).right;
widthTop = (this.value.width as EdgeOutlineWidths).top;
widthBottom = (this.value.width as EdgeOutlineWidths).bottom;
}
}
let leftColor;
let rightColor;
let topColor;
let bottomColor;
if (!isUndefined(this.value.color) && this.value.color != null) {
if (isNumber(this.value.color) || isString(this.value.color) || isResource(this.value.color)) {
leftColor = this.value.color;
rightColor = this.value.color;
topColor = this.value.color;
bottomColor = this.value.color;
} else {
leftColor = (this.value.color as EdgeColors).left;
rightColor = (this.value.color as EdgeColors).right;
topColor = (this.value.color as EdgeColors).top;
bottomColor = (this.value.color as EdgeColors).bottom;
}
}
let topLeft;
let topRight;
let bottomLeft;
let bottomRight;
if (!isUndefined(this.value.radius) && this.value.radius != null) {
if (isNumber(this.value.radius) || isString(this.value.radius) || isResource(this.value.radius)) {
topLeft = this.value.radius;
topRight = this.value.radius;
bottomLeft = this.value.radius;
bottomRight = this.value.radius;
} else {
topLeft = (this.value.radius as OutlineRadiuses).topLeft;
topRight = (this.value.radius as OutlineRadiuses).topRight;
bottomLeft = (this.value.radius as OutlineRadiuses).bottomLeft;
bottomRight = (this.value.radius as OutlineRadiuses).bottomRight;
}
}
let styleTop;
let styleRight;
let styleBottom;
let styleLeft;
if (!isUndefined(this.value.style) && this.value.style != null) {
if (isNumber(this.value.style) || isString(this.value.style) || isResource(this.value.style)) {
styleTop = this.value.style;
styleRight = this.value.style;
styleBottom = this.value.style;
styleLeft = this.value.style;
} else {
styleTop = (this.value.style as EdgeOutlineStyles).top;
styleRight = (this.value.style as EdgeOutlineStyles).right;
styleBottom = (this.value.style as EdgeOutlineStyles).bottom;
styleLeft = (this.value.style as EdgeOutlineStyles).left;
}
}
getUINativeModule().textInput.setOutline(node, widthLeft, widthRight, widthTop, widthBottom,
leftColor, rightColor, topColor, bottomColor,
topLeft, topRight, bottomLeft, bottomRight,
styleTop, styleRight, styleBottom, styleLeft);
}
}
checkObjectDiff(): boolean {
return !isBaseOrResourceEqual(this.stageValue.width, this.value.width) ||
!isBaseOrResourceEqual(this.stageValue.color, this.value.color) ||
!isBaseOrResourceEqual(this.stageValue.radius, this.value.radius) ||
!isBaseOrResourceEqual(this.stageValue.style, this.value.style);
}
}
class TextInputMarginModifier extends ModifierWithKey<ArkPadding> {
constructor(value: ArkPadding) {
@ -1738,6 +1931,22 @@ class ArkTextInputComponent extends ArkComponent implements CommonMethod<TextInp
modifierWithKey(this._modifiersWithKeys, TextInputBackgroundColorModifier.identity, TextInputBackgroundColorModifier, value);
return this;
}
outline(value: OutlineOptions): this {
modifierWithKey(this._modifiersWithKeys, TextInputOutlineModifier.identity, TextInputOutlineModifier, value);
return this;
}
outlineColor(value: ResourceColor | EdgeColors): this {
modifierWithKey(this._modifiersWithKeys, TextInputOutlineColorModifier.identity, TextInputOutlineColorModifier, value);
return this;
}
outlineRadius(value: Dimension | OutlineRadiuses): this {
modifierWithKey(this._modifiersWithKeys, TextInputOutlineRadiusModifier.identity, TextInputOutlineRadiusModifier, value);
return this;
}
outlineWidth(value: Dimension | EdgeOutlineWidths): this {
modifierWithKey(this._modifiersWithKeys, TextInputOutlineWidthModifier.identity, TextInputOutlineWidthModifier, value);
return this;
}
margin(value: Margin | Length): this {
let arkValue = new ArkPadding();
if (value !== null && value !== undefined) {

View File

@ -8828,13 +8828,15 @@ class SearchSearchButtonModifier extends ModifierWithKey {
getUINativeModule().search.resetSearchButton(node);
}
else {
getUINativeModule().search.setSearchButton(node, this.value.value, this.value.fontSize, this.value.fontColor);
getUINativeModule().search.setSearchButton(node, this.value.value, this.value.fontSize, this.value.fontColor,
this.value.autoDisable);
}
}
checkObjectDiff() {
return this.stageValue.value !== this.value.value ||
!isBaseOrResourceEqual(this.stageValue.fontSize, this.value.fontSize) ||
!isBaseOrResourceEqual(this.stageValue.fontColor, this.value.fontColor);
!isBaseOrResourceEqual(this.stageValue.fontColor, this.value.fontColor) ||
!isBaseOrResourceEqual(this.stageValue.autoDisable, this.value.autoDisable);
}
}
SearchSearchButtonModifier.identity = Symbol('searchSearchButton');
@ -9506,6 +9508,7 @@ class ArkSearchComponent extends ArkComponent {
searchButton.value = value;
searchButton.fontColor = option === null || option === void 0 ? void 0 : option.fontColor;
searchButton.fontSize = option === null || option === void 0 ? void 0 : option.fontSize;
searchButton.autoDisable = option === null || option === void 0 ? void 0 : option.autoDisable;
modifierWithKey(this._modifiersWithKeys, SearchSearchButtonModifier.identity, SearchSearchButtonModifier, searchButton);
return this;
}
@ -12937,6 +12940,202 @@ class TextAreaBackgroundColorModifier extends ModifierWithKey {
}
}
TextAreaBackgroundColorModifier.identity = Symbol('textAreaBackgroundColor');
class TextAreaOutlineColorModifier extends ModifierWithKey {
constructor(value) {
super(value);
}
applyPeer(node, reset) {
if (reset) {
getUINativeModule().textArea.resetOutlineColor(node);
}
else {
const valueType = typeof this.value;
if (valueType === 'number' || valueType === 'string' || isResource(this.value)) {
getUINativeModule().textArea.setOutlineColor(node, this.value, this.value, this.value, this.value);
}
else {
getUINativeModule().textArea.setOutlineColor(node, this.value.left, this.value.right, this.value.top, this.value.bottom);
}
}
}
checkObjectDiff() {
if (isResource(this.stageValue) && isResource(this.value)) {
return !isResourceEqual(this.stageValue, this.value);
}
else if (!isResource(this.stageValue) && !isResource(this.value)) {
return !(this.stageValue.left === this.value.left &&
this.stageValue.right === this.value.right &&
this.stageValue.top === this.value.top &&
this.stageValue.bottom === this.value.bottom);
}
else {
return true;
}
}
}
TextAreaOutlineColorModifier.identity = Symbol('textAreaOutlineColor');
class TextAreaOutlineRadiusModifier extends ModifierWithKey {
constructor(value) {
super(value);
}
applyPeer(node, reset) {
if (reset) {
getUINativeModule().textArea.resetOutlineRadius(node);
}
else {
const valueType = typeof this.value;
if (valueType === 'number' || valueType === 'string' || isResource(this.value)) {
getUINativeModule().textArea.setOutlineRadius(node, this.value, this.value, this.value, this.value);
}
else {
getUINativeModule().textArea.setOutlineRadius(node, this.value.topLeft, this.value.topRight, this.value.bottomLeft, this.value.bottomRight);
}
}
}
checkObjectDiff() {
if (isResource(this.stageValue) && isResource(this.value)) {
return !isResourceEqual(this.stageValue, this.value);
}
else if (!isResource(this.stageValue) && !isResource(this.value)) {
return !(this.stageValue.topLeft === this.value.topLeft &&
this.stageValue.topRight === this.value.topRight &&
this.stageValue.bottomLeft === this.value.bottomLeft &&
this.stageValue.bottomRight === this.value.bottomRight);
}
else {
return true;
}
}
}
TextAreaOutlineRadiusModifier.identity = Symbol('textAreaOutlineRadius');
class TextAreaOutlineWidthModifier extends ModifierWithKey {
constructor(value) {
super(value);
}
applyPeer(node, reset) {
if (reset) {
getUINativeModule().textArea.resetOutlineWidth(node);
}
else {
if (isNumber(this.value) || isString(this.value) || isResource(this.value)) {
getUINativeModule().textArea.setOutlineWidth(node, this.value, this.value, this.value, this.value);
}
else {
getUINativeModule().textArea.setOutlineWidth(node, this.value.left, this.value.right, this.value.top, this.value.bottom);
}
}
}
checkObjectDiff() {
if (isResource(this.stageValue) && isResource(this.value)) {
return !isResourceEqual(this.stageValue, this.value);
}
else if (!isResource(this.stageValue) && !isResource(this.value)) {
return !(this.stageValue.left === this.value.left &&
this.stageValue.right === this.value.right &&
this.stageValue.top === this.value.top &&
this.stageValue.bottom === this.value.bottom);
}
else {
return true;
}
}
}
TextAreaOutlineWidthModifier.identity = Symbol('textAreaOutlineWidth');
class TextAreaOutlineModifier extends ModifierWithKey {
constructor(value) {
super(value);
}
applyPeer(node, reset) {
if (reset) {
getUINativeModule().textArea.resetOutline(node);
}
else {
let widthLeft;
let widthRight;
let widthTop;
let widthBottom;
if (!isUndefined(this.value.width) && this.value.width != null) {
if (isNumber(this.value.width) || isString(this.value.width) || isResource(this.value.width)) {
widthLeft = this.value.width;
widthRight = this.value.width;
widthTop = this.value.width;
widthBottom = this.value.width;
}
else {
widthLeft = this.value.width.left;
widthRight = this.value.width.right;
widthTop = this.value.width.top;
widthBottom = this.value.width.bottom;
}
}
let leftColor;
let rightColor;
let topColor;
let bottomColor;
if (!isUndefined(this.value.color) && this.value.color != null) {
if (isNumber(this.value.color) || isString(this.value.color) || isResource(this.value.color)) {
leftColor = this.value.color;
rightColor = this.value.color;
topColor = this.value.color;
bottomColor = this.value.color;
}
else {
leftColor = this.value.color.left;
rightColor = this.value.color.right;
topColor = this.value.color.top;
bottomColor = this.value.color.bottom;
}
}
let topLeft;
let topRight;
let bottomLeft;
let bottomRight;
if (!isUndefined(this.value.radius) && this.value.radius != null) {
if (isNumber(this.value.radius) || isString(this.value.radius) || isResource(this.value.radius)) {
topLeft = this.value.radius;
topRight = this.value.radius;
bottomLeft = this.value.radius;
bottomRight = this.value.radius;
}
else {
topLeft = this.value.radius.topLeft;
topRight = this.value.radius.topRight;
bottomLeft = this.value.radius.bottomLeft;
bottomRight = this.value.radius.bottomRight;
}
}
let styleTop;
let styleRight;
let styleBottom;
let styleLeft;
if (!isUndefined(this.value.style) && this.value.style != null) {
if (isNumber(this.value.style) || isString(this.value.style) || isResource(this.value.style)) {
styleTop = this.value.style;
styleRight = this.value.style;
styleBottom = this.value.style;
styleLeft = this.value.style;
}
else {
styleTop = this.value.style.top;
styleRight = this.value.style.right;
styleBottom = this.value.style.bottom;
styleLeft = this.value.style.left;
}
}
getUINativeModule().textArea.setOutline(node, widthLeft, widthRight, widthTop, widthBottom,
leftColor, rightColor, topColor, bottomColor,
topLeft, topRight, bottomLeft, bottomRight,
styleTop, styleRight, styleBottom, styleLeft);
}
}
checkObjectDiff() {
return !isBaseOrResourceEqual(this.stageValue.width, this.value.width) ||
!isBaseOrResourceEqual(this.stageValue.color, this.value.color) ||
!isBaseOrResourceEqual(this.stageValue.radius, this.value.radius) ||
!isBaseOrResourceEqual(this.stageValue.style, this.value.style);
}
}
TextAreaOutlineModifier.identity = Symbol('textAreaOutline');
class TextAreaMarginModifier extends ModifierWithKey {
constructor(value) {
super(value);
@ -13347,6 +13546,22 @@ class ArkTextAreaComponent extends ArkComponent {
modifierWithKey(this._modifiersWithKeys, TextAreaBackgroundColorModifier.identity, TextAreaBackgroundColorModifier, value);
return this;
}
outline(value) {
modifierWithKey(this._modifiersWithKeys, TextAreaOutlineModifier.identity, TextAreaOutlineModifier, value);
return this;
}
outlineColor(value) {
modifierWithKey(this._modifiersWithKeys, TextAreaOutlineColorModifier.identity, TextAreaOutlineColorModifier, value);
return this;
}
outlineRadius(value) {
modifierWithKey(this._modifiersWithKeys, TextAreaOutlineRadiusModifier.identity, TextAreaOutlineRadiusModifier, value);
return this;
}
outlineWidth(value) {
modifierWithKey(this._modifiersWithKeys, TextAreaOutlineWidthModifier.identity, TextAreaOutlineWidthModifier, value);
return this;
}
margin(value) {
let arkValue = new ArkPadding();
if (value !== null && value !== undefined) {
@ -14579,6 +14794,202 @@ class TextInputBackgroundColorModifier extends ModifierWithKey {
}
}
TextInputBackgroundColorModifier.identity = Symbol('textInputBackgroundColor');
class TextInputOutlineColorModifier extends ModifierWithKey {
constructor(value) {
super(value);
}
applyPeer(node, reset) {
if (reset) {
getUINativeModule().textInput.resetOutlineColor(node);
}
else {
const valueType = typeof this.value;
if (valueType === 'number' || valueType === 'string' || isResource(this.value)) {
getUINativeModule().textInput.setOutlineColor(node, this.value, this.value, this.value, this.value);
}
else {
getUINativeModule().textInput.setOutlineColor(node, this.value.left, this.value.right, this.value.top, this.value.bottom);
}
}
}
checkObjectDiff() {
if (isResource(this.stageValue) && isResource(this.value)) {
return !isResourceEqual(this.stageValue, this.value);
}
else if (!isResource(this.stageValue) && !isResource(this.value)) {
return !(this.stageValue.left === this.value.left &&
this.stageValue.right === this.value.right &&
this.stageValue.top === this.value.top &&
this.stageValue.bottom === this.value.bottom);
}
else {
return true;
}
}
}
TextInputOutlineColorModifier.identity = Symbol('textInputOutlineColor');
class TextInputOutlineRadiusModifier extends ModifierWithKey {
constructor(value) {
super(value);
}
applyPeer(node, reset) {
if (reset) {
getUINativeModule().textInput.resetOutlineRadius(node);
}
else {
const valueType = typeof this.value;
if (valueType === 'number' || valueType === 'string' || isResource(this.value)) {
getUINativeModule().textInput.setOutlineRadius(node, this.value, this.value, this.value, this.value);
}
else {
getUINativeModule().textInput.setOutlineRadius(node, this.value.topLeft, this.value.topRight, this.value.bottomLeft, this.value.bottomRight);
}
}
}
checkObjectDiff() {
if (isResource(this.stageValue) && isResource(this.value)) {
return !isResourceEqual(this.stageValue, this.value);
}
else if (!isResource(this.stageValue) && !isResource(this.value)) {
return !(this.stageValue.topLeft === this.value.topLeft &&
this.stageValue.topRight === this.value.topRight &&
this.stageValue.bottomLeft === this.value.bottomLeft &&
this.stageValue.bottomRight === this.value.bottomRight);
}
else {
return true;
}
}
}
TextInputOutlineRadiusModifier.identity = Symbol('textInputOutlineRadius');
class TextInputOutlineWidthModifier extends ModifierWithKey {
constructor(value) {
super(value);
}
applyPeer(node, reset) {
if (reset) {
getUINativeModule().textInput.resetOutlineWidth(node);
}
else {
if (isNumber(this.value) || isString(this.value) || isResource(this.value)) {
getUINativeModule().textInput.setOutlineWidth(node, this.value, this.value, this.value, this.value);
}
else {
getUINativeModule().textInput.setOutlineWidth(node, this.value.left, this.value.right, this.value.top, this.value.bottom);
}
}
}
checkObjectDiff() {
if (isResource(this.stageValue) && isResource(this.value)) {
return !isResourceEqual(this.stageValue, this.value);
}
else if (!isResource(this.stageValue) && !isResource(this.value)) {
return !(this.stageValue.left === this.value.left &&
this.stageValue.right === this.value.right &&
this.stageValue.top === this.value.top &&
this.stageValue.bottom === this.value.bottom);
}
else {
return true;
}
}
}
TextInputOutlineWidthModifier.identity = Symbol('textInputOutlineWidth');
class TextInputOutlineModifier extends ModifierWithKey {
constructor(value) {
super(value);
}
applyPeer(node, reset) {
if (reset) {
getUINativeModule().textInput.resetOutline(node);
}
else {
let widthLeft;
let widthRight;
let widthTop;
let widthBottom;
if (!isUndefined(this.value.width) && this.value.width != null) {
if (isNumber(this.value.width) || isString(this.value.width) || isResource(this.value.width)) {
widthLeft = this.value.width;
widthRight = this.value.width;
widthTop = this.value.width;
widthBottom = this.value.width;
}
else {
widthLeft = this.value.width.left;
widthRight = this.value.width.right;
widthTop = this.value.width.top;
widthBottom = this.value.width.bottom;
}
}
let leftColor;
let rightColor;
let topColor;
let bottomColor;
if (!isUndefined(this.value.color) && this.value.color != null) {
if (isNumber(this.value.color) || isString(this.value.color) || isResource(this.value.color)) {
leftColor = this.value.color;
rightColor = this.value.color;
topColor = this.value.color;
bottomColor = this.value.color;
}
else {
leftColor = this.value.color.left;
rightColor = this.value.color.right;
topColor = this.value.color.top;
bottomColor = this.value.color.bottom;
}
}
let topLeft;
let topRight;
let bottomLeft;
let bottomRight;
if (!isUndefined(this.value.radius) && this.value.radius != null) {
if (isNumber(this.value.radius) || isString(this.value.radius) || isResource(this.value.radius)) {
topLeft = this.value.radius;
topRight = this.value.radius;
bottomLeft = this.value.radius;
bottomRight = this.value.radius;
}
else {
topLeft = this.value.radius.topLeft;
topRight = this.value.radius.topRight;
bottomLeft = this.value.radius.bottomLeft;
bottomRight = this.value.radius.bottomRight;
}
}
let styleTop;
let styleRight;
let styleBottom;
let styleLeft;
if (!isUndefined(this.value.style) && this.value.style != null) {
if (isNumber(this.value.style) || isString(this.value.style) || isResource(this.value.style)) {
styleTop = this.value.style;
styleRight = this.value.style;
styleBottom = this.value.style;
styleLeft = this.value.style;
}
else {
styleTop = this.value.style.top;
styleRight = this.value.style.right;
styleBottom = this.value.style.bottom;
styleLeft = this.value.style.left;
}
}
getUINativeModule().textInput.setOutline(node, widthLeft, widthRight, widthTop, widthBottom,
leftColor, rightColor, topColor, bottomColor,
topLeft, topRight, bottomLeft, bottomRight,
styleTop, styleRight, styleBottom, styleLeft);
}
}
checkObjectDiff() {
return !isBaseOrResourceEqual(this.stageValue.width, this.value.width) ||
!isBaseOrResourceEqual(this.stageValue.color, this.value.color) ||
!isBaseOrResourceEqual(this.stageValue.radius, this.value.radius) ||
!isBaseOrResourceEqual(this.stageValue.style, this.value.style);
}
}
TextInputOutlineModifier.identity = Symbol('textInputOutline');
class TextInputMarginModifier extends ModifierWithKey {
constructor(value) {
super(value);
@ -15021,6 +15432,22 @@ class ArkTextInputComponent extends ArkComponent {
modifierWithKey(this._modifiersWithKeys, TextInputBackgroundColorModifier.identity, TextInputBackgroundColorModifier, value);
return this;
}
outline(value) {
modifierWithKey(this._modifiersWithKeys, TextInputOutlineModifier.identity, TextInputOutlineModifier, value);
return this;
}
outlineColor(value) {
modifierWithKey(this._modifiersWithKeys, TextInputOutlineColorModifier.identity, TextInputOutlineColorModifier, value);
return this;
}
outlineRadius(value) {
modifierWithKey(this._modifiersWithKeys, TextInputOutlineRadiusModifier.identity, TextInputOutlineRadiusModifier, value);
return this;
}
outlineWidth(value) {
modifierWithKey(this._modifiersWithKeys, TextInputOutlineWidthModifier.identity, TextInputOutlineWidthModifier, value);
return this;
}
margin(value) {
let arkValue = new ArkPadding();
if (value !== null && value !== undefined) {
@ -15951,11 +16378,13 @@ class ArkSearchButton {
this.value = undefined;
this.fontSize = undefined;
this.fontColor = undefined;
this.autoDisable = undefined;
}
isEqual(another) {
return (this.value === another.value) &&
(this.fontSize === another.fontSize) &&
(this.fontColor === another.fontColor);
(this.fontColor === another.fontColor) &&
(this.autoDisable === another.autoDisable);
}
}
class ArkSearchInputFilter {

View File

@ -60,12 +60,14 @@ void AnimatorModelNG::Create(const std::string& animatorId)
{
auto page = GetCurrentPage();
CHECK_NULL_VOID(page);
auto pageNode = page->GetHost();
CHECK_NULL_VOID(pageNode);
auto animatorInfo = page->GetJsAnimator(animatorId);
if (!animatorInfo) {
animatorInfo = AceType::MakeRefPtr<AnimatorInfo>();
TAG_LOGI(AceLogTag::ACE_ANIMATION,
"create animator component, id:%{public}s, pageUrl:%{public}s, pagePattern:%{public}p", animatorId.c_str(),
page->GetPageUrl().c_str(), AceType::RawPtr(page));
"create animator component, id:%{public}s, pageUrl:%{public}s, pageId:%{public}d", animatorId.c_str(),
page->GetPageUrl().c_str(), pageNode->GetId());
auto animator = CREATE_ANIMATOR(animatorId.c_str());
animatorInfo->SetAnimator(animator);
page->AddJsAnimator(animatorId, animatorInfo);
@ -80,11 +82,13 @@ RefPtr<AnimatorInfo> AnimatorModelNG::GetAnimatorInfo(const std::string& animato
animatorId.c_str());
return nullptr;
}
auto pageNode = page->GetHost();
CHECK_NULL_RETURN(pageNode, nullptr);
auto animatorInfo = page->GetJsAnimator(animatorId);
if (!animatorInfo) {
TAG_LOGW(AceLogTag::ACE_ANIMATION,
"cannot find animator component in current page, id:%{public}s, pageUrl:%{public}s, pagePattern:%{public}p",
animatorId.c_str(), page->GetPageUrl().c_str(), AceType::RawPtr(page));
"cannot find animator component in current page, id:%{public}s, pageUrl:%{public}s, pageId:%{public}d",
animatorId.c_str(), page->GetPageUrl().c_str(), pageNode->GetId());
}
return animatorInfo;
}

View File

@ -2522,6 +2522,20 @@ std::string JsiDeclarativeEngine::GetFullPathInfo(const std::string& url)
return "";
}
std::optional<std::string> JsiDeclarativeEngine::GetRouteNameByUrl(
const std::string& url, const std::string& bundleName, const std::string& moduleName)
{
auto iter = std::find_if(namedRouterRegisterMap_.begin(), namedRouterRegisterMap_.end(),
[&bundleName, &moduleName, &url](const auto& item) {
return item.second.bundleName == bundleName && item.second.moduleName == moduleName &&
item.second.pagePath == url;
});
if (iter != namedRouterRegisterMap_.end()) {
return iter->first;
}
return std::nullopt;
}
void JsiDeclarativeEngine::SetLocalStorage(int32_t instanceId, NativeReference* nativeValue)
{
#ifdef USE_ARK_ENGINE

View File

@ -374,6 +374,9 @@ public:
static std::string GetFullPathInfo(const std::string& url);
static std::optional<std::string> GetRouteNameByUrl(
const std::string& url, const std::string& bundleName, const std::string& moduleName);
void SetLocalStorage(int32_t instanceId, NativeReference* storage) override;
void SetContext(int32_t instanceId, NativeReference* context) override;

View File

@ -486,7 +486,7 @@ bool JsiCallbackInfo::GetUint32Arg(size_t index, uint32_t& value) const
return true;
}
bool JsiCallbackInfo::GetDoubleArg(size_t index, double& value) const
bool JsiCallbackInfo::GetDoubleArg(size_t index, double& value, bool isJudgeSpecialValue) const
{
auto arg = info_->GetCallArgRef(index);
if (arg.IsEmpty()) {
@ -494,6 +494,9 @@ bool JsiCallbackInfo::GetDoubleArg(size_t index, double& value) const
}
bool ret = false;
value = arg->GetValueDouble(ret);
if (isJudgeSpecialValue) {
return (std::isnan(value) || std::isinf(value)) ? false : ret;
}
return ret;
}

View File

@ -312,7 +312,7 @@ public:
bool GetBooleanArg(size_t index, bool& value) const;
bool GetInt32Arg(size_t index, int32_t& value) const;
bool GetUint32Arg(size_t index, uint32_t& value) const;
bool GetDoubleArg(size_t index, double& value) const;
bool GetDoubleArg(size_t index, double& value, bool isJudgeSpecialValue = false) const;
bool GetDoubleArrayArg(size_t index, std::vector<double>& valueArr) const;
bool GetStringArg(size_t index, std::string& value) const;

View File

@ -2048,6 +2048,22 @@ ArkUINativeModuleValue ArkUINativeModule::GetArkUINativeModule(ArkUIRuntimeCallI
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::SetBackgroundColor));
textArea->Set(vm, panda::StringRef::NewFromUtf8(vm, "resetBackgroundColor"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::ResetBackgroundColor));
textArea->Set(vm, panda::StringRef::NewFromUtf8(vm, "setOutlineColor"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::SetOutlineColor));
textArea->Set(vm, panda::StringRef::NewFromUtf8(vm, "resetOutlineColor"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::ResetOutlineColor));
textArea->Set(vm, panda::StringRef::NewFromUtf8(vm, "setOutlineRadius"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::SetOutlineRadius));
textArea->Set(vm, panda::StringRef::NewFromUtf8(vm, "resetOutlineRadius"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::ResetOutlineRadius));
textArea->Set(vm, panda::StringRef::NewFromUtf8(vm, "setOutlineWidth"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::SetOutlineWidth));
textArea->Set(vm, panda::StringRef::NewFromUtf8(vm, "resetOutlineWidth"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::ResetOutlineWidth));
textArea->Set(vm, panda::StringRef::NewFromUtf8(vm, "setOutline"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::SetOutline));
textArea->Set(vm, panda::StringRef::NewFromUtf8(vm, "resetOutline"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::ResetOutline));
textArea->Set(vm, panda::StringRef::NewFromUtf8(vm, "setMargin"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::SetMargin));
textArea->Set(vm, panda::StringRef::NewFromUtf8(vm, "resetMargin"),
@ -2469,6 +2485,22 @@ ArkUINativeModuleValue ArkUINativeModule::GetArkUINativeModule(ArkUIRuntimeCallI
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextInputBridge::SetBackgroundColor));
textInput->Set(vm, panda::StringRef::NewFromUtf8(vm, "resetBackgroundColor"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextInputBridge::ResetBackgroundColor));
textInput->Set(vm, panda::StringRef::NewFromUtf8(vm, "setOutlineColor"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::SetOutlineColor));
textInput->Set(vm, panda::StringRef::NewFromUtf8(vm, "resetOutlineColor"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::ResetOutlineColor));
textInput->Set(vm, panda::StringRef::NewFromUtf8(vm, "setOutlineRadius"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::SetOutlineRadius));
textInput->Set(vm, panda::StringRef::NewFromUtf8(vm, "resetOutlineRadius"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::ResetOutlineRadius));
textInput->Set(vm, panda::StringRef::NewFromUtf8(vm, "setOutlineWidth"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::SetOutlineWidth));
textInput->Set(vm, panda::StringRef::NewFromUtf8(vm, "resetOutlineWidth"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::ResetOutlineWidth));
textInput->Set(vm, panda::StringRef::NewFromUtf8(vm, "setOutline"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::SetOutline));
textInput->Set(vm, panda::StringRef::NewFromUtf8(vm, "resetOutline"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextAreaBridge::ResetOutline));
textInput->Set(vm, panda::StringRef::NewFromUtf8(vm, "setMargin"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), TextInputBridge::SetMargin));
textInput->Set(vm, panda::StringRef::NewFromUtf8(vm, "resetMargin"),
@ -5327,6 +5359,10 @@ void ArkUINativeModule::RegisterResourceAttributes(Local<panda::ObjectRef> objec
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), ResourceBridge::Restore));
resource->Set(vm, panda::StringRef::NewFromUtf8(vm, "getColorValue"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), ResourceBridge::GetColorValue));
resource->Set(vm, panda::StringRef::NewFromUtf8(vm, "getStringValue"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), ResourceBridge::GetStringValue));
resource->Set(vm, panda::StringRef::NewFromUtf8(vm, "getNumberValue"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), ResourceBridge::GetNumberValue));
resource->Set(vm, panda::StringRef::NewFromUtf8(vm, "clearCache"),
panda::FunctionRef::New(const_cast<panda::EcmaVM*>(vm), ResourceBridge::ClearCache));
object->Set(vm, panda::StringRef::NewFromUtf8(vm, "resource"), resource);

View File

@ -96,15 +96,6 @@ enum class WidthBreakpoint {WIDTH_XS, WIDTH_SM, WIDTH_MD, WIDTH_LG, WIDTH_XL};
enum class HeightBreakpoint {HEIGHT_SM, HEIGHT_MD, HEIGHT_LG};
enum ParseResult { LENGTHMETRICS_SUCCESS, DIMENSION_SUCCESS, FAIL };
BorderStyle ConvertBorderStyle(int32_t value)
{
auto style = static_cast<BorderStyle>(value);
if (style < BorderStyle::SOLID || style > BorderStyle::NONE) {
style = BorderStyle::SOLID;
}
return style;
}
bool ParseJsDouble(const EcmaVM *vm, const Local<JSValueRef> &value, double &result)
{
if (value->IsNumber()) {
@ -878,223 +869,6 @@ void ParseGradientCenter(const EcmaVM* vm, const Local<JSValueRef>& value, std::
values.push_back({.i32 = static_cast<ArkUI_Int32>(valueY.Unit())});
}
void PushOuterBorderDimensionVector(const std::optional<CalcDimension>& valueDim, std::vector<ArkUI_Float32> &options)
{
options.push_back(static_cast<ArkUI_Float32>(valueDim.has_value()));
if (valueDim.has_value()) {
options.push_back(static_cast<ArkUI_Float32>(valueDim.value().Value()));
options.push_back(static_cast<ArkUI_Float32>(valueDim.value().Unit()));
} else {
options.push_back(0);
options.push_back(0);
}
}
void ParseOuterBorderWidth(
ArkUIRuntimeCallInfo* runtimeCallInfo, EcmaVM* vm, std::vector<ArkUI_Float32>& values, bool needLocalized = false)
{
Local<JSValueRef> leftArgs = runtimeCallInfo->GetCallArgRef(NUM_1);
Local<JSValueRef> rightArgs = runtimeCallInfo->GetCallArgRef(NUM_2);
Local<JSValueRef> topArgs = runtimeCallInfo->GetCallArgRef(NUM_3);
Local<JSValueRef> bottomArgs = runtimeCallInfo->GetCallArgRef(NUM_4);
std::optional<CalcDimension> leftDim;
std::optional<CalcDimension> rightDim;
std::optional<CalcDimension> topDim;
std::optional<CalcDimension> bottomDim;
std::optional<CalcDimension> startDim;
std::optional<CalcDimension> endDim;
ArkTSUtils::ParseOuterBorder(vm, leftArgs, leftDim);
ArkTSUtils::ParseOuterBorder(vm, rightArgs, rightDim);
if (needLocalized) {
Local<JSValueRef> startArgs = runtimeCallInfo->GetCallArgRef(25); // 25: index of BorderWidth.start
Local<JSValueRef> endArgs = runtimeCallInfo->GetCallArgRef(26); // 26: index of BorderWidth.end
ArkTSUtils::ParseOuterBorderForDashParams(vm, startArgs, startDim);
ArkTSUtils::ParseOuterBorderForDashParams(vm, endArgs, endDim);
ArkTSUtils::ParseOuterBorderForDashParams(vm, topArgs, topDim);
ArkTSUtils::ParseOuterBorderForDashParams(vm, bottomArgs, bottomDim);
} else {
ArkTSUtils::ParseOuterBorder(vm, topArgs, topDim);
ArkTSUtils::ParseOuterBorder(vm, bottomArgs, bottomDim);
}
if (startDim.has_value() || endDim.has_value()) {
PushOuterBorderDimensionVector(startDim, values);
PushOuterBorderDimensionVector(endDim, values);
} else {
PushOuterBorderDimensionVector(leftDim, values);
PushOuterBorderDimensionVector(rightDim, values);
}
PushOuterBorderDimensionVector(topDim, values);
PushOuterBorderDimensionVector(bottomDim, values);
}
void PushOuterBorderColorVector(const std::optional<Color>& valueColor, std::vector<uint32_t> &options)
{
options.push_back(static_cast<uint32_t>(valueColor.has_value()));
if (valueColor.has_value()) {
options.push_back(static_cast<uint32_t>(valueColor.value().GetValue()));
} else {
options.push_back(0);
}
}
void ParseOuterBorderColor(ArkUIRuntimeCallInfo* runtimeCallInfo, EcmaVM* vm, std::vector<uint32_t>& values,
int32_t argsIndex, bool needLocalized = false)
{
Local<JSValueRef> leftArg = runtimeCallInfo->GetCallArgRef(argsIndex);
Local<JSValueRef> rightArg = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_1);
Local<JSValueRef> topArg = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_2);
Local<JSValueRef> bottomArg = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_3);
std::optional<Color> leftColor;
std::optional<Color> rightColor;
std::optional<Color> topColor;
std::optional<Color> bottomColor;
std::optional<Color> startColor;
std::optional<Color> endColor;
Color left;
if (!leftArg->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, leftArg, left)) {
leftColor = left;
}
Color right;
if (!rightArg->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, rightArg, right)) {
rightColor = right;
}
Color top;
if (!topArg->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, topArg, top)) {
topColor = top;
}
Color bottom;
if (!bottomArg->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, bottomArg, bottom)) {
bottomColor = bottom;
}
if (needLocalized) {
Local<JSValueRef> startArgs = runtimeCallInfo->GetCallArgRef(27); // 27: index of BorderColor.startColor
Local<JSValueRef> endArgs = runtimeCallInfo->GetCallArgRef(28); // 28: index of BorderColor.endColor
Color start;
if (!startArgs->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, startArgs, start)) {
startColor = start;
}
Color end;
if (!endArgs->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, endArgs, end)) {
endColor = end;
}
}
if (startColor.has_value() || endColor.has_value()) {
PushOuterBorderColorVector(startColor, values);
PushOuterBorderColorVector(endColor, values);
} else {
PushOuterBorderColorVector(leftColor, values);
PushOuterBorderColorVector(rightColor, values);
}
PushOuterBorderColorVector(topColor, values);
PushOuterBorderColorVector(bottomColor, values);
}
bool ParseLocalizedBorderRadius(const EcmaVM* vm, const Local<JSValueRef>& value, CalcDimension& result)
{
if (ArkTSUtils::ParseJsLengthMetrics(vm, value, result)) {
if (result.IsNegative()) {
result.Reset();
}
return true;
}
return false;
}
void ParseOuterBorderRadius(ArkUIRuntimeCallInfo* runtimeCallInfo, EcmaVM* vm, std::vector<ArkUI_Float32>& values,
int32_t argsIndex, bool needLocalized = false)
{
Local<JSValueRef> topLeftArgs = runtimeCallInfo->GetCallArgRef(argsIndex);
Local<JSValueRef> topRightArgs = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_1);
Local<JSValueRef> bottomLeftArgs = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_2);
Local<JSValueRef> bottomRightArgs = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_3);
if (needLocalized) {
Local<JSValueRef> topStartArgs = runtimeCallInfo->GetCallArgRef(29); // 29: index of BorderRadius.topStart
Local<JSValueRef> topEndArgs = runtimeCallInfo->GetCallArgRef(30); // 30: index of BorderRadius.topEnd
Local<JSValueRef> bottomStartArgs = runtimeCallInfo->GetCallArgRef(31); // 31: index of BorderRadius.bottomStart
Local<JSValueRef> bottomEndArgs = runtimeCallInfo->GetCallArgRef(32); // 32: index of BorderRadius.bottomEnd
// 35: index of is LocalizedBorderRadius or not
Local<JSValueRef> isLocalizedBorderRadiusArg = runtimeCallInfo->GetCallArgRef(35);
bool isLocalizedBorderRadius =
(isLocalizedBorderRadiusArg->IsBoolean()) ? isLocalizedBorderRadiusArg->ToBoolean(vm)->Value() : false;
if (isLocalizedBorderRadius) {
CalcDimension topStartOptional;
CalcDimension topEndOptional;
CalcDimension bottomStartOptional;
CalcDimension bottomEndOptional;
ParseLocalizedBorderRadius(vm, topStartArgs, topStartOptional);
ParseLocalizedBorderRadius(vm, topEndArgs, topEndOptional);
ParseLocalizedBorderRadius(vm, bottomStartArgs, bottomStartOptional);
ParseLocalizedBorderRadius(vm, bottomEndArgs, bottomEndOptional);
PushOuterBorderDimensionVector(topStartOptional, values);
PushOuterBorderDimensionVector(topEndOptional, values);
PushOuterBorderDimensionVector(bottomStartOptional, values);
PushOuterBorderDimensionVector(bottomEndOptional, values);
return;
}
}
std::optional<CalcDimension> topLeftOptional;
std::optional<CalcDimension> topRightOptional;
std::optional<CalcDimension> bottomLeftOptional;
std::optional<CalcDimension> bottomRightOptional;
ArkTSUtils::ParseOuterBorder(vm, topLeftArgs, topLeftOptional);
ArkTSUtils::ParseOuterBorder(vm, topRightArgs, topRightOptional);
ArkTSUtils::ParseOuterBorder(vm, bottomLeftArgs, bottomLeftOptional);
ArkTSUtils::ParseOuterBorder(vm, bottomRightArgs, bottomRightOptional);
PushOuterBorderDimensionVector(topLeftOptional, values);
PushOuterBorderDimensionVector(topRightOptional, values);
PushOuterBorderDimensionVector(bottomLeftOptional, values);
PushOuterBorderDimensionVector(bottomRightOptional, values);
}
void PushOuterBorderStyleVector(const std::optional<BorderStyle>& value, std::vector<uint32_t> &options)
{
options.push_back(static_cast<uint32_t>(value.has_value()));
if (value.has_value()) {
options.push_back(static_cast<uint32_t>(value.value()));
} else {
options.push_back(0);
}
}
void ParseOuterBorderStyle(
ArkUIRuntimeCallInfo* runtimeCallInfo, EcmaVM* vm, std::vector<uint32_t>& values, int32_t argsIndex)
{
std::optional<BorderStyle> styleLeft;
std::optional<BorderStyle> styleRight;
std::optional<BorderStyle> styleTop;
std::optional<BorderStyle> styleBottom;
auto topArg = runtimeCallInfo->GetCallArgRef(argsIndex);
auto rightArg = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_1);
auto bottomArg = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_2);
auto leftArg = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_3);
if (!topArg->IsUndefined() && topArg->IsNumber()) {
styleTop = ConvertBorderStyle(topArg->Int32Value(vm));
}
if (!rightArg->IsUndefined() && rightArg->IsNumber()) {
styleRight = ConvertBorderStyle(rightArg->Int32Value(vm));
}
if (!bottomArg->IsUndefined() && bottomArg->IsNumber()) {
styleBottom = ConvertBorderStyle(bottomArg->Int32Value(vm));
}
if (!leftArg->IsUndefined() && leftArg->IsNumber()) {
styleLeft = ConvertBorderStyle(leftArg->Int32Value(vm));
}
PushOuterBorderStyleVector(styleLeft, values);
PushOuterBorderStyleVector(styleRight, values);
PushOuterBorderStyleVector(styleTop, values);
PushOuterBorderStyleVector(styleBottom, values);
}
void ParseOuterBorderDashParam(ArkUIRuntimeCallInfo *runtimeCallInfo, EcmaVM *vm, std::vector<ArkUI_Float32> &values,
int32_t argsIndex)
{
@ -1112,10 +886,10 @@ void ParseOuterBorderDashParam(ArkUIRuntimeCallInfo *runtimeCallInfo, EcmaVM *vm
ArkTSUtils::ParseOuterBorderForDashParams(vm, topArgs, topDim);
ArkTSUtils::ParseOuterBorderForDashParams(vm, bottomArgs, bottomDim);
PushOuterBorderDimensionVector(leftDim, values);
PushOuterBorderDimensionVector(rightDim, values);
PushOuterBorderDimensionVector(topDim, values);
PushOuterBorderDimensionVector(bottomDim, values);
ArkTSUtils::PushOuterBorderDimensionVector(leftDim, values);
ArkTSUtils::PushOuterBorderDimensionVector(rightDim, values);
ArkTSUtils::PushOuterBorderDimensionVector(topDim, values);
ArkTSUtils::PushOuterBorderDimensionVector(bottomDim, values);
}
void SetBackgroundImagePositionAlign(double &value, DimensionUnit &type, double valueContent,
@ -1638,16 +1412,16 @@ ArkUINativeModuleValue CommonBridge::SetBorderRadius(ArkUIRuntimeCallInfo *runti
CalcDimension bottomRight;
bool isLengthMetrics = false;
if (topLeftArgs->IsObject(vm)) {
isLengthMetrics |= ParseLocalizedBorderRadius(vm, topLeftArgs, topLeft);
isLengthMetrics |= ArkTSUtils::ParseLocalizedBorderRadius(vm, topLeftArgs, topLeft);
}
if (topRightArgs->IsObject(vm)) {
isLengthMetrics |= ParseLocalizedBorderRadius(vm, topRightArgs, topRight);
isLengthMetrics |= ArkTSUtils::ParseLocalizedBorderRadius(vm, topRightArgs, topRight);
}
if (bottomLeftArgs->IsObject(vm)) {
isLengthMetrics |= ParseLocalizedBorderRadius(vm, bottomLeftArgs, bottomLeft);
isLengthMetrics |= ArkTSUtils::ParseLocalizedBorderRadius(vm, bottomLeftArgs, bottomLeft);
}
if (bottomRightArgs->IsObject(vm)) {
isLengthMetrics |= ParseLocalizedBorderRadius(vm, bottomRightArgs, bottomRight);
isLengthMetrics |= ArkTSUtils::ParseLocalizedBorderRadius(vm, bottomRightArgs, bottomRight);
}
if (!isLengthMetrics) {
ArkTSUtils::ParseAllBorder(vm, topLeftArgs, topLeft);
@ -1885,7 +1659,7 @@ ArkUINativeModuleValue CommonBridge::SetOutlineColor(ArkUIRuntimeCallInfo* runti
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
std::vector<uint32_t> colorOptions;
ParseOuterBorderColor(runtimeCallInfo, vm, colorOptions, NUM_1);
ArkTSUtils::ParseOuterBorderColor(runtimeCallInfo, vm, colorOptions, NUM_1);
GetArkUINodeModifiers()->getCommonModifier()->setOutlineColor(
nativeNode, colorOptions.data(), colorOptions.size());
return panda::JSValueRef::Undefined(vm);
@ -1908,7 +1682,7 @@ ArkUINativeModuleValue CommonBridge::SetOutlineRadius(ArkUIRuntimeCallInfo* runt
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
std::vector<ArkUI_Float32> radiusOptions;
ParseOuterBorderRadius(runtimeCallInfo, vm, radiusOptions, NUM_1);
ArkTSUtils::ParseOuterBorderRadius(runtimeCallInfo, vm, radiusOptions, NUM_1);
GetArkUINodeModifiers()->getCommonModifier()->setOutlineRadius(
nativeNode, radiusOptions.data(), radiusOptions.size());
return panda::JSValueRef::Undefined(vm);
@ -1931,7 +1705,7 @@ ArkUINativeModuleValue CommonBridge::SetOutlineWidth(ArkUIRuntimeCallInfo* runti
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
std::vector<ArkUI_Float32> widthOptions;
ParseOuterBorderWidth(runtimeCallInfo, vm, widthOptions);
ArkTSUtils::ParseOuterBorderWidth(runtimeCallInfo, vm, widthOptions, false);
GetArkUINodeModifiers()->getCommonModifier()->setOutlineWidth(
nativeNode, widthOptions.data(), widthOptions.size());
return panda::JSValueRef::Undefined(vm);
@ -1954,7 +1728,7 @@ ArkUINativeModuleValue CommonBridge::SetOutlineStyle(ArkUIRuntimeCallInfo* runti
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
std::vector<uint32_t> styleOptions;
ParseOuterBorderStyle(runtimeCallInfo, vm, styleOptions, NUM_1);
ArkTSUtils::ParseOuterBorderStyle(runtimeCallInfo, vm, styleOptions, NUM_1);
GetArkUINodeModifiers()->getCommonModifier()->setOutlineStyle(
nativeNode, styleOptions.data(), styleOptions.size());
return panda::JSValueRef::Undefined(vm);
@ -1977,12 +1751,14 @@ ArkUINativeModuleValue CommonBridge::SetOutline(ArkUIRuntimeCallInfo* runtimeCal
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
std::vector<ArkUI_Float32> options;
ParseOuterBorderWidth(runtimeCallInfo, vm, options); // Outline Width args start index from 1
ParseOuterBorderRadius(runtimeCallInfo, vm, options, NUM_9); // Outline Radius args start index
ArkTSUtils::ParseOuterBorderWidth(runtimeCallInfo, vm, options, false); // Outline Width args start index from 1
ArkTSUtils::ParseOuterBorderRadius(runtimeCallInfo, vm, options, NUM_9); // Outline Radius args start index
std::vector<uint32_t> colorAndStyleOptions;
ParseOuterBorderColor(runtimeCallInfo, vm, colorAndStyleOptions, NUM_5); // Outline Color args start index
ParseOuterBorderStyle(runtimeCallInfo, vm, colorAndStyleOptions, NUM_13); // Outline Style args start index
ArkTSUtils::ParseOuterBorderColor(
runtimeCallInfo, vm, colorAndStyleOptions, NUM_5); // Outline Color args start index
ArkTSUtils::ParseOuterBorderStyle(
runtimeCallInfo, vm, colorAndStyleOptions, NUM_13); // Outline Style args start index
GetArkUINodeModifiers()->getCommonModifier()->setOutline(
nativeNode, options.data(), options.size(), colorAndStyleOptions.data(), colorAndStyleOptions.size());
@ -2921,12 +2697,14 @@ ArkUINativeModuleValue CommonBridge::SetBorder(ArkUIRuntimeCallInfo* runtimeCall
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
std::vector<ArkUI_Float32> options;
ParseOuterBorderWidth(runtimeCallInfo, vm, options); // Border Width args start index from 1
ParseOuterBorderRadius(runtimeCallInfo, vm, options, NUM_9); // Border Radius args start index
ArkTSUtils::ParseOuterBorderWidth(runtimeCallInfo, vm, options); // Border Width args start index from 1
ArkTSUtils::ParseOuterBorderRadius(runtimeCallInfo, vm, options, NUM_9); // Border Radius args start index
std::vector<uint32_t> colorAndStyleOptions;
ParseOuterBorderColor(runtimeCallInfo, vm, colorAndStyleOptions, NUM_5); // Border Color args start index
ParseOuterBorderStyle(runtimeCallInfo, vm, colorAndStyleOptions, NUM_13); // Border Style args start index
ArkTSUtils::ParseOuterBorderColor(
runtimeCallInfo, vm, colorAndStyleOptions, NUM_5); // Border Color args start index
ArkTSUtils::ParseOuterBorderStyle(
runtimeCallInfo, vm, colorAndStyleOptions, NUM_13); // Border Style args start index
GetArkUINodeModifiers()->getCommonModifier()->setBorder(nativeNode, options.data(), options.size(),
colorAndStyleOptions.data(), colorAndStyleOptions.size(), false, false, false);
@ -2941,12 +2719,14 @@ ArkUINativeModuleValue CommonBridge::SetLocalizedBorder(ArkUIRuntimeCallInfo* ru
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
std::vector<ArkUI_Float32> options;
ParseOuterBorderWidth(runtimeCallInfo, vm, options, true); // Border Width args start index from 1
ParseOuterBorderRadius(runtimeCallInfo, vm, options, NUM_9, true); // Border Radius args start index
ArkTSUtils::ParseOuterBorderWidth(runtimeCallInfo, vm, options, true); // Border Width args start index from 1
ArkTSUtils::ParseOuterBorderRadius(runtimeCallInfo, vm, options, NUM_9, true); // Border Radius args start index
std::vector<uint32_t> colorAndStyleOptions;
ParseOuterBorderColor(runtimeCallInfo, vm, colorAndStyleOptions, NUM_5, true); // Border Color args start index
ParseOuterBorderStyle(runtimeCallInfo, vm, colorAndStyleOptions, NUM_13); // Border Style args start index
ArkTSUtils::ParseOuterBorderColor(
runtimeCallInfo, vm, colorAndStyleOptions, NUM_5, true); // Border Color args start index
ArkTSUtils::ParseOuterBorderStyle(
runtimeCallInfo, vm, colorAndStyleOptions, NUM_13); // Border Style args start index
int32_t isLocalizedBorderWidth = 0;
int32_t isLocalizedBorderColor = 0;

View File

@ -89,6 +89,30 @@ ArkUINativeModuleValue ResourceBridge::GetColorValue(ArkUIRuntimeCallInfo* runti
return panda::JSValueRef::Undefined(vm);
}
ArkUINativeModuleValue ResourceBridge::GetStringValue(ArkUIRuntimeCallInfo* runtimeCallInfo)
{
EcmaVM* vm = runtimeCallInfo->GetVM();
CHECK_NULL_RETURN(vm, panda::NativePointerRef::New(vm, nullptr));
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
std::string result;
if (ArkTSUtils::ParseJsString(vm, firstArg, result)) {
return panda::StringRef::NewFromUtf8(vm, result.c_str());
}
return panda::JSValueRef::Undefined(vm);
}
ArkUINativeModuleValue ResourceBridge::GetNumberValue(ArkUIRuntimeCallInfo* runtimeCallInfo)
{
EcmaVM* vm = runtimeCallInfo->GetVM();
CHECK_NULL_RETURN(vm, panda::NativePointerRef::New(vm, nullptr));
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
double result;
if (ArkTSUtils::ParseJsDouble(vm, firstArg, result)) {
return panda::NumberRef::New(vm, result);
}
return panda::JSValueRef::Undefined(vm);
}
ArkUINativeModuleValue ResourceBridge::ClearCache(ArkUIRuntimeCallInfo* runtimeCallInfo)
{
EcmaVM* vm = runtimeCallInfo->GetVM();

View File

@ -26,6 +26,8 @@ public:
static ArkUINativeModuleValue UpdateColorMode(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue Restore(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue GetColorValue(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue GetStringValue(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue GetNumberValue(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue ClearCache(ArkUIRuntimeCallInfo* runtimeCallInfo);
};
} // namespace OHOS::Ace::NG

View File

@ -33,7 +33,7 @@ ArkUINativeModuleValue ScrollableBridge::SetContentClip(ArkUIRuntimeCallInfo* ru
AceType::DynamicCast<ShapeRect>(clipShape->GetBasicShape()));
return panda::JSValueRef::Undefined(vm);
}
} else if (info[0]->IsNumber()) {
} else if (info[1]->IsNumber()) {
GetArkUINodeModifiers()->getScrollableModifier()->setContentClip(node, info[1]->ToNumber<int32_t>());
return panda::JSValueRef::Undefined(vm);
}

View File

@ -522,6 +522,7 @@ ArkUINativeModuleValue SearchBridge::SetSearchButton(ArkUIRuntimeCallInfo* runti
Local<JSValueRef> secondArg = runtimeCallInfo->GetCallArgRef(NUM_1);
Local<JSValueRef> threeArg = runtimeCallInfo->GetCallArgRef(NUM_2);
Local<JSValueRef> fourArg = runtimeCallInfo->GetCallArgRef(NUM_3);
Local<JSValueRef> fiveArg = runtimeCallInfo->GetCallArgRef(NUM_4);
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
struct ArkUISearchButtonOptionsStruct value = {"", 0.0, 0, INVALID_COLOR_VALUE};
@ -556,6 +557,14 @@ ArkUINativeModuleValue SearchBridge::SetSearchButton(ArkUIRuntimeCallInfo* runti
} else {
value.fontColor = static_cast<int32_t>(theme->GetSearchButtonTextColor().GetValue());
}
if (fiveArg->IsBoolean()) {
value.autoDisable = fiveArg->ToBoolean(vm)->Value();
GetArkUINodeModifiers()->getSearchModifier()->setSearchSearchButton(nativeNode, &value);
} else {
GetArkUINodeModifiers()->getSearchModifier()->resetSearchSearchButton(nativeNode);
}
GetArkUINodeModifiers()->getSearchModifier()->setSearchSearchButton(nativeNode, &value);
return panda::JSValueRef::Undefined(vm);
}

View File

@ -1756,6 +1756,106 @@ ArkUINativeModuleValue TextAreaBridge::ResetBorderRadius(ArkUIRuntimeCallInfo *r
return panda::JSValueRef::Undefined(vm);
}
ArkUINativeModuleValue TextAreaBridge::SetOutlineColor(ArkUIRuntimeCallInfo* runtimeCallInfo)
{
EcmaVM* vm = runtimeCallInfo->GetVM();
CHECK_NULL_RETURN(vm, panda::NativePointerRef::New(vm, nullptr));
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
std::vector<uint32_t> colorOptions;
ArkTSUtils::ParseOuterBorderColor(runtimeCallInfo, vm, colorOptions, NUM_1);
GetArkUINodeModifiers()->getTextAreaModifier()->setTextAreaOutlineColor(
nativeNode, colorOptions.data(), colorOptions.size());
return panda::JSValueRef::Undefined(vm);
}
ArkUINativeModuleValue TextAreaBridge::ResetOutlineColor(ArkUIRuntimeCallInfo* runtimeCallInfo)
{
EcmaVM* vm = runtimeCallInfo->GetVM();
CHECK_NULL_RETURN(vm, panda::NativePointerRef::New(vm, nullptr));
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
GetArkUINodeModifiers()->getTextAreaModifier()->resetTextAreaOutlineColor(nativeNode);
return panda::JSValueRef::Undefined(vm);
}
ArkUINativeModuleValue TextAreaBridge::SetOutlineRadius(ArkUIRuntimeCallInfo* runtimeCallInfo)
{
EcmaVM* vm = runtimeCallInfo->GetVM();
CHECK_NULL_RETURN(vm, panda::NativePointerRef::New(vm, nullptr));
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
std::vector<ArkUI_Float32> radiusOptions;
ArkTSUtils::ParseOuterBorderRadius(runtimeCallInfo, vm, radiusOptions, NUM_1);
GetArkUINodeModifiers()->getTextAreaModifier()->setTextAreaOutlineRadius(
nativeNode, radiusOptions.data(), radiusOptions.size());
return panda::JSValueRef::Undefined(vm);
}
ArkUINativeModuleValue TextAreaBridge::ResetOutlineRadius(ArkUIRuntimeCallInfo* runtimeCallInfo)
{
EcmaVM* vm = runtimeCallInfo->GetVM();
CHECK_NULL_RETURN(vm, panda::NativePointerRef::New(vm, nullptr));
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
GetArkUINodeModifiers()->getTextAreaModifier()->resetTextAreaOutlineRadius(nativeNode);
return panda::JSValueRef::Undefined(vm);
}
ArkUINativeModuleValue TextAreaBridge::SetOutlineWidth(ArkUIRuntimeCallInfo* runtimeCallInfo)
{
EcmaVM* vm = runtimeCallInfo->GetVM();
CHECK_NULL_RETURN(vm, panda::NativePointerRef::New(vm, nullptr));
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
std::vector<ArkUI_Float32> widthOptions;
ArkTSUtils::ParseOuterBorderWidth(runtimeCallInfo, vm, widthOptions, false);
GetArkUINodeModifiers()->getTextAreaModifier()->setTextAreaOutlineWidth(
nativeNode, widthOptions.data(), widthOptions.size());
return panda::JSValueRef::Undefined(vm);
}
ArkUINativeModuleValue TextAreaBridge::ResetOutlineWidth(ArkUIRuntimeCallInfo* runtimeCallInfo)
{
EcmaVM* vm = runtimeCallInfo->GetVM();
CHECK_NULL_RETURN(vm, panda::NativePointerRef::New(vm, nullptr));
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
GetArkUINodeModifiers()->getTextAreaModifier()->resetTextAreaOutlineWidth(nativeNode);
return panda::JSValueRef::Undefined(vm);
}
ArkUINativeModuleValue TextAreaBridge::SetOutline(ArkUIRuntimeCallInfo* runtimeCallInfo)
{
EcmaVM* vm = runtimeCallInfo->GetVM();
CHECK_NULL_RETURN(vm, panda::NativePointerRef::New(vm, nullptr));
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
std::vector<ArkUI_Float32> options;
ArkTSUtils::ParseOuterBorderWidth(runtimeCallInfo, vm, options); // Outline Width args start index from 1
ArkTSUtils::ParseOuterBorderRadius(runtimeCallInfo, vm, options, NUM_9); // Outline Radius args start index
std::vector<uint32_t> colorAndStyleOptions;
ArkTSUtils::ParseOuterBorderColor(
runtimeCallInfo, vm, colorAndStyleOptions, NUM_5); // Outline Color args start index
ArkTSUtils::ParseOuterBorderStyle(
runtimeCallInfo, vm, colorAndStyleOptions, NUM_13); // Outline Style args start index
GetArkUINodeModifiers()->getTextAreaModifier()->setTextAreaOutline(
nativeNode, options.data(), options.size(), colorAndStyleOptions.data(), colorAndStyleOptions.size());
return panda::JSValueRef::Undefined(vm);
}
ArkUINativeModuleValue TextAreaBridge::ResetOutline(ArkUIRuntimeCallInfo* runtimeCallInfo)
{
EcmaVM* vm = runtimeCallInfo->GetVM();
CHECK_NULL_RETURN(vm, panda::NativePointerRef::New(vm, nullptr));
Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0);
auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value());
GetArkUINodeModifiers()->getTextAreaModifier()->resetTextAreaOutline(nativeNode);
return panda::JSValueRef::Undefined(vm);
}
ArkUINativeModuleValue TextAreaBridge::SetBackgroundColor(ArkUIRuntimeCallInfo *runtimeCallInfo)
{
EcmaVM *vm = runtimeCallInfo->GetVM();

View File

@ -121,6 +121,14 @@ public:
static ArkUINativeModuleValue ResetBorderStyle(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue SetBorderRadius(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue ResetBorderRadius(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue SetOutlineColor(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue ResetOutlineColor(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue SetOutlineRadius(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue ResetOutlineRadius(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue SetOutlineWidth(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue ResetOutlineWidth(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue SetOutline(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue ResetOutline(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue SetBackgroundColor(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue ResetBackgroundColor(ArkUIRuntimeCallInfo* runtimeCallInfo);
static ArkUINativeModuleValue SetMargin(ArkUIRuntimeCallInfo* runtimeCallInfo);

View File

@ -1601,29 +1601,6 @@ void ArkTSUtils::PushOuterBorderDimensionVector(const std::optional<CalcDimensio
}
}
void ArkTSUtils::ParseOuterBorderWidth(
ArkUIRuntimeCallInfo *runtimeCallInfo, EcmaVM *vm, std::vector<ArkUI_Float32> &values)
{
Local<JSValueRef> leftArgs = runtimeCallInfo->GetCallArgRef(NUM_1);
Local<JSValueRef> rightArgs = runtimeCallInfo->GetCallArgRef(NUM_2);
Local<JSValueRef> topArgs = runtimeCallInfo->GetCallArgRef(NUM_3);
Local<JSValueRef> bottomArgs = runtimeCallInfo->GetCallArgRef(NUM_4);
std::optional<CalcDimension> leftDim;
std::optional<CalcDimension> rightDim;
std::optional<CalcDimension> topDim;
std::optional<CalcDimension> bottomDim;
ParseOuterBorder(vm, leftArgs, leftDim);
ParseOuterBorder(vm, rightArgs, rightDim);
ParseOuterBorder(vm, topArgs, topDim);
ParseOuterBorder(vm, bottomArgs, bottomDim);
PushOuterBorderDimensionVector(leftDim, values);
PushOuterBorderDimensionVector(rightDim, values);
PushOuterBorderDimensionVector(topDim, values);
PushOuterBorderDimensionVector(bottomDim, values);
}
void ArkTSUtils::PushOuterBorderColorVector(const std::optional<Color>& valueColor, std::vector<uint32_t> &options)
{
options.push_back(static_cast<uint32_t>(valueColor.has_value()));
@ -1634,66 +1611,6 @@ void ArkTSUtils::PushOuterBorderColorVector(const std::optional<Color>& valueCol
}
}
void ArkTSUtils::ParseOuterBorderColor(
ArkUIRuntimeCallInfo* runtimeCallInfo, EcmaVM* vm, std::vector<uint32_t>& values, int32_t argsIndex)
{
Local<JSValueRef> leftArg = runtimeCallInfo->GetCallArgRef(argsIndex);
Local<JSValueRef> rightArg = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_1);
Local<JSValueRef> topArg = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_2);
Local<JSValueRef> bottomArg = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_3);
std::optional<Color> leftColor;
std::optional<Color> rightColor;
std::optional<Color> topColor;
std::optional<Color> bottomColor;
Color left;
if (!leftArg->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, leftArg, left)) {
leftColor = left;
}
Color right;
if (!rightArg->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, rightArg, right)) {
rightColor = right;
}
Color top;
if (!topArg->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, topArg, top)) {
topColor = top;
}
Color bottom;
if (!bottomArg->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, bottomArg, bottom)) {
bottomColor = bottom;
}
PushOuterBorderColorVector(leftColor, values);
PushOuterBorderColorVector(rightColor, values);
PushOuterBorderColorVector(topColor, values);
PushOuterBorderColorVector(bottomColor, values);
}
void ArkTSUtils::ParseOuterBorderRadius(
ArkUIRuntimeCallInfo* runtimeCallInfo, EcmaVM* vm, std::vector<ArkUI_Float32>& values, int32_t argsIndex)
{
Local<JSValueRef> topLeftArgs = runtimeCallInfo->GetCallArgRef(argsIndex);
Local<JSValueRef> topRightArgs = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_1);
Local<JSValueRef> bottomLeftArgs = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_2);
Local<JSValueRef> bottomRightArgs = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_3);
std::optional<CalcDimension> topLeftOptional;
std::optional<CalcDimension> topRightOptional;
std::optional<CalcDimension> bottomLeftOptional;
std::optional<CalcDimension> bottomRightOptional;
ParseOuterBorder(vm, topLeftArgs, topLeftOptional);
ParseOuterBorder(vm, topRightArgs, topRightOptional);
ParseOuterBorder(vm, bottomLeftArgs, bottomLeftOptional);
ParseOuterBorder(vm, bottomRightArgs, bottomRightOptional);
PushOuterBorderDimensionVector(topLeftOptional, values);
PushOuterBorderDimensionVector(topRightOptional, values);
PushOuterBorderDimensionVector(bottomLeftOptional, values);
PushOuterBorderDimensionVector(bottomRightOptional, values);
}
void ArkTSUtils::ParseOuterBorderRadius(ArkUIRuntimeCallInfo* runtimeCallInfo,
EcmaVM* vm, std::vector<ArkUI_Float32>& values, std::vector<ArkUI_Int32>& units, int32_t argsIndex)
{
@ -1778,6 +1695,160 @@ void ArkTSUtils::SetBorderWidthArray(const EcmaVM* vm, const Local<JSValueRef>&
}
}
void ArkTSUtils::ParseOuterBorderWidth(
ArkUIRuntimeCallInfo* runtimeCallInfo, EcmaVM* vm, std::vector<ArkUI_Float32>& values, bool needLocalized)
{
Local<JSValueRef> leftArgs = runtimeCallInfo->GetCallArgRef(NUM_1);
Local<JSValueRef> rightArgs = runtimeCallInfo->GetCallArgRef(NUM_2);
Local<JSValueRef> topArgs = runtimeCallInfo->GetCallArgRef(NUM_3);
Local<JSValueRef> bottomArgs = runtimeCallInfo->GetCallArgRef(NUM_4);
std::optional<CalcDimension> leftDim;
std::optional<CalcDimension> rightDim;
std::optional<CalcDimension> topDim;
std::optional<CalcDimension> bottomDim;
std::optional<CalcDimension> startDim;
std::optional<CalcDimension> endDim;
ParseOuterBorder(vm, leftArgs, leftDim);
ParseOuterBorder(vm, rightArgs, rightDim);
if (needLocalized) {
Local<JSValueRef> startArgs = runtimeCallInfo->GetCallArgRef(25); // 25: index of BorderWidth.start
Local<JSValueRef> endArgs = runtimeCallInfo->GetCallArgRef(26); // 26: index of BorderWidth.end
ParseOuterBorderForDashParams(vm, startArgs, startDim);
ParseOuterBorderForDashParams(vm, endArgs, endDim);
ParseOuterBorderForDashParams(vm, topArgs, topDim);
ParseOuterBorderForDashParams(vm, bottomArgs, bottomDim);
} else {
ParseOuterBorder(vm, topArgs, topDim);
ParseOuterBorder(vm, bottomArgs, bottomDim);
}
if (startDim.has_value() || endDim.has_value()) {
PushOuterBorderDimensionVector(startDim, values);
PushOuterBorderDimensionVector(endDim, values);
} else {
PushOuterBorderDimensionVector(leftDim, values);
PushOuterBorderDimensionVector(rightDim, values);
}
PushOuterBorderDimensionVector(topDim, values);
PushOuterBorderDimensionVector(bottomDim, values);
}
void ArkTSUtils::ParseOuterBorderColor(ArkUIRuntimeCallInfo* runtimeCallInfo, EcmaVM* vm, std::vector<uint32_t>& values,
int32_t argsIndex, bool needLocalized)
{
Local<JSValueRef> leftArg = runtimeCallInfo->GetCallArgRef(argsIndex);
Local<JSValueRef> rightArg = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_1);
Local<JSValueRef> topArg = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_2);
Local<JSValueRef> bottomArg = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_3);
std::optional<Color> leftColor;
std::optional<Color> rightColor;
std::optional<Color> topColor;
std::optional<Color> bottomColor;
std::optional<Color> startColor;
std::optional<Color> endColor;
Color left;
if (!leftArg->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, leftArg, left)) {
leftColor = left;
}
Color right;
if (!rightArg->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, rightArg, right)) {
rightColor = right;
}
Color top;
if (!topArg->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, topArg, top)) {
topColor = top;
}
Color bottom;
if (!bottomArg->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, bottomArg, bottom)) {
bottomColor = bottom;
}
if (needLocalized) {
Local<JSValueRef> startArgs = runtimeCallInfo->GetCallArgRef(27); // 27: index of BorderColor.startColor
Local<JSValueRef> endArgs = runtimeCallInfo->GetCallArgRef(28); // 28: index of BorderColor.endColor
Color start;
if (!startArgs->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, startArgs, start)) {
startColor = start;
}
Color end;
if (!endArgs->IsUndefined() && ArkTSUtils::ParseJsColorAlpha(vm, endArgs, end)) {
endColor = end;
}
}
if (startColor.has_value() || endColor.has_value()) {
PushOuterBorderColorVector(startColor, values);
PushOuterBorderColorVector(endColor, values);
} else {
PushOuterBorderColorVector(leftColor, values);
PushOuterBorderColorVector(rightColor, values);
}
PushOuterBorderColorVector(topColor, values);
PushOuterBorderColorVector(bottomColor, values);
}
bool ArkTSUtils::ParseLocalizedBorderRadius(const EcmaVM* vm, const Local<JSValueRef>& value, CalcDimension& result)
{
if (ArkTSUtils::ParseJsLengthMetrics(vm, value, result)) {
if (result.IsNegative()) {
result.Reset();
}
return true;
}
return false;
}
void ArkTSUtils::ParseOuterBorderRadius(ArkUIRuntimeCallInfo* runtimeCallInfo, EcmaVM* vm,
std::vector<ArkUI_Float32>& values, int32_t argsIndex, bool needLocalized)
{
Local<JSValueRef> topLeftArgs = runtimeCallInfo->GetCallArgRef(argsIndex);
Local<JSValueRef> topRightArgs = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_1);
Local<JSValueRef> bottomLeftArgs = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_2);
Local<JSValueRef> bottomRightArgs = runtimeCallInfo->GetCallArgRef(argsIndex + NUM_3);
if (needLocalized) {
Local<JSValueRef> topStartArgs = runtimeCallInfo->GetCallArgRef(29); // 29: index of BorderRadius.topStart
Local<JSValueRef> topEndArgs = runtimeCallInfo->GetCallArgRef(30); // 30: index of BorderRadius.topEnd
Local<JSValueRef> bottomStartArgs = runtimeCallInfo->GetCallArgRef(31); // 31: index of BorderRadius.bottomStart
Local<JSValueRef> bottomEndArgs = runtimeCallInfo->GetCallArgRef(32); // 32: index of BorderRadius.bottomEnd
// 35: index of is LocalizedBorderRadius or not
Local<JSValueRef> isLocalizedBorderRadiusArg = runtimeCallInfo->GetCallArgRef(35);
bool isLocalizedBorderRadius =
(isLocalizedBorderRadiusArg->IsBoolean()) ? isLocalizedBorderRadiusArg->ToBoolean(vm)->Value() : false;
if (isLocalizedBorderRadius) {
CalcDimension topStartOptional;
CalcDimension topEndOptional;
CalcDimension bottomStartOptional;
CalcDimension bottomEndOptional;
ParseLocalizedBorderRadius(vm, topStartArgs, topStartOptional);
ParseLocalizedBorderRadius(vm, topEndArgs, topEndOptional);
ParseLocalizedBorderRadius(vm, bottomStartArgs, bottomStartOptional);
ParseLocalizedBorderRadius(vm, bottomEndArgs, bottomEndOptional);
PushOuterBorderDimensionVector(topStartOptional, values);
PushOuterBorderDimensionVector(topEndOptional, values);
PushOuterBorderDimensionVector(bottomStartOptional, values);
PushOuterBorderDimensionVector(bottomEndOptional, values);
return;
}
}
std::optional<CalcDimension> topLeftOptional;
std::optional<CalcDimension> topRightOptional;
std::optional<CalcDimension> bottomLeftOptional;
std::optional<CalcDimension> bottomRightOptional;
ParseOuterBorder(vm, topLeftArgs, topLeftOptional);
ParseOuterBorder(vm, topRightArgs, topRightOptional);
ParseOuterBorder(vm, bottomLeftArgs, bottomLeftOptional);
ParseOuterBorder(vm, bottomRightArgs, bottomRightOptional);
PushOuterBorderDimensionVector(topLeftOptional, values);
PushOuterBorderDimensionVector(topRightOptional, values);
PushOuterBorderDimensionVector(bottomLeftOptional, values);
PushOuterBorderDimensionVector(bottomRightOptional, values);
}
ArkUISizeType ArkTSUtils::ParseJsToArkUISize(const EcmaVM *vm, const Local<JSValueRef> &arg)
{
ArkUISizeType size = { 0.0, static_cast<int8_t>(DimensionUnit::VP), nullptr };

View File

@ -107,6 +107,13 @@ public:
std::optional<CalcDimension>& optionalDimension);
static void PushOuterBorderDimensionVector(const std::optional<CalcDimension>& valueDim,
std::vector<ArkUI_Float32>& values, std::vector<ArkUI_Int32>& units);
static void ParseOuterBorderWidth(ArkUIRuntimeCallInfo* runtimeCallInfo, EcmaVM* vm,
std::vector<ArkUI_Float32>& values, bool needLocalized = false);
static void ParseOuterBorderColor(ArkUIRuntimeCallInfo* runtimeCallInfo, EcmaVM* vm, std::vector<uint32_t>& values,
int32_t argsIndex, bool needLocalized = false);
static void ParseOuterBorderRadius(ArkUIRuntimeCallInfo* runtimeCallInfo, EcmaVM* vm,
std::vector<ArkUI_Float32>& values, int32_t argsIndex, bool needLocalized = false);
static bool ParseLocalizedBorderRadius(const EcmaVM* vm, const Local<JSValueRef>& value, CalcDimension& result);
template <class T>
static bool ParseArray(const EcmaVM *vm, const Local<JSValueRef> &arg, T *array, int32_t defaultLength,
std::function<T(const EcmaVM *, const Local<JSValueRef> &)> getValue)
@ -164,14 +171,8 @@ public:
static BorderStyle ConvertBorderStyle(int32_t value);
static void PushOuterBorderDimensionVector(
const std::optional<CalcDimension>& valueDim, std::vector<ArkUI_Float32> &options);
static void ParseOuterBorderWidth(
ArkUIRuntimeCallInfo *runtimeCallInfo, EcmaVM *vm, std::vector<ArkUI_Float32> &values);
static void PushOuterBorderColorVector(
const std::optional<Color>& valueColor, std::vector<uint32_t> &options);
static void ParseOuterBorderColor(ArkUIRuntimeCallInfo* runtimeCallInfo,
EcmaVM* vm, std::vector<uint32_t>& values, int32_t argsIndex);
static void ParseOuterBorderRadius(ArkUIRuntimeCallInfo* runtimeCallInfo,
EcmaVM* vm, std::vector<ArkUI_Float32>& values, int32_t argsIndex);
static void ParseOuterBorderRadius(ArkUIRuntimeCallInfo* runtimeCallInfo,
EcmaVM* vm, std::vector<ArkUI_Float32>& values, std::vector<ArkUI_Int32>& units, int32_t argsIndex);
static void PushOuterBorderStyleVector(

View File

@ -4014,6 +4014,8 @@ class PUV2ViewBase extends NativeViewPartialUpdate {
// the key is the elementId of the Component/Element that's the result of this function
this.updateFuncByElmtId = new UpdateFuncsByElmtId();
this.extraInfo_ = undefined;
// Set of elements for delayed update
this.elmtIdsDelayedUpdate_ = new Set();
// if set use the elmtId also as the ViewPU/V2 object's subscribable id.
// these matching is requirement for updateChildViewById(elmtId) being able to
// find the child ViewPU/V2 object by given elmtId
@ -4038,6 +4040,15 @@ class PUV2ViewBase extends NativeViewPartialUpdate {
updateId(elmtId) {
this.id_ = elmtId;
}
/* Adds the elmtId to elmtIdsDelayedUpdate for delayed update
once the view gets active
*/
scheduleDelayedUpdate(elmtId) {
this.elmtIdsDelayedUpdate.add(elmtId);
}
get elmtIdsDelayedUpdate() {
return this.elmtIdsDelayedUpdate_;
}
setParent(parent) {
if (this.parent_ && parent) {
stateMgmtConsole.warn(`${this.debugInfo__()}: setChild: changing parent to '${parent === null || parent === void 0 ? void 0 : parent.debugInfo__()} (unsafe operation)`);
@ -6607,7 +6618,7 @@ class ViewPU extends PUV2ViewBase {
}
performDelayedUpdate() {
if (!this.ownObservedPropertiesStore_.size) {
if (!this.ownObservedPropertiesStore_.size && !this.elmtIdsDelayedUpdate.size) {
return;
}
@ -6631,6 +6642,10 @@ class ViewPU extends PUV2ViewBase {
}
}
} // for all ownStateLinkProps_
for (let elementId of this.elmtIdsDelayedUpdate) {
this.dirtDescendantElementIds_.add(elementId);
}
this.elmtIdsDelayedUpdate.clear();
this.restoreInstanceId();
if (this.dirtDescendantElementIds_.size) {
this.markNeedUpdate();
@ -8306,7 +8321,7 @@ class ObserveV2 {
if (view.isViewActive()) {
view.uiNodeNeedUpdateV2(elmtId);
}
else if (view instanceof ViewV2) {
else {
// schedule delayed update once the view gets active
view.scheduleDelayedUpdate(elmtId);
}
@ -9118,11 +9133,10 @@ AsyncAddComputedV2.computedVars = new Array();
*/
class ViewV2 extends PUV2ViewBase {
constructor(parent, elmtId = UINodeRegisterProxy.notRecordingDependencies, extraInfo = undefined) {
var _a;
super(parent, elmtId, extraInfo);
// Set of elmtIds that need re-render
this.dirtDescendantElementIds_ = new Set();
// Set of elements for delayed update
this.elmtIdsDelayedUpdate = new Set();
this.monitorIdsDelayedUpdate = new Set();
this.computedIdsDelayedUpdate = new Set();
/**
@ -9145,8 +9159,26 @@ class ViewV2 extends PUV2ViewBase {
return repeat;
};
this.setIsV2(true);
(_a = PUV2ViewBase.arkThemeScopeManager) === null || _a === void 0 ? void 0 : _a.onViewPUCreate(this);
}
onGlobalThemeChanged() {
this.onWillApplyThemeInternally();
this.forceCompleteRerender(false);
this.childrenWeakrefMap_.forEach((weakRefChild) => {
const child = weakRefChild.deref();
if (child) {
child.onGlobalThemeChanged();
}
});
}
onWillApplyThemeInternally() {
var _a;
const theme = (_a = PUV2ViewBase.arkThemeScopeManager) === null || _a === void 0 ? void 0 : _a.getFinalTheme(this.id__());
if (theme) {
this.onWillApplyTheme(theme);
}
}
onWillApplyTheme(theme) { }
/**
* The `freezeState` parameter determines whether this @ComponentV2 is allowed to freeze, when inactive
* Its called with value of the `freezeWhenInactive` parameter from the @ComponentV2 decorator,
@ -9197,6 +9229,7 @@ class ViewV2 extends PUV2ViewBase {
// super class will call this function from
// its aboutToBeDeleted implementation
aboutToBeDeletedInternal() {
var _a;
// if this isDeleting_ is true already, it may be set delete status recursively by its parent, so it is not necessary
// to set and resursively set its children any more
@ -9226,9 +9259,11 @@ class ViewV2 extends PUV2ViewBase {
if (this.parent_) {
this.parent_.removeChild(this);
}
(_a = PUV2ViewBase.arkThemeScopeManager) === null || _a === void 0 ? void 0 : _a.onViewPUDelete(this);
}
initialRenderView() {
this.onWillApplyThemeInternally();
this.initialRender();
}
@ -9240,8 +9275,10 @@ class ViewV2 extends PUV2ViewBase {
const _componentName = (classObject && ('name' in classObject)) ? Reflect.get(classObject, 'name') : 'unspecified UINode';
const _popFunc = (classObject && 'pop' in classObject) ? classObject.pop : () => { };
const updateFunc = (elmtId, isFirstRender) => {
var _a, _b;
this.syncInstanceId();
(_a = PUV2ViewBase.arkThemeScopeManager) === null || _a === void 0 ? void 0 : _a.onComponentCreateEnter(_componentName, elmtId, isFirstRender, this);
ViewStackProcessor.StartGetAccessRecordingFor(elmtId);
ObserveV2.getObserve().startRecordDependencies(this, elmtId);
compilerAssignedUpdateFunc(elmtId, isFirstRender);
@ -9254,6 +9291,7 @@ class ViewV2 extends PUV2ViewBase {
}
ObserveV2.getObserve().stopRecordDependencies();
ViewStackProcessor.StopGetAccessRecording();
(_b = PUV2ViewBase.arkThemeScopeManager) === null || _b === void 0 ? void 0 : _b.onComponentCreateExit(elmtId);
this.restoreInstanceId();
};
@ -9424,12 +9462,6 @@ class ViewV2 extends PUV2ViewBase {
}
return retVal;
}
/* Adds the elmtId to elmtIdsDelayedUpdate for delayed update
once the view gets active
*/
scheduleDelayedUpdate(elmtId) {
this.elmtIdsDelayedUpdate.add(elmtId);
}
// WatchIds that needs to be fired later gets added to monitorIdsDelayedUpdate
// monitor fireChange will be triggered for all these watchIds once this view gets active
addDelayedMonitorIds(watchId) {
@ -10729,7 +10761,8 @@ class __RepeatVirtualScrollImpl {
}
reRender() {
if (this.hasVisibleItemsChanged()) {
// When this.totalCount_ == 0 need render to clear visible items
if (this.hasVisibleItemsChanged() || this.totalCount_ == 0) {
this.purgeKeyCache();
RepeatVirtualScrollNative.updateRenderState(this.totalCount_, true);

View File

@ -21,7 +21,12 @@
namespace OHOS::Ace::Framework {
constexpr size_t GCTHRESHOLD = 50;
JSCanvasPath::JSCanvasPath() = default;
JSCanvasPath::JSCanvasPath()
{
if (Container::GreatOrEqualAPITargetVersion(PlatformVersion::VERSION_FOURTEEN)) {
isJudgeSpecialValue_ = true;
}
}
void JSCanvasPath::JsPath2DSetTransform(const JSCallbackInfo& info)
{
@ -31,8 +36,12 @@ void JSCanvasPath::JsPath2DSetTransform(const JSCallbackInfo& info)
double scaleY = 0.0;
double translateX = 0.0;
double translateY = 0.0;
if (info.GetDoubleArg(0, scaleX) && info.GetDoubleArg(1, skewX) && info.GetDoubleArg(2, skewY) &&
info.GetDoubleArg(3, scaleY) && info.GetDoubleArg(4, translateX) && info.GetDoubleArg(5, translateY)) {
if (info.GetDoubleArg(0, scaleX, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, skewX, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, skewY, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, scaleY, isJudgeSpecialValue_) && // Index3: the 4th arg.
info.GetDoubleArg(4, translateX, isJudgeSpecialValue_) && // Index4: the 5th arg.
info.GetDoubleArg(5, translateY, isJudgeSpecialValue_)) { // Index5: the 6th arg.
double density = GetDensity();
path2d_->SetTransform(scaleX, skewX, skewY, scaleY, translateX * density, translateY * density);
SetPathSize(info);
@ -44,7 +53,8 @@ void JSCanvasPath::JsPath2DMoveTo(const JSCallbackInfo& info)
{
double x = 0.0;
double y = 0.0;
if (info.GetDoubleArg(0, x) && info.GetDoubleArg(1, y)) {
if (info.GetDoubleArg(0, x, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, y, isJudgeSpecialValue_)) { // Index1: the 2nd arg.
double density = GetDensity();
path2d_->MoveTo(x * density, y * density);
SetPathSize(info);
@ -56,7 +66,8 @@ void JSCanvasPath::JsPath2DLineTo(const JSCallbackInfo& info)
{
double x = 0.0;
double y = 0.0;
if (info.GetDoubleArg(0, x) && info.GetDoubleArg(1, y)) {
if (info.GetDoubleArg(0, x, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, y, isJudgeSpecialValue_)) { // Index1: the 2nd arg.
double density = GetDensity();
path2d_->LineTo(x * density, y * density);
SetPathSize(info);
@ -71,8 +82,11 @@ void JSCanvasPath::JsPath2DArc(const JSCallbackInfo& info)
double radius = 0.0;
double startAngle = 0.0;
double endAngle = 0.0;
if (info.GetDoubleArg(0, x) && info.GetDoubleArg(1, y) && info.GetDoubleArg(2, radius) &&
info.GetDoubleArg(3, startAngle) && info.GetDoubleArg(4, endAngle)) {
if (info.GetDoubleArg(0, x, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, y, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, radius, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, startAngle, isJudgeSpecialValue_) && // Index3: the 4th arg.
info.GetDoubleArg(4, endAngle, isJudgeSpecialValue_)) { // Index4: the 5th arg.
bool anticlockwise = false;
info.GetBooleanArg(5, anticlockwise);
double density = GetDensity();
@ -89,8 +103,11 @@ void JSCanvasPath::JsPath2DArcTo(const JSCallbackInfo& info)
double x2 = 0.0;
double y2 = 0.0;
double radius = 0.0;
if (info.GetDoubleArg(0, x1) && info.GetDoubleArg(1, y1) && info.GetDoubleArg(2, x2) && info.GetDoubleArg(3, y2) &&
info.GetDoubleArg(4, radius)) {
if (info.GetDoubleArg(0, x1, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, y1, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, x2, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, y2, isJudgeSpecialValue_) && // Index3: the 4th arg.
info.GetDoubleArg(4, radius, isJudgeSpecialValue_)) { // Index4: the 5th arg.
double density = GetDensity();
path2d_->ArcTo(x1 * density, y1 * density, x2 * density, y2 * density, radius * density);
SetPathSize(info);
@ -104,7 +121,10 @@ void JSCanvasPath::JsPath2DQuadraticCurveTo(const JSCallbackInfo& info)
double cpy = 0.0;
double x = 0.0;
double y = 0.0;
if (info.GetDoubleArg(0, cpx) && info.GetDoubleArg(1, cpy) && info.GetDoubleArg(2, x) && info.GetDoubleArg(3, y)) {
if (info.GetDoubleArg(0, cpx, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, cpy, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, x, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, y, isJudgeSpecialValue_)) { // Index3: the 4th arg.
double density = GetDensity();
path2d_->QuadraticCurveTo(cpx * density, cpy * density, x * density, y * density);
SetPathSize(info);
@ -120,8 +140,12 @@ void JSCanvasPath::JsPath2DBezierCurveTo(const JSCallbackInfo& info)
double cp2y = 0.0;
double x = 0.0;
double y = 0.0;
if (info.GetDoubleArg(0, cp1x) && info.GetDoubleArg(1, cp1y) && info.GetDoubleArg(2, cp2x) &&
info.GetDoubleArg(3, cp2y) && info.GetDoubleArg(4, x) && info.GetDoubleArg(5, y)) {
if (info.GetDoubleArg(0, cp1x, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, cp1y, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, cp2x, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, cp2y, isJudgeSpecialValue_) && // Index3: the 4th arg.
info.GetDoubleArg(4, x, isJudgeSpecialValue_) && // Index4: the 5th arg.
info.GetDoubleArg(5, y, isJudgeSpecialValue_)) { // Index5: the 6th arg.
double density = GetDensity();
path2d_->BezierCurveTo(
cp1x * density, cp1y * density, cp2x * density, cp2y * density, x * density, y * density);
@ -140,9 +164,13 @@ void JSCanvasPath::JsPath2DEllipse(const JSCallbackInfo& info)
double rotation = 0.0;
double startAngle = 0.0;
double endAngle = 0.0;
if (info.GetDoubleArg(0, x) && info.GetDoubleArg(1, y) && info.GetDoubleArg(2, radiusX) &&
info.GetDoubleArg(3, radiusY) && info.GetDoubleArg(4, rotation) && info.GetDoubleArg(5, startAngle) &&
info.GetDoubleArg(6, endAngle)) {
if (info.GetDoubleArg(0, x, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, y, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, radiusX, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, radiusY, isJudgeSpecialValue_) && // Index3: the 4th arg.
info.GetDoubleArg(4, rotation, isJudgeSpecialValue_) && // Index4: the 5th arg.
info.GetDoubleArg(5, startAngle, isJudgeSpecialValue_) && // Index5: the 6th arg.
info.GetDoubleArg(6, endAngle, isJudgeSpecialValue_)) { // Index6: the 7th arg.
bool anticlockwise = false;
info.GetBooleanArg(7, anticlockwise);
double density = GetDensity();
@ -159,8 +187,10 @@ void JSCanvasPath::JsPath2DRect(const JSCallbackInfo& info)
double y = 0.0;
double width = 0.0;
double height = 0.0;
if (info.GetDoubleArg(0, x) && info.GetDoubleArg(1, y) && info.GetDoubleArg(2, width) &&
info.GetDoubleArg(3, height)) {
if (info.GetDoubleArg(0, x, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, y, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, width, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, height, isJudgeSpecialValue_)) { // Index3: the 4th arg.
double density = GetDensity();
path2d_->Rect(x * density, y * density, width * density, height * density);
SetPathSize(info);

View File

@ -68,6 +68,7 @@ protected:
panda::CopyableGlobal<panda::JSValueRef> pathCmdObj_;
RefPtr<CanvasPath2D> path2d_;
CanvasUnit unit_ = CanvasUnit::DEFAULT;
bool isJudgeSpecialValue_ = false;
};
} // namespace OHOS::Ace::Framework

View File

@ -114,6 +114,9 @@ JSCanvasRenderer::JSCanvasRenderer()
// The default value of the font size in canvas is 14px.
paintState_ = PaintState(TextAlign::START, TextDirection::INHERIT, DEFAULT_FONT_SIZE);
}
if (Container::GreatOrEqualAPITargetVersion(PlatformVersion::VERSION_FOURTEEN)) {
isJudgeSpecialValue_ = true;
}
auto pipeline = PipelineBase::GetCurrentContextSafely();
if (pipeline) {
densityCallbackId_ = pipeline->RegisterDensityChangedCallback([self = WeakClaim(this)](double density) {
@ -994,7 +997,7 @@ void JSCanvasRenderer::JsSetLineWidth(const JSCallbackInfo& info)
void JSCanvasRenderer::JsSetGlobalAlpha(const JSCallbackInfo& info)
{
double alpha = 0.0;
if (info.GetDoubleArg(0, alpha)) {
if (info.GetDoubleArg(0, alpha, isJudgeSpecialValue_)) { // Indexd0: the 1st arg.
renderingContext2DModel_->SetGlobalAlpha(alpha);
}
}
@ -1028,7 +1031,7 @@ void JSCanvasRenderer::JsSetGlobalCompositeOperation(const JSCallbackInfo& info)
void JSCanvasRenderer::JsSetLineDashOffset(const JSCallbackInfo& info)
{
double lineDashOffset = 0.0;
if (info.GetDoubleArg(0, lineDashOffset)) {
if (info.GetDoubleArg(0, lineDashOffset, isJudgeSpecialValue_)) { // Indexd0: the 1st arg.
renderingContext2DModel_->SetLineDashOffset(lineDashOffset * GetDensity());
}
}
@ -1092,7 +1095,8 @@ void JSCanvasRenderer::JsMoveTo(const JSCallbackInfo& info)
{
double x = 0.0;
double y = 0.0;
if (info.GetDoubleArg(0, x) && info.GetDoubleArg(1, y)) {
if (info.GetDoubleArg(0, x, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, y, isJudgeSpecialValue_)) { // Index1: the 2nd arg.
double density = GetDensity();
renderingContext2DModel_->MoveTo(x * density, y * density);
}
@ -1103,7 +1107,8 @@ void JSCanvasRenderer::JsLineTo(const JSCallbackInfo& info)
{
double x = 0.0;
double y = 0.0;
if (info.GetDoubleArg(0, x) && info.GetDoubleArg(1, y)) {
if (info.GetDoubleArg(0, x, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, y, isJudgeSpecialValue_)) { // Index1: the 2nd arg.
double density = GetDensity();
renderingContext2DModel_->LineTo(x * density, y * density);
}
@ -1113,8 +1118,12 @@ void JSCanvasRenderer::JsLineTo(const JSCallbackInfo& info)
void JSCanvasRenderer::JsBezierCurveTo(const JSCallbackInfo& info)
{
BezierCurveParam param;
if (info.GetDoubleArg(0, param.cp1x) && info.GetDoubleArg(1, param.cp1y) && info.GetDoubleArg(2, param.cp2x) &&
info.GetDoubleArg(3, param.cp2y) && info.GetDoubleArg(4, param.x) && info.GetDoubleArg(5, param.y)) {
if (info.GetDoubleArg(0, param.cp1x, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, param.cp1y, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, param.cp2x, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, param.cp2y, isJudgeSpecialValue_) && // Index3: the 4th arg.
info.GetDoubleArg(4, param.x, isJudgeSpecialValue_) && // Index4: the 5th arg.
info.GetDoubleArg(5, param.y, isJudgeSpecialValue_)) { // Index5: the 6th arg.
double density = GetDensity();
param.cp1x *= density;
param.cp1y *= density;
@ -1130,8 +1139,10 @@ void JSCanvasRenderer::JsBezierCurveTo(const JSCallbackInfo& info)
void JSCanvasRenderer::JsQuadraticCurveTo(const JSCallbackInfo& info)
{
QuadraticCurveParam param;
if (info.GetDoubleArg(0, param.cpx) && info.GetDoubleArg(1, param.cpy) && info.GetDoubleArg(2, param.x) &&
info.GetDoubleArg(3, param.y)) {
if (info.GetDoubleArg(0, param.cpx, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, param.cpy, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, param.x, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, param.y, isJudgeSpecialValue_)) { // Index3: the 4th arg.
double density = GetDensity();
param.cpx *= density;
param.cpy *= density;
@ -1145,8 +1156,11 @@ void JSCanvasRenderer::JsQuadraticCurveTo(const JSCallbackInfo& info)
void JSCanvasRenderer::JsArcTo(const JSCallbackInfo& info)
{
ArcToParam param;
if (info.GetDoubleArg(0, param.x1) && info.GetDoubleArg(1, param.y1) && info.GetDoubleArg(2, param.x2) &&
info.GetDoubleArg(3, param.y2) && info.GetDoubleArg(4, param.radius)) {
if (info.GetDoubleArg(0, param.x1, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, param.y1, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, param.x2, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, param.y2, isJudgeSpecialValue_) && // Index3: the 4th arg.
info.GetDoubleArg(4, param.radius, isJudgeSpecialValue_)) { // Index4: the 5th arg.
double density = GetDensity();
param.x1 *= density;
param.y1 *= density;
@ -1161,8 +1175,11 @@ void JSCanvasRenderer::JsArcTo(const JSCallbackInfo& info)
void JSCanvasRenderer::JsArc(const JSCallbackInfo& info)
{
ArcParam param;
if (info.GetDoubleArg(0, param.x) && info.GetDoubleArg(1, param.y) && info.GetDoubleArg(2, param.radius) &&
info.GetDoubleArg(3, param.startAngle) && info.GetDoubleArg(4, param.endAngle)) {
if (info.GetDoubleArg(0, param.x, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, param.y, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, param.radius, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, param.startAngle, isJudgeSpecialValue_) && // Index3: the 4th arg.
info.GetDoubleArg(4, param.endAngle, isJudgeSpecialValue_)) { // Index4: the 5th arg.
info.GetBooleanArg(5, param.anticlockwise); // Non mandatory parameter with default value 'false'
double density = GetDensity();
param.x *= density;
@ -1177,9 +1194,13 @@ void JSCanvasRenderer::JsArc(const JSCallbackInfo& info)
void JSCanvasRenderer::JsEllipse(const JSCallbackInfo& info)
{
EllipseParam param;
if (info.GetDoubleArg(0, param.x) && info.GetDoubleArg(1, param.y) && info.GetDoubleArg(2, param.radiusX) &&
info.GetDoubleArg(3, param.radiusY) && info.GetDoubleArg(4, param.rotation) &&
info.GetDoubleArg(5, param.startAngle) && info.GetDoubleArg(6, param.endAngle)) {
if (info.GetDoubleArg(0, param.x, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, param.y, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, param.radiusX, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, param.radiusY, isJudgeSpecialValue_) && // Index3: the 4th arg.
info.GetDoubleArg(4, param.rotation, isJudgeSpecialValue_) && // Index4: the 5th arg.
info.GetDoubleArg(5, param.startAngle, isJudgeSpecialValue_) && // Index5: the 6th arg.
info.GetDoubleArg(6, param.endAngle, isJudgeSpecialValue_)) { // Index6: the 7th arg.
info.GetBooleanArg(7, param.anticlockwise); // Non mandatory parameter with default value 'false'
double density = GetDensity();
param.x *= density;
@ -1257,8 +1278,10 @@ void JSCanvasRenderer::JsRect(const JSCallbackInfo& info)
double y = 0.0;
double width = 0.0;
double height = 0.0;
if (info.GetDoubleArg(0, x) && info.GetDoubleArg(1, y) && info.GetDoubleArg(2, width) &&
info.GetDoubleArg(3, height)) {
if (info.GetDoubleArg(0, x, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, y, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, width, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, height, isJudgeSpecialValue_)) { // Index3: the 4th arg.
renderingContext2DModel_->AddRect(Rect(x, y, width, height) * GetDensity());
}
}
@ -1296,8 +1319,9 @@ void JSCanvasRenderer::JsSave(const JSCallbackInfo& info)
void JSCanvasRenderer::JsRotate(const JSCallbackInfo& info)
{
double angle = 0.0;
info.GetDoubleArg(0, angle);
renderingContext2DModel_->CanvasRendererRotate(angle);
if (info.GetDoubleArg(0, angle, isJudgeSpecialValue_)) { // Indexd0: the 1st arg.
renderingContext2DModel_->CanvasRendererRotate(angle);
}
}
// scale(x: number, y: number): void
@ -1305,7 +1329,8 @@ void JSCanvasRenderer::JsScale(const JSCallbackInfo& info)
{
double x = 0.0;
double y = 0.0;
if (info.GetDoubleArg(0, x) && info.GetDoubleArg(1, y)) {
if (info.GetDoubleArg(0, x, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, y, isJudgeSpecialValue_)) { // Index1: the 2nd arg.
renderingContext2DModel_->CanvasRendererScale(x, y);
}
}
@ -1335,9 +1360,12 @@ void JSCanvasRenderer::JsSetTransform(const JSCallbackInfo& info)
double density = GetDensity();
TransformParam param;
// setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void
if (info.GetDoubleArg(0, param.scaleX) && info.GetDoubleArg(1, param.skewY) && info.GetDoubleArg(2, param.skewX) &&
info.GetDoubleArg(3, param.scaleY) && info.GetDoubleArg(4, param.translateX) &&
info.GetDoubleArg(5, param.translateY)) {
if (info.GetDoubleArg(0, param.scaleX, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, param.skewY, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, param.skewX, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, param.scaleY, isJudgeSpecialValue_) && // Index3: the 4th arg.
info.GetDoubleArg(4, param.translateX, isJudgeSpecialValue_) && // Index4: the 5th arg.
info.GetDoubleArg(5, param.translateY, isJudgeSpecialValue_)) { // Index5: the 6th arg.
param.translateX *= density;
param.translateY *= density;
renderingContext2DModel_->SetTransform(param, true);
@ -1373,9 +1401,12 @@ void JSCanvasRenderer::JsResetTransform(const JSCallbackInfo& info)
void JSCanvasRenderer::JsTransform(const JSCallbackInfo& info)
{
TransformParam param;
if (info.GetDoubleArg(0, param.scaleX) && info.GetDoubleArg(1, param.skewX) && info.GetDoubleArg(2, param.skewY) &&
info.GetDoubleArg(3, param.scaleY) && info.GetDoubleArg(4, param.translateX) &&
info.GetDoubleArg(5, param.translateY)) {
if (info.GetDoubleArg(0, param.scaleX, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, param.skewX, isJudgeSpecialValue_) && // Index1: the 2nd arg.
info.GetDoubleArg(2, param.skewY, isJudgeSpecialValue_) && // Index2: the 3rd arg.
info.GetDoubleArg(3, param.scaleY, isJudgeSpecialValue_) && // Index3: the 4th arg.
info.GetDoubleArg(4, param.translateX, isJudgeSpecialValue_) && // Index4: the 5th arg.
info.GetDoubleArg(5, param.translateY, isJudgeSpecialValue_)) { // Index5: the 6th arg.
double density = GetDensity();
param.translateX *= density;
param.translateY *= density;
@ -1388,7 +1419,8 @@ void JSCanvasRenderer::JsTranslate(const JSCallbackInfo& info)
{
double x = 0.0;
double y = 0.0;
if (info.GetDoubleArg(0, x) && info.GetDoubleArg(1, y)) {
if (info.GetDoubleArg(0, x, isJudgeSpecialValue_) && // Indexd0: the 1st arg.
info.GetDoubleArg(1, y, isJudgeSpecialValue_)) { // Index1: the 2nd arg.
double density = GetDensity();
renderingContext2DModel_->Translate(x * density, y * density);
}

View File

@ -195,6 +195,7 @@ protected:
JSRenderImage* UnwrapNapiImage(const EcmaVM* vm, const JSRef<JSObject> jsObject);
protected:
bool isJudgeSpecialValue_ = false;
RefPtr<RenderingContext2DModel> renderingContext2DModel_;
bool anti_ = false;

View File

@ -332,7 +332,6 @@ void JSNavigation::SetTitle(const JSCallbackInfo& info)
}
} else {
NavigationModel::GetInstance()->ParseCommonTitle(false, false, "", "");
return;
}
NG::NavigationTitlebarOptions options;

View File

@ -108,8 +108,6 @@ void JSProgress::JSBind(BindingTarget globalObj)
JSClass<JSProgress>::StaticMethod("create", &JSProgress::Create, opt);
JSClass<JSProgress>::StaticMethod("value", &JSProgress::SetValue, opt);
JSClass<JSProgress>::StaticMethod("color", &JSProgress::SetColor, opt);
JSClass<JSProgress>::StaticMethod("circularStyle", &JSProgress::SetCircularStyle, opt);
JSClass<JSProgress>::StaticMethod("cricularStyle", &JSProgress::SetCircularStyle, opt);
JSClass<JSProgress>::StaticMethod("style", &JSProgress::SetCircularStyle, opt);
JSClass<JSProgress>::StaticMethod("backgroundColor", &JSProgress::JsBackgroundColor, opt);
JSClass<JSProgress>::StaticMethod("onClick", &JSInteractableView::JsOnClick);

View File

@ -326,6 +326,13 @@ void JSSearch::SetSearchButton(const JSCallbackInfo& info)
} else {
SearchModel::GetInstance()->SetSearchButtonFontColor(fontColor);
}
auto autoDisable = param->GetProperty("autoDisable");
if (autoDisable->IsUndefined() || autoDisable->IsNull() || !autoDisable->IsBoolean()) {
SearchModel::GetInstance()->SetSearchButtonAutoDisable(false);
} else {
SearchModel::GetInstance()->SetSearchButtonAutoDisable(autoDisable->ToBoolean());
}
} else {
SearchModel::GetInstance()->SetSearchButtonFontSize(theme->GetFontSize());
if (!JSSeacrhTheme::ObtainSearchButtonFontColor(fontColor)) {
@ -888,11 +895,52 @@ void JSSearch::JsBorderRadius(const JSCallbackInfo& info)
SearchModel::GetInstance()->SetBackBorderRadius();
}
void JSSearch::CreateJsSearchCommonEvent(const JSCallbackInfo &info)
{
if (info.Length() < 1 || !info[0]->IsObject()) {
return;
}
auto jsValue = info[0];
auto jsTextFunc = AceType::MakeRefPtr<JsCommonEventFunction<NG::TextFieldCommonEvent, 2>>(
JSRef<JSFunc>::Cast(jsValue));
WeakPtr<NG::FrameNode> targetNode = AceType::WeakClaim(NG::ViewStackProcessor::GetInstance()->GetMainFrameNode());
auto callback = [execCtx = info.GetExecutionContext(), func = std::move(jsTextFunc), node = targetNode](
const std::string& value, NG::TextFieldCommonEvent& event) {
JAVASCRIPT_EXECUTION_SCOPE_WITH_CHECK(execCtx);
ACE_SCORING_EVENT("onSubmit");
PipelineContext::SetCallBackNode(node);
JSRef<JSObjTemplate> objectTemplate = JSRef<JSObjTemplate>::New();
objectTemplate->SetInternalFieldCount(2);
JSRef<JSObject> object = objectTemplate->NewInstance();
object->SetProperty<std::string>("text", event.GetText());
object->SetPropertyObject(
"keepEditableState", JSRef<JSFunc>::New<FunctionCallback>(JSTextField::JsKeepEditableState));
object->Wrap<NG::TextFieldCommonEvent>(&event);
JSRef<JSVal> stringValue = JSRef<JSVal>::Make(ToJSValue(value));
JSRef<JSVal> dataObject = JSRef<JSVal>::Cast(object);
JSRef<JSVal> param[2] = {stringValue, dataObject};
func->Execute(param);
#if !defined(PREVIEW) && defined(OHOS_PLATFORM)
UiSessionManager::GetInstance().ReportComponentChangeEvent("event", "onSubmit");
#endif
};
SearchModel::GetInstance()->SetOnSubmit(std::move(callback));
}
void JSSearch::OnSubmit(const JSCallbackInfo& info)
{
CHECK_NULL_VOID(info[0]->IsFunction());
JsEventCallback<void(const std::string&)> callback(info.GetExecutionContext(), JSRef<JSFunc>::Cast(info[0]));
SearchModel::GetInstance()->SetOnSubmit(std::move(callback));
auto jsValue = info[0];
CHECK_NULL_VOID(jsValue->IsFunction());
#ifdef NG_BUILD
CreateJsSearchCommonEvent(info);
#else
if (Container::IsCurrentUseNewPipeline()) {
CreateJsSearchCommonEvent(info);
} else {
JsEventCallback<void(const std::string&)> callback(info.GetExecutionContext(), JSRef<JSFunc>::Cast(jsValue));
SearchModel::GetInstance()->SetOnSubmit(std::move(callback));
}
#endif
}
JSRef<JSVal> JSSearch::CreateJsOnChangeObj(const PreviewText& previewText)

View File

@ -95,6 +95,7 @@ public:
static void SetCancelSymbolIcon(const JSCallbackInfo& info);
static void SetCancelImageIcon(const JSCallbackInfo& info);
static void SetEnableHapticFeedback(const JSCallbackInfo& info);
static void CreateJsSearchCommonEvent(const JSCallbackInfo& info);
};
class JSSearchController final : public Referenced {

View File

@ -52,6 +52,10 @@ void JSTextArea::JSBind(BindingTarget globalObj)
JSClass<JSTextArea>::StaticMethod("borderColor", &JSTextField::JsBorderColor);
JSClass<JSTextArea>::StaticMethod("borderStyle", &JSTextField::JsBorderStyle);
JSClass<JSTextArea>::StaticMethod("borderRadius", &JSTextField::JsBorderRadius);
JSClass<JSTextArea>::StaticMethod("outline", &JSTextField::JsOutline);
JSClass<JSTextArea>::StaticMethod("outlineWidth", &JSTextField::JsOutlineWidth);
JSClass<JSTextArea>::StaticMethod("outlineColor", &JSTextField::JsOutlineColor);
JSClass<JSTextArea>::StaticMethod("outlineRadius", &JSTextField::JsOutlineRadius);
JSClass<JSTextArea>::StaticMethod("fontSize", &JSTextField::SetFontSize);
JSClass<JSTextArea>::StaticMethod("fontColor", &JSTextField::SetTextColor);
JSClass<JSTextArea>::StaticMethod("fontWeight", &JSTextField::SetFontWeight);

View File

@ -989,6 +989,30 @@ void JSTextField::JsBorderRadius(const JSCallbackInfo& info)
TextFieldModel::GetInstance()->SetBackBorder();
}
void JSTextField::JsOutline(const JSCallbackInfo& info)
{
JSViewAbstract::JsOutline(info);
TextFieldModel::GetInstance()->SetBackOuterBorder();
}
void JSTextField::JsOutlineWidth(const JSCallbackInfo& info)
{
JSViewAbstract::JsOutlineWidth(info);
TextFieldModel::GetInstance()->SetBackOuterBorderWidth();
}
void JSTextField::JsOutlineColor(const JSCallbackInfo& info)
{
JSViewAbstract::JsOutlineColor(info);
TextFieldModel::GetInstance()->SetBackOuterBorderColor();
}
void JSTextField::JsOutlineRadius(const JSCallbackInfo& info)
{
JSViewAbstract::JsOutlineRadius(info);
TextFieldModel::GetInstance()->SetBackOuterBorderRadius();
}
void JSTextField::JsHoverEffect(const JSCallbackInfo& info)
{
auto jsValue = info[0];

View File

@ -73,6 +73,10 @@ public:
CalcDimension& topRight, CalcDimension& bottomLeft, CalcDimension& bottomRight);
static void ParseBorderRadius(const JSRef<JSVal>& args);
static void JsBorderRadius(const JSCallbackInfo& info);
static void JsOutline(const JSCallbackInfo& info);
static void JsOutlineWidth(const JSCallbackInfo& info);
static void JsOutlineColor(const JSCallbackInfo& info);
static void JsOutlineRadius(const JSCallbackInfo& info);
static void JsHoverEffect(const JSCallbackInfo& info);
static void SetOnEditChanged(const JSCallbackInfo& info);
static void SetOnSubmit(const JSCallbackInfo& info);

View File

@ -62,6 +62,10 @@ void JSTextInput::JSBind(BindingTarget globalObj)
JSClass<JSTextInput>::StaticMethod("borderColor", &JSTextField::JsBorderColor);
JSClass<JSTextInput>::StaticMethod("borderStyle", &JSTextField::JsBorderStyle);
JSClass<JSTextInput>::StaticMethod("borderRadius", &JSTextField::JsBorderRadius);
JSClass<JSTextInput>::StaticMethod("outline", &JSTextField::JsOutline);
JSClass<JSTextInput>::StaticMethod("outlineWidth", &JSTextField::JsOutlineWidth);
JSClass<JSTextInput>::StaticMethod("outlineColor", &JSTextField::JsOutlineColor);
JSClass<JSTextInput>::StaticMethod("outlineRadius", &JSTextField::JsOutlineRadius);
JSClass<JSTextInput>::StaticMethod("fontSize", &JSTextField::SetFontSize);
JSClass<JSTextInput>::StaticMethod("fontColor", &JSTextField::SetTextColor);
JSClass<JSTextInput>::StaticMethod("fontWeight", &JSTextField::SetFontWeight);

View File

@ -296,6 +296,7 @@ void ParseTextShadowFromShadowObject(const JSRef<JSVal>& shadowObject, std::vect
#ifdef PIXEL_MAP_SUPPORTED
JSRef<JSVal> ConvertPixmap(const RefPtr<PixelMap>& pixelMap)
{
ContainerScope scope(Container::CurrentIdSafely());
auto engine = EngineHelper::GetCurrentEngine();
CHECK_NULL_RETURN(engine, {});
NativeEngine* nativeEngine = engine->GetNativeEngine();

View File

@ -485,30 +485,22 @@ bool ParseLocalizedEdges(const JSRef<JSObject>& LocalizeEdgesObj, EdgesParam& ed
CalcDimension bottom;
JSRef<JSVal> startVal = LocalizeEdgesObj->GetProperty(static_cast<int32_t>(ArkUIIndex::START));
if (startVal->IsObject()) {
JSRef<JSObject> startObj = JSRef<JSObject>::Cast(startVal);
ParseJsLengthMetrics(startObj, start);
if (startVal->IsObject() && ParseJsLengthMetrics(JSRef<JSObject>::Cast(startVal), start)) {
edges.start = start;
useLocalizedEdges = true;
}
JSRef<JSVal> endVal = LocalizeEdgesObj->GetProperty(static_cast<int32_t>(ArkUIIndex::END));
if (endVal->IsObject()) {
JSRef<JSObject> endObj = JSRef<JSObject>::Cast(endVal);
ParseJsLengthMetrics(endObj, end);
if (endVal->IsObject() && ParseJsLengthMetrics(JSRef<JSObject>::Cast(endVal), end)) {
edges.end = end;
useLocalizedEdges = true;
}
JSRef<JSVal> topVal = LocalizeEdgesObj->GetProperty(static_cast<int32_t>(ArkUIIndex::TOP));
if (topVal->IsObject()) {
JSRef<JSObject> topObj = JSRef<JSObject>::Cast(topVal);
ParseJsLengthMetrics(topObj, top);
if (topVal->IsObject() && ParseJsLengthMetrics(JSRef<JSObject>::Cast(topVal), top)) {
edges.SetTop(top);
useLocalizedEdges = true;
}
JSRef<JSVal> bottomVal = LocalizeEdgesObj->GetProperty(static_cast<int32_t>(ArkUIIndex::BOTTOM));
if (bottomVal->IsObject()) {
JSRef<JSObject> bottomObj = JSRef<JSObject>::Cast(bottomVal);
ParseJsLengthMetrics(bottomObj, bottom);
if (bottomVal->IsObject() && ParseJsLengthMetrics(JSRef<JSObject>::Cast(bottomVal), bottom)) {
edges.SetBottom(bottom);
useLocalizedEdges = true;
}

View File

@ -48,6 +48,7 @@ public:
void SetCancelIconColor(const Color& color) override {}
void SetSearchButtonFontSize(const Dimension& value) override {}
void SetSearchButtonFontColor(const Color& color) override {}
void SetSearchButtonAutoDisable(bool needToDisable) override {};
void SetPlaceholderColor(const Color& color) override;
void SetPlaceholderFont(const Font& font) override;
void SetTextFont(const Font& font) override;
@ -59,6 +60,7 @@ public:
void SetHeight(const Dimension& value) override;
void SetBackBorder() override;
void SetOnSubmit(std::function<void(const std::string&)>&& onSubmit) override;
void SetOnSubmit(std::function<void(const std::string&, NG::TextFieldCommonEvent&)>&& onSubmit) override {};
void SetOnChange(std::function<void(const std::string&, PreviewText&)>&& onChange) override;
void SetOnTextSelectionChange(std::function<void(int32_t, int32_t)>&& func) override {};
void SetOnScroll(std::function<void(float, float)>&& func) override {};

View File

@ -275,10 +275,9 @@ void PageRouterManager::PushNamedRouteInner(const RouterPageInfo& target)
}
CleanPageOverlay();
if (target.routerMode == RouterMode::SINGLE) {
auto PageInfoByUrl = FindPageInStack(target.url);
auto pagePath = Framework::JsiDeclarativeEngine::GetPagePath(target.url);
auto PageInfoByUrl = FindPageInStackByRouteName(target.url);
if (PageInfoByUrl.second) {
// get pageInfo by url, find page in stack, move postion and update params.
// find page in stack, move postion and update params.
MovePageToFront(PageInfoByUrl.first, PageInfoByUrl.second, target, true);
return;
}
@ -288,12 +287,6 @@ void PageRouterManager::PushNamedRouteInner(const RouterPageInfo& target)
RestorePageWithTarget(index, false, target, RestorePageDestination::TOP);
return;
}
auto PageInfoByPagePath = FindPageInStack(pagePath);
if (PageInfoByPagePath.second) {
// get pageInfo by pagePath, find page in stack, move postion and update params.
MovePageToFront(PageInfoByPagePath.first, PageInfoByPagePath.second, target, true);
return;
}
}
RouterPageInfo info = target;
info.isNamedRouterMode = true;
@ -1087,6 +1080,26 @@ std::pair<int32_t, RefPtr<FrameNode>> PageRouterManager::FindPageInStack(const s
return { std::distance(iter, pageRouterStack_.rend()) - 1, iter->Upgrade() };
}
std::pair<int32_t, RefPtr<FrameNode>> PageRouterManager::FindPageInStackByRouteName(
const std::string& name, bool needIgnoreBegin)
{
auto iter = std::find_if(needIgnoreBegin ? ++pageRouterStack_.rbegin() : pageRouterStack_.rbegin(),
pageRouterStack_.rend(), [name](const WeakPtr<FrameNode>& item) {
auto pageNode = item.Upgrade();
CHECK_NULL_RETURN(pageNode, false);
auto pagePattern = pageNode->GetPattern<PagePattern>();
CHECK_NULL_RETURN(pagePattern, false);
auto entryPageInfo = DynamicCast<EntryPageInfo>(pagePattern->GetPageInfo());
CHECK_NULL_RETURN(entryPageInfo, false);
return entryPageInfo->GetRouteName() == name;
});
if (iter == pageRouterStack_.rend()) {
return { INVALID_PAGE_INDEX, nullptr };
}
// Returns to the forward position.
return { std::distance(iter, pageRouterStack_.rend()) - 1, iter->Upgrade() };
}
int32_t PageRouterManager::FindPageInRestoreStack(const std::string& url)
{
auto iter = std::find_if(restorePageStack_.rbegin(), restorePageStack_.rend(),
@ -1465,6 +1478,7 @@ RefPtr<FrameNode> PageRouterManager::CreatePage(int32_t pageId, const RouterPage
keyInfo = moduleName + keyInfo;
}
#endif
SetPageInfoRouteName(entryPageInfo);
auto pagePath = Framework::JsiDeclarativeEngine::GetFullPathInfo(keyInfo);
if (pagePath.empty()) {
auto container = Container::Current();
@ -2247,4 +2261,20 @@ void PageRouterManager::LoadOhmUrlPage(const std::string& url, std::function<voi
};
pageUrlChecker->LoadPageUrl(url, callback, silentInstallErrorCallBack);
}
void PageRouterManager::SetPageInfoRouteName(const RefPtr<EntryPageInfo>& info)
{
std::optional<std::string> routeName = std::nullopt;
if (info->IsCreateByNamedRouter()) {
// info->GetPageUrl() represents the name of namedRoute
routeName = info->GetPageUrl();
} else {
auto container = Container::Current();
CHECK_NULL_VOID(container);
// info->GetPageUrl() represents the url of destination page
routeName = Framework::JsiDeclarativeEngine::GetRouteNameByUrl(
info->GetPageUrl(), container->GetBundleName(), container->GetModuleName());
}
info->SetRouteName(routeName);
}
} // namespace OHOS::Ace::NG

View File

@ -230,8 +230,12 @@ protected:
}
std::pair<int32_t, RefPtr<FrameNode>> FindPageInStack(const std::string& url, bool needIgnoreBegin = false);
std::pair<int32_t, RefPtr<FrameNode>> FindPageInStackByRouteName(
const std::string& name, bool needIgnoreBegin = false);
int32_t FindPageInRestoreStack(const std::string& url);
void SetPageInfoRouteName(const RefPtr<EntryPageInfo>& info);
void LoadOhmUrl(const RouterPageInfo& target);
void PushOhmUrl(const RouterPageInfo& target);
void ReplaceOhmUrl(const RouterPageInfo& target);

View File

@ -249,7 +249,9 @@ class __RepeatVirtualScrollImpl<T> {
private reRender(): void {
stateMgmtConsole.debug(`__RepeatVirtualScrollImpl(${this.repeatElmtId_}): reRender ...`);
if (this.hasVisibleItemsChanged()) {
// When this.totalCount_ == 0 need render to clear visible items
if (this.hasVisibleItemsChanged() || this.totalCount_ == 0) {
this.purgeKeyCache();
RepeatVirtualScrollNative.updateRenderState(this.totalCount_, true);
stateMgmtConsole.debug(`__RepeatVirtualScrollImpl: reRender - done.`);

View File

@ -506,7 +506,7 @@ abstract class ViewPU extends PUV2ViewBase
}
private performDelayedUpdate(): void {
if (!this.ownObservedPropertiesStore_.size) {
if (!this.ownObservedPropertiesStore_.size && !this.elmtIdsDelayedUpdate.size) {
return;
}
stateMgmtProfiler.begin('ViewPU.performDelayedUpdate');
@ -533,6 +533,12 @@ abstract class ViewPU extends PUV2ViewBase
}
}
} // for all ownStateLinkProps_
for (let elementId of this.elmtIdsDelayedUpdate) {
this.dirtDescendantElementIds_.add(elementId);
}
this.elmtIdsDelayedUpdate.clear();
this.restoreInstanceId();
if (this.dirtDescendantElementIds_.size) {

View File

@ -75,6 +75,9 @@ abstract class PUV2ViewBase extends NativeViewPartialUpdate {
protected extraInfo_: ExtraInfo = undefined;
// Set of elements for delayed update
private elmtIdsDelayedUpdate_: Set<number> = new Set();
protected static arkThemeScopeManager: ArkThemeScopeManager | undefined = undefined
constructor(parent: IView, elmtId: number = UINodeRegisterProxy.notRecordingDependencies, extraInfo: ExtraInfo = undefined) {
@ -112,6 +115,17 @@ abstract class PUV2ViewBase extends NativeViewPartialUpdate {
this.id_ = elmtId;
}
/* Adds the elmtId to elmtIdsDelayedUpdate for delayed update
once the view gets active
*/
public scheduleDelayedUpdate(elmtId: number) : void {
this.elmtIdsDelayedUpdate.add(elmtId);
}
public get elmtIdsDelayedUpdate(): Set<number> {
return this.elmtIdsDelayedUpdate_;
}
public setParent(parent: IView): void {
if (this.parent_ && parent) {
stateMgmtConsole.warn(`${this.debugInfo__()}: setChild: changing parent to '${parent?.debugInfo__()} (unsafe operation)`);

View File

@ -645,7 +645,7 @@ class ObserveV2 {
((view instanceof ViewV2) || (view instanceof ViewPU))) {
if (view.isViewActive()) {
view.uiNodeNeedUpdateV2(elmtId);
} else if (view instanceof ViewV2) {
} else {
// schedule delayed update once the view gets active
view.scheduleDelayedUpdate(elmtId);
}

View File

@ -28,18 +28,37 @@ abstract class ViewV2 extends PUV2ViewBase implements IView {
// Set of elmtIds that need re-render
protected dirtDescendantElementIds_: Set<number> = new Set<number>();
// Set of elements for delayed update
private elmtIdsDelayedUpdate: Set<number> = new Set();
private monitorIdsDelayedUpdate: Set<number> = new Set();
private computedIdsDelayedUpdate: Set<number> = new Set();
constructor(parent: IView, elmtId: number = UINodeRegisterProxy.notRecordingDependencies, extraInfo: ExtraInfo = undefined) {
super(parent, elmtId, extraInfo);
this.setIsV2(true);
PUV2ViewBase.arkThemeScopeManager?.onViewPUCreate(this);
stateMgmtConsole.debug(`ViewV2 constructor: Creating @Component '${this.constructor.name}' from parent '${parent?.constructor.name}'`);
}
onGlobalThemeChanged(): void {
this.onWillApplyThemeInternally();
this.forceCompleteRerender(false);
this.childrenWeakrefMap_.forEach((weakRefChild) => {
const child = weakRefChild.deref();
if (child) {
child.onGlobalThemeChanged();
}
});
}
private onWillApplyThemeInternally(): void {
const theme = PUV2ViewBase.arkThemeScopeManager?.getFinalTheme(this.id__());
if (theme) {
this.onWillApplyTheme(theme);
}
}
onWillApplyTheme(theme: Theme): void {}
/**
* The `freezeState` parameter determines whether this @ComponentV2 is allowed to freeze, when inactive
* Its called with value of the `freezeWhenInactive` parameter from the @ComponentV2 decorator,
@ -139,10 +158,12 @@ abstract class ViewV2 extends PUV2ViewBase implements IView {
if (this.parent_) {
this.parent_.removeChild(this);
}
PUV2ViewBase.arkThemeScopeManager?.onViewPUDelete(this);
}
public initialRenderView(): void {
stateMgmtProfiler.begin(`ViewV2: initialRenderView`);
this.onWillApplyThemeInternally();
this.initialRender();
stateMgmtProfiler.end();
}
@ -157,7 +178,7 @@ abstract class ViewV2 extends PUV2ViewBase implements IView {
const updateFunc = (elmtId: number, isFirstRender: boolean): void => {
this.syncInstanceId();
stateMgmtConsole.debug(`@ComponentV2 ${this.debugInfo__()}: ${isFirstRender ? `First render` : `Re-render/update`} ${_componentName}[${elmtId}] - start ....`);
PUV2ViewBase.arkThemeScopeManager?.onComponentCreateEnter(_componentName, elmtId, isFirstRender, this);
ViewStackProcessor.StartGetAccessRecordingFor(elmtId);
ObserveV2.getObserve().startRecordDependencies(this, elmtId);
@ -173,7 +194,7 @@ abstract class ViewV2 extends PUV2ViewBase implements IView {
ObserveV2.getObserve().stopRecordDependencies();
ViewStackProcessor.StopGetAccessRecording();
PUV2ViewBase.arkThemeScopeManager?.onComponentCreateExit(elmtId);
stateMgmtConsole.debug(`${this.debugInfo__()}: ${isFirstRender ? `First render` : `Re-render/update`} ${_componentName}[${elmtId}] - DONE ....`);
this.restoreInstanceId();
};
@ -362,13 +383,6 @@ abstract class ViewV2 extends PUV2ViewBase implements IView {
return retVal;
}
/* Adds the elmtId to elmtIdsDelayedUpdate for delayed update
once the view gets active
*/
public scheduleDelayedUpdate(elmtId: number) : void {
this.elmtIdsDelayedUpdate.add(elmtId);
}
// WatchIds that needs to be fired later gets added to monitorIdsDelayedUpdate
// monitor fireChange will be triggered for all these watchIds once this view gets active
public addDelayedMonitorIds(watchId: number): void {

View File

@ -553,7 +553,8 @@ void Animator::Cancel()
UpdateScaledTime();
NotifyPrepareListener();
float normalizedTime = GetNormalizedTime(0.0f, true);
for (auto& interpolator : interpolators_) {
auto interpolators = interpolators_;
for (auto& interpolator : interpolators) {
interpolator->OnInitNotify(normalizedTime, isReverse_);
}
if (motion_) {
@ -591,7 +592,8 @@ void Animator::OnFrame(int64_t duration)
// skip delay time
if (elapsedTime_ < scaledStartDelay_) {
if ((fillMode_ == FillMode::BACKWARDS || fillMode_ == FillMode::BOTH) && !isBothBackwards) {
for (const auto& interpolator : interpolators_) {
auto interpolators = interpolators_;
for (const auto& interpolator : interpolators) {
interpolator->OnNormalizedTimestampChanged(isCurDirection_ ? 1.0f : 0.0f, isReverse_);
}
isBothBackwards = true;

View File

@ -41,7 +41,8 @@ enum class PlatformVersion {
VERSION_TWELVE,
VERSION_THIRTEEN,
VERSION_FOURTEEN,
VERSION_FIFTEEN
VERSION_FIFTEEN,
VERSION_SIXTEEN
};
struct AceBundleInfo {
uint32_t versionCode = 0;

View File

@ -30,8 +30,8 @@ struct ConfigurationChange {
bool IsNeedUpdate() const
{
return colorModeUpdate || languageUpdate || directionUpdate || dpiUpdate || fontUpdate || iconUpdate ||
skinUpdate || fontScaleUpdate || fontWeightScaleUpdate;
return colorModeUpdate || languageUpdate || directionUpdate || dpiUpdate || fontUpdate || skinUpdate ||
fontScaleUpdate || fontWeightScaleUpdate;
}
void MergeConfig(const ConfigurationChange& config)

View File

@ -28,7 +28,7 @@ class TaskRunnerAdapter : public virtual AceType {
public:
TaskRunnerAdapter() = default;
virtual ~TaskRunnerAdapter() override = default;
~TaskRunnerAdapter() override = default;
virtual void PostTask(
std::function<void()> task, const std::string& name, PriorityType priorityType = PriorityType::LOW)

View File

@ -16,6 +16,13 @@
#include "core/common/task_runner_adapter_impl.h"
namespace OHOS::Ace {
TaskRunnerAdapterImpl::~TaskRunnerAdapterImpl()
{
if (eventHandler_) {
eventHandler_->RemoveAllEvents();
}
}
void TaskRunnerAdapterImpl::Initialize(bool useCurrentEventRunner, const std::string& name)
{
if (useCurrentEventRunner) {

View File

@ -27,7 +27,7 @@ class TaskRunnerAdapterImpl final : public TaskRunnerAdapter {
public:
TaskRunnerAdapterImpl():TaskRunnerAdapter() {};
~TaskRunnerAdapterImpl() = default;
~TaskRunnerAdapterImpl() override;
void PostTask(std::function<void()> task, const std::string& name, PriorityType priorityType = PriorityType::LOW) override;
void PostTaskForTime(std::function<void()> task, uint32_t targetTime, const std::string& caller) override;
void PostDelayedTask(

View File

@ -75,6 +75,8 @@ public:
return nullptr;
}
virtual void FlushLayoutSize(int32_t width, int32_t height) {}
virtual bool FlushAnimation(uint64_t timeStamp)
{
return false;

View File

@ -524,6 +524,7 @@ void DragEventActuator::OnCollectTouchTarget(const OffsetF& coordinateOffset, co
if (manager->IsGatherWithMenu() || !actuator->GetGatherNode()) {
return;
}
TAG_LOGI(AceLogTag::ACE_DRAG, "Pan reject, try remove gather node");
actuator->SetGatherNode(nullptr);
actuator->ClearGatherNodeChildrenInfo();
auto dragDropManager = pipelineContext->GetDragDropManager();
@ -1917,10 +1918,12 @@ RefPtr<FrameNode> DragEventActuator::CreateGatherNode(const RefPtr<DragEventActu
CHECK_NULL_RETURN(manager, nullptr);
if (manager->GetHasGatherNode()) {
TAG_LOGI(AceLogTag::ACE_DRAG, "Not need create gather node, already have");
return nullptr;
}
if (!actuator->IsNeedGather()) {
TAG_LOGI(AceLogTag::ACE_DRAG, "Not need create gather node, not need gather");
return nullptr;
}
auto fatherNode = actuator->itemParentNode_.Upgrade();
@ -1950,6 +1953,8 @@ RefPtr<FrameNode> DragEventActuator::CreateGatherNode(const RefPtr<DragEventActu
actuator->PushBackGatherNodeChild(gatherNodeChildInfo);
}
actuator->SetGatherNode(stackNode);
TAG_LOGI(AceLogTag::ACE_DRAG, "Create gather node success, count %{public}d",
static_cast<int32_t>(children.size()));
return stackNode;
}
@ -2046,7 +2051,7 @@ void DragEventActuator::MountGatherNode(const RefPtr<OverlayManager>& overlayMan
if (!overlayManager || !frameNode || !gatherNode) {
return;
}
TAG_LOGI(AceLogTag::ACE_DRAG, "Mount gather node");
auto container = Container::Current();
if (container && container->IsScenceBoardWindow()) {
auto windowScene = overlayManager->FindWindowScene(frameNode);

View File

@ -161,6 +161,8 @@ void LongPressRecognizer::HandleTouchDownEvent(const TouchEvent& event)
} else {
DeadlineTimer(curDuration, false);
}
} else {
PrintCurrentFingersInfo();
}
ThumbnailTimer(thumbnailDeadline);
@ -255,12 +257,14 @@ void LongPressRecognizer::HandleOverdueDeadline(bool isCatchMode)
auto dragEventActuator = GetDragEventActuator();
CHECK_NULL_VOID(dragEventActuator);
if (dragEventActuator->IsDragUserReject()) {
TAG_LOGI(AceLogTag::ACE_GESTURE, "Drag long press reject because of user's reject");
Adjudicate(AceType::Claim(this), GestureDisposal::REJECT);
return;
}
}
auto onGestureJudgeBeginResult = TriggerGestureJudgeCallback();
if (onGestureJudgeBeginResult == GestureJudgeResult::REJECT) {
TAG_LOGI(AceLogTag::ACE_GESTURE, "Long press reject as judge result is reject");
Adjudicate(AceType::Claim(this), GestureDisposal::REJECT);
if (gestureInfo_ && gestureInfo_->GetType() == GestureTypeName::DRAG) {
auto dragEventActuator = GetDragEventActuator();
@ -440,6 +444,23 @@ RefPtr<GestureSnapshot> LongPressRecognizer::Dump() const
return info;
}
void LongPressRecognizer::PrintCurrentFingersInfo()
{
std::string log = "Fingers number = ";
log += std::to_string(GetValidFingersCount());
log += " fingers_ = ";
log += std::to_string(fingers_);
log += ". ";
for (const auto& iter : touchPoints_) {
log += "Event id = ";
log += std::to_string(iter.first);
log += ", event type = ";
log += std::to_string(static_cast<int32_t>(iter.second.type));
log += "; ";
}
TAG_LOGI(AceLogTag::ACE_GESTURE, "Finger info : %{public}s", log.c_str());
}
GestureJudgeResult LongPressRecognizer::TriggerGestureJudgeCallback()
{
auto targetComponent = GetTargetComponent();

View File

@ -118,6 +118,8 @@ public:
virtual RefPtr<GestureSnapshot> Dump() const override;
void PrintCurrentFingersInfo();
private:
void HandleTouchDownEvent(const TouchEvent& event) override;
void HandleTouchUpEvent(const TouchEvent& event) override;

View File

@ -289,9 +289,9 @@ void PanRecognizer::HandleTouchUpEvent(const TouchEvent& event)
return;
}
if (static_cast<int32_t>(touchPoints_.size()) == fingers_) {
if (currentFingers_ == fingers_) {
UpdateTouchPointInVelocityTracker(event);
} else if (static_cast<int32_t>(touchPoints_.size()) > fingers_) {
} else if (currentFingers_ > fingers_) {
panVelocity_.Reset(event.id);
UpdateTouchPointInVelocityTracker(event);
}

View File

@ -139,6 +139,7 @@ void DragAnimationHelper::PlayGatherNodeOpacityAnimation(const RefPtr<OverlayMan
void DragAnimationHelper::PlayGatherAnimationBeforeLifting(const RefPtr<DragEventActuator>& actuator)
{
TAG_LOGI(AceLogTag::ACE_DRAG, "Play gather animation before lifting");
CHECK_NULL_VOID(actuator);
if (!actuator->IsNeedGather()) {
return;
@ -218,6 +219,7 @@ void DragAnimationHelper::PlayNodeResetAnimation(const RefPtr<DragEventActuator>
void DragAnimationHelper::PlayGatherAnimation(const RefPtr<FrameNode>& frameNode,
const RefPtr<OverlayManager>& overlayManager)
{
TAG_LOGI(AceLogTag::ACE_DRAG, "Play gather animation");
CHECK_NULL_VOID(frameNode);
auto gatherNodeCenter = frameNode->GetPaintRectCenter();
CHECK_NULL_VOID(overlayManager);
@ -319,6 +321,8 @@ void DragAnimationHelper::CalcBadgeTextPosition(const RefPtr<MenuPattern>& menuP
auto badgeNumber = frameNode->GetDragPreviewOption().GetCustomerBadgeNumber();
auto childSize = badgeNumber.has_value() ? static_cast<size_t>(badgeNumber.value()) :
manager->GetGatherNodeChildrenInfo().size() + 1;
TAG_LOGI(AceLogTag::ACE_DRAG, "Badge node number %{public}d, children count %{public}d",
badgeNumber.value_or(-1), static_cast<int32_t>(manager->GetGatherNodeChildrenInfo().size()));
auto badgeLength = std::to_string(childSize).size();
UpdateBadgeLayoutAndRenderContext(textNode, badgeLength, childSize);
auto textRenderContext = textNode->GetRenderContext();
@ -377,6 +381,7 @@ void DragAnimationHelper::UpdateGatherNodeToTop()
void DragAnimationHelper::ShowGatherAnimationWithMenu(const RefPtr<FrameNode>& menuWrapperNode)
{
TAG_LOGI(AceLogTag::ACE_DRAG, "Show gather animation with menu");
auto mainPipeline = PipelineContext::GetMainPipelineContext();
CHECK_NULL_VOID(mainPipeline);
auto manager = mainPipeline->GetOverlayManager();

View File

@ -277,9 +277,12 @@ void SelectContentOverlayManager::UpdateExistOverlay(const SelectOverlayInfo& in
handlePattern->UpdateIsSingleHandle(info.isSingleHandle);
handlePattern->UpdateIsShowHandleLine(info.isHandleLineShow);
handlePattern->UpdateFirstAndSecondHandleInfo(info.firstHandle, info.secondHandle);
CHECK_NULL_VOID(selectOverlayHolder_);
auto callerNode = selectOverlayHolder_->GetOwner();
CHECK_NULL_VOID(callerNode);
TAG_LOGI(AceLogTag::ACE_SELECT_OVERLAY,
"Update first %{public}s isShow %{public}d, second %{public}s isShow %{public}d",
info.firstHandle.paintRect.ToString().c_str(), info.firstHandle.isShow,
"Update id:%{public}d, first %{public}s isShow %{public}d, second %{public}s isShow %{public}d",
callerNode->GetId(), info.firstHandle.paintRect.ToString().c_str(), info.firstHandle.isShow,
info.secondHandle.paintRect.ToString().c_str(), info.secondHandle.isShow);
if (info.isSingleHandle) {
if (selectOverlayHolder_->CheckRestartHiddenHandleTask(requestCode)) {
@ -446,9 +449,12 @@ void SelectContentOverlayManager::CreateNormalSelectOverlay(SelectOverlayInfo& i
void SelectContentOverlayManager::CreateHandleLevelSelectOverlay(
SelectOverlayInfo& info, bool animation, HandleLevelMode mode)
{
CHECK_NULL_VOID(selectOverlayHolder_);
auto callerNode = selectOverlayHolder_->GetOwner();
CHECK_NULL_VOID(callerNode);
TAG_LOGI(AceLogTag::ACE_SELECT_OVERLAY,
"Show SelectOverlay, first %{public}s isShow %{public}d, second %{public}s isShow %{public}d",
info.firstHandle.paintRect.ToString().c_str(), info.firstHandle.isShow,
"Show SelectOverlay by Id:%{public}d, first %{public}s isShow %{public}d, second %{public}s isShow %{public}d",
callerNode->GetId(), info.firstHandle.paintRect.ToString().c_str(), info.firstHandle.isShow,
info.secondHandle.paintRect.ToString().c_str(), info.secondHandle.isShow);
shareOverlayInfo_ = std::make_shared<SelectOverlayInfo>(info);
auto menuNode = SelectOverlayNode::CreateSelectOverlayNode(shareOverlayInfo_, SelectOverlayMode::MENU_ONLY);
@ -514,13 +520,6 @@ void SelectContentOverlayManager::MountNodeToRoot(const RefPtr<FrameNode>& overl
node->ShowSelectOverlay(animation);
}
}
auto context = PipelineContext::GetCurrentContext();
CHECK_NULL_VOID(context);
context->AddAfterLayoutTask([weakNode = WeakPtr<FrameNode>(rootNode)]() {
auto hostNode = weakNode.Upgrade();
CHECK_NULL_VOID(hostNode);
hostNode->OnAccessibilityEvent(AccessibilityEventType::PAGE_CHANGE);
});
}
std::list<RefPtr<UINode>>::const_iterator SelectContentOverlayManager::FindSelectOverlaySlot(
@ -623,8 +622,7 @@ bool SelectContentOverlayManager::CloseInternal(int32_t id, bool animation, Clos
CHECK_NULL_RETURN(selectOverlayHolder_, false);
CHECK_NULL_RETURN(selectOverlayHolder_->GetOwnerId() == id, false);
CHECK_NULL_RETURN(shareOverlayInfo_, false);
TAG_LOGI(AceLogTag::ACE_SELECT_OVERLAY, "Close selectoverlay, id:%{public}d, reason %{public}d",
id, reason);
TAG_LOGI(AceLogTag::ACE_SELECT_OVERLAY, "Close SelectOverlay, by id:%{public}d, reason %{public}d", id, reason);
auto callback = selectOverlayHolder_->GetCallback();
auto menuType = shareOverlayInfo_->menuInfo.menuType;
auto pattern = GetSelectHandlePattern(WeakClaim(this));
@ -686,21 +684,6 @@ void SelectContentOverlayManager::DestroySelectOverlayNode(const RefPtr<FrameNod
parentNode->RemoveChild(overlay);
parentNode->MarkNeedSyncRenderTree();
parentNode->RebuildRenderContextTree();
auto rootNode = GetSelectOverlayRoot();
if (rootNode != DynamicCast<FrameNode>(parentNode)) {
return;
}
auto context = PipelineContext::GetCurrentContext();
CHECK_NULL_VOID(context);
context->AddAfterRenderTask([weakNode = WeakPtr<UINode>(parentNode)]() {
auto hostNode = weakNode.Upgrade();
CHECK_NULL_VOID(hostNode);
if (AceType::InstanceOf<FrameNode>(hostNode)) {
auto frameNode = AceType::DynamicCast<FrameNode>(hostNode);
CHECK_NULL_VOID(frameNode);
frameNode->OnAccessibilityEvent(AccessibilityEventType::PAGE_CHANGE);
}
});
}
void SelectContentOverlayManager::ClearAllStatus()

View File

@ -91,13 +91,6 @@ RefPtr<SelectOverlayProxy> SelectOverlayManager::CreateAndShowSelectOverlay(
CHECK_NULL_VOID(node);
node->ShowSelectOverlay(animation);
}
auto context = PipelineContext::GetCurrentContext();
CHECK_NULL_VOID(context);
context->AddAfterLayoutTask([weakNode = WeakPtr<FrameNode>(rootNode)]() {
auto hostNode = weakNode.Upgrade();
CHECK_NULL_VOID(hostNode);
hostNode->OnAccessibilityEvent(AccessibilityEventType::PAGE_OPEN);
});
},
TaskExecutor::TaskType::UI, "ArkUISelectOverlayShow");
@ -195,17 +188,6 @@ void SelectOverlayManager::Destroy(const RefPtr<FrameNode>& overlay)
rootNode->RemoveChild(overlay);
rootNode->MarkNeedSyncRenderTree();
rootNode->RebuildRenderContextTree();
auto context = PipelineContext::GetCurrentContext();
CHECK_NULL_VOID(context);
context->AddAfterRenderTask([weakNode = WeakPtr<UINode>(rootNode)]() {
auto hostNode = weakNode.Upgrade();
CHECK_NULL_VOID(hostNode);
if (AceType::InstanceOf<FrameNode>(hostNode)) {
auto frameNode = AceType::DynamicCast<FrameNode>(hostNode);
CHECK_NULL_VOID(frameNode);
frameNode->OnAccessibilityEvent(AccessibilityEventType::PAGE_CLOSE);
}
});
}
bool SelectOverlayManager::HasSelectOverlay(int32_t overlayId)

View File

@ -17,6 +17,7 @@
#include "core/components/badge/badge_theme.h"
#include "core/components_ng/pattern/text/text_pattern.h"
#include "core/components_v2/inspector/utils.h"
namespace OHOS::Ace::NG {
@ -51,12 +52,12 @@ void BadgePattern::OnModifyDone()
const int32_t maxCountNum = 99;
auto badgeMaxCount = layoutProperty->GetBadgeMaxCount().value_or(maxCountNum);
auto maxCount = badgeMaxCount;
auto content = std::to_string(badgeCount.value());
if (badgeCount.value() > maxCount) {
badgeCount.value() = maxCount;
textLayoutProperty->UpdateContent(std::to_string(badgeCount.value()) + "+");
} else {
textLayoutProperty->UpdateContent(std::to_string(badgeCount.value()));
content += "+";
}
textLayoutProperty->UpdateContent(content);
TAG_LOGD(AceLogTag::ACE_BADGE, "BadgeContent: %{public}s", content.c_str());
badgeVisible = true;
} else {
textLayoutProperty->ResetContent();
@ -70,6 +71,7 @@ void BadgePattern::OnModifyDone()
if (badgeValue.has_value()) {
textLayoutProperty->UpdateContent(badgeValue.value());
if (badgeValue.value().empty()) {
TAG_LOGI(AceLogTag::ACE_BADGE, "Badge content is empty");
textLayoutProperty->UpdateContent(" ");
}
badgeVisible = true;
@ -118,6 +120,11 @@ void BadgePattern::DumpInfo()
auto circleSize = layoutProperty->GetBadgeCircleSize();
auto badgeTextColor = layoutProperty->GetBadgeTextColor();
auto badgeFontSize = layoutProperty->GetBadgeFontSize();
auto badgePosition = layoutProperty->GetBadgePositionString(layoutProperty->GetBadgePositionValue());
auto badgeColor = layoutProperty->GetBadgeColor();
auto badgeFontWeight = layoutProperty->GetBadgeFontWeight();
auto badgeBorderColor = layoutProperty->GetBadgeBorderColor();
auto badgeBorderWidth = layoutProperty->GetBadgeBorderWidth();
if (badgeCount.has_value()) {
const int32_t maxCountNum = 99;
auto badgeMaxCount = layoutProperty->GetBadgeMaxCount().value_or(maxCountNum);
@ -131,9 +138,15 @@ void BadgePattern::DumpInfo()
DumpLog::GetInstance().AddDesc(std::string("badgeValue: ").append(badgeValue.value()));
}
}
DumpLog::GetInstance().AddDesc(std::string("badgePosition: ").append(badgePosition));
DumpLog::GetInstance().AddDesc(std::string("badgeTextColor: ").append(badgeTextColor.value().ToString()));
DumpLog::GetInstance().AddDesc(std::string("circleSize: ").append(std::to_string(circleSize->ConvertToPx())));
DumpLog::GetInstance().AddDesc(std::string("badgeFontSize: ").append(badgeFontSize.value().ToString()));
DumpLog::GetInstance().AddDesc(std::string("badgeColor: ").append(badgeColor.value().ToString()));
DumpLog::GetInstance().AddDesc(std::string("badgeFontWeight: ")
.append(V2::ConvertWrapFontWeightToStirng(badgeFontWeight.value())));
DumpLog::GetInstance().AddDesc(std::string("badgeBorderColor: ").append(badgeBorderColor.value().ToString()));
DumpLog::GetInstance().AddDesc(std::string("badgeBorderWidth: ").append(badgeBorderWidth.value().ToString()));
}
void BadgePattern::DumpInfo(std::unique_ptr<JsonValue>& json)
@ -144,6 +157,11 @@ void BadgePattern::DumpInfo(std::unique_ptr<JsonValue>& json)
auto circleSize = layoutProperty->GetBadgeCircleSize();
auto badgeTextColor = layoutProperty->GetBadgeTextColor();
auto badgeFontSize = layoutProperty->GetBadgeFontSize();
auto badgePosition = layoutProperty->GetBadgePositionString(layoutProperty->GetBadgePositionValue());
auto badgeColor = layoutProperty->GetBadgeColor();
auto badgeFontWeight = layoutProperty->GetBadgeFontWeight();
auto badgeBorderColor = layoutProperty->GetBadgeBorderColor();
auto badgeBorderWidth = layoutProperty->GetBadgeBorderWidth();
if (badgeCount.has_value()) {
const int32_t maxCountNum = 99;
auto badgeMaxCount = layoutProperty->GetBadgeMaxCount().value_or(maxCountNum);
@ -157,9 +175,14 @@ void BadgePattern::DumpInfo(std::unique_ptr<JsonValue>& json)
json->Put("badgeValue", badgeValue.value().c_str());
}
}
json->Put("badgePosition", badgePosition.c_str());
json->Put("badgeTextColor", badgeTextColor.value().ToString().c_str());
json->Put("circleSize", std::to_string(circleSize->ConvertToPx()).c_str());
json->Put("badgeFontSize", badgeFontSize.value().ToString().c_str());
json->Put("badgeColor", badgeColor.value().ToString().c_str());
json->Put("badgeFontWeight", V2::ConvertWrapFontWeightToStirng(badgeFontWeight.value()).c_str());
json->Put("badgeBorderColor", badgeBorderColor.value().ToString().c_str());
json->Put("badgeBorderWidth", badgeBorderWidth.value().ToString().c_str());
}
void BadgePattern::DumpSimplifyInfo(std::unique_ptr<JsonValue>& json)

View File

@ -93,6 +93,7 @@ public:
ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(ControlSize, ControlSize, PROPERTY_UPDATE_MEASURE);
ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(ButtonRole, ButtonRole, PROPERTY_UPDATE_NORMAL);
ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(CreateWithLabel, bool, PROPERTY_UPDATE_NORMAL);
ACE_DEFINE_PROPERTY_ITEM_WITHOUT_GROUP(AutoDisable, bool, PROPERTY_UPDATE_NORMAL);
private:
ACE_DISALLOW_COPY_AND_MOVE(ButtonLayoutProperty);

View File

@ -568,6 +568,12 @@ Color ButtonModelNG::GetFontColor(FrameNode* frameNode)
ACE_GET_NODE_LAYOUT_PROPERTY(ButtonLayoutProperty, FontColor, value, frameNode);
return value;
}
void ButtonModelNG::GetAutoDisable(FrameNode* frameNode, bool autoDisable)
{
ACE_GET_NODE_LAYOUT_PROPERTY(ButtonLayoutProperty, AutoDisable, autoDisable, frameNode);
}
void ButtonModelNG::SetBuilderFunc(FrameNode* frameNode, NG::ButtonMakeCallback&& makeFunc)
{
CHECK_NULL_VOID(frameNode);

View File

@ -88,6 +88,7 @@ public:
static void ApplyTheme(FrameNode* frameNode, ButtonStyleMode buttonStyle, ButtonRole buttonRole);
static void SetLabelWithCheck(FrameNode* frameNode, const char* label);
static void SetCreateWithLabel(FrameNode* frameNode, bool createWithLabel);
static void GetAutoDisable(FrameNode* frameNode, bool autoDisable);
private:
static void CreateWithLabel(const std::string& label);

View File

@ -34,6 +34,7 @@ namespace {
constexpr int32_t CALENDAR_WEEK_DAYS = 7;
constexpr int32_t DAILY_FOUR_ROWSPACE = 4;
constexpr int32_t DAILY_FIVE_ROWSPACE = 5;
constexpr int32_t CALENDAR_DISTANCE_ADJUST_FOCUSED_SIZE = 2;
constexpr Dimension CALENDAR_DISTANCE_ADJUST_FOCUSED_EVENT = 4.0_vp;
constexpr int32_t MONDAY_INDEX = 1;
constexpr int32_t TUESDAY_INDEX = 2;
@ -245,20 +246,32 @@ void CalendarMonthPattern::InitClickEvent()
gesture->AddClickEvent(clickListener_);
}
float CalendarMonthPattern::GetWidth(const RefPtr<FrameNode>& host)
{
auto width = 0.0f;
auto contentConstraint = host->GetLayoutProperty()->GetLayoutConstraint();
if (!contentConstraint.has_value()) {
return width;
}
auto constraint = contentConstraint.value();
auto selfWidth = constraint.selfIdealSize.Width();
if (!selfWidth.has_value()) {
return width;
}
width = selfWidth.value()
- CALENDAR_DISTANCE_ADJUST_FOCUSED_EVENT.ConvertToPx() * CALENDAR_DISTANCE_ADJUST_FOCUSED_SIZE;
return width;
}
void CalendarMonthPattern::BeforeSyncGeometryProperties(const DirtySwapConfig& config)
{
auto host = GetHost();
CHECK_NULL_VOID(host);
auto contentConstraint = host->GetLayoutProperty()->GetLayoutConstraint();
if (!contentConstraint.has_value()) {
return;
}
auto constraint = contentConstraint.value();
auto width = GetWidth(host);
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
CHECK_NULL_VOID(pipelineContext);
RefPtr<CalendarTheme> theme = pipelineContext->GetTheme<CalendarTheme>();
CHECK_NULL_VOID(theme);
auto width = constraint.selfIdealSize.Width().value() - CALENDAR_DISTANCE_ADJUST_FOCUSED_EVENT.ConvertToPx() * 2;
auto calendarDaySize = GetDaySize(theme);
auto space = (width - calendarDaySize.ConvertToPx() * CALENDAR_WEEK_DAYS) / (CALENDAR_WEEK_DAYS - 1);
Dimension colSpace = 0.0_px;
@ -921,7 +934,9 @@ void CalendarMonthPattern::ChangeVirtualNodeContent(const CalendarDay& calendarD
void CalendarMonthPattern::FireModifyAccessibilityVirtualNode(const ObtainedMonth& currentData)
{
if (isInitVirtualNode_) {
auto pipeline = GetHost()->GetContext();
auto host = GetHost();
CHECK_NULL_VOID(host);
auto pipeline = host->GetContext();
CHECK_NULL_VOID(pipeline);
pipeline->AddAfterRenderTask([weak = WeakClaim(this), currentData]() {
auto calendarMonthPattern = weak.Upgrade();

View File

@ -160,6 +160,7 @@ private:
void ChangeVirtualNodeState(const CalendarDay& calendarDay);
void SetLineNodeSize(RefPtr<FrameNode> lineNode);
void SetFocusNode(int32_t index, bool isDeviceOrientation = false);
float GetWidth(const RefPtr<FrameNode>& host);
std::string GetDayStr(int32_t index);
bool isCalendarDialog_ = false;
bool hoverState_ = false;

View File

@ -134,7 +134,8 @@ void CalendarDialogView::CreateChildNode(const RefPtr<FrameNode>& contentColumn,
radius.SetRadius(theme->GetDialogBorderRadius());
renderContext->UpdateBorderRadius(radius);
}
if (Container::LessThanAPIVersion(PlatformVersion::VERSION_TWELVE)) {
if (Container::LessThanAPIVersion(PlatformVersion::VERSION_TWELVE) ||
Container::GreatOrEqualAPIVersion(PlatformVersion::VERSION_FOURTEEN)) {
renderContext->UpdateBackShadow(ShadowConfig::DefaultShadowS);
}
UpdateBackgroundStyle(renderContext, dialogProperties);

View File

@ -432,7 +432,9 @@ void CalendarPickerPattern::ShowDialog()
if (IsDialogShow()) {
return;
}
auto pipeline = GetHost()->GetContext();
auto host = GetHost();
CHECK_NULL_VOID(host);
auto pipeline = host->GetContext();
CHECK_NULL_VOID(pipeline);
auto overlayManager = pipeline->GetOverlayManager();
@ -456,8 +458,6 @@ void CalendarPickerPattern::ShowDialog()
pattern->SetDialogShow(false);
};
dialogCancelEvent["cancelId"] = cancelId;
auto host = GetHost();
CHECK_NULL_VOID(host);
calendarData_.entryNode = AceType::DynamicCast<FrameNode>(host);
DialogProperties properties;
InitDialogProperties(properties);
@ -1271,7 +1271,9 @@ void CalendarPickerPattern::SetSelectedType(CalendarPickerSelectedType type)
bool CalendarPickerPattern::IsContainerModal()
{
auto pipelineContext = GetHost()->GetContext();
auto host = GetHost();
CHECK_NULL_RETURN(host, false);
auto pipelineContext = host->GetContext();
CHECK_NULL_RETURN(pipelineContext, false);
auto windowManager = pipelineContext->GetWindowManager();
return pipelineContext->GetWindowModal() == WindowModal::CONTAINER_MODAL && windowManager &&

View File

@ -40,15 +40,20 @@ CanvasPaintMethod::CanvasPaintMethod(RefPtr<CanvasModifier> contentModifier, con
SetFontSize(DEFAULT_FONT_SIZE);
// The default value of TextAlign is TextAlign::START.
SetDefaultTextAlign();
if (apiVersion_ >= static_cast<int32_t>(PlatformVersion::VERSION_FOURTEEN)) {
isPathChanged_ = false;
isPath2dChanged_ = false;
}
}
#ifndef USE_FAST_TASKPOOL
void CanvasPaintMethod::PushTask(const TaskFunc& task)
{
static constexpr uint32_t suggestSize = 1000;
static constexpr uint32_t suggestSize = 100000;
tasks_.emplace_back(task);
if (tasks_.size() >= suggestSize && tasks_.size() % suggestSize == 0) {
ACE_SCOPED_TRACE("[%s] Canvas task size: %zu", customNodeName_.c_str(), tasks_.size());
TAG_LOGI(AceLogTag::ACE_CANVAS, "[%{public}s] Canvas task size: %{public}zu", customNodeName_.c_str(),
tasks_.size());
}
CHECK_EQUAL_VOID(needMarkDirty_, false);
needMarkDirty_ = false;

View File

@ -119,6 +119,17 @@ const LinearMapNode<void (*)(std::shared_ptr<RSImage>&, std::shared_ptr<RSShader
} },
};
CustomPaintPaintMethod::CustomPaintPaintMethod()
{
auto container = Container::CurrentSafely();
if (container) {
apiVersion_ = container->GetApiTargetVersion();
} else {
// %1000 because the API version is the last three digits of the APP version
apiVersion_ = AceApplicationInfo::GetInstance().GetApiTargetVersion() % 1000;
}
}
bool CustomPaintPaintMethod::CheckFilterProperty(FilterType filterType, const std::string& filterParam)
{
switch (filterType) {
@ -722,6 +733,9 @@ void CustomPaintPaintMethod::Fill(const RefPtr<CanvasPath2D>& path)
ParsePath2D(path);
Path2DFill();
rsPath2d_.Reset();
if (apiVersion_ >= static_cast<int32_t>(PlatformVersion::VERSION_FOURTEEN)) {
isPath2dChanged_ = false;
}
}
void CustomPaintPaintMethod::Path2DFill()
@ -786,6 +800,9 @@ void CustomPaintPaintMethod::Stroke(const RefPtr<CanvasPath2D>& path)
ParsePath2D(path);
Path2DStroke();
rsPath2d_.Reset();
if (apiVersion_ >= static_cast<int32_t>(PlatformVersion::VERSION_FOURTEEN)) {
isPath2dChanged_ = false;
}
}
void CustomPaintPaintMethod::Path2DStroke()
@ -828,6 +845,9 @@ void CustomPaintPaintMethod::Clip(const RefPtr<CanvasPath2D>& path)
ParsePath2D(path);
Path2DClip();
rsPath2d_.Reset();
if (apiVersion_ >= static_cast<int32_t>(PlatformVersion::VERSION_FOURTEEN)) {
isPath2dChanged_ = false;
}
}
void CustomPaintPaintMethod::Path2DClip()
@ -839,6 +859,9 @@ void CustomPaintPaintMethod::Path2DClip()
void CustomPaintPaintMethod::BeginPath()
{
rsPath_.Reset();
if (apiVersion_ >= static_cast<int32_t>(PlatformVersion::VERSION_FOURTEEN)) {
isPathChanged_ = false;
}
}
void CustomPaintPaintMethod::ClosePath()
@ -849,11 +872,16 @@ void CustomPaintPaintMethod::ClosePath()
void CustomPaintPaintMethod::MoveTo(double x, double y)
{
rsPath_.MoveTo(static_cast<RSScalar>(x), static_cast<RSScalar>(y));
isPathChanged_ = true;
}
void CustomPaintPaintMethod::LineTo(double x, double y)
{
if (!isPathChanged_) {
rsPath_.MoveTo(static_cast<RSScalar>(x), static_cast<RSScalar>(y));
}
rsPath_.LineTo(static_cast<RSScalar>(x), static_cast<RSScalar>(y));
isPathChanged_ = true;
}
void CustomPaintPaintMethod::Arc(const ArcParam& param)
@ -890,18 +918,24 @@ void CustomPaintPaintMethod::Arc(const ArcParam& param)
} else {
rsPath_.ArcTo(point1, point2, static_cast<RSScalar>(startAngle), static_cast<RSScalar>(sweepAngle));
}
isPathChanged_ = true;
}
void CustomPaintPaintMethod::ArcTo(const ArcToParam& param)
{
if (!isPathChanged_) {
rsPath_.MoveTo(static_cast<RSScalar>(param.x1), static_cast<RSScalar>(param.y1));
}
rsPath_.ArcTo(static_cast<RSScalar>(param.x1), static_cast<RSScalar>(param.y1), static_cast<RSScalar>(param.x2),
static_cast<RSScalar>(param.y2), static_cast<RSScalar>(param.radius));
isPathChanged_ = true;
}
void CustomPaintPaintMethod::AddRect(const Rect& rect)
{
RSRect rsRect(rect.Left(), rect.Top(), rect.Right(), rect.Bottom());
rsPath_.AddRect(rsRect);
isPathChanged_ = true;
}
void CustomPaintPaintMethod::Ellipse(const EllipseParam& param)
@ -953,20 +987,29 @@ void CustomPaintPaintMethod::Ellipse(const EllipseParam& param)
matrix.Rotate(rotation, param.x, param.y);
rsPath_.Transform(matrix);
}
isPathChanged_ = true;
}
void CustomPaintPaintMethod::BezierCurveTo(const BezierCurveParam& param)
{
if (!isPathChanged_) {
rsPath_.MoveTo(static_cast<RSScalar>(param.cp1x), static_cast<RSScalar>(param.cp1y));
}
rsPath_.CubicTo(static_cast<RSScalar>(param.cp1x),
static_cast<RSScalar>(param.cp1y), static_cast<RSScalar>(param.cp2x),
static_cast<RSScalar>(param.cp2y), static_cast<RSScalar>(param.x),
static_cast<RSScalar>(param.y));
isPathChanged_ = true;
}
void CustomPaintPaintMethod::QuadraticCurveTo(const QuadraticCurveParam& param)
{
if (!isPathChanged_) {
rsPath_.MoveTo(static_cast<RSScalar>(param.cpx), static_cast<RSScalar>(param.cpy));
}
rsPath_.QuadTo(static_cast<RSScalar>(param.cpx), static_cast<RSScalar>(param.cpy),
static_cast<RSScalar>(param.x), static_cast<RSScalar>(param.y));
isPathChanged_ = true;
}
void CustomPaintPaintMethod::ParsePath2D(const RefPtr<CanvasPath2D>& path)
@ -1027,11 +1070,16 @@ void CustomPaintPaintMethod::Path2DClosePath()
void CustomPaintPaintMethod::Path2DMoveTo(const PathArgs& args)
{
rsPath2d_.MoveTo(args.para1, args.para2);
isPath2dChanged_ = true;
}
void CustomPaintPaintMethod::Path2DLineTo(const PathArgs& args)
{
if (!isPath2dChanged_) {
rsPath2d_.MoveTo(static_cast<RSScalar>(args.para1), static_cast<RSScalar>(args.para2));
}
rsPath2d_.LineTo(args.para1, args.para2);
isPath2dChanged_ = true;
}
void CustomPaintPaintMethod::Path2DArc(const PathArgs& args)
@ -1063,12 +1111,17 @@ void CustomPaintPaintMethod::Path2DArc(const PathArgs& args)
} else {
rsPath2d_.ArcTo(point1, point2, startAngle, sweepAngle);
}
isPath2dChanged_ = true;
}
void CustomPaintPaintMethod::Path2DArcTo(const PathArgs& args)
{
if (!isPath2dChanged_) {
rsPath2d_.MoveTo(static_cast<RSScalar>(args.para1), static_cast<RSScalar>(args.para2));
}
rsPath2d_.ArcTo(static_cast<RSScalar>(args.para1), static_cast<RSScalar>(args.para2),
static_cast<RSScalar>(args.para3), static_cast<RSScalar>(args.para4), static_cast<RSScalar>(args.para5));
isPath2dChanged_ = true;
}
void CustomPaintPaintMethod::Path2DEllipse(const PathArgs& args)
@ -1116,16 +1169,25 @@ void CustomPaintPaintMethod::Path2DEllipse(const PathArgs& args)
matrix.Rotate(rotation, args.para1, args.para2);
rsPath2d_.Transform(matrix);
}
isPath2dChanged_ = true;
}
void CustomPaintPaintMethod::Path2DBezierCurveTo(const PathArgs& args)
{
if (!isPath2dChanged_) {
rsPath2d_.MoveTo(static_cast<RSScalar>(args.para1), static_cast<RSScalar>(args.para2));
}
rsPath2d_.CubicTo(args.para1, args.para2, args.para3, args.para4, args.para5, args.para6);
isPath2dChanged_ = true;
}
void CustomPaintPaintMethod::Path2DQuadraticCurveTo(const PathArgs& args)
{
if (!isPath2dChanged_) {
rsPath2d_.MoveTo(static_cast<RSScalar>(args.para1), static_cast<RSScalar>(args.para2));
}
rsPath2d_.QuadTo(args.para1, args.para2, args.para3, args.para4);
isPath2dChanged_ = true;
}
void CustomPaintPaintMethod::Path2DSetTransform(const PathArgs& args)
@ -1970,6 +2032,10 @@ void CustomPaintPaintMethod::ResetStates()
colorMatrix_ = RSColorMatrix();
colorFilter_ = RSColorFilter::CreateMatrixColorFilter(colorMatrix_);
blurFilter_ = RSImageFilter::CreateBlurImageFilter(0, 0, RSTileMode::DECAL, nullptr);
if (apiVersion_ >= static_cast<int32_t>(PlatformVersion::VERSION_FOURTEEN)) {
isPathChanged_ = false;
isPath2dChanged_ = false;
}
}
void CustomPaintPaintMethod::PaintShadow(

Some files were not shown because too many files have changed in this diff Show More