diff --git a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/AccessibilityManager.cpp b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/AccessibilityManager.cpp index 09175edb7f0a6deb8424c74e5f234a1d8b073548..5ace45f8167d5d5e2292c3032c1685f04b285bef 100644 --- a/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/AccessibilityManager.cpp +++ b/ArkUIKit/AccessibilityCapi/entry/src/main/cpp/manager/AccessibilityManager.cpp @@ -13,12 +13,14 @@ * limitations under the License. */ +// [Start abilitycap_one_start] #include #include #include "common/common.h" #include "fakenode/fake_node.h" #include "AccessibilityManager.h" +// [StartExclude abilitycap_one_start] const char *DEFAULT_ID = "XComponentIdSingle"; const char *LOG_PRINT_TEXT = "AccessibilityManager"; @@ -29,6 +31,7 @@ const int32_t NUMBER_FIRST = 100; const int32_t NUMBER_SECOND = 500; const int32_t NUMBER_THIRD = 800; +// [Start abilitycap_six_start] void FillEvent(ArkUI_AccessibilityEventInfo *eventInfo, ArkUI_AccessibilityElementInfo *elementInfo, ArkUI_AccessibilityEventType eventType, std::string announcedText) { @@ -47,8 +50,9 @@ void FillEvent(ArkUI_AccessibilityEventInfo *eventInfo, ArkUI_AccessibilityEleme } } - +// [StartExclude abilitycap_six_start] ArkUI_AccessibilityProvider *g_provider = nullptr; +// [EndExclude abilitycap_six_start] void AccessibilityManager::SendAccessibilityAsyncEvent(ArkUI_AccessibilityElementInfo *elementInfo, ArkUI_AccessibilityEventType eventType, @@ -64,7 +68,8 @@ void AccessibilityManager::SendAccessibilityAsyncEvent(ArkUI_AccessibilityElemen // 3. 调用接口发送事件给OH侧 OH_ArkUI_SendAccessibilityAsyncEvent(g_provider, eventInfo, callback); } - +// [EndExclude abilitycap_one_start] +// [StartExclude abilitycap_six_start] AccessibilityManager::AccessibilityManager() { // 多实例场景 @@ -103,6 +108,8 @@ void AccessibilityManager::Initialize(const std::string &id, OH_NativeXComponent g_provider = provider; } +// [StartExclude abilitycap_one_start] +// [Start abilitycap_two_start] int32_t AccessibilityManager::FindAccessibilityNodeInfosById(const char* instanceId, int64_t elementId, ArkUI_AccessibilitySearchMode mode, int32_t requestId, ArkUI_AccessibilityElementInfoList *elementList) { @@ -240,7 +247,9 @@ int32_t AccessibilityManager::FindAccessibilityNodeInfosById(const char* instanc OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, "FindAccessibilityNodeInfosById end"); return OH_NATIVEXCOMPONENT_RESULT_SUCCESS; } +// [End abilitycap_two_start] +// [Start abilitycap_four_start] int32_t AccessibilityManager::FindAccessibilityNodeInfosByText(const char* instanceId, int64_t elementId, const char *text, int32_t requestId, ArkUI_AccessibilityElementInfoList *elementList) { @@ -250,7 +259,9 @@ int32_t AccessibilityManager::FindAccessibilityNodeInfosByText(const char* insta elementId, requestId, text); return OH_NATIVEXCOMPONENT_RESULT_SUCCESS; } +// [End abilitycap_four_start] +// [Start abilitycap_five_start] int32_t AccessibilityManager::FindFocusedAccessibilityNode(const char* instanceId, int64_t elementId, ArkUI_AccessibilityFocusType focusType, int32_t requestId, ArkUI_AccessibilityElementInfo *elementInfo) { @@ -260,7 +271,9 @@ int32_t AccessibilityManager::FindFocusedAccessibilityNode(const char* instanceI instanceId, elementId, requestId, static_cast(focusType)); return OH_NATIVEXCOMPONENT_RESULT_SUCCESS; } +// [End abilitycap_five_start] +// [Start abilitycap_three_start] int32_t AccessibilityManager::FindNextFocusAccessibilityNode(const char* instanceId, int64_t elementId, ArkUI_AccessibilityFocusMoveDirection direction, int32_t requestId, ArkUI_AccessibilityElementInfo *elementInfo) @@ -312,6 +325,8 @@ int32_t AccessibilityManager::FindNextFocusAccessibilityNode(const char* instanc OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, "%{public}ld", nextElementId); return OH_NATIVEXCOMPONENT_RESULT_SUCCESS; } +// [End abilitycap_three_start] +// [EndExclude abilitycap_six_start] int32_t AccessibilityManager::ExecuteAccessibilityAction(const char* instanceId, int64_t elementId, ArkUI_Accessibility_ActionType action, ArkUI_AccessibilityActionArguments *actionArguments, int32_t requestId) @@ -366,14 +381,18 @@ int32_t AccessibilityManager::ExecuteAccessibilityAction(const char* instanceId, OH_ArkUI_DestoryAccessibilityElementInfo(element); return OH_NATIVEXCOMPONENT_RESULT_SUCCESS; } +// [End abilitycap_six_start] +// [Start abilitycap_seven_start] int32_t AccessibilityManager::ClearFocusedFocusAccessibilityNode(const char* instanceId) { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, LOG_PRINT_TEXT, "ClearFocusedFocusAccessibilityNode, instanceId %{public}s", instanceId); return OH_NATIVEXCOMPONENT_RESULT_SUCCESS; } +// [End abilitycap_seven_start] +// [Start abilitycap_eight_start] int32_t AccessibilityManager::GetAccessibilityNodeCursorPosition(const char* instanceId, int64_t elementId, int32_t requestId, int32_t *index) { @@ -383,6 +402,7 @@ int32_t AccessibilityManager::GetAccessibilityNodeCursorPosition(const char* ins instanceId, elementId, requestId, index); return OH_NATIVEXCOMPONENT_RESULT_SUCCESS; } +// [End abilitycap_eight_start] void AccessibilityManager::Initialize(OH_NativeXComponent *nativeXComponent) { @@ -440,4 +460,6 @@ int32_t AccessibilityManager::GetAccessibilityNodeCursorPosition(int64_t element { return GetAccessibilityNodeCursorPosition(DEFAULT_ID, elementId, requestId, index); } -} \ No newline at end of file +} +// [EndExclude abilitycap_one_start] +// [End abilitycap_one_start] \ No newline at end of file diff --git a/ArkUIKit/Animation/README_zh.md b/ArkUIKit/Animation/README_zh.md index 04aad6061b8a533eaa6857a87cbe1be6ecec93d9..b406dd41ffab56f314346901fad37e9ba643913e 100644 --- a/ArkUIKit/Animation/README_zh.md +++ b/ArkUIKit/Animation/README_zh.md @@ -18,12 +18,16 @@ 13. [模糊动画](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/ui/arkts-blur-effect.md) 14. [自定义属性动画](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/ui/arkts-custom-attribute-animation.md) 15. [组件动画](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/ui/arkts-component-animation.md) +16. [传统曲线](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/ui/arkts-traditional-curve.md)。 +17. [弹簧曲线](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/ui/arkts-spring-curve.md)。 +18. [模态转场](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/ui/arkts-modal-transition.md)。 + ### 效果预览 | 首页 | |------------------------------------| -| ![](screenshots/device/image2.png) | +| ![](screenshots/device/image1.png) | ### 使用说明 @@ -146,7 +150,39 @@ entry/src/main/ets/ | | | |---Index.ets | |---shareTransition // 共享元素转场 | | |---template1 -| | | |---Index.ets +| | | |---Index.ets //示例1(共享元素转场) +| | |---template2 +| | | |---Index.ets //示例2(不新建容器并直接变化原容器) +| | |---template3 +| | | |---Index.ets //示例3(新建容器并跨容器迁移组件-结合Stack使用) +| | |---template4 +| | | |---Index.ets //示例4(新建容器并跨容器迁移组件-结合Navigation使用) +| | |---template5 +| | | |---Index.ets //示例5(新建容器并跨容器迁移组件-结合BindSheet使用) +| | |---template6 +| | | |---IfElseGeometryTransition.ets //示例6(使用geometryTransition共享元素转场-geometryTransition的简单使用) +| | |---template7 +| | | |---Index.ets //示例7(使用geometryTransition共享元素转场-geometryTransition结合模态转场使用) +| |---traditionalCurve // 传统曲线 +| | |---template1 +| | | |---CurveDemo.ets +| |---springCurve // 弹簧曲线 +| | |---template1 +| | | |---SpringCurve.ets +| |---modalTransition // 模态转场 +| | |---template1 +| | | |---BindContentCoverDemo.ets // 示例1(使用bindContentCover构建全屏模态转场效果) +| | |---template2 +| | | |---BindSheetDemo.ets // 示例2(使用bindSheet构建半模态转场效果) +| | |---template3 +| | | |---BindMenuDemo.ets // 示例3(使用bindMenu实现菜单弹出效果) +| | |---template4 +| | | |---BindContextMenuDemo.ets // 示例4(使用bindContextMenu实现菜单弹出效果) +| | |---template5 +| | | |---BindPopupDemo.ets // 示例5(使用bindPopup实现气泡弹窗效果) +| | |---template6 +| | | |---ModalTransitionWithIf.ets // 示例6(使用if实现模态转场) + |---pages | |---Index.ets // 应用主页面 entry/src/ohosTest/ @@ -166,6 +202,9 @@ entry/src/ohosTest/ | | |---Particle.test.ets // 粒子动画示例代码测试代码 | | |---Rotation.test.ets // 旋转屏动画示例代码测试代码 | | |---ShareTransition.test.ets // 共享元素转场示例代码测试代码 +| | |---TraditionalCurve.test.ets // 传统曲线示例代码测试代码 +| | |---SpringCurve.test.ets // 弹簧曲线示例代码测试代码 +| | |---ModalTransition.test.ets // 模态转场示例代码测试代码 ``` ### 具体实现 @@ -191,20 +230,49 @@ entry/src/ohosTest/ * 开发者仅需在animateTo动画闭包中改变属性值或者改变animation接口作用的属性值,即可产生动画。 5. 组件动画 组件默认动画功能封装在ComponentDefaultAnimationModule,源码参考:[Index.ets](https://gitcode.com/openharmony/applications_app_samples/blob/master/code/DocsSample/ArkUISample/Animation/entry/src/main/ets/pages/component/template1/Index.ets) -* 默认动画特性:ArkUI 部分基础组件(如 Checkbox、Button、List 等)内置了状态切换或交互反馈动画。例如 Checkbox 的勾选 / 取消动效、Button 的点击高亮反馈、List 的滑动过渡效果,这些动画无需开发者手动编写逻辑,能直观提示用户操作状态(如选中、点击生效)。 -* 使用方式:直接声明组件并配置基础属性(如 Checkbox 的shape、size、select状态),当组件状态发生变更时(如通过交互修改select值),默认动画会自动触发,简化了基础交互场景的动效实现。 -* 适用场景:适用于需要快速实现标准化交互反馈的场景,无需关注动画细节即可让界面具备基础生动性,减少开发工作量。 - Scroll 组件定制化动效封装在TaskSwitchModule,源码参考:[Index.ets](https://gitcode.com/openharmony/applications_app_samples/blob/master/code/DocsSample/ArkUISample/Animation/entry/src/main/ets/pages/component/template2/Index.ets) -* 动效定制逻辑:通过Scroller和PanGesture手势监控滑动距离,结合WindowManager获取屏幕尺寸,动态计算子组件的仿射属性。例如根据滑动进度调整卡片的scale(中间卡片放大、边缘卡片正常)、translate(位移偏移)和zIndex(层级叠加),实现滑动时的立体层次感。 -* 动画参数配置:为子组件绑定animation,设置不同曲线(如Curve.Smooth用于缩放过渡、curves.springMotion()用于位移弹性效果),确保滑动过程中动效自然流畅。 -* 边界与校准处理:在手势结束回调中,通过计算滑动速度和偏移量,校准卡片最终位置(如左滑 / 右滑到极限时锁定位置,未满足切换距离时自动回位),保证交互体验一致性。 -* 触发方式:支持滑动手势直接触发动效,也可通过点击 “Move to first/last” 按钮切换首尾位置,按钮点击会同步更新偏移量并触发动画。 - List 组件定制化动效封装在ListAutoSortModule,源码参考:[Index.ets](https://gitcode.com/openharmony/applications_app_samples/blob/master/code/DocsSample/ArkUISample/Animation/entry/src/main/ets/pages/component/template3/Index.ets) -* 动效核心实现:通过DragSortCtrl类管理列表项数据与视觉属性,该类封装了列表项移动逻辑(itemMove方法)和偏移量计算(onMove方法)。结合animateTo和createAnimator创建弹簧动画(使用interpolatingSpring曲线),在逐帧回调中更新translate属性,实现 Item 移动时的弹性过渡。 -* 交互触发机制:为 ListItem 配置swipeAction,滑动 Item 后显示 “To TOP” 按钮,点击按钮时启动动画;通过attributeModifier动态应用ListItemModify中的偏移量,让列表项在移动过程中实时更新位置。 -* 列表分组适配:支持将列表项分为多个ListItemGroup,动效会自动适配分组内的 Item 排列逻辑,确保移动时不破坏分组结构,保持界面布局合理性。 -* 动画控制细节:通过listScroll.closeAllSwipeActions确保滑动操作完成后再启动动画,避免交互冲突;动画结束后自动更新列表数据顺序,实现视觉与数据的同步。 ->>>>>>> master + * 默认动画特性:ArkUI 部分基础组件(如 Checkbox、Button、List 等)内置了状态切换或交互反馈动画。例如 Checkbox 的勾选 / 取消动效、Button 的点击高亮反馈、List 的滑动过渡效果,这些动画无需开发者手动编写逻辑,能直观提示用户操作状态(如选中、点击生效)。 + * 使用方式:直接声明组件并配置基础属性(如 Checkbox 的shape、size、select状态),当组件状态发生变更时(如通过交互修改select值),默认动画会自动触发,简化了基础交互场景的动效实现。 + * 适用场景:适用于需要快速实现标准化交互反馈的场景,无需关注动画细节即可让界面具备基础生动性,减少开发工作量。 + Scroll 组件定制化动效封装在TaskSwitchModule,源码参考:[Index.ets](https://gitcode.com/openharmony/applications_app_samples/blob/master/code/DocsSample/ArkUISample/Animation/entry/src/main/ets/pages/component/template2/Index.ets) + * 动效定制逻辑:通过Scroller和PanGesture手势监控滑动距离,结合WindowManager获取屏幕尺寸,动态计算子组件的仿射属性。例如根据滑动进度调整卡片的scale(中间卡片放大、边缘卡片正常)、translate(位移偏移)和zIndex(层级叠加),实现滑动时的立体层次感。 + * 动画参数配置:为子组件绑定animation,设置不同曲线(如Curve.Smooth用于缩放过渡、curves.springMotion()用于位移弹性效果),确保滑动过程中动效自然流畅。 + * 边界与校准处理:在手势结束回调中,通过计算滑动速度和偏移量,校准卡片最终位置(如左滑 / 右滑到极限时锁定位置,未满足切换距离时自动回位),保证交互体验一致性。 + * 触发方式:支持滑动手势直接触发动效,也可通过点击 “Move to first/last” 按钮切换首尾位置,按钮点击会同步更新偏移量并触发动画。 + List 组件定制化动效封装在ListAutoSortModule,源码参考:[Index.ets](https://gitcode.com/openharmony/applications_app_samples/blob/master/code/DocsSample/ArkUISample/Animation/entry/src/main/ets/pages/component/template3/Index.ets) + * 动效核心实现:通过DragSortCtrl类管理列表项数据与视觉属性,该类封装了列表项移动逻辑(itemMove方法)和偏移量计算(onMove方法)。结合animateTo和createAnimator创建弹簧动画(使用interpolatingSpring曲线),在逐帧回调中更新translate属性,实现 Item 移动时的弹性过渡。 + * 交互触发机制:为 ListItem 配置swipeAction,滑动 Item 后显示 “To TOP” 按钮,点击按钮时启动动画;通过attributeModifier动态应用ListItemModify中的偏移量,让列表项在移动过程中实时更新位置。 + * 列表分组适配:支持将列表项分为多个ListItemGroup,动效会自动适配分组内的 Item 排列逻辑,确保移动时不破坏分组结构,保持界面布局合理性。 + * 动画控制细节:通过listScroll.closeAllSwipeActions确保滑动操作完成后再启动动画,避免交互冲突;动画结束后自动更新列表数据顺序,实现视觉与数据的同步。 +6. 旋转屏动画:旋转屏动画主要分为两类:布局切换的旋转屏动画和透明度变化的旋转屏动画,旨在实现屏幕显示方向变化时的自然过渡。源码参考[rotation/template1/Index.ets](https://gitcode.com/openharmony/applications_app_samples/blob/master/code/DocsSample/ArkUISample/Animation/entry/src/main/ets/pages/rotation/template1/Index.ets) + * 布局切换时的旋转屏动画,是在屏幕显示方向改变时,为窗口与应用视图同步旋转而设计的大小和位置过渡动画。 + * 这种布局切换的旋转屏动画是系统默认的,便于开发者实现。当屏幕显示方向变化时,系统会生成窗口旋转动画,并自动调整窗口大小以匹配旋转后的尺寸。 + * 在此过程中,窗口会通知对应的应用,要求其根据新的窗口大小重新布局,产生与窗口旋转动画参数相同的布局动画。 + * 透明度变化的旋转屏动画在屏幕显示方向变化时启用,当窗口进行旋转动画时,为旋转过程中新增或删除的组件添加默认透明度转场,以实现组件的优雅出现和消失。 + * 此功能通过监听窗口旋转事件,在事件中切换组件的视图效果,如果消失视图的根节点和新出现视图的根节点未设置转场效果,会为其自动添加默认透明度转场(即TransitionEffect.OPACITY),展现出透明度的渐隐和渐显效果。 +7. 传统曲线:传统曲线基于数学公式,创造形状符合开发者预期的动画曲线。源码参考[traditionalCurve/template1/Index.ets](https://gitcode.com/openharmony/applications_app_samples/blob/master/code/DocsSample/ArkUISample/SupportingAgingFriendly/entry/src/main/ets/pages/traditionalCurve/template1/Index.ets) + * 以三阶贝塞尔曲线为代表,通过调整曲线控制点,可以改变曲线形状,从而带来缓入、缓出等动画效果。 + * 对于同一条传统曲线,由于不具备物理含义,其形状不会因为用户行为发生任何改变,缺少物理动画的自然感和生动感。 + * 建议优先采用物理曲线创建动画,将传统曲线作为辅助用于极少数必要场景中。 +8. 弹簧曲线:使用animation接口作用的属性值,即可产生动画。源码参考[springCurve/template1/Index.ets](https://gitcode.com/openharmony/applications_app_samples/blob/master/code/DocsSample/ArkUISample/SupportingAgingFriendly/entry/src/main/ets/pages/springCurve/template1/Index.ets) + * 阻尼弹簧曲线(以下简称弹簧曲线)对应的阻尼弹簧系统中,偏离平衡位置的物体一方面受到弹簧形变产生的反向作用力,被迫发生振动。 + * 另一方面,阻尼的存在为物体振动提供阻力。 + * 除阻尼为0的特殊情况,物体在振动过程中振幅不断减小,且最终趋于0,其轨迹对应的动画曲线自然连续。 +9. 共享元素转场 (一镜到底):共享元素转场是一种界面切换时对相同或者相似的两个元素做的一种位置和大小匹配的过渡动画效果,也称一镜到底动效。源码参考[shareTransition/template1/Index.ets](https://gitcode.com/openharmony/applications_app_samples/blob/master/code/DocsSample/ArkUISample/SupportingAgingFriendly/entry/src/main/ets/pages/shareTransition/template1/Index.ets) + * 不新建容器并直接变化原容器。通过在已有容器上增删组件触发transition,搭配组件属性动画实现一镜到底效果。 + * 新建容器并跨容器迁移组件。利用Stack内后定义组件在最上方的特性控制组件在跨节点迁移后位z序最高。 + * 新建容器并跨容器迁移组件。利用Navigation的自定义导航转场动画能力实现一镜到底动效。共享元素转场期间,组件由消失页面迁移至出现页面。 + * 新建容器并跨容器迁移组件。实现半模态转场(bindSheet)的同时,组件从初始界面做一镜到底动画到半模态页面的效果,可以使用这样的设计思路。将SheetOptions中的mode设置为SheetMode.EMBEDDED,该模式下新起的页面可以覆盖在半模态弹窗上,页面返回后该半模态依旧存在,半模态面板内容不丢失。在半模态转场的同时设置一全模态转场(bindContentCover)页面无转场出现,该页面仅有需要做共享元素转场的组件,通过属性动画,展示组件从初始界面至半模态页面的一镜到底动效,并在动画结束时关闭页面,并将该组件迁移至半模态页面。 + * 使用geometryTransition共享元素转场。geometryTransition用于组件内隐式共享元素转场,在视图状态切换过程中提供丝滑的上下文继承过渡体验。 + * geometryTransition的使用方式为对需要添加一镜到底动效的两个组件使用geometryTransition接口绑定同一id,这样在其中一个组件消失同时另一个组件创建出现的时候,系统会对二者添加一镜到底动效。 + * geometryTransition绑定两个对象的实现方式使得geometryTransition区别于其他方法,最适合用于两个不同对象之间完成一镜到底。 +10. 模态转场:模态转场是新的界面覆盖在旧的界面上,旧的界面不消失的一种转场方式。源码参考[modalTransition/template1/Index.ets](https://gitcode.com/openharmony/applications_app_samples/blob/master/code/DocsSample/ArkUISample/Animation/entry/src/main/ets/pages/modalTransition/template1/BindContentCoverDemo.ets) + * bindContentCover接口用于为组件绑定全屏模态页面,在组件出现和消失时可通过设置转场参数ModalTransition添加过渡动效。 + * bindSheet属性可为组件绑定半模态页面,在组件出现时可通过设置自定义或默认的内置高度确定半模态大小。构建半模态转场动效的步骤基本与使用bindContentCover构建全屏模态转场动效相同。 + * bindMenu属性为组件绑定弹出式菜单,通过点击触发。 + * bindContextMenu属性为组件绑定弹出式菜单,通过长按或右键点击触发。 + * bindPopup属性可为组件绑定弹窗,并设置弹窗,交互逻辑和显示状态。 + * 使用if语句实现模态转场。模态转场接口需要绑定到其他组件上,通过监听状态变量变化调起态界面。同时,也可以通过if语句,通过新增或删除组件实现模态转场效果。 + ### 相关权限 diff --git a/ArkUIKit/Animation/entry/src/main/ets/CustomTransition/AnimationProperties.ets b/ArkUIKit/Animation/entry/src/main/ets/CustomTransition/AnimationProperties.ets new file mode 100644 index 0000000000000000000000000000000000000000..0ac5727cf6fc96e16d5053f873e49ebefcbbfa01 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/CustomTransition/AnimationProperties.ets @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start navigation_animation_properties] +// 一镜到底转场动画封装 +import { curves, UIContext } from '@kit.ArkUI'; +import { RectInfoInPx } from '../utils/ComponentAttrUtils'; +import { WindowUtils } from '../utils/WindowUtils'; +import { MyNodeController } from '../NodeContainer/CustomComponent'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const TAG: string = 'AnimationProperties'; +const DOMAIN = 0xF811; +const DEVICE_BORDER_RADIUS: number = 34; + +// 将自定义一镜到底转场动画进行封装,其他界面也需要做自定义一镜到底转场的话,可以直接复用,减少工作量 +@Observed +export class AnimationProperties { + public navDestinationBgColor: ResourceColor = Color.Transparent; + public translateX: number = 0; + public translateY: number = 0; + public scaleValue: number = 1; + public clipWidth: Dimension = 0; + public clipHeight: Dimension = 0; + public radius: number = 0; + public positionValue: number = 0; + public showDetailContent: boolean = false; + private uiContext: UIContext; + + constructor(uiContext: UIContext) { + this.uiContext = uiContext; + } + + public doAnimation(cardItemInfoPx: RectInfoInPx, isPush: boolean, isExit: boolean, + transitionProxy: NavigationTransitionProxy, extraTranslateValue: number, + prePageOnFinish: (index: MyNodeController) => void, myNodeController: MyNodeController | undefined): void { + // 首先计算卡片的宽高与窗口宽高的比例 + let widthScaleRatio = cardItemInfoPx.width / WindowUtils.windowWidthPx; + let heightScaleRatio = cardItemInfoPx.height / WindowUtils.windowHeightPx; + let isUseWidthScale = widthScaleRatio > heightScaleRatio; + let initScale: number = isUseWidthScale ? widthScaleRatio : heightScaleRatio; + + let initTranslateX: number = 0; + let initTranslateY: number = 0; + let initClipWidth: Dimension = 0; + let initClipHeight: Dimension = 0; + // 使得PageTwo卡片向上扩到状态栏 + let initPositionValue: number = -this.uiContext.px2vp(WindowUtils.topAvoidAreaHeightPx + extraTranslateValue); + + if (isUseWidthScale) { + initTranslateX = this.uiContext.px2vp(cardItemInfoPx.left - + (WindowUtils.windowWidthPx - cardItemInfoPx.width) / 2); + initClipWidth = '100%'; + initClipHeight = this.uiContext.px2vp((cardItemInfoPx.height) / initScale); + initTranslateY = this.uiContext.px2vp(cardItemInfoPx.top - ((this.uiContext.vp2px(initClipHeight) - + this.uiContext.vp2px(initClipHeight) * initScale) / 2)); + } else { + initTranslateY = this.uiContext.px2vp(cardItemInfoPx.top - + (WindowUtils.windowHeightPx - cardItemInfoPx.height) / 2); + initClipHeight = '100%'; + initClipWidth = this.uiContext.px2vp((cardItemInfoPx.width) / initScale); + initTranslateX = this.uiContext.px2vp(cardItemInfoPx.left - + (WindowUtils.windowWidthPx / 2 - cardItemInfoPx.width / 2)); + } + + // 转场动画开始前通过计算scale、translate、position和clip height & width,确定节点迁移前后位置一致 + hilog.info(DOMAIN, TAG, 'initScale: ' + initScale + ' initTranslateX ' + initTranslateX + + ' initTranslateY ' + initTranslateY + ' initClipWidth ' + initClipWidth + + ' initClipHeight ' + initClipHeight + ' initPositionValue ' + initPositionValue); + + // 转场至新页面 + if (isPush && !isExit) { + this.scaleValue = initScale; + this.translateX = initTranslateX; + this.clipWidth = initClipWidth; + this.clipHeight = initClipHeight; + this.translateY = initTranslateY; + this.positionValue = initPositionValue; + + this.uiContext?.animateTo({ + curve: curves.interpolatingSpring(0, 1, 328, 36), + onFinish: () => { + if (transitionProxy) { + transitionProxy.finishTransition(); + } + } + }, () => { + this.scaleValue = 1.0; + this.translateX = 0; + this.translateY = 0; + this.clipWidth = '100%'; + this.clipHeight = '100%'; + // 页面圆角与系统圆角一致 + this.radius = DEVICE_BORDER_RADIUS; + this.showDetailContent = true; + }) + + this.uiContext?.animateTo({ + duration: 100, + curve: Curve.Sharp, + }, () => { + // 页面由透明逐渐变为设置背景色 + this.navDestinationBgColor = '#00ffffff'; + }) + + // 返回旧页面 + } else if (!isPush && isExit) { + + this.uiContext?.animateTo({ + duration: 350, + curve: Curve.EaseInOut, + onFinish: () => { + if (transitionProxy) { + transitionProxy.finishTransition(); + } + prePageOnFinish(myNodeController); + // 自定义节点从PageTwo下树 + if (myNodeController != undefined) { + (myNodeController as MyNodeController).onRemove(); + } + } + }, () => { + this.scaleValue = initScale; + this.translateX = initTranslateX; + this.translateY = initTranslateY; + this.radius = 0; + this.clipWidth = initClipWidth; + this.clipHeight = initClipHeight; + this.showDetailContent = false; + }) + + this.uiContext?.animateTo({ + duration: 200, + delay: 150, + curve: Curve.Friction, + }, () => { + this.navDestinationBgColor = Color.Transparent; + }) + } + } +} + +// [End navigation_animation_properties] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/CustomTransition/CustomNavigationUtils.ets b/ArkUIKit/Animation/entry/src/main/ets/CustomTransition/CustomNavigationUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..4281fec4755807dac2651e1694e9f0ba51335e53 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/CustomTransition/CustomNavigationUtils.ets @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start custom_navigation_utils] +// 配置Navigation自定义转场动画 +export interface AnimateCallback { + animation: ((isPush: boolean, isExit: boolean, transitionProxy: NavigationTransitionProxy) => void | undefined) + | undefined; + timeout: (number | undefined) | undefined; +} + +const customTransitionMap: Map = new Map(); + +export class CustomTransition { + private constructor() { + }; + + static delegate = new CustomTransition(); + + static getInstance() { + return CustomTransition.delegate; + } + + // 注册页面的动画回调,name是注册页面的动画的回调 + // animationCallback是需要执行的动画内容,timeout是转场结束的超时时间 + registerNavParam( + name: number, + animationCallback: (operation: boolean, isExit: boolean, transitionProxy: NavigationTransitionProxy) => void, + timeout: number): void { + if (customTransitionMap.has(name)) { + let param = customTransitionMap.get(name); + if (param != undefined) { + param.animation = animationCallback; + param.timeout = timeout; + return; + } + } + let params: AnimateCallback = { timeout: timeout, animation: animationCallback }; + customTransitionMap.set(name, params); + } + + unRegisterNavParam(name: number): void { + customTransitionMap.delete(name); + } + + getAnimateParam(name: number): AnimateCallback { + let result: AnimateCallback = { + animation: customTransitionMap.get(name)?.animation, + timeout: customTransitionMap.get(name)?.timeout, + }; + return result; + } +} + +// [End custom_navigation_utils] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/NodeContainer/CustomComponent.ets b/ArkUIKit/Animation/entry/src/main/ets/NodeContainer/CustomComponent.ets new file mode 100644 index 0000000000000000000000000000000000000000..63a319969b75c938b349d31a293b49f5c5ec7bea --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/NodeContainer/CustomComponent.ets @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start navigation_custom_component] +// 自定义占位节点,跨容器迁移能力 +import { BuilderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +@Builder +function cardBuilder() { + // 图片使用Resource资源,需用户自定义 + Image($r('app.media.card')) + .width('100%') + .id('card') +} + +export class MyNodeController extends NodeController { + private cardNode: BuilderNode<[]> | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(cardBuilder); + private needCreate: boolean = false; + private isRemove: boolean = false; + + constructor(create: boolean) { + super(); + this.needCreate = create; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isRemove === true) { + return null; + } + if (this.needCreate && this.cardNode === null) { + this.cardNode = new BuilderNode(uiContext); + this.cardNode.build(this.wrapBuilder); + } + if (this.cardNode === null) { + return null; + } + return this.cardNode!.getFrameNode()!; + } + + getNode(): BuilderNode<[]> | null { + return this.cardNode; + } + + setNode(node: BuilderNode<[]> | null) { + this.cardNode = node; + this.rebuild(); + } + + onRemove() { + this.isRemove = true; + this.rebuild(); + this.isRemove = false; + } + + init(uiContext: UIContext) { + this.cardNode = new BuilderNode(uiContext); + this.cardNode.build(this.wrapBuilder); + } +} + +let myNode: MyNodeController | undefined; + +export const createMyNode = + (uiContext: UIContext) => { + myNode = new MyNodeController(false); + myNode.init(uiContext); + } + +export const getMyNode = (): MyNodeController | undefined => { + return myNode; +} + +// [End navigation_custom_component] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/NodeContainer/CustomComponentBindSheet.ets b/ArkUIKit/Animation/entry/src/main/ets/NodeContainer/CustomComponentBindSheet.ets new file mode 100644 index 0000000000000000000000000000000000000000..5e8b1c80f40aff3f3149d6d7ff6c276563dc56f6 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/NodeContainer/CustomComponentBindSheet.ets @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start bind_custom_component] +// 自定义占位节点,跨容器迁移能力 +import { BuilderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +@Builder +function flowerBuilder() { + // 图片使用Resource资源,需用户自定义 + Image($r('app.media.longevity_flower')) + // 避免第一次加载图片时图片闪烁 + .syncLoad(true); +} + +export class MyNodeController extends NodeController { + private flowerNode: BuilderNode<[]> | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(flowerBuilder); + private needCreate: boolean = false; + private isRemove: boolean = false; + + constructor(create: boolean) { + super(); + this.needCreate = create; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isRemove === true) { + return null; + } + if (this.needCreate && this.flowerNode === null) { + this.flowerNode = new BuilderNode(uiContext); + this.flowerNode.build(this.wrapBuilder); + } + if (this.flowerNode === null) { + return null; + } + return this.flowerNode!.getFrameNode()!; + } + + getNode(): BuilderNode<[]> | null { + return this.flowerNode; + } + + setNode(node: BuilderNode<[]> | null) { + this.flowerNode = node; + this.rebuild(); + } + + onRemove() { + this.isRemove = true; + this.rebuild(); + this.isRemove = false; + } + + init(uiContext: UIContext) { + this.flowerNode = new BuilderNode(uiContext); + this.flowerNode.build(this.wrapBuilder); + } +} + +let myNode: MyNodeController | undefined; + +export const createMyNode = + (uiContext: UIContext) => { + myNode = new MyNodeController(false); + myNode.init(uiContext); + } + +export const getMyNode = (): MyNodeController | undefined => { + return myNode; +} + +// [Start bind_custom_component] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/Animation/entry/src/main/ets/entryability/EntryAbility.ets index 081b700cacec6def24d204fbc37ab93985f7b4ec..18656e03463c2d8abff66ac37dc93738322c512f 100644 --- a/ArkUIKit/Animation/entry/src/main/ets/entryability/EntryAbility.ets +++ b/ArkUIKit/Animation/entry/src/main/ets/entryability/EntryAbility.ets @@ -12,21 +12,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start navigation_entry_ability] +// [Start bind_sheet_entry_ability] import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; import { display, uiObserver, window } from '@kit.ArkUI'; +import { WindowUtils } from '../utils/WindowUtils'; +// [StartExclude navigation_entry_ability] +// [StartExclude bind_sheet_entry_ability] const DOMAIN = 0x0000; +// [EndExclude bind_sheet_entry_ability] +// [EndExclude navigation_entry_ability] +const TAG: string = 'EntryAbility'; +// [StartExclude navigation_entry_ability] +// [StartExclude bind_sheet_entry_ability] function callBackFunc(info: uiObserver.NavDestinationSwitchInfo) { - console.info(`testTag navDestinationSwitch from: ${JSON.stringify(info.from)} to: ${JSON.stringify(info.to)}`) + console.info(`testTag navDestinationSwitch from: ${JSON.stringify(info.from)} to: ${JSON.stringify(info.to)}`); } function callBackFunc2(info: uiObserver.NavDestinationSwitchInfo) { - console.info(`testTag2 navDestinationSwitch from: ${JSON.stringify(info.from)} to: ${JSON.stringify(info.to)}`) + console.info(`testTag2 navDestinationSwitch from: ${JSON.stringify(info.from)} to: ${JSON.stringify(info.to)}`); } +// [EndExclude bind_sheet_entry_ability] + export default class EntryAbility extends UIAbility { + private currentBreakPoint: string = ''; + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); @@ -44,6 +58,7 @@ export default class EntryAbility extends UIAbility { }, callBackFunc); } + // [Start window_stage] onWindowStageCreate(windowStage: window.WindowStage): void { // Main window is created, set main page for this ability hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); @@ -76,8 +91,82 @@ export default class EntryAbility extends UIAbility { } hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); }); + // [EndExclude navigation_entry_ability] + // [StartExclude window_stage] + // 获取窗口宽高 + WindowUtils.window = windowStage.getMainWindowSync(); + WindowUtils.windowWidthPx = WindowUtils.window.getWindowProperties().windowRect.width; + WindowUtils.windowHeightPx = WindowUtils.window.getWindowProperties().windowRect.height; + + this.updateBreakpoint(WindowUtils.windowWidthPx); + + // 获取上方避让区(状态栏等)高度 + let avoidArea = WindowUtils.window.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM); + WindowUtils.topAvoidAreaHeightPx = avoidArea.topRect.height; + + // 获取导航条高度 + let navigationArea = WindowUtils.window.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR); + WindowUtils.navigationIndicatorHeightPx = navigationArea.bottomRect.height; + + hilog.info(0x0000, TAG, 'the width is ' + WindowUtils.windowWidthPx + ' ' + WindowUtils.windowHeightPx + ' ' + + WindowUtils.topAvoidAreaHeightPx + ' ' + WindowUtils.navigationIndicatorHeightPx); + + // 监听窗口尺寸、状态栏高度及导航条高度的变化并更新 + try { + WindowUtils.window.on('windowSizeChange', (data) => { + hilog.info(0x0000, TAG, 'on windowSizeChange, the width is ' + data.width + ', the height is ' + data.height); + WindowUtils.windowWidthPx = data.width; + WindowUtils.windowHeightPx = data.height; + this.updateBreakpoint(data.width); + AppStorage.setOrCreate('windowSizeChanged', Date.now()); + }) + + WindowUtils.window.on('avoidAreaChange', (data) => { + if (data.type === window.AvoidAreaType.TYPE_SYSTEM) { + let topRectHeight = data.area.topRect.height; + hilog.info(0x0000, TAG, 'on avoidAreaChange, the top avoid area height is ' + topRectHeight); + WindowUtils.topAvoidAreaHeightPx = topRectHeight; + } else if (data.type === window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR) { + let bottomRectHeight = data.area.bottomRect.height; + hilog.info(0x0000, TAG, 'on avoidAreaChange, the navigation indicator height is ' + bottomRectHeight); + WindowUtils.navigationIndicatorHeightPx = bottomRectHeight; + } + }) + } catch (exception) { + hilog.error(0x0000, TAG, `register failed. code: ${exception.code}, message: ${exception.message}`); + } + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); } + updateBreakpoint(width: number) { + let windowWidthVp = width / (display.getDefaultDisplaySync().densityDPI / 160); + let newBreakPoint: string = ''; + if (windowWidthVp < 400) { + newBreakPoint = 'xs'; + } else if (windowWidthVp < 600) { + newBreakPoint = 'sm'; + } else if (windowWidthVp < 800) { + newBreakPoint = 'md'; + } else { + newBreakPoint = 'lg'; + } + if (this.currentBreakPoint !== newBreakPoint) { + this.currentBreakPoint = newBreakPoint; + // 使用状态变量记录当前断点值 + AppStorage.setOrCreate('currentBreakpoint', this.currentBreakPoint); + } + // [EndExclude window_stage] + } + + // [End window_stage] + onWindowStageDestroy(): void { // Main window is destroyed, release UI related resources hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); @@ -92,4 +181,7 @@ export default class EntryAbility extends UIAbility { // Ability has back to background hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); } -} \ No newline at end of file +} + +// [End bind_sheet_entry_ability] +// [End navigation_entry_ability] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/Index.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/Index.ets index 1cb9c86c23bf7ab7c18c9e9a727f7b75e2be2af5..df7b7c29f6a66cd866456d1565e451c291a12702 100644 --- a/ArkUIKit/Animation/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/Index.ets @@ -16,6 +16,7 @@ import curves from '@ohos.curves'; import { Route, RouteGroup } from './common/Index'; import { KeyboardAvoidMode } from '@kit.ArkUI'; import router from '@ohos.router'; +import { common } from '@kit.AbilityKit'; @Styles function cardPressedStyle() { @@ -42,6 +43,7 @@ function cardDisabledStyle() { @Entry @Component struct AnimateIndex { + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; @Provide('router') router: NavPathStack = new NavPathStack(); @State routes: RouteGroup[] = [ { @@ -54,160 +56,174 @@ struct AnimateIndex { { name: 'template2/Index', label: $r('app.string.animate_to_temp_label2') }, { name: 'template3/Index', label: $r('app.string.animate_to_temp_label3') } ] - }, - { - name: "animation", - // $r('app.string.animation_label')需要替换为开发者所需的资源文件 - label: $r('app.string.animation_label'), - children: [ - // $r('app.string.temp1')需要替换为开发者所需的资源文件 - { name: 'template1/Index', label: $r('app.string.temp1') }, - { name: 'template2/Index', label: $r('app.string.animation_temp_label2') }, - { name: 'template3/Index', label: $r('app.string.animation_temp_label3') }, - { name: 'template4/Index', label: $r('app.string.animation_temp_label4') } - ] - }, - { - name: "animationBlur", - label: $r("app.string.animation_blur_label"), - children: [ - { name: 'template1/BlurEffectsExample', label: $r("app.string.animation_blur_label1") }, - { name: 'template2/Index', label: $r("app.string.animation_blur_label2") }, - { name: 'template3/BackDropBlurStyleDemo', label: $r("app.string.animation_blur_label3") }, - { name: 'template4/ForegroundBlurStyleDemo', label: $r("app.string.animation_blur_label4") }, - { name: 'template5/MotionBlurTest', label: $r("app.string.animation_blur_label5") } - ] - }, - { - name: "cohesion", - // $r('app.string.cohesion_label')需要替换为开发者所需的资源文件 - label: $r('app.string.cohesion_label'), - children: [ - // $r('app.string.cohesion_temp_label1')需要替换为开发者所需的资源文件 - { name: 'template1/Index', label: $r('app.string.cohesion_temp_label1') }, - { name: 'template2/Index', label: $r('app.string.cohesion_temp_label2') } - ] - }, - { - name: "keyframeAnimateTo", - // $r('app.string.keyframeAnimateTo_label')需要替换为开发者所需的资源文件 - label: $r('app.string.keyframeAnimateTo_label'), - children: [ - // $r('app.string.temp1') 需要替换为开发者所需的资源文件 - { name: 'template1/Index', label: $r('app.string.temp1') } - ] - }, - { - name: "pageTransition", - // $r('app.string.pageTransition_label')需要替换为开发者所需的资源文件 - label: $r('app.string.pageTransition_label'), - children: [ - // $r('app.string.pageTransition_temp_label1')需要替换为开发者所需的资源文件 - { name: 'template1/Index', label: $r('app.string.pageTransition_temp_label1') }, - { name: 'template2/Index', label: $r('app.string.pageTransition_temp_label2') }, - { name: 'template3/pageTransitionSrc1', label: $r('app.string.pageTransition_temp_label3') }, - { name: 'template4/pageTransitionSrc2', label: $r('app.string.pageTransition_temp_label4') }, - { name: 'template5/PageTransitionSrc3', label: $r("app.string.pageTransition_temp_label5") }, - { name: 'template6/PageTransitionSrc4', label: $r("app.string.pageTransition_temp_label6") } - ] - }, - { - name: "compTransition", - // $r('app.string.compTransition_label')需要替换为开发者所需的资源文件 - label: $r('app.string.compTransition_label'), - children: [ - // $r('app.string.compTransition_temp_label1')需要替换为开发者所需的资源文件 - { name: 'template1/Index', label: $r('app.string.compTransition_temp_label1') }, - { name: 'template2/Index', label: $r('app.string.compTransition_temp_label2') }, - { name: 'template3/Index', label: $r('app.string.compTransition_temp_label3') }, - { name: 'template4/Index', label: $r('app.string.compTransition_temp_label4') }, - { name: 'template5/Index', label: $r('app.string.compTransition_temp_label5') }, - { name: 'template6/Index', label: $r('app.string.compTransition_temp_label6') } - ] - }, - { - name: "shareTransition", - // $r('app.string.shareTransition_label')需要替换为开发者所需的资源文件 - label: $r('app.string.shareTransition_label'), - children: [ - // $r('app.string.temp1') 需要替换为开发者所需的资源文件 - { name: 'template1/Index', label: $r('app.string.temp1') } - ] - }, - { - name: "motionPath", - // $r('app.string.motionPath_label')需要替换为开发者所需的资源文件 - label: $r('app.string.motionPath_label'), - children: [ - // $r('app.string.temp1')需要替换为开发者所需的资源文件 - { name: 'template1/Index', label: $r('app.string.temp1') } - ] - }, - { - name: "particle", - // $r('app.string.particle_label')需要替换为开发者所需的资源文件 - label: $r('app.string.particle_label'), - children: [ - // $r('app.string.particle_temp_label1')需要替换为开发者所需的资源文件 - { name: 'template1/Index', label: $r('app.string.particle_temp_label1') }, - { name: 'template2/Index', label: $r('app.string.particle_temp_label2') }, - { name: 'template3/Index', label: $r('app.string.particle_temp_label3') }, - { name: 'template4/Index', label: $r('app.string.particle_temp_label4') }, - { name: 'template5/Index', label: $r('app.string.particle_temp_label5') }, - { name: 'template6/Index', label: $r('app.string.particle_temp_label6') } - ] - }, - { - name: "animator", - // $r('app.string.animator_label')需要替换为开发者所需的资源文件 - label: $r('app.string.animator_label'), - children: [ - // $r('app.string.animator_temp_label1')需要替换为开发者所需的资源文件 - { name: 'template1/Index', label: $r("app.string.animator_temp_label1") }, - { name: 'template2/Index', label: $r("app.string.animator_temp_label2") }, - { name: 'template3/Index', label: $r("app.string.animator_temp_label3") }, - { name: 'template4/Index', label: $r("app.string.animator_temp_label4") } - ] - }, - { - name: "animateToImmediately", - // $r('app.string.animateToImmediately_label')需要替换为开发者所需的资源文件 - label: $r('app.string.animateToImmediately_label'), - children: [ - // $r('app.string.temp1')需要替换为开发者所需的资源文件 - { name: 'template1/Index', label: $r('app.string.temp1') } - ] - }, - { - name: "rotation", - // $r('app.string.rotation_label')需要替换为开发者所需的资源文件 - label: $r('app.string.rotation_label'), - children: [ - // $r('app.string.rotation_temp_label1')需要替换为开发者所需的资源文件 - { name: 'template1/Index', label: $r('app.string.rotation_temp_label1') }, - { name: 'template2/Index', label: $r('app.string.rotation_temp_label2') } - ] - }, - { - name: "animatableProperty", - // $r("app.string.animatableProperty_label")需要替换为开发者所需的资源文件 - label: $r("app.string.animatableProperty_label"), - children: [ - // $r("app.string.component_temp_label1")需要替换为开发者所需的资源文件 - { name: 'template1/Index', label: $r("app.string.animatableProperty_temp_label1") }, - { name: 'template2/Index', label: $r("app.string.animatableProperty_temp_label2") }, + },{ + name: "animation", + // $r('app.string.animation_label')需要替换为开发者所需的资源文件 + label: $r('app.string.animation_label'), + children:[ + // $r('app.string.temp1')需要替换为开发者所需的资源文件 + { name: 'template1/Index', label: $r('app.string.temp1') }, + { name: 'template2/Index', label: $r('app.string.animation_temp_label2') }, + { name: 'template3/Index', label: $r('app.string.animation_temp_label3') }, + { name: 'template4/Index', label: $r('app.string.animation_temp_label4') } + ] + }, { + name: "animationBlur", + label: $r("app.string.animation_blur_label"), + children:[ + { name: 'template1/BlurEffectsExample', label: $r("app.string.animation_blur_label1") }, + { name: 'template2/Index', label: $r("app.string.animation_blur_label2") }, + { name: 'template3/BackDropBlurStyleDemo', label: $r("app.string.animation_blur_label3") }, + { name: 'template4/ForegroundBlurStyleDemo', label: $r("app.string.animation_blur_label4") }, + { name: 'template5/MotionBlurTest', label: $r("app.string.animation_blur_label5") } + ] + }, { + name: "cohesion", + // $r('app.string.cohesion_label')需要替换为开发者所需的资源文件 + label: $r('app.string.cohesion_label'), + children:[ + // $r('app.string.cohesion_temp_label1')需要替换为开发者所需的资源文件 + { name: 'template1/Index', label: $r('app.string.cohesion_temp_label1') }, + { name: 'template2/Index', label: $r('app.string.cohesion_temp_label2') } + ] + }, { + name: "keyframeAnimateTo", + // $r('app.string.keyframeAnimateTo_label')需要替换为开发者所需的资源文件 + label: $r('app.string.keyframeAnimateTo_label'), + children:[ + // $r('app.string.temp1') 需要替换为开发者所需的资源文件 + { name: 'template1/Index', label: $r('app.string.temp1') } + ] + }, { + name: "pageTransition", + // $r('app.string.pageTransition_label')需要替换为开发者所需的资源文件 + label: $r('app.string.pageTransition_label'), + children:[ + // $r('app.string.pageTransition_temp_label1')需要替换为开发者所需的资源文件 + { name: 'template1/Index', label: $r('app.string.pageTransition_temp_label1') }, + { name: 'template2/Index', label: $r('app.string.pageTransition_temp_label2') }, + { name: 'template3/pageTransitionSrc1', label: $r('app.string.pageTransition_temp_label3') }, + { name: 'template4/pageTransitionSrc2', label: $r('app.string.pageTransition_temp_label4') }, + { name: 'template5/PageTransitionSrc3', label: $r("app.string.pageTransition_temp_label5") }, + { name: 'template6/PageTransitionSrc4', label: $r("app.string.pageTransition_temp_label6") } + ] + }, { + name: "compTransition", + // $r('app.string.compTransition_label')需要替换为开发者所需的资源文件 + label: $r('app.string.compTransition_label'), + children:[ + // $r('app.string.compTransition_temp_label1')需要替换为开发者所需的资源文件 + { name: 'template1/Index', label: $r('app.string.compTransition_temp_label1') }, + { name: 'template2/Index', label: $r('app.string.compTransition_temp_label2') }, + { name: 'template3/Index', label: $r('app.string.compTransition_temp_label3') }, + { name: 'template4/Index', label: $r('app.string.compTransition_temp_label4') }, + { name: 'template5/Index', label: $r('app.string.compTransition_temp_label5') }, + { name: 'template6/Index', label: $r('app.string.compTransition_temp_label6') } + ] + }, { + name: "shareTransition", + // $r('app.string.shareTransition_label')需要替换为开发者所需的资源文件 + label: $r('app.string.shareTransition_label'), + children:[ + { name: 'template1/Index', label: $r("app.string.shareTransition_label1") }, + { name: 'template2/Index', label: $r("app.string.shareTransition_label2") }, + { name: 'template3/Index', label: $r("app.string.shareTransition_label3") }, + { name: 'template4/Index', label: $r("app.string.shareTransition_label4") }, + { name: 'template5/Index', label: $r("app.string.shareTransition_label5") }, + { name: 'template6/IfElseGeometryTransition', label: $r("app.string.shareTransition_label6") }, + { name: 'template7/Index', label: $r("app.string.shareTransition_label7") } + ] + }, { + name: "motionPath", + // $r('app.string.motionPath_label')需要替换为开发者所需的资源文件 + label: $r('app.string.motionPath_label'), + children:[ + // $r('app.string.temp1')需要替换为开发者所需的资源文件 + { name: 'template1/Index', label: $r('app.string.temp1') } + ] + }, { + name: "particle", + // $r('app.string.particle_label')需要替换为开发者所需的资源文件 + label: $r('app.string.particle_label'), + children:[ + // $r('app.string.particle_temp_label1')需要替换为开发者所需的资源文件 + { name: 'template1/Index', label: $r('app.string.particle_temp_label1') }, + { name: 'template2/Index', label: $r('app.string.particle_temp_label2') }, + { name: 'template3/Index', label: $r('app.string.particle_temp_label3') }, + { name: 'template4/Index', label: $r('app.string.particle_temp_label4') }, + { name: 'template5/Index', label: $r('app.string.particle_temp_label5') }, + { name: 'template6/Index', label: $r('app.string.particle_temp_label6') } + ] + }, { + name: "animator", + // $r('app.string.animator_label')需要替换为开发者所需的资源文件 + label: $r('app.string.animator_label'), + children:[ + // $r('app.string.animator_temp_label1')需要替换为开发者所需的资源文件 + { name: 'template1/Index', label: $r("app.string.animator_temp_label1") }, + { name: 'template2/Index', label: $r("app.string.animator_temp_label2") }, + { name: 'template3/Index', label: $r("app.string.animator_temp_label3") }, + { name: 'template4/Index', label: $r("app.string.animator_temp_label4") } + ] + }, { + name: "animateToImmediately", + // $r('app.string.animateToImmediately_label')需要替换为开发者所需的资源文件 + label: $r('app.string.animateToImmediately_label'), + children:[ + // $r('app.string.temp1')需要替换为开发者所需的资源文件 + { name: 'template1/Index', label: $r('app.string.temp1') } + ] + }, { + name: "rotation", + // $r('app.string.rotation_label')需要替换为开发者所需的资源文件 + label: $r('app.string.rotation_label'), + children:[ + // $r('app.string.rotation_temp_label1')需要替换为开发者所需的资源文件 + { name: 'template1/Index', label: $r('app.string.rotation_temp_label1') }, + { name: 'template2/Index', label: $r('app.string.rotation_temp_label2') } + ] + }, { + name: "animatableProperty", + // $r("app.string.animatableProperty_label")需要替换为开发者所需的资源文件 + label: $r("app.string.animatableProperty_label"), + children:[ + // $r("app.string.component_temp_label1")需要替换为开发者所需的资源文件 + { name: 'template1/Index', label: $r("app.string.animatableProperty_temp_label1") }, + { name: 'template2/Index', label: $r("app.string.animatableProperty_temp_label2") }, ] - }, - { - name: "component", - // $r('app.string.component_label')需要替换为开发者所需的资源文件 - label: $r('app.string.component_label'), - children: [ - // $r('app.string.component_temp_label1')需要替换为开发者所需的资源文件 - { name: 'template1/Index', label: $r('app.string.component_temp_label1') }, - { name: 'template2/Index', label: $r('app.string.component_temp_label2') }, - ] - } + }, { + name: "component", + // $r('app.string.component_label')需要替换为开发者所需的资源文件 + label: $r('app.string.component_label'), + children:[ + // $r('app.string.component_temp_label1')需要替换为开发者所需的资源文件 + { name: 'template1/Index', label: $r('app.string.component_temp_label1') }, + { name: 'template2/Index', label: $r('app.string.component_temp_label2') }, + ] + }, { + name: "traditionalCurve", + label: $r("app.string.traditionalCurve_label"), + children:[ + { name: 'template1/CurveDemo', label: $r("app.string.temp1") } + ] + }, { + name: "springCurve", + label: $r("app.string.springCurve_label"), + children:[ + { name: 'template1/SpringCurve', label: $r("app.string.temp1") } + ] + }, { + name: "modalTransition", + label: $r("app.string.modal_transition_label"), + children:[ + { name: 'template1/BindContentCoverDemo', label: $r("app.string.modal_transition_label1") }, + { name: 'template2/BindSheetDemo', label: $r("app.string.modal_transition_label2") }, + { name: 'template3/BindMenuDemo', label: $r("app.string.modal_transition_label3") }, + { name: 'template4/BindContextMenuDemo', label: $r("app.string.modal_transition_label4") }, + { name: 'template5/BindPopupDemo', label: $r("app.string.modal_transition_label5") }, + { name: 'template6/ModalTransitionWithIf', label: $r("app.string.modal_transition_label6") } + ] + } ]; @State selection: string | null = null; @@ -228,7 +244,7 @@ struct AnimateIndex { // $r('sys.media.ohos_ic_public_arrow_right')需要替换为开发者所需的资源文件 Image($r('sys.media.ohos_ic_public_arrow_right')) - // $r('sys.color.ohos_id_color_fourth')需要替换为开发者所需的资源文件 + // $r('sys.color.ohos_id_color_fourth')需要替换为开发者所需的资源文件 .fillColor($r('sys.color.ohos_id_color_fourth')) .height(24) .width(24) @@ -258,10 +274,9 @@ struct AnimateIndex { }) } - aboutToAppear(): void { + aboutToAppear(): void{ this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); } - build() { Column() { // $r('app.string.AnimateIndex')需要替换为开发者所需的资源文件 @@ -280,7 +295,7 @@ struct AnimateIndex { Blank() // $r('sys.media.ohos_ic_public_arrow_right')需要替换为开发者所需的资源文件 Image($r('sys.media.ohos_ic_public_arrow_right')) - // $r('sys.color.ohos_id_color_fourth')需要替换为开发者所需的资源文件 + // $r('sys.color.ohos_id_color_fourth')需要替换为开发者所需的资源文件 .fillColor($r('sys.color.ohos_id_color_fourth')) .height(24) .width(24) @@ -300,7 +315,7 @@ struct AnimateIndex { .width('100%') .onClick(() => { const name = `pages/${routeGroup.name}/${route.name}`; - this.getUIContext().getRouter().pushUrl({ url: name }); + this.getUIContext().getRouter().pushUrl({url:name}); }) } .width('100%') @@ -310,7 +325,7 @@ struct AnimateIndex { .padding(2) .divider({ strokeWidth: 0.5 }) }) - }.padding({ bottom: 10 }) + }.padding({bottom: 10}) } } } \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/component/template1/Index.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/component/template1/Index.ets index 6d6b1da2e4dca9e59742855e0303dbf5cae4fe64..14e0e813ff2b883773590a03cc6120cc4dcde6d6 100644 --- a/ArkUIKit/Animation/entry/src/main/ets/pages/component/template1/Index.ets +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/component/template1/Index.ets @@ -12,6 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +// [Start Component_Scroll] import { curves, window, display, mediaquery, UIContext } from '@kit.ArkUI'; import { UIAbility } from '@kit.AbilityKit'; @@ -308,4 +310,5 @@ export struct TaskSwitchMainPage { .width('100%') .height('100%'); } -} \ No newline at end of file +} +// [End Component_Scroll] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/component/template2/Index.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/component/template2/Index.ets index bc4620e0e518820a85efc8532861ff8de3010ccd..1685c82cb93cbdf657414ac9630329dc29e03c83 100644 --- a/ArkUIKit/Animation/entry/src/main/ets/pages/component/template2/Index.ets +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/component/template2/Index.ets @@ -12,6 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +// [Start Component_List] import { curves, AnimatorResult } from '@kit.ArkUI'; // 该接口控制列表项视觉属性 @@ -174,4 +176,5 @@ struct ListAutoSortExample { } }.backgroundColor(0xDCDCDC); // 0xDCDCDC: 浅灰色背景 } -} \ No newline at end of file +} +// [End Component_List] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template1/BindContentCoverDemo.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template1/BindContentCoverDemo.ets new file mode 100644 index 0000000000000000000000000000000000000000..42b218004bb729d527259bc9251344721bcd9c99 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template1/BindContentCoverDemo.ets @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2025 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 { common } from '@kit.AbilityKit'; + +// [Start bind_content_cover] +import { curves } from '@kit.ArkUI'; + +interface PersonList { + name: string, + cardNum: string +} + +@Entry +@Component +struct BindContentCoverDemo { + // [StartExclude bind_content_cover] + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + // [EndExclude bind_content_cover] + private personList: Array = [ + { name: this.context.resourceManager.getStringByNameSync('modal_transition_text1'), cardNum: '1234***********789' }, + { name: this.context.resourceManager.getStringByNameSync('modal_transition_text2'), cardNum: '2345***********789' }, + { name: this.context.resourceManager.getStringByNameSync('modal_transition_text3'), cardNum: '3456***********789' }, + { name: this.context.resourceManager.getStringByNameSync('modal_transition_text4'), cardNum: '4567***********789' } + ]; + // 第一步:定义全屏模态转场效果bindContentCover + // 模态转场控制变量 + @State isPresent: boolean = false; + + // 第二步:定义模态展示界面 + // 通过@Builder构建模态展示界面 + @Builder + MyBuilder() { + Column() { + Row() { + Text(this.context.resourceManager.getStringByNameSync('modal_transition_text5')) + .fontSize(20) + .fontColor(Color.White) + .width('100%') + .textAlign(TextAlign.Center) + .padding({ top: 30, bottom: 15 }) + } + .backgroundColor(0x007dfe) + + Row() { + Text(this.context.resourceManager.getStringByNameSync('modal_transition_text6')) + .fontSize(16) + .fontColor(0x333333) + .margin({ top: 10 }) + .padding({ top: 20, bottom: 20 }) + .width('92%') + .borderRadius(10) + .textAlign(TextAlign.Center) + .backgroundColor(Color.White) + } + + Column() { + ForEach(this.personList, (item: PersonList, index: number) => { + Row() { + Column() { + if (index % 2 === 0) { + Column() + .width(20) + .height(20) + .border({ width: 1, color: 0x007dfe }) + .backgroundColor(0x007dfe) + } else { + Column() + .width(20) + .height(20) + .border({ width: 1, color: 0x007dfe }) + } + } + .width('20%') + + Column() { + Text(item.name) + .fontColor(0x333333) + .fontSize(18) + Text(item.cardNum) + .fontColor(0x666666) + .fontSize(14) + } + .width('60%') + .alignItems(HorizontalAlign.Start) + + Column() { + Text(this.context.resourceManager.getStringByNameSync('modal_transition_text7')) + .fontColor(0x007dfe) + .fontSize(16) + } + .width('20%') + } + .padding({ top: 10, bottom: 10 }) + .border({ width: { bottom: 1 }, color: 0xf1f1f1 }) + .width('92%') + .backgroundColor(Color.White) + }) + } + .padding({ top: 20, bottom: 20 }) + + Text(this.context.resourceManager.getStringByNameSync('modal_transition_text8')) + .width('90%') + .height(40) + .textAlign(TextAlign.Center) + .borderRadius(10) + .fontColor(Color.White) + .backgroundColor(0x007dfe) + .onClick(() => { + this.isPresent = !this.isPresent; + }) + } + .size({ width: '100%', height: '100%' }) + .backgroundColor(0xf5f5f5) + // 通过转场动画实现出现消失转场动画效果 + .transition(TransitionEffect.translate({ y: 1000 }).animation({ curve: curves.springMotion(0.6, 0.8) })) + } + + build() { + Column() { + Row() { + Text(this.context.resourceManager.getStringByNameSync('modal_transition_text9')) + .fontSize(20) + .fontColor(Color.White) + .width('100%') + .textAlign(TextAlign.Center) + .padding({ top: 30, bottom: 60 }) + } + .backgroundColor(0x007dfe) + + Column() { + Row() { + Column() { + Text('00:25'); + Text(this.context.resourceManager.getStringByNameSync('modal_transition_text10')); + } + .width('30%'); + + Column() { + Text('G1234'); + Text(this.context.resourceManager.getStringByNameSync('modal_transition_text11')); + } + .width('30%'); + + Column() { + Text('08:26'); + Text(this.context.resourceManager.getStringByNameSync('modal_transition_text12')); + } + .width('30%'); + } + } + .width('92%') + .padding(15) + .margin({ top: -30 }) + .backgroundColor(Color.White) + .shadow({ radius: 30, color: '#aaaaaa' }) + .borderRadius(10) + + Column() { + Text(this.context.resourceManager.getStringByNameSync('modal_transition_text13')) + .fontSize(18) + .fontColor(Color.Orange) + .fontWeight(FontWeight.Bold) + .padding({ top: 10, bottom: 10 }) + .width('60%') + .textAlign(TextAlign.Center) + // 通过选定的模态接口,绑定模态展示界面,ModalTransition是内置的ContentCover转场动画类型, + // 这里选择DEFAULT代表设置上下切换动画效果,通过onDisappear控制状态变量变换。 + .borderRadius(15) + .bindContentCover(this.isPresent, this.MyBuilder(), { + modalTransition: ModalTransition.DEFAULT, + onDisappear: () => { + if (this.isPresent) { + this.isPresent = !this.isPresent; + } + } + }) + .onClick(() => { + // 第三步:通过模态接口调起模态展示界面,通过转场动画或者共享元素动画去实现对应的动画效果 + // 改变状态变量,显示模态界面 + this.isPresent = !this.isPresent; + }) + } + .padding({ top: 60 }); + } + } +} +// [End bind_content_cover] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template2/BindSheetDemo.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template2/BindSheetDemo.ets new file mode 100644 index 0000000000000000000000000000000000000000..e4ab063a14431d9ab98d6690a4e4d7f6940a4216 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template2/BindSheetDemo.ets @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2025 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 { common } from '@kit.AbilityKit'; + +// [Start bind_sheet_demo] +@Entry +@Component +struct BindSheetDemo { + // [StartExclude bind_sheet_demo] + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + // [EndExclude bind_sheet_demo] + // 半模态转场显示隐藏控制 + @State isShowSheet: boolean = false; + private menuList: string[] = [this.context.resourceManager.getStringByNameSync('modal_transition_text14'), + this.context.resourceManager.getStringByNameSync('modal_transition_text15'), + this.context.resourceManager.getStringByNameSync('modal_transition_text16'), + this.context.resourceManager.getStringByNameSync('modal_transition_text17'), + this.context.resourceManager.getStringByNameSync('modal_transition_text18'), + this.context.resourceManager.getStringByNameSync('modal_transition_text19'), + this.context.resourceManager.getStringByNameSync('modal_transition_text20')]; + + // 通过@Builder构建半模态展示界面 + @Builder + mySheet() { + Column() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(this.menuList, (item: string) => { + Text(item) + .fontSize(16) + .fontColor(0x333333) + .backgroundColor(0xf1f1f1) + .borderRadius(8) + .margin(10) + .padding(10) + }) + } + .padding({ top: 18 }) + } + .width('100%') + .height('100%') + .backgroundColor(Color.White) + } + + build() { + Column() { + Text(this.context.resourceManager.getStringByNameSync('modal_transition_text21')) + .fontSize(28) + .padding({ top: 30, bottom: 30 }) + Column() { + Row() { + Row() + .width(10) + .height(10) + .backgroundColor('#a8a8a8') + .margin({ right: 12 }) + .borderRadius(20) + + Column() { + Text(this.context.resourceManager.getStringByNameSync('modal_transition_text22')) + .fontSize(16) + .fontWeight(FontWeight.Medium) + } + .alignItems(HorizontalAlign.Start) + + Blank(); + + Row() + .width(12) + .height(12) + .margin({ right: 15 }) + .border({ + width: { top: 2, right: 2 }, + color: 0xcccccc + }) + .rotate({ angle: 45 }) + } + .borderRadius(15) + .shadow({ radius: 100, color: '#ededed' }) + .width('90%') + .alignItems(VerticalAlign.Center) + .padding({ left: 15, top: 15, bottom: 15 }) + .backgroundColor(Color.White) + // 通过选定的半模态接口,绑定模态展示界面,style中包含两个参数,一个是设置半模态的高度,不设置时默认高度是Large, + // 一个是是否显示控制条DragBar,默认是true显示控制条,通过onDisappear控制状态变量变换。 + .bindSheet(this.isShowSheet, this.mySheet(), { + height: 300, + dragBar: false, + onDisappear: () => { + this.isShowSheet = !this.isShowSheet; + } + }) + .onClick(() => { + this.isShowSheet = !this.isShowSheet; + }) + } + .width('100%') + } + .width('100%') + .height('100%') + .backgroundColor(0xf1f1f1) + } +} + +// [End bind_sheet_demo] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template3/BindMenuDemo.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template3/BindMenuDemo.ets new file mode 100644 index 0000000000000000000000000000000000000000..5c4f5df6e82679089df3b6d4fd150a3970007657 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template3/BindMenuDemo.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2025 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 { common } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const DOMAIN = 0xF811; +const TAG = '[Sample_Animation]'; + +// [Start bind_menu_demo] +class BMD { + public value: ResourceStr = ''; + public action: () => void = () => { + }; +} + +@Entry +@Component +struct BindMenuDemo { + // [StartExclude bind_menu_demo] + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + // [EndExclude bind_menu_demo] + + // 第一步: 定义一组数据用来表示菜单按钮项 + @State items: BMD[] = [ + { + value: this.context.resourceManager.getStringByNameSync('modal_transition_text23'), + action: () => { + hilog.info(DOMAIN, TAG, 'handle Menu1 select'); + } + }, + { + value: this.context.resourceManager.getStringByNameSync('modal_transition_text24'), + action: () => { + hilog.info(DOMAIN, TAG, 'handle Menu2 select'); + } + }, + ] + + build() { + Column() { + Button('click') + .backgroundColor(0x409eff) + .borderRadius(5) + // 第二步: 通过bindMenu接口将菜单数据绑定给元素 + .bindMenu(this.items) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height(437) + } +} + +// [End bind_menu_demo] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template4/BindContextMenuDemo.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template4/BindContextMenuDemo.ets new file mode 100644 index 0000000000000000000000000000000000000000..894718990e9e84380730614a116feacb4205dff0 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template4/BindContextMenuDemo.ets @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2025 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 { common } from '@kit.AbilityKit'; + +// [Start bind_context_menu_demo] +@Entry +@Component +struct BindContextMenuDemo { + // [StartExclude bind_context_menu_demo] + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + // [EndExclude bind_context_menu_demo] + private menu: string[] = [this.context.resourceManager.getStringByNameSync('modal_transition_text25'), + this.context.resourceManager.getStringByNameSync('modal_transition_text26'), + this.context.resourceManager.getStringByNameSync('modal_transition_text27')]; + // $r('app.media.xxx')需要替换为开发者所需的图像资源文件。 + private pics: Resource[] = [$r('app.media.icon_1'), $r('app.media.icon_2')]; + + // 通过@Builder构建自定义菜单项 + @Builder + myMenu() { + Column() { + ForEach(this.menu, (item: string) => { + Row() { + Text(item) + .fontSize(18) + .width('100%') + .textAlign(TextAlign.Center) + } + .padding(15) + .border({ width: { bottom: 1 }, color: 0xcccccc }) + }) + } + .width(140) + .borderRadius(15) + .shadow({ radius: 15, color: 0xf1f1f1 }) + .backgroundColor(0xf1f1f1) + } + + build() { + Column() { + Row() { + Text(this.context.resourceManager.getStringByNameSync('modal_transition_text28')) + .fontSize(20) + .fontColor(Color.White) + .width('100%') + .textAlign(TextAlign.Center) + .padding({ top: 20, bottom: 20 }) + } + .backgroundColor(0x007dfe) + + Column() { + ForEach(this.pics, (item: Resource) => { + Row() { + Image(item) + .width('100%') + .draggable(false) + } + .padding({ + top: 20, + bottom: 20, + left: 10, + right: 10 + }) + .bindContextMenu(this.myMenu, ResponseType.LongPress) + }) + } + } + .width('100%') + .alignItems(HorizontalAlign.Center) + } +} + +// [End bind_context_menu_demo] \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsResolvedWith.js b/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template5/BindPopupDemo.ets similarity index 31% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsResolvedWith.js rename to ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template5/BindPopupDemo.ets index c6f0ef68fde5b04a589a9fa3c6e2ab2b39acf4d3..a565e2ba49c9a84d7ae2e50d877159c8e2b32e24 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsResolvedWith.js +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template5/BindPopupDemo.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -13,43 +13,57 @@ * limitations under the License. */ -import isPromiseLike from './isPromiseLike'; +// [Start bind_popup_demo] +@Entry +@Component +struct BindPopupDemo { + // 第一步:定义变量控制弹窗显示 + @State customPopup: boolean = false; -function assertPromiseIsResolvedWith(actualPromise, expectedValue) { - if (!isPromiseLike(actualPromise)) { - return Promise.reject().then(function () { - }, function () { - return {pass: false, message: 'Expected not be called on a promise.'}; - }); + // 第二步:popup构造器定义弹框内容 + @Builder + popupBuilder() { + Column({ space: 2 }) { + Row().width(64) + .height(64) + .backgroundColor(0x409eff) + Text('Popup') + .fontSize(10) + .fontColor(Color.White) } + .justifyContent(FlexAlign.SpaceAround) + .width(100) + .height(100) + .padding(5) + } - function tips(passed) { - return ( - 'Expected a promise ' + (passed ? 'not ' : '') + - 'to be resolved with ' + JSON.stringify(expectedValue[0])); - } + build() { + Column() { - return actualPromise.then( - function (got) { - if (JSON.stringify(got) == JSON.stringify(expectedValue[0])) { - return { - pass: true, - message: 'actualValue was resolved with ' + JSON.stringify(got) + '.' - }; + Button('click') + // 第四步:创建点击事件,控制弹窗显隐 + .onClick(() => { + this.customPopup = !this.customPopup; + }) + .backgroundColor(0xf56c6c) + // 第三步:使用bindPopup接口将弹窗内容绑定给元素 + .bindPopup(this.customPopup, { + builder: this.popupBuilder, + placement: Placement.Top, + maskColor: 0x33000000, + popupColor: 0xf56c6c, + enableArrow: true, + onStateChange: (e) => { + if (!e.isVisible) { + this.customPopup = false; } - return { - pass: false, - message: tips(false) + ' but it was resolved with ' + - JSON.stringify(got) + '.' - }; - }, - function (rej) { - return { - pass: false, - message: tips(false) + ' but it was rejected with ' + JSON.stringify(rej) + '.' - }; - } - ); + } + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height(437) + } } -export default assertPromiseIsResolvedWith; \ No newline at end of file +// [End bind_popup_demo] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template6/ModalTransitionWithIf.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template6/ModalTransitionWithIf.ets new file mode 100644 index 0000000000000000000000000000000000000000..3d343d54c27ccdc33a6428915fa544903fa5b50c --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/modalTransition/template6/ModalTransitionWithIf.ets @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2025 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 { common } from '@kit.AbilityKit'; + +// [Start modal_transition_with_if] +@Entry +@Component +struct ModalTransitionWithIf { + // [StartExclude modal_transition_with_if] + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + // [EndExclude modal_transition_with_if] + private listArr: string[] = ['WLAN', this.context.resourceManager.getStringByNameSync('modal_transition_text29'), + this.context.resourceManager.getStringByNameSync('modal_transition_text30'), + this.context.resourceManager.getStringByNameSync('modal_transition_text31')]; + private shareArr: string[] = [this.context.resourceManager.getStringByNameSync('modal_transition_text32'), + this.context.resourceManager.getStringByNameSync('modal_transition_text33'), 'VPN', + this.context.resourceManager.getStringByNameSync('modal_transition_text34'), 'NFC']; + // 第一步:定义状态变量控制页面显示 + @State isShowShare: boolean = false; + + private shareFunc(): void { + this.getUIContext()?.animateTo({ duration: 500 }, () => { + this.isShowShare = !this.isShowShare; + }) + } + + build() { + // 第二步:定义Stack布局显示当前页面和模态页面 + Stack() { + Column() { + Column() { + Text(this.context.resourceManager.getStringByNameSync('modal_transition_text35')) + .fontSize(28) + .fontColor(0x333333) + } + .width('90%') + .padding({ top: 30, bottom: 15 }) + .alignItems(HorizontalAlign.Start) + + TextInput({ placeholder: this.context.resourceManager.getStringByNameSync('modal_transition_text36') }) + .width('90%') + .height(40) + .margin({ bottom: 10 }) + .focusable(false) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.listArr, (item: string, index: number) => { + ListItem() { + Row() { + Row() { + Text(`${item.slice(0, 1)}`) + .fontColor(Color.White) + .fontSize(14) + .fontWeight(FontWeight.Bold) + } + .width(30) + .height(30) + .backgroundColor('#a8a8a8') + .margin({ right: 12 }) + .borderRadius(20) + .justifyContent(FlexAlign.Center) + + Column() { + Text(item) + .fontSize(16) + .fontWeight(FontWeight.Medium) + } + .alignItems(HorizontalAlign.Start) + + Blank(); + + Row() + .width(12) + .height(12) + .margin({ right: 15 }) + .border({ + width: { top: 2, right: 2 }, + color: 0xcccccc + }) + .rotate({ angle: 45 }) + } + .borderRadius(15) + .shadow({ radius: 100, color: '#ededed' }) + .width('90%') + .alignItems(VerticalAlign.Center) + .padding({ left: 15, top: 15, bottom: 15 }) + .backgroundColor(Color.White) + } + .width('100%') + .onClick(() => { + // 第五步:改变状态变量,显示模态页面 + if (item.slice(-2) === this.context.resourceManager.getStringByNameSync('modal_transition_text37')) { + this.shareFunc(); + } + }) + }, (item: string): string => item) + } + .width('100%') + } + .width('100%') + .height('100%') + .backgroundColor(0xfefefe) + + // 第三步:在if中定义模态页面,显示在最上层,通过if控制模态页面出现消失 + if (this.isShowShare) { + Column() { + Column() { + Row() { + Row() { + Row() + .width(16) + .height(16) + .border({ + width: { left: 2, top: 2 }, + color: 0x333333 + }) + .rotate({ angle: -45 }) + } + .padding({ left: 15, right: 10 }) + .onClick(() => { + this.shareFunc(); + }) + + Text(this.context.resourceManager.getStringByNameSync('modal_transition_text31')) + .fontSize(28) + .fontColor(0x333333) + } + .padding({ top: 30 }) + } + .width('90%') + .padding({ bottom: 15 }) + .alignItems(HorizontalAlign.Start) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.shareArr, (item: string) => { + ListItem() { + Row() { + Row() { + Text(`${item.slice(0, 1)}`) + .fontColor(Color.White) + .fontSize(14) + .fontWeight(FontWeight.Bold) + } + .width(30) + .height(30) + .backgroundColor('#a8a8a8') + .margin({ right: 12 }) + .borderRadius(20) + .justifyContent(FlexAlign.Center) + + Column() { + Text(item) + .fontSize(16) + .fontWeight(FontWeight.Medium) + } + .alignItems(HorizontalAlign.Start) + + Blank(); + + Row() + .width(12) + .height(12) + .margin({ right: 15 }) + .border({ + width: { top: 2, right: 2 }, + color: 0xcccccc + }) + .rotate({ angle: 45 }) + } + .borderRadius(15) + .shadow({ radius: 100, color: '#ededed' }) + .width('90%') + .alignItems(VerticalAlign.Center) + .padding({ left: 15, top: 15, bottom: 15 }) + .backgroundColor(Color.White) + } + .width('100%') + }, (item: string): string => item) + } + .width('100%') + } + .width('100%') + .height('100%') + .backgroundColor(0xffffff) + // 第四步:定义模态页面出现消失转场方式 + .transition(TransitionEffect.OPACITY + .combine(TransitionEffect.translate({ x: '100%' })) + .combine(TransitionEffect.scale({ x: 0.95, y: 0.95 }))) + } + } + } +} + +// [End modal_transition_with_if] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/rotation/template1/Index.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/rotation/template1/Index.ets index ec7946947d9710cb03e48463203c133899e82866..13d4af581d222241419e0d6e5641bbc7ff0374d3 100644 --- a/ArkUIKit/Animation/entry/src/main/ets/pages/rotation/template1/Index.ets +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/rotation/template1/Index.ets @@ -14,10 +14,10 @@ */ import { display } from '@kit.ArkUI'; +// [Start rotation] @Entry @Component struct rotation { - build() { Stack() { Image($r('app.media.tree')) @@ -28,4 +28,6 @@ struct rotation { .backgroundColor(Color.White) .size({ width: '100%', height: '100%' }) } -} \ No newline at end of file +} + +// [End rotation] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/rotation/template2/Index.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/rotation/template2/Index.ets index 29f6df2372d6e936055ff5a0d10091c2c4fb4d9e..8912d07c4d2d1df0de82aea19045088ef42f70af 100644 --- a/ArkUIKit/Animation/entry/src/main/ets/pages/rotation/template2/Index.ets +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/rotation/template2/Index.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start rotation_page] import { display } from '@kit.ArkUI'; @Entry @@ -45,4 +46,6 @@ struct rotation { .backgroundColor(Color.White) .size({ width: '100%', height: '100%' }) } -} \ No newline at end of file +} + +// [End rotation_page] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template2/Index.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template2/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..fc629422a6b25c74181f63e697733bea699b8ebd --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template2/Index.ets @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2025 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 { common } from '@kit.AbilityKit'; + +// [Start post_data] +class PostData { + // 图片使用Resource资源,需用户自定义 + avatar: Resource = $r('app.media.flower'); + name: string = ''; + message: string = ''; + images: Resource[] = []; +} + +@Entry +@Component +struct Index { + // [StartExclude post_data] + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + // [EndExclude post_data] + @State isExpand: boolean = false; + @State @Watch('onItemClicked') selectedIndex: number = -1; + // 数组中图片均使用Resource资源,需用户自定义 + private allPostData: PostData[] = [ + { + avatar: $r('app.media.flower'), + name: 'Alice', + message: this.context.resourceManager.getStringByNameSync('shareTransition_text1'), + images: [$r('app.media.spring'), $r('app.media.tall_tree')] + }, + { + avatar: $r('app.media.sunset_sky'), + name: 'Bob', + message: this.context.resourceManager.getStringByNameSync('shareTransition_text2'), + images: [$r('app.media.island')] + }, + { + avatar: $r('app.media.tall_tree'), + name: 'Carl', + message: this.context.resourceManager.getStringByNameSync('shareTransition_text3'), + images: [$r('app.media.flower'), $r('app.media.sunset_sky'), $r('app.media.spring')] + }]; + + private onItemClicked(): void { + if (this.selectedIndex < 0) { + return; + } + this.getUIContext()?.animateTo({ + duration: 350, + curve: Curve.Friction + }, () => { + this.isExpand = !this.isExpand; + }); + } + + build() { + Column({ space: 20 }) { + ForEach(this.allPostData, (postData: PostData, index: number) => { + // 当点击了某个post后,会使其余的post消失下树 + if (!this.isExpand || this.selectedIndex === index) { + Column() { + Post({ data: postData, selectedIndex: this.selectedIndex, index: index }); + } + .width('100%') + // 对出现消失的post添加透明度转场和位移转场效果 + .transition(TransitionEffect.OPACITY + .combine(TransitionEffect.translate({ y: index < this.selectedIndex ? -250 : 250 })) + .animation({ duration: 350, curve: Curve.Friction })) + } + }, (postData: PostData, index: number) => index.toString()) + } + .size({ width: '100%', height: '100%' }) + .backgroundColor('#40808080') + } +} + +@Component +export default struct Post { + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + @Link selectedIndex: number; + @Prop data: PostData; + @Prop index: number; + @State itemHeight: number = 250; + @State isExpand: boolean = false; + @State expandImageSize: number = 100; + @State avatarSize: number = 50; + + build() { + Column({ space: 20 }) { + Row({ space: 10 }) { + Image(this.data.avatar) + .size({ width: this.avatarSize, height: this.avatarSize }) + .borderRadius(this.avatarSize / 2) + .clip(true) + + Text(this.data.name); + } + .justifyContent(FlexAlign.Start) + + Text(this.data.message); + + Row({ space: 15 }) { + ForEach(this.data.images, (imageResource: Resource, index: number) => { + Image(imageResource) + .size({ width: this.expandImageSize, height: this.expandImageSize }) + }, (imageResource: Resource, index: number) => index.toString()) + } + + // 展开态下组件增加的内容 + if (this.isExpand) { + Column() { + Text(this.context.resourceManager.getStringByNameSync('shareTransition_text4')) + // 对评论区文本添加出现消失转场效果 + .transition(TransitionEffect.OPACITY + .animation({ duration: 350, curve: Curve.Friction })) + .padding({ top: 10 }) + } + .transition(TransitionEffect.asymmetric( + TransitionEffect.opacity(0.99) + .animation({ duration: 350, curve: Curve.Friction }), + TransitionEffect.OPACITY.animation({ duration: 0 }) + )) + .size({ width: '100%' }) + } + } + .backgroundColor(Color.White) + .size({ width: '100%', height: this.itemHeight }) + .alignItems(HorizontalAlign.Start) + .padding({ left: 10, top: 10 }) + .onClick(() => { + this.selectedIndex = -1; + this.selectedIndex = this.index; + this.getUIContext()?.animateTo({ + duration: 350, + curve: Curve.Friction + }, () => { + // 对展开的post做宽高动画,并对头像尺寸和图片尺寸加动画 + this.isExpand = !this.isExpand; + this.itemHeight = this.isExpand ? 780 : 250; + this.avatarSize = this.isExpand ? 75 : 50; + this.expandImageSize = (this.isExpand && this.data.images.length > 0) + ? (360 - (this.data.images.length + 1) * 15) / this.data.images.length : 100; + }) + }) + } +} + +// [End post_data] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template3/Index.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template3/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..8897076b3a3020104ba4a94f85f5ec1b911d3479 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template3/Index.ets @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start stack_index] +import { createPostNode, getPostNode, PostNode } from './PostNode'; +import { componentUtils, curves, UIContext } from '@kit.ArkUI'; + +@Entry +@Component +struct Index { + // 新建一镜到底动画类 + private uiContext: UIContext = this.getUIContext(); + @State animationProperties: AnimationProperties = new AnimationProperties(this.uiContext); + private listArray: Array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + + build() { + // 卡片折叠态,展开态的共同父组件 + Stack() { + List({ space: 20 }) { + ForEach(this.listArray, (item: number) => { + ListItem() { + // 卡片折叠态 + PostItem({ index: item, animationProperties: this.animationProperties }); + } + }) + } + .clip(false) + .alignListItem(ListItemAlign.Center) + + if (this.animationProperties.isExpandPageShow) { + // 卡片展开态 + ExpandPage({ animationProperties: this.animationProperties }); + } + } + .key('rootStack') + .enabled(this.animationProperties.isEnabled) + } +} + +@Component +struct PostItem { + @Prop index: number + @Link animationProperties: AnimationProperties; + @State nodeController: PostNode | undefined = undefined; + // 折叠时详细内容隐藏 + private showDetailContent: boolean = false; + + aboutToAppear(): void { + this.nodeController = createPostNode(this.getUIContext(), this.index.toString(), this.showDetailContent); + if (this.nodeController != undefined) { + // 设置回调,当卡片从展开态回到折叠态时触发 + this.nodeController.setCallback(this.resetNode.bind(this)); + } + } + + resetNode() { + this.nodeController = getPostNode(this.index.toString()); + } + + build() { + Stack() { + NodeContainer(this.nodeController); + } + .width('100%') + .height(100) + .key(this.index.toString()) + .onClick(() => { + if (this.nodeController != undefined) { + // 卡片从折叠态节点下树 + this.nodeController.onRemove(); + } + // 触发卡片从折叠到展开态的动画 + this.animationProperties.expandAnimation(this.index); + }) + } +} + +@Component +struct ExpandPage { + @Link animationProperties: AnimationProperties; + @State nodeController: PostNode | undefined = undefined; + // 展开时详细内容出现 + private showDetailContent: boolean = true; + + aboutToAppear(): void { + // 获取对应序号的卡片组件 + this.nodeController = getPostNode(this.animationProperties.curIndex.toString()); + // 更新为详细内容出现 + this.nodeController?.update(this.animationProperties.curIndex.toString(), this.showDetailContent); + } + + build() { + Stack() { + NodeContainer(this.nodeController); + } + .width('100%') + .height(this.animationProperties.changedHeight ? '100%' : 100) + .translate({ x: this.animationProperties.translateX, y: this.animationProperties.translateY }) + .position({ x: this.animationProperties.positionX, y: this.animationProperties.positionY }) + .onClick(() => { + this.getUIContext()?.animateTo({ + curve: curves.springMotion(0.6, 0.9), + onFinish: () => { + if (this.nodeController != undefined) { + // 执行回调,折叠态节点获取卡片组件 + this.nodeController.callCallback(); + // 当前展开态节点的卡片组件下树 + this.nodeController.onRemove(); + } + // 卡片展开态节点下树 + this.animationProperties.isExpandPageShow = false; + this.animationProperties.isEnabled = true; + } + }, () => { + // 卡片从展开态回到折叠态 + this.animationProperties.isEnabled = false; + this.animationProperties.translateX = 0; + this.animationProperties.translateY = 0; + this.animationProperties.changedHeight = false; + // 更新为详细内容消失 + this.nodeController?.update(this.animationProperties.curIndex.toString(), false); + }) + }) + } +} + +class RectInfo { + left: number = 0; + top: number = 0; + right: number = 0; + bottom: number = 0; + width: number = 0; + height: number = 0; +} + +// 封装的一镜到底动画类 +@Observed +class AnimationProperties { + public isExpandPageShow: boolean = false; + // 控制组件是否响应点击事件 + public isEnabled: boolean = true; + // 展开卡片的序号 + public curIndex: number = -1; + public translateX: number = 0; + public translateY: number = 0; + public positionX: number = 0; + public positionY: number = 0; + public changedHeight: boolean = false; + private calculatedTranslateX: number = 0; + private calculatedTranslateY: number = 0; + // 设置卡片展开后相对父组件的位置 + private expandTranslateX: number = 0; + private expandTranslateY: number = 0; + private uiContext: UIContext; + + constructor(uiContext: UIContext) { + this.uiContext = uiContext + } + + public expandAnimation(index: number): void { + // 记录展开态卡片的序号 + if (index != undefined) { + this.curIndex = index; + } + // 计算折叠态卡片相对父组件的位置 + this.calculateData(index.toString()); + // 展开态卡片上树 + this.isExpandPageShow = true; + // 卡片展开的属性动画 + this.uiContext?.animateTo({ + curve: curves.springMotion(0.6, 0.9) + }, () => { + this.translateX = this.calculatedTranslateX; + this.translateY = this.calculatedTranslateY; + this.changedHeight = true; + }) + } + + // 获取需要跨节点迁移的组件的位置,及迁移前后节点的公共父节点的位置,用以计算做动画组件的动画参数 + public calculateData(key: string): void { + let clickedImageInfo = this.getRectInfoById(this.uiContext, key); + let rootStackInfo = this.getRectInfoById(this.uiContext, 'rootStack'); + this.positionX = this.uiContext.px2vp(clickedImageInfo.left - rootStackInfo.left); + this.positionY = this.uiContext.px2vp(clickedImageInfo.top - rootStackInfo.top); + this.calculatedTranslateX = this.uiContext.px2vp(rootStackInfo.left - clickedImageInfo.left) + + this.expandTranslateX; + this.calculatedTranslateY = this.uiContext.px2vp(rootStackInfo.top - clickedImageInfo.top) + this.expandTranslateY; + } + + // 根据组件的id获取组件的位置信息 + private getRectInfoById(context: UIContext, id: string): RectInfo { + let componentInfo: componentUtils.ComponentInfo = context.getComponentUtils().getRectangleById(id); + + if (!componentInfo) { + throw Error('object is empty'); + } + + let rstRect: RectInfo = new RectInfo(); + const widthScaleGap = componentInfo.size.width * (1 - componentInfo.scale.x) / 2; + const heightScaleGap = componentInfo.size.height * (1 - componentInfo.scale.y) / 2; + rstRect.left = componentInfo.translate.x + componentInfo.windowOffset.x + widthScaleGap; + rstRect.top = componentInfo.translate.y + componentInfo.windowOffset.y + heightScaleGap; + rstRect.right = + componentInfo.translate.x + componentInfo.windowOffset.x + componentInfo.size.width - widthScaleGap; + rstRect.bottom = + componentInfo.translate.y + componentInfo.windowOffset.y + componentInfo.size.height - heightScaleGap; + rstRect.width = rstRect.right - rstRect.left; + rstRect.height = rstRect.bottom - rstRect.top; + + return { + left: rstRect.left, + right: rstRect.right, + top: rstRect.top, + bottom: rstRect.bottom, + width: rstRect.width, + height: rstRect.height + } + } +} + +// [End stack_index] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template3/PostNode.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template3/PostNode.ets new file mode 100644 index 0000000000000000000000000000000000000000..b6bb70ce9a37086445413bdd87cee748853ad2e7 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template3/PostNode.ets @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2025 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 { common } from '@kit.AbilityKit'; +import resource from '../../../common/resource'; + +// [Start stack_post_node] +// 跨容器迁移能力 +import { UIContext, curves, NodeController, BuilderNode, FrameNode } from '@kit.ArkUI'; + +class Data { + public item: string | null = null; + public isExpand: boolean = false; +} + +@Builder +function postBuilder(data: Data) { + // 跨容器迁移组件置于@Builder内 + Column() { + Row() { + Row() + .backgroundColor(Color.Pink) + .borderRadius(20) + .width(80) + .height(80) + Column() { + Text(resource.resourceToString($r('app.string.shareTransition_text5')) + data.item) + .fontSize(20) + Text(resource.resourceToString($r('app.string.shareTransition_text6'))) + .fontSize(12) + .fontColor(0x909399) + } + .alignItems(HorizontalAlign.Start) + .justifyContent(FlexAlign.SpaceAround) + .margin({ left: 10 }) + .height(80) + } + .width('90%') + .height(100) + + // 展开后显示细节内容 + if (data.isExpand) { + Row() { + Text(resource.resourceToString($r('app.string.shareTransition_text7'))) + .fontSize(28) + .fontColor(0x909399) + .textAlign(TextAlign.Center) + .transition(TransitionEffect.OPACITY.animation({ curve: curves.springMotion(0.6, 0.9) })) + } + .width('90%') + .justifyContent(FlexAlign.Center) + } + } + .width('90%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .borderRadius(10) + .margin({ top: 15 }) + .backgroundColor(Color.White) + .shadow({ + radius: 20, + color: 0x909399, + offsetX: 20, + offsetY: 10 + }) +} + +class InternalValue { + public flag: boolean = false; +} +; + +export class PostNode extends NodeController { + private node: BuilderNode | null = null; + private isRemove: InternalValue = new InternalValue(); + private callback: Function | undefined = undefined; + private data: Data | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isRemove.flag === true) { + return null; + } + if (this.node != null) { + return this.node.getFrameNode(); + } + + return null; + } + + init(uiContext: UIContext, id: string, isExpand: boolean) { + if (this.node != null) { + return; + } + // 创建节点,需要uiContext + this.node = new BuilderNode(uiContext); + // 创建离线组件 + this.data = { item: id, isExpand: isExpand }; + this.node.build(wrapBuilder(postBuilder), this.data); + } + + update(id: string, isExpand: boolean) { + if (this.node !== null) { + // 调用update进行更新。 + this.data = { item: id, isExpand: isExpand }; + this.node.update(this.data); + } + } + + setCallback(callback: Function | undefined) { + this.callback = callback; + } + + callCallback() { + if (this.callback != undefined) { + this.callback(); + } + } + + onRemove() { + this.isRemove.flag = true; + // 组件迁移出节点时触发重建 + this.rebuild(); + this.isRemove.flag = false; + } +} + +let gNodeMap: Map = new Map(); + +export const createPostNode = + (uiContext: UIContext, id: string, isExpand: boolean): PostNode | undefined => { + let node = new PostNode(); + node.init(uiContext, id, isExpand); + gNodeMap.set(id, node); + return node; + } + +export const getPostNode = (id: string): PostNode | undefined => { + if (!gNodeMap.has(id)) { + return undefined; + } + return gNodeMap.get(id); +} + +export const deleteNode = (id: string) => { + gNodeMap.delete(id); +} + +// [End stack_post_node] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template4/Index.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template4/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..5820cc3e2fb8c4f29af2f10e3269f75a4a041858 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template4/Index.ets @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start navigation_index] +import { AnimateCallback, CustomTransition } from '../../../CustomTransition/CustomNavigationUtils'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const TAG: string = 'Index'; +const DOMAIN = 0xF811; + +@Entry +@Component +struct Index { + private pageInfos: NavPathStack = new NavPathStack(); + // 允许进行自定义转场的页面名称 + private allowedCustomTransitionFromPageName: string[] = ['PageOne']; + private allowedCustomTransitionToPageName: string[] = ['PageTwo']; + + aboutToAppear(): void { + this.pageInfos.pushPath({ name: 'PageOne' }); + } + + private isCustomTransitionEnabled(fromName: string, toName: string): boolean { + // 点击和返回均需要进行自定义转场,因此需要分别判断 + if ((this.allowedCustomTransitionFromPageName.includes(fromName) && + this.allowedCustomTransitionToPageName.includes(toName)) || + (this.allowedCustomTransitionFromPageName.includes(toName) && + this.allowedCustomTransitionToPageName.includes(fromName))) { + return true; + } + return false; + } + + build() { + Navigation(this.pageInfos) + .hideNavBar(true) + .customNavContentTransition((from: NavContentInfo, to: NavContentInfo, operation: NavigationOperation) => { + if ((!from || !to) || (!from.name || !to.name)) { + return undefined; + } + + // 通过from和to的name对自定义转场路由进行管控 + if (!this.isCustomTransitionEnabled(from.name, to.name)) { + return undefined; + } + + // 需要对转场页面是否注册了animation进行判断,来决定是否进行自定义转场 + let fromParam: AnimateCallback = CustomTransition.getInstance().getAnimateParam(from.index); + let toParam: AnimateCallback = CustomTransition.getInstance().getAnimateParam(to.index); + if (!fromParam.animation || !toParam.animation) { + return undefined; + } + + // 一切判断完成后,构造customAnimation给系统侧调用,执行自定义转场动画 + let customAnimation: NavigationAnimatedTransition = { + onTransitionEnd: (isSuccess: boolean) => { + hilog.info(DOMAIN, 'current transition result is', 'isSuccess: %s', isSuccess.toString()); + }, + timeout: 2000, + transition: (transitionProxy: NavigationTransitionProxy) => { + hilog.info(DOMAIN, TAG, 'trigger transition callback'); + if (fromParam.animation) { + fromParam.animation(operation === NavigationOperation.PUSH, true, transitionProxy); + } + if (toParam.animation) { + toParam.animation(operation === NavigationOperation.PUSH, false, transitionProxy); + } + } + }; + return customAnimation; + }) + } +} + +// [End navigation_index] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template4/PageOne.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template4/PageOne.ets new file mode 100644 index 0000000000000000000000000000000000000000..8cd32d1a5e7b66a5bf3338824a998d5cf2ccbe56 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template4/PageOne.ets @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2025 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 { common } from '@kit.AbilityKit'; + +// [Start navigation_page_one] +import { CustomTransition } from '../../../CustomTransition/CustomNavigationUtils'; +import { MyNodeController, createMyNode, getMyNode } from '../../../NodeContainer/CustomComponent'; +import { ComponentAttrUtils, RectInfoInPx } from '../../../utils/ComponentAttrUtils'; +import { WindowUtils } from '../../../utils/WindowUtils'; + +@Builder +export function PageOneBuilder() { + PageOne(); +} + +@Component +export struct PageOne { + // [StartExclude navigation_page_one] + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + // [EndExclude navigation_page_one] + private pageInfos: NavPathStack = new NavPathStack(); + private pageId: number = -1; + @State myNodeController: MyNodeController | undefined = new MyNodeController(false); + + aboutToAppear(): void { + let node = getMyNode(); + if (node === undefined) { + // 新建自定义节点 + createMyNode(this.getUIContext()); + } + this.myNodeController = getMyNode(); + } + + private doFinishTransition(): void { + // PageTwo结束转场时将节点从PageTwo迁移回PageOne + this.myNodeController = getMyNode(); + } + + private registerCustomTransition(): void { + // 注册自定义动画协议 + CustomTransition.getInstance().registerNavParam(this.pageId, + (isPush: boolean, isExit: boolean, transitionProxy: NavigationTransitionProxy) => { + }, 500); + } + + private onCardClicked(): void { + let cardItemInfo: RectInfoInPx = + ComponentAttrUtils.getRectInfoById(WindowUtils.window.getUIContext(), 'card'); + let param: Record = {}; + param['cardItemInfo'] = cardItemInfo; + param['doDefaultTransition'] = (myController: MyNodeController) => { + this.doFinishTransition(); + }; + this.pageInfos.pushPath({ name: 'PageTwo', param: param }); + // 自定义节点从PageOne下树 + if (this.myNodeController != undefined) { + (this.myNodeController as MyNodeController).onRemove(); + } + } + + build() { + NavDestination() { + Stack() { + Column({ space: 20 }) { + Row({ space: 10 }) { + // 图片使用Resource资源,需用户自定义 + Image($r('app.media.avatar')) + .size({ width: 50, height: 50 }) + .borderRadius(25) + .clip(true) + + Text('Alice'); + } + .justifyContent(FlexAlign.Start) + + Text(this.context.resourceManager.getStringByNameSync('shareTransition_text2')); + + NodeContainer(this.myNodeController) + .size({ width: 320, height: 250 }) + .onClick(() => { + this.onCardClicked(); + }) + } + .alignItems(HorizontalAlign.Start) + .margin(30) + } + } + .onReady((context: NavDestinationContext) => { + this.pageInfos = context.pathStack; + this.pageId = this.pageInfos.getAllPathName().length - 1; + this.registerCustomTransition(); + }) + .onDisAppear(() => { + CustomTransition.getInstance().unRegisterNavParam(this.pageId); + // 自定义节点从PageOne下树 + if (this.myNodeController != undefined) { + (this.myNodeController as MyNodeController).onRemove(); + } + }) + } +} + +// [End navigation_page_one] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template4/PageTwo.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template4/PageTwo.ets new file mode 100644 index 0000000000000000000000000000000000000000..00ede4e66ff9d803fa6ab5eabaae5dba3e6e71e1 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template4/PageTwo.ets @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2025 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 { common } from '@kit.AbilityKit'; + +// [Start navigation_page_two] +import { CustomTransition } from '../../../CustomTransition/CustomNavigationUtils'; +import { AnimationProperties } from '../../../CustomTransition/AnimationProperties'; +import { RectInfoInPx } from '../../../utils/ComponentAttrUtils'; +import { getMyNode, MyNodeController } from '../../../NodeContainer/CustomComponent'; + +@Builder +export function PageTwoBuilder() { + PageTwo(); +} + +@Component +export struct PageTwo { + @State pageInfos: NavPathStack = new NavPathStack(); + @State animationProperties: AnimationProperties = new AnimationProperties(this.getUIContext()); + @State myNodeController: MyNodeController | undefined = new MyNodeController(false); + // [StartExclude navigation_page_two] + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + // [EndExclude navigation_page_two] + private pageId: number = -1; + private shouldDoDefaultTransition: boolean = false; + private prePageDoFinishTransition: () => void = () => { + }; + private cardItemInfo: RectInfoInPx = new RectInfoInPx(); + @StorageProp('windowSizeChanged') @Watch('unRegisterNavParam') windowSizeChangedTime: number = 0; + @StorageProp('onConfigurationUpdate') @Watch('unRegisterNavParam') onConfigurationUpdateTime: number = 0; + + aboutToAppear(): void { + // 迁移自定义节点至当前页面 + this.myNodeController = getMyNode(); + } + + private unRegisterNavParam(): void { + this.shouldDoDefaultTransition = true; + } + + private onBackPressed(): boolean { + if (this.shouldDoDefaultTransition) { + CustomTransition.getInstance().unRegisterNavParam(this.pageId); + this.pageInfos.pop(); + this.prePageDoFinishTransition(); + this.shouldDoDefaultTransition = false; + return true; + } + this.pageInfos.pop(); + return true; + } + + build() { + NavDestination() { + // Stack需要设置alignContent为TopStart,否则在高度变化过程中,截图和内容都会随高度重新布局位置 + Stack({ alignContent: Alignment.TopStart }) { + Stack({ alignContent: Alignment.TopStart }) { + Column({ space: 20 }) { + NodeContainer(this.myNodeController); + if (this.animationProperties.showDetailContent) { + Text(this.context.resourceManager.getStringByNameSync('shareTransition_text8')) + .fontSize(20) + .transition(TransitionEffect.OPACITY) + .margin(30) + } + } + .alignItems(HorizontalAlign.Start); + } + .position({ y: this.animationProperties.positionValue }); + } + .scale({ x: this.animationProperties.scaleValue, y: this.animationProperties.scaleValue }) + .translate({ x: this.animationProperties.translateX, y: this.animationProperties.translateY }) + .width(this.animationProperties.clipWidth) + .height(this.animationProperties.clipHeight) + .borderRadius(this.animationProperties.radius) + // expandSafeArea使得Stack做沉浸式效果,向上扩到状态栏,向下扩到导航条 + .expandSafeArea([SafeAreaType.SYSTEM]) + // 对高度进行裁切 + .clip(true) + } + .backgroundColor(this.animationProperties.navDestinationBgColor) + .hideTitleBar(true) + .onReady((context: NavDestinationContext) => { + this.pageInfos = context.pathStack; + this.pageId = this.pageInfos.getAllPathName().length - 1; + let param = context.pathInfo?.param as Record; + this.prePageDoFinishTransition = param['doDefaultTransition'] as () => void; + this.cardItemInfo = param['cardItemInfo'] as RectInfoInPx; + CustomTransition.getInstance().registerNavParam(this.pageId, + (isPush: boolean, isExit: boolean, transitionProxy: NavigationTransitionProxy) => { + this.animationProperties.doAnimation( + this.cardItemInfo, isPush, isExit, transitionProxy, 0, + this.prePageDoFinishTransition, this.myNodeController); + }, 500); + }) + .onBackPressed(() => { + return this.onBackPressed(); + }) + .onDisAppear(() => { + CustomTransition.getInstance().unRegisterNavParam(this.pageId); + }) + } +} + +// [End navigation_page_two] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template5/Index.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template5/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..9bc9b3d8348f3ce19f79b3ef8ae601645b06d41f --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template5/Index.ets @@ -0,0 +1,286 @@ +/* + * Copyright (c) 2025 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 { common } from '@kit.AbilityKit'; + +// [Start bind_sheet_index] +import { MyNodeController, createMyNode, getMyNode } from '../../../NodeContainer/CustomComponentBindSheet'; +import { ComponentAttrUtils, RectInfoInPx } from '../../../utils/ComponentAttrUtils'; +import { WindowUtils } from '../../../utils/WindowUtils'; +import { inspector } from '@kit.ArkUI'; + +class AnimationInfo { + scale: number = 0; + translateX: number = 0; + translateY: number = 0; + clipWidth: Dimension = 0; + clipHeight: Dimension = 0; +} + +@Entry +@Component +struct Index { + @State isShowSheet: boolean = false; + @State isShowImage: boolean = false; + @State isShowOverlay: boolean = false; + @State isAnimating: boolean = false; + @State isEnabled: boolean = true; + @State scaleValue: number = 0; + @State translateX: number = 0; + @State translateY: number = 0; + @State clipWidth: Dimension = 0; + @State clipHeight: Dimension = 0; + @State radius: number = 0; + // 原图的透明度 + @State opacityDegree: number = 1; + // [StartExclude bind_sheet_index] + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + // [EndExclude bind_sheet_index] + + // 抓取照片原位置信息 + private originInfo: AnimationInfo = new AnimationInfo; + // 抓取照片在半模态页上位置信息 + private targetInfo: AnimationInfo = new AnimationInfo; + // 半模态高度 + private bindSheetHeight: number = 450; + // 半模态上图片圆角 + private sheetRadius: number = 20; + // 设置半模态上图片的布局监听 + listener: inspector.ComponentObserver = this.getUIContext().getUIInspector().createComponentObserver('target'); + + aboutToAppear(): void { + // 设置半模态上图片的布局完成回调 + let onLayoutComplete: () => void = (): void => { + // 目标图片布局完成时抓取布局信息 + this.targetInfo = this.calculateData('target'); + // 仅半模态正确布局且此时无动画时触发一镜到底动画 + if (this.targetInfo.scale != 0 && this.targetInfo.clipWidth != 0 && + this.targetInfo.clipHeight != 0 && !this.isAnimating) { + this.isAnimating = true; + // 用于一镜到底的模态页的属性动画 + this.getUIContext()?.animateTo({ + duration: 1000, + curve: Curve.Friction, + onFinish: () => { + // 模态转场页(overlay)上的自定义节点下树 + this.isShowOverlay = false; + // 半模态上的自定义节点上树,由此完成节点迁移 + this.isShowImage = true; + } + }, () => { + this.scaleValue = this.targetInfo.scale; + this.translateX = this.targetInfo.translateX; + this.clipWidth = this.targetInfo.clipWidth; + this.clipHeight = this.targetInfo.clipHeight; + // 修正因半模态高度和缩放导致的高度差 + this.translateY = this.targetInfo.translateY + + (this.getUIContext().px2vp(WindowUtils.windowHeightPx) - this.bindSheetHeight - + this.getUIContext().px2vp(WindowUtils.navigationIndicatorHeightPx) - + this.getUIContext().px2vp(WindowUtils.topAvoidAreaHeightPx)); + // 修正因缩放导致的圆角差异 + this.radius = this.sheetRadius / this.scaleValue; + }) + // 原图从透明到出现的动画 + this.getUIContext()?.animateTo({ + duration: 2000, + curve: Curve.Friction, + }, () => { + this.opacityDegree = 1; + }) + } + } + // 打开布局监听 + this.listener.on('layout', onLayoutComplete); + } + + // 获取对应id的组件相对窗口左上角的属性 + calculateData(id: string): AnimationInfo { + let itemInfo: RectInfoInPx = + ComponentAttrUtils.getRectInfoById(WindowUtils.window.getUIContext(), id); + // 首先计算图片的宽高与窗口宽高的比例 + let widthScaleRatio = itemInfo.width / WindowUtils.windowWidthPx; + let heightScaleRatio = itemInfo.height / WindowUtils.windowHeightPx; + let isUseWidthScale = widthScaleRatio > heightScaleRatio; + let itemScale: number = isUseWidthScale ? widthScaleRatio : heightScaleRatio; + let itemTranslateX: number = 0; + let itemClipWidth: Dimension = 0; + let itemClipHeight: Dimension = 0; + let itemTranslateY: number = 0; + + if (isUseWidthScale) { + itemTranslateX = this.getUIContext().px2vp(itemInfo.left - (WindowUtils.windowWidthPx - itemInfo.width) / 2); + itemClipWidth = '100%'; + itemClipHeight = this.getUIContext().px2vp((itemInfo.height) / itemScale); + itemTranslateY = this.getUIContext().px2vp(itemInfo.top - ((this.getUIContext().vp2px(itemClipHeight) - + this.getUIContext().vp2px(itemClipHeight) * itemScale) / 2)); + } else { + itemTranslateY = this.getUIContext().px2vp(itemInfo.top - (WindowUtils.windowHeightPx - itemInfo.height) / 2); + itemClipHeight = '100%'; + itemClipWidth = this.getUIContext().px2vp((itemInfo.width) / itemScale); + itemTranslateX = this.getUIContext().px2vp(itemInfo.left - (WindowUtils.windowWidthPx / 2 - itemInfo.width / 2)); + } + + return { + scale: itemScale, + translateX: itemTranslateX, + translateY: itemTranslateY, + clipWidth: itemClipWidth, + clipHeight: itemClipHeight, + } + } + + // 照片页 + build() { + Column() { + Text(this.context.resourceManager.getStringByNameSync('shareTransition_text9')) + .textAlign(TextAlign.Start) + .width('100%') + .fontSize(30) + .padding(20) + // 图片使用Resource资源,需用户自定义 + Image($r("app.media.longevity_flower")) + .opacity(this.opacityDegree) + .width('90%') + .id('origin')// 挂载半模态页 + .enabled(this.isEnabled) + .onClick(() => { + // 获取原始图像的位置信息,将模态页上图片移动缩放至该位置 + this.originInfo = this.calculateData('origin'); + this.scaleValue = this.originInfo.scale; + this.translateX = this.originInfo.translateX; + this.translateY = this.originInfo.translateY; + this.clipWidth = this.originInfo.clipWidth; + this.clipHeight = this.originInfo.clipHeight; + this.radius = 0; + this.opacityDegree = 0; + // 启动半模态页和模态页 + this.isShowSheet = true; + this.isShowOverlay = true; + // 设置原图为不可交互抗打断 + this.isEnabled = false; + }) + } + .width('100%') + .height('100%') + .padding({ top: 20 }) + .alignItems(HorizontalAlign.Center) + .bindSheet(this.isShowSheet, this.mySheet(), { + // Embedded模式使得其他页面可以高于半模态页 + mode: SheetMode.EMBEDDED, + height: this.bindSheetHeight, + onDisappear: () => { + // 保证半模态消失时状态正确 + this.isShowImage = false; + this.isShowSheet = false; + // 设置一镜到底动画又进入可触发状态 + this.isAnimating = false; + // 原图重新变为可交互状态 + this.isEnabled = true; + } + }) // 挂载模态页作为一镜到底动画的实现页 + .bindContentCover(this.isShowOverlay, this.overlayNode(), { + // 模态页面设置为无转场 + transition: TransitionEffect.IDENTITY, + }) + } + + // 半模态页面 + @Builder + mySheet() { + Column({ space: 20 }) { + Text(this.context.resourceManager.getStringByNameSync('shareTransition_text10')) + .fontSize(30) + Row({ space: 40 }) { + Column({ space: 20 }) { + ForEach([1, 2, 3, 4], () => { + Stack() + .backgroundColor(Color.Pink) + .borderRadius(20) + .width(60) + .height(60) + }) + } + + Column() { + if (this.isShowImage) { + // 半模态页面的自定义图片节点 + ImageNode(); + } else { + // 抓取布局和占位用,实际不显示 + // 图片使用Resource资源,需用户自定义 + Image($r('app.media.longevity_flower')) + .visibility(Visibility.Hidden); + } + } + .height(300) + .width(200) + .borderRadius(20) + .clip(true) + .id('target') + } + .alignItems(VerticalAlign.Top) + } + .alignItems(HorizontalAlign.Start) + .height('100%') + .width('100%') + .margin(40) + } + + @Builder + overlayNode() { + // Stack需要设置alignContent为TopStart,否则在高度变化过程中,截图和内容都会随高度重新布局位置 + Stack({ alignContent: Alignment.TopStart }) { + ImageNode() + } + .scale({ + x: this.scaleValue, + y: this.scaleValue, + centerX: undefined, + centerY: undefined + }) + .translate({ x: this.translateX, y: this.translateY }) + .width(this.clipWidth) + .height(this.clipHeight) + .borderRadius(this.radius) + .clip(true) + } +} + +@Component +struct ImageNode { + @State myNodeController: MyNodeController | undefined = new MyNodeController(false); + + aboutToAppear(): void { + // 获取自定义节点 + let node = getMyNode(); + if (node === undefined) { + // 新建自定义节点 + createMyNode(this.getUIContext()); + } + this.myNodeController = getMyNode(); + } + + aboutToDisappear(): void { + if (this.myNodeController != undefined) { + // 节点下树 + this.myNodeController.onRemove(); + } + } + + build() { + NodeContainer(this.myNodeController); + } +} + +// [End bind_sheet_index] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template6/IfElseGeometryTransition.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template6/IfElseGeometryTransition.ets new file mode 100644 index 0000000000000000000000000000000000000000..68e9c6f75215f5cf29cb82967f55bd91b02df00a --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template6/IfElseGeometryTransition.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start geometry_transition_simple] +import { curves } from '@kit.ArkUI'; + +@Entry +@Component +struct IfElseGeometryTransition { + @State isShow: boolean = false; + + build() { + Stack({ alignContent: Alignment.Center }) { + if (this.isShow) { + // 图片使用Resource资源,需用户自定义 + Image($r('app.media.spring')) + .autoResize(false) + .clip(true) + .width(200) + .height(200) + .borderRadius(100) + .geometryTransition('picture') + .transition(TransitionEffect.OPACITY) + // 在打断场景下,即动画过程中点击页面触发下一次转场,如果不加id,则会出现重影 + // 加了id之后,新建的spring图片会复用之前的spring图片节点,不会重新创建节点,也就不会有重影问题 + // 加id的规则为加在if和else下的第一个节点上,有多个并列节点则也需要进行添加 + .id('item1') + } else { + // geometryTransition此处绑定的是容器,那么容器内的子组件需设为相对布局跟随父容器变化, + // 套多层容器为了说明相对布局约束传递 + Column() { + Column() { + // 图片使用Resource资源,需用户自定义 + Image($r('app.media.sunset_sky')) + .size({ width: '100%', height: '100%' }) + } + .size({ width: '100%', height: '100%' }) + } + .width(100) + .height(100) + // geometryTransition会同步圆角,但仅限于geometryTransition绑定处,此处绑定的是容器 + // 则对容器本身有圆角同步而不会操作容器内部子组件的borderRadius + .borderRadius(50) + .clip(true) + .geometryTransition('picture') + // transition保证节点离场不被立即析构,设置通用转场效果 + .transition(TransitionEffect.OPACITY) + .position({ x: 40, y: 40 }) + .id('item2') + } + } + .onClick(() => { + this.getUIContext()?.animateTo({ + curve: curves.springMotion() + }, () => { + this.isShow = !this.isShow; + }) + }) + .size({ width: '100%', height: '100%' }) + } +} + +// [End geometry_transition_simple] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template7/Index.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template7/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..22e36c28eec4c6ff4c6fefdd6b0449e8d5c98573 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/shareTransition/template7/Index.ets @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2025 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 { common } from '@kit.AbilityKit'; + +// [Start geometry_transition] +class PostData { + // 图片使用Resource资源,需用户自定义 + avatar: Resource = $r('app.media.flower'); + name: string = ''; + message: string = ''; + images: Resource[] = []; +} + +@Entry +@Component +struct Index { + @State isPersonalPageShow: boolean = false; + @State selectedIndex: number = 0; + @State alphaValue: number = 1; + // [StartExclude geometry_transition] + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + // [EndExclude geometry_transition] + + // 数组中图片均使用Resource资源,需用户自定义 + private allPostData: PostData[] = [ + { + avatar: $r('app.media.flower'), + name: 'Alice', + message: this.context.resourceManager.getStringByNameSync('shareTransition_text1'), + images: [$r('app.media.spring'), $r('app.media.tall_tree')] + }, + { + avatar: $r('app.media.sunset_sky'), + name: 'Bob', + message: this.context.resourceManager.getStringByNameSync('shareTransition_text2'), + images: [$r('app.media.island')] + }, + { + avatar: $r('app.media.tall_tree'), + name: 'Carl', + message: this.context.resourceManager.getStringByNameSync('shareTransition_text3'), + images: [$r('app.media.flower'), $r('app.media.sunset_sky'), $r('app.media.spring')] + }]; + + private onAvatarClicked(index: number): void { + this.selectedIndex = index; + this.getUIContext()?.animateTo({ + duration: 350, + curve: Curve.Friction + }, () => { + this.isPersonalPageShow = !this.isPersonalPageShow; + this.alphaValue = 0; + }); + } + + private onPersonalPageBack(index: number): void { + this.getUIContext()?.animateTo({ + duration: 350, + curve: Curve.Friction + }, () => { + this.isPersonalPageShow = !this.isPersonalPageShow; + this.alphaValue = 1; + }); + } + + @Builder + PersonalPageBuilder(index: number) { + Column({ space: 20 }) { + Image(this.allPostData[index].avatar) + .size({ width: 200, height: 200 }) + .borderRadius(100) + // 头像配置共享元素效果,与点击的头像的id匹配 + .geometryTransition(index.toString()) + .clip(true) + .transition(TransitionEffect.opacity(0.99)) + + Text(this.allPostData[index].name) + .font({ size: 30, weight: 600 }) + // 对文本添加出现转场效果 + .transition(TransitionEffect.asymmetric( + TransitionEffect.OPACITY + .combine(TransitionEffect.translate({ y: 100 })), + TransitionEffect.OPACITY.animation({ duration: 0 }) + )) + + Text(this.context.resourceManager.getStringByNameSync('shareTransition_text11') + + this.allPostData[index].name) + // 对文本添加出现转场效果 + .transition(TransitionEffect.asymmetric( + TransitionEffect.OPACITY + .combine(TransitionEffect.translate({ y: 100 })), + TransitionEffect.OPACITY.animation({ duration: 0 }) + )) + } + .padding({ top: 20 }) + .size({ width: 360, height: 780 }) + .backgroundColor(Color.White) + .onClick(() => { + this.onPersonalPageBack(index); + }) + .transition(TransitionEffect.asymmetric( + TransitionEffect.opacity(0.99), + TransitionEffect.OPACITY + )) + } + + build() { + Column({ space: 20 }) { + ForEach(this.allPostData, (postData: PostData, index: number) => { + Column() { + Post({ + data: postData, index: index, onAvatarClicked: (index: number) => { + this.onAvatarClicked(index); + } + }) + } + .width('100%') + }, (postData: PostData, index: number) => index.toString()) + } + .size({ width: '100%', height: '100%' }) + .backgroundColor('#40808080') + .bindContentCover(this.isPersonalPageShow, + this.PersonalPageBuilder(this.selectedIndex), { modalTransition: ModalTransition.NONE }) + .opacity(this.alphaValue) + } +} + +@Component +export default struct Post { + @Prop data: PostData; + @Prop index: number; + @State expandImageSize: number = 100; + @State avatarSize: number = 50; + private onAvatarClicked: (index: number) => void = (index: number) => { + }; + + build() { + Column({ space: 20 }) { + Row({ space: 10 }) { + Image(this.data.avatar) + .size({ width: this.avatarSize, height: this.avatarSize }) + .borderRadius(this.avatarSize / 2) + .clip(true) + .onClick(() => { + this.onAvatarClicked(this.index); + }) + // 对头像绑定共享元素转场的id + .geometryTransition(this.index.toString(), { follow: true }) + .transition(TransitionEffect.OPACITY.animation({ duration: 350, curve: Curve.Friction })) + + Text(this.data.name); + } + .justifyContent(FlexAlign.Start) + + Text(this.data.message); + + Row({ space: 15 }) { + ForEach(this.data.images, (imageResource: Resource, index: number) => { + Image(imageResource) + .size({ width: 100, height: 100 }) + }, (imageResource: Resource, index: number) => index.toString()) + } + } + .backgroundColor(Color.White) + .size({ width: '100%', height: 250 }) + .alignItems(HorizontalAlign.Start) + .padding({ left: 10, top: 10 }) + } +} + +// [End geometry_transition] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/springCurve/template1/SpringCurve.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/springCurve/template1/SpringCurve.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c25d9d723ab64125fbb6c809f28814551b7fca3 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/springCurve/template1/SpringCurve.ets @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2025 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 { common } from '@kit.AbilityKit'; + +// [Start spring_curve] +import { curves } from '@kit.ArkUI'; + +class Spring { + public title: string; + public subTitle: string; + public iCurve: ICurve; + + constructor(title: string, subTitle: string, iCurve: ICurve) { + this.title = title; + this.iCurve = iCurve; + this.subTitle = subTitle; + } +} + +// 弹簧组件 +@Component +struct Motion { + @Prop dRotate: number = 0; + private title: string = ''; + private subTitle: string = ''; + private iCurve: ICurve | undefined = undefined; + + build() { + Column() { + Circle() + .translate({ y: this.dRotate }) + .animation({ curve: this.iCurve, iterations: -1 }) + .foregroundColor('#317AF7') + .width(30) + .height(30) + + Column() { + Text(this.title) + .fontColor(Color.Black) + .fontSize(10).height(30) + Text(this.subTitle) + .fontColor(0xcccccc) + .fontSize(10).width(50) + } + .borderWidth({ top: 1 }) + .borderColor(0xf5f5f5) + .width(80) + .alignItems(HorizontalAlign.Center) + .height(100) + + } + .height(110) + .margin({ bottom: 5 }) + .alignItems(HorizontalAlign.Center) + } +} + +@Entry +@Component +export struct SpringCurve { + // [StartExclude spring_curve] + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + // [EndExclude spring_curve] + @State dRotate: number = 0; + private springs: Spring[] = [ + new Spring('springMotion', this.context.resourceManager.getStringByNameSync('springCurve_text1'), + curves.springMotion(1, 0.25)), + new Spring('responsive' + '\n' + 'SpringMotion', + this.context.resourceManager.getStringByNameSync('springCurve_text2'), + curves.responsiveSpringMotion(1, 0.25)), + new Spring('interpolating' + '\n' + 'Spring', + this.context.resourceManager.getStringByNameSync('springCurve_text3'), + curves.interpolatingSpring(10, 1, 228, 30)), + new Spring('springCurve', this.context.resourceManager.getStringByNameSync('springCurve_text1'), + curves.springCurve(10, 1, 228, 30)) + ]; + + build() { + Row() { + ForEach(this.springs, (item: Spring) => { + Motion({ + title: item.title, + subTitle: item.subTitle, + iCurve: item.iCurve, + dRotate: this.dRotate + }) + }) + } + .justifyContent(FlexAlign.Center) + .alignItems(VerticalAlign.Bottom) + .width('100%') + .height(437) + .margin({ top: 20 }) + .onClick(() => { + this.dRotate = -50; + }) + } +} + +// [End spring_curve] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/pages/traditionalCurve/template1/CurveDemo.ets b/ArkUIKit/Animation/entry/src/main/ets/pages/traditionalCurve/template1/CurveDemo.ets new file mode 100644 index 0000000000000000000000000000000000000000..e91f8d9a9424dc751e82f4bd90c6e3aa5ad532e3 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/pages/traditionalCurve/template1/CurveDemo.ets @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2025 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. + */ + +// [Start traditional_curve] +class TraditionalCurve { + public title: string; + public curve: Curve; + public color: Color | string; + + constructor(title: string, curve: Curve, color: Color | string = '') { + this.title = title; + this.curve = curve; + this.color = color; + } +} + +const traditionalCurves: TraditionalCurve[] = [ + new TraditionalCurve(' Linear', Curve.Linear, '#317AF7'), + new TraditionalCurve(' Ease', Curve.Ease, '#D94838'), + new TraditionalCurve(' EaseIn', Curve.EaseIn, '#DB6B42'), + new TraditionalCurve(' EaseOut', Curve.EaseOut, '#5BA854'), + new TraditionalCurve(' EaseInOut', Curve.EaseInOut, '#317AF7'), + new TraditionalCurve(' FastOutSlowIn', Curve.FastOutSlowIn, '#D94838') +] + +@Entry +@Component +struct CurveDemo { + @State dRotate: number = 0; // 旋转角度 + + build() { + Column() { + // 曲线图例 + Grid() { + ForEach(traditionalCurves, (item: TraditionalCurve) => { + GridItem() { + Column() { + Row() + .width(30) + .height(30) + .borderRadius(15) + .backgroundColor(item.color) + Text(item.title) + .fontSize(15) + .fontColor(0x909399) + } + .width('100%') + } + }) + } + .columnsTemplate('1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .padding(10) + .width('100%') + .height(300) + .margin({ top: 50 }) + + Stack() { + // 摆动管道 + Row() + .width(290) + .height(290) + .border({ + width: 15, + color: 0xE6E8EB, + radius: 145 + }) + + ForEach(traditionalCurves, (item: TraditionalCurve) => { + // 小球 + Column() { + Row() + .width(30) + .height(30) + .borderRadius(15) + .backgroundColor(item.color) + } + .width(20) + .height(300) + .rotate({ angle: this.dRotate }) + .animation({ + duration: 2000, + iterations: -1, + curve: item.curve, + delay: 100 + }) + }) + } + .width('100%') + .height(200) + .onClick(() => { + this.dRotate ? null : this.dRotate = 360; + }) + } + .width('100%') + } +} + +// [End traditional_curve] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/ets/utils/ComponentAttrUtils.ets b/ArkUIKit/Animation/entry/src/main/ets/utils/ComponentAttrUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..b29f9273204d9ae14e7c68fa9914fc13d88a5e4a --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/ets/utils/ComponentAttrUtils.ets @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start navigation_component_attr_utils] +// [Start bind_sheet_component_attr_utils] +// 获取组件相对窗口的位置 +import { componentUtils, UIContext } from '@kit.ArkUI'; +import { JSON } from '@kit.ArkTS'; + +export class ComponentAttrUtils { + // 根据组件的id获取组件的位置信息 + public static getRectInfoById(context: UIContext, id: string): RectInfoInPx { + if (!context || !id) { + throw Error('object is empty'); + } + let componentInfo: componentUtils.ComponentInfo = context.getComponentUtils().getRectangleById(id); + + if (!componentInfo) { + throw Error('object is empty'); + } + + let rstRect: RectInfoInPx = new RectInfoInPx(); + const widthScaleGap = componentInfo.size.width * (1 - componentInfo.scale.x) / 2; + const heightScaleGap = componentInfo.size.height * (1 - componentInfo.scale.y) / 2; + rstRect.left = componentInfo.translate.x + componentInfo.windowOffset.x + widthScaleGap; + rstRect.top = componentInfo.translate.y + componentInfo.windowOffset.y + heightScaleGap; + rstRect.right = + componentInfo.translate.x + componentInfo.windowOffset.x + componentInfo.size.width - widthScaleGap; + rstRect.bottom = + componentInfo.translate.y + componentInfo.windowOffset.y + componentInfo.size.height - heightScaleGap; + rstRect.width = rstRect.right - rstRect.left; + rstRect.height = rstRect.bottom - rstRect.top; + return { + left: rstRect.left, + right: rstRect.right, + top: rstRect.top, + bottom: rstRect.bottom, + width: rstRect.width, + height: rstRect.height + } + } +} + +export class RectInfoInPx { + public left: number = 0; + public top: number = 0; + public right: number = 0; + public bottom: number = 0; + public width: number = 0; + public height: number = 0; +} + +export class RectJson { + public $rect: Array = []; +} + +// [End bind_sheet_component_attr_utils] +// [End navigation_component_attr_utils] \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertInstanceOf.js b/ArkUIKit/Animation/entry/src/main/ets/utils/WindowUtils.ets similarity index 54% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertInstanceOf.js rename to ArkUIKit/Animation/entry/src/main/ets/utils/WindowUtils.ets index 1e11b93f7251c67f5455c5007cd7be268aa53b32..dc0541cf582fe81567b2e7f0895e1572515091b5 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertInstanceOf.js +++ b/ArkUIKit/Animation/entry/src/main/ets/utils/WindowUtils.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -12,18 +12,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start navigation_window_utils] +// [Start bind_sheet_window_utils] +// 窗口信息 +import { window } from '@kit.ArkUI'; -function assertInstanceOf(actualValue, expected) { - if (Object.prototype.toString.call(actualValue) == '[object ' + expected[0] + ']') { - return { - pass: true - }; - } else { - return { - pass: false, - message: actualValue + ' is ' + Object.prototype.toString.call(actualValue) + 'not ' + expected[0] - }; - } +export class WindowUtils { + public static window: window.Window; + public static windowWidthPx: number; + public static windowHeightPx: number; + public static topAvoidAreaHeightPx: number; + public static navigationIndicatorHeightPx: number; } -export default assertInstanceOf; +// [End bind_sheet_window_utils] +// [End navigation_window_utils] \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/module.json5 b/ArkUIKit/Animation/entry/src/main/module.json5 index 00d847b7bfd514973fbade9f670e96253df4a7be..59fcc3fc56fd48f507b621d4b10e405032a557f5 100644 --- a/ArkUIKit/Animation/entry/src/main/module.json5 +++ b/ArkUIKit/Animation/entry/src/main/module.json5 @@ -32,7 +32,9 @@ "icon": "$media:layered_image", "label": "$string:EntryAbility_label", "startWindowIcon": "$media:startIcon", + // [Start auto_rotation] "orientation": "auto_rotation", + // [End auto_rotation] "startWindowBackground": "$color:start_window_background", "exported": true, "skills": [ @@ -60,6 +62,9 @@ } ] } - ] + ], + // [Start navigation_router_map] + "routerMap": "$profile:route_map", + // [End navigation_router_map] } } \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/resources/base/element/string.json b/ArkUIKit/Animation/entry/src/main/resources/base/element/string.json index 0f731181cd22043f5d3baa117350a0b9a493a9cc..d26488cdcd81e23f84ef505225257b7062915aa0 100644 --- a/ArkUIKit/Animation/entry/src/main/resources/base/element/string.json +++ b/ArkUIKit/Animation/entry/src/main/resources/base/element/string.json @@ -196,6 +196,90 @@ "name": "shareTransition_label", "value": "共享元素转场" }, + { + "name": "shareTransition_label1", + "value": "示例1(共享元素转场)" + }, + { + "name": "shareTransition_label2", + "value": "示例2(不新建容器并直接变化原容器)" + }, + { + "name": "shareTransition_label3", + "value": "示例3(新建容器并跨容器迁移组件-结合Stack使用)" + }, + { + "name": "shareTransition_label4", + "value": "示例4(新建容器并跨容器迁移组件-结合Navigation使用)" + }, + { + "name": "shareTransition_label5", + "value": "示例5(新建容器并跨容器迁移组件-结合BindSheet使用)" + }, + { + "name": "shareTransition_label6", + "value": "示例6(使用geometryTransition共享元素转场-geometryTransition的简单使用)" + }, + { + "name": "shareTransition_label7", + "value": "示例7(使用geometryTransition共享元素转场-geometryTransition结合模态转场使用)" + }, + { + "name": "shareTransition_text1", + "value": "天气晴朗" + }, + { + "name": "shareTransition_text2", + "value": "你好世界" + }, + { + "name": "shareTransition_text3", + "value": "万物生长" + }, + { + "name": "shareTransition_text4", + "value": "评论区" + }, + { + "name": "shareTransition_text5", + "value": "点击展开 Item " + }, + { + "name": "shareTransition_text6", + "value": "共享元素转场" + }, + { + "name": "shareTransition_text7", + "value": "展开态" + }, + { + "name": "shareTransition_text8", + "value": "展开态内容" + }, + { + "name": "shareTransition_text9", + "value": "照片" + }, + { + "name": "shareTransition_text10", + "value": "半模态页面" + }, + { + "name": "shareTransition_text11", + "value": "你好,我是" + }, + { + "name": "shareTransition_text12", + "value": "点击展开 Item 2" + }, + { + "name": "shareTransition_text13", + "value": "点击展开 Item 4" + }, + { + "name": "shareTransition_text14", + "value": "点击展开 Item 8" + }, { "name": "motionPath_label", "value": "路径动画" @@ -302,7 +386,7 @@ }, { "name": "animation_blur_label", - "value": "背景模糊" + "value": "模糊动画" }, { "name": "animation_blur_label1", @@ -323,6 +407,202 @@ { "name": "animation_blur_label5", "value": "示例5(使用motionBlur为组件添加运动模糊效果)" + }, + { + "name": "traditionalCurve_label", + "value": "传统曲线" + }, + { + "name": "springCurve_label", + "value": "弹簧曲线" + }, + { + "name": "springCurve_text1", + "value": "周期1, 阻尼0.25" + }, + { + "name": "springCurve_text2", + "value": "弹性跟手曲线" + }, + { + "name": "springCurve_text3", + "value": "初始速度10, 质量1, 刚度228, 阻尼30" + }, + { + "name": "modal_transition_label", + "value": "模态转场" + }, + { + "name": "modal_transition_label1", + "value": "示例1(使用bindContentCover构建全屏模态转场效果)" + }, + { + "name": "modal_transition_label2", + "value": "示例2(使用bindSheet构建半模态转场效果)" + }, + { + "name": "modal_transition_label3", + "value": "示例3(使用bindMenu实现菜单弹出效果)" + }, + { + "name": "modal_transition_label4", + "value": "示例4(使用bindContextMenu实现菜单弹出效果)" + }, + { + "name": "modal_transition_label5", + "value": "示例5(使用bindPopup实现气泡弹窗效果)" + }, + { + "name": "modal_transition_label6", + "value": "示例6(使用if实现模态转场)" + }, + { + "name": "modal_transition_text1", + "value": "王**" + }, + { + "name": "modal_transition_text2", + "value": "宋*" + }, + { + "name": "modal_transition_text3", + "value": "许**" + }, + { + "name": "modal_transition_text4", + "value": "唐*" + }, + { + "name": "modal_transition_text5", + "value": "选择乘车人" + }, + { + "name": "modal_transition_text6", + "value": "+ 添加乘车人" + }, + { + "name": "modal_transition_text7", + "value": "编辑" + }, + { + "name": "modal_transition_text8", + "value": "确认" + }, + { + "name": "modal_transition_text9", + "value": "确认订单" + }, + { + "name": "modal_transition_text10", + "value": "始发站" + }, + { + "name": "modal_transition_text11", + "value": "8时1分" + }, + { + "name": "modal_transition_text12", + "value": "终点站" + }, + { + "name": "modal_transition_text13", + "value": "+ 选择乘车人" + }, + { + "name": "modal_transition_text14", + "value": "不要辣" + }, + { + "name": "modal_transition_text15", + "value": "少放辣" + }, + { + "name": "modal_transition_text16", + "value": "多放辣" + }, + { + "name": "modal_transition_text17", + "value": "不要香菜" + }, + { + "name": "modal_transition_text18", + "value": "不要香葱" + }, + { + "name": "modal_transition_text19", + "value": "不要一次性餐具" + }, + { + "name": "modal_transition_text20", + "value": "需要一次性餐具" + }, + { + "name": "modal_transition_text21", + "value": "口味与餐具" + }, + { + "name": "modal_transition_text22", + "value": "选择点餐口味和餐具" + }, + { + "name": "modal_transition_text23", + "value": "菜单项1" + }, + { + "name": "modal_transition_text24", + "value": "菜单项2" + }, + { + "name": "modal_transition_text25", + "value": "保存图片" + }, + { + "name": "modal_transition_text26", + "value": "收藏" + }, + { + "name": "modal_transition_text27", + "value": "搜一搜" + }, + { + "name": "modal_transition_text28", + "value": "查看图片" + }, + { + "name": "modal_transition_text29", + "value": "蓝牙" + }, + { + "name": "modal_transition_text30", + "value": "个人热点" + }, + { + "name": "modal_transition_text31", + "value": "连接与共享" + }, + { + "name": "modal_transition_text32", + "value": "投屏" + }, + { + "name": "modal_transition_text33", + "value": "打印" + }, + { + "name": "modal_transition_text34", + "value": "私人DNS" + }, + { + "name": "modal_transition_text35", + "value": "设置" + }, + { + "name": "modal_transition_text36", + "value": "输入关键字搜索" + }, + { + "name": "modal_transition_text37", + "value": "共享" } ] } \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/main/resources/base/media/avatar.jpeg b/ArkUIKit/Animation/entry/src/main/resources/base/media/avatar.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..8b9ecfffab49893e615b6f0f54e1804aba9a90a9 Binary files /dev/null and b/ArkUIKit/Animation/entry/src/main/resources/base/media/avatar.jpeg differ diff --git a/ArkUIKit/Animation/entry/src/main/resources/base/media/card.jpeg b/ArkUIKit/Animation/entry/src/main/resources/base/media/card.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..ed89d60601903936d830b43b57e85f55e776bce3 Binary files /dev/null and b/ArkUIKit/Animation/entry/src/main/resources/base/media/card.jpeg differ diff --git a/ArkUIKit/Animation/entry/src/main/resources/base/media/flower.jpg b/ArkUIKit/Animation/entry/src/main/resources/base/media/flower.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a0c66de1d8d4a51a7fb14143c3c4cf4c44e78302 Binary files /dev/null and b/ArkUIKit/Animation/entry/src/main/resources/base/media/flower.jpg differ diff --git a/ArkUIKit/Animation/entry/src/main/resources/base/media/icon_1.JPG b/ArkUIKit/Animation/entry/src/main/resources/base/media/icon_1.JPG new file mode 100644 index 0000000000000000000000000000000000000000..00d71c9cac8cddc37eb2a5da35e4a18ac5b4e7a5 Binary files /dev/null and b/ArkUIKit/Animation/entry/src/main/resources/base/media/icon_1.JPG differ diff --git a/ArkUIKit/Animation/entry/src/main/resources/base/media/island.jpg b/ArkUIKit/Animation/entry/src/main/resources/base/media/island.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4d90cdd19fe776b59ec48a93d0960d39c249237c Binary files /dev/null and b/ArkUIKit/Animation/entry/src/main/resources/base/media/island.jpg differ diff --git a/ArkUIKit/StateTrack/entry/build/default/outputs/default/entry-default-unsigned.hap b/ArkUIKit/Animation/entry/src/main/resources/base/media/longevity_flower.jpg similarity index 30% rename from ArkUIKit/StateTrack/entry/build/default/outputs/default/entry-default-unsigned.hap rename to ArkUIKit/Animation/entry/src/main/resources/base/media/longevity_flower.jpg index c19482591378829235c4977a945d966517fdfecc..ebce11d564999afed3f879247a71f5c5fa7bf72f 100644 Binary files a/ArkUIKit/StateTrack/entry/build/default/outputs/default/entry-default-unsigned.hap and b/ArkUIKit/Animation/entry/src/main/resources/base/media/longevity_flower.jpg differ diff --git a/ArkUIKit/Animation/entry/src/main/resources/base/media/spring.jpg b/ArkUIKit/Animation/entry/src/main/resources/base/media/spring.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5c226925fb081c947cb42eebcdac6c4f319302aa Binary files /dev/null and b/ArkUIKit/Animation/entry/src/main/resources/base/media/spring.jpg differ diff --git a/ArkUIKit/Animation/entry/src/main/resources/base/media/sunset_sky.jpg b/ArkUIKit/Animation/entry/src/main/resources/base/media/sunset_sky.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fdd486a03bb8b606bb8a07e6788b207f1d467a32 Binary files /dev/null and b/ArkUIKit/Animation/entry/src/main/resources/base/media/sunset_sky.jpg differ diff --git a/ArkUIKit/Animation/entry/src/main/resources/base/media/tall_tree.jpg b/ArkUIKit/Animation/entry/src/main/resources/base/media/tall_tree.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5ca2e7da214b2e00904f9ed7460916daadc1f54d Binary files /dev/null and b/ArkUIKit/Animation/entry/src/main/resources/base/media/tall_tree.jpg differ diff --git a/ArkUIKit/Animation/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/Animation/entry/src/main/resources/base/profile/main_pages.json index 4e87fb1383a571552cc66eada16f5e567525200c..a89793c33f52d4f4bbcac13e0387afdf26059d8f 100644 --- a/ArkUIKit/Animation/entry/src/main/resources/base/profile/main_pages.json +++ b/ArkUIKit/Animation/entry/src/main/resources/base/profile/main_pages.json @@ -39,6 +39,12 @@ "pages/compTransition/template6/Index", "pages/shareTransition/template1/Index", "pages/shareTransition/template1/PageB", + "pages/shareTransition/template2/Index", + "pages/shareTransition/template3/Index", + "pages/shareTransition/template4/Index", + "pages/shareTransition/template5/Index", + "pages/shareTransition/template6/IfElseGeometryTransition", + "pages/shareTransition/template7/Index", "pages/motionPath/template1/Index", "pages/animateToImmediately/template1/Index", "pages/rotation/template1/Index", @@ -48,6 +54,19 @@ "pages/animatableProperty/template1/Index", "pages/animatableProperty/template2/Index", "pages/component/template1/Index", - "pages/component/template2/Index" + "pages/component/template2/Index", + "pages/animationBlur/template1/BlurEffectsExample", + "pages/animationBlur/template2/Index", + "pages/animationBlur/template3/BackDropBlurStyleDemo", + "pages/animationBlur/template4/ForegroundBlurStyleDemo", + "pages/animationBlur/template5/MotionBlurTest", + "pages/traditionalCurve/template1/CurveDemo", + "pages/springCurve/template1/SpringCurve", + "pages/modalTransition/template1/BindContentCoverDemo", + "pages/modalTransition/template2/BindSheetDemo", + "pages/modalTransition/template3/BindMenuDemo", + "pages/modalTransition/template4/BindContextMenuDemo", + "pages/modalTransition/template5/BindPopupDemo", + "pages/modalTransition/template6/ModalTransitionWithIf" ] } diff --git a/ArkUIKit/Animation/entry/src/main/resources/base/profile/route_map.json b/ArkUIKit/Animation/entry/src/main/resources/base/profile/route_map.json new file mode 100644 index 0000000000000000000000000000000000000000..89769f49e1cd95fe8c298f8fd38dfb92ec4a5c18 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/main/resources/base/profile/route_map.json @@ -0,0 +1,14 @@ +{ + "routerMap": [ + { + "name": "PageOne", + "pageSourceFile": "src/main/ets/pages/shareTransition/template4/PageOne.ets", + "buildFunction": "PageOneBuilder" + }, + { + "name": "PageTwo", + "pageSourceFile": "src/main/ets/pages/shareTransition/template4/PageTwo.ets", + "buildFunction": "PageTwoBuilder" + } + ] +} \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/ohosTest/ets/test/Component.test.ets b/ArkUIKit/Animation/entry/src/ohosTest/ets/test/Component.test.ets index 0a34eb00f19ddef49bc7d6b0c7b58bcf8235cfba..2e4330acd7d2219c8ad6172661bd89b6d38648e1 100644 --- a/ArkUIKit/Animation/entry/src/ohosTest/ets/test/Component.test.ets +++ b/ArkUIKit/Animation/entry/src/ohosTest/ets/test/Component.test.ets @@ -107,38 +107,38 @@ export function ComponentTest() { * @tc.type: Function * @tc.level Level 1 */ - it(BUNDLE + 'ComponentTest_002', 0, async () => { - hilog.info(DOMAIN, TAG, 'Animation_ComponentTest_002_begin'); - - aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.component")))); - await aimComponent.click(); - await driver.delayMs(1000); - - const firstGroup = await driver.findComponent(ON.text('first ListItemGroup')); - const secondGroup = await driver.findComponent(ON.text('second ListItemGroup')); - - const displaySize = await driver.getDisplaySize(); - const itemWidth = displaySize.x; - const itemHeight = 100; - const targetItemY = Math.floor(displaySize.y * 0.4); - - await driver.swipe( - Math.floor(itemWidth * 0.9), - targetItemY, - Math.floor(itemWidth * 0.1), - targetItemY, - 300 - ); - await driver.delayMs(500); - - const toTopButton = await driver.findComponent(ON.text('To TOP')); - await toTopButton.click(); - await driver.delayMs(1500); - - const firstItem = await driver.findComponent(ON.text('3')); - - hilog.info(DOMAIN, TAG, 'Animation_ComponentTest_002_end'); - }); + // it(BUNDLE + 'ComponentTest_002', 0, async () => { + // hilog.info(DOMAIN, TAG, 'Animation_ComponentTest_002_begin'); + // + // aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.component")))); + // await aimComponent.click(); + // await driver.delayMs(1000); + // + // const firstGroup = await driver.findComponent(ON.text('first ListItemGroup')); + // const secondGroup = await driver.findComponent(ON.text('second ListItemGroup')); + // + // const displaySize = await driver.getDisplaySize(); + // const itemWidth = displaySize.x; + // const itemHeight = 100; + // const targetItemY = Math.floor(displaySize.y * 0.4); + // + // await driver.swipe( + // Math.floor(itemWidth * 0.9), + // targetItemY, + // Math.floor(itemWidth * 0.1), + // targetItemY, + // 300 + // ); + // await driver.delayMs(500); + // + // const toTopButton = await driver.findComponent(ON.text('To TOP')); + // await toTopButton.click(); + // await driver.delayMs(1500); + // + // const firstItem = await driver.findComponent(ON.text('3')); + // + // hilog.info(DOMAIN, TAG, 'Animation_ComponentTest_002_end'); + // }); }); } \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/Animation/entry/src/ohosTest/ets/test/List.test.ets index c2c08d21df4eeb79b27cd658689ded15757a1798..76a5e4eae6c5def4d353f815865b6a87d7e303e1 100644 --- a/ArkUIKit/Animation/entry/src/ohosTest/ets/test/List.test.ets +++ b/ArkUIKit/Animation/entry/src/ohosTest/ets/test/List.test.ets @@ -26,7 +26,10 @@ import { AnimateToImmediatelyTest } from './AnimateToImmediately.test'; import { RotationTest } from './Rotation.test'; import { AnimatablePropertyTest } from './AnimatableProperty.test'; import { ComponentTest } from './Component.test'; - +import { AnimationBlurTest } from './AnimationBlur.test'; +import { TraditionalCurveTest } from './TraditionalCurve.test'; +import { SpringCurveTest } from './SpringCurve.test'; +import { ModalTransitionTest } from './ModalTransition.test'; export default function testsuite() { AnimateToTest(); @@ -43,4 +46,8 @@ export default function testsuite() { RotationTest(); AnimatablePropertyTest(); ComponentTest(); + AnimationBlurTest(); + TraditionalCurveTest(); + SpringCurveTest(); + ModalTransitionTest(); } \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/ohosTest/ets/test/ModalTransition.test.ets b/ArkUIKit/Animation/entry/src/ohosTest/ets/test/ModalTransition.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc608a342dd8115c1d6b5d78f49f30008ce38a18 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/ohosTest/ets/test/ModalTransition.test.ets @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2025 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 { abilityDelegatorRegistry, Component, Driver } from '@kit.TestKit'; +import { afterEach, beforeAll, describe, expect, it } from '@ohos/hypium'; +import { ON } from '@ohos.UiTest'; +import resource from '../../../main/ets/common/resource'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator() + +const driver = Driver.create(); +const BUNDLE = 'Animation_' +const TAG = '[Sample_Animation]'; +const DOMAIN = 0xF811; + +let aimComponent: Component + +export function ModalTransitionTest() { + describe('Animation_ModalTransitionTest', () => { + + beforeAll(async () => { + await delegator.startAbility({ + bundleName: 'com.samples.animation', + abilityName: 'EntryAbility' + }); + await driver.delayMs(3000); + await driver.swipe(500, 800, 500, 20); + aimComponent = + await driver.findComponent(ON.text(resource.resourceToString($r("app.string.modal_transition_label")))); + await aimComponent.click(); + await driver.delayMs(1000); + }) + + afterEach(async () => { + aimComponent = await driver.findComponent(ON.text('AnimateIndex')); + do { + await driver.pressBack(); + aimComponent = await driver.findComponent(ON.text('AnimateIndex')); + } while (aimComponent === null) + }) + + /* + * @tc.number: Animation_ModalTransitionTest_001 + * @tc.name: Animation_ModalTransitionTest_001 + * @tc.desc: Set modalTransition + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level Level 1 + */ + it(BUNDLE + 'ModalTransitionTest_001', 0, async () => { + hilog.info(DOMAIN, TAG, 'Animation_ModalTransitionTest_001_begin'); + await driver.swipe(500, 800, 500, 1); + aimComponent = + await driver.findComponent(ON.text(resource.resourceToString($r("app.string.modal_transition_label1")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = + await driver.findComponent(ON.text(resource.resourceToString($r("app.string.modal_transition_text13")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = + await driver.findComponent(ON.text(resource.resourceToString($r("app.string.modal_transition_text8")))); + await aimComponent.click(); + await driver.delayMs(1000); + hilog.info(DOMAIN, TAG, 'Animation_ModalTransitionTest_001_end'); + }) + + /* + * @tc.number: Animation_ModalTransitionTest_002 + * @tc.name: Animation_ModalTransitionTest_002 + * @tc.desc: Set modalTransition + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level Level 1 + */ + it(BUNDLE + 'ModalTransitionTest_002', 0, async () => { + hilog.info(DOMAIN, TAG, 'Animation_ModalTransitionTest_002_begin'); + aimComponent = + await driver.findComponent(ON.text(resource.resourceToString($r("app.string.modal_transition_label2")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = + await driver.findComponent(ON.text(resource.resourceToString($r("app.string.modal_transition_text22")))); + await aimComponent.click(); + await driver.delayMs(1000); + await aimComponent.click(); + await driver.delayMs(1000); + hilog.info(DOMAIN, TAG, 'Animation_ModalTransitionTest_002_end'); + }) + + /* + * @tc.number: Animation_ModalTransitionTest_003 + * @tc.name: Animation_ModalTransitionTest_003 + * @tc.desc: Set modalTransition + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level Level 1 + */ + it(BUNDLE + 'ModalTransitionTest_003', 0, async () => { + hilog.info(DOMAIN, TAG, 'Animation_ModalTransitionTest_003_begin'); + aimComponent = + await driver.findComponent(ON.text(resource.resourceToString($r("app.string.modal_transition_label3")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.text('click')); + await aimComponent.click(); + await driver.delayMs(1000); + await aimComponent.click(); + await driver.delayMs(1000); + hilog.info(DOMAIN, TAG, 'Animation_ModalTransitionTest_003_end'); + }) + + /* + * @tc.number: Animation_ModalTransitionTest_004 + * @tc.name: Animation_ModalTransitionTest_004 + * @tc.desc: Set modalTransition + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level Level 1 + */ + it(BUNDLE + 'ModalTransitionTest_004', 0, async () => { + hilog.info(DOMAIN, TAG, 'Animation_ModalTransitionTest_004_begin'); + aimComponent = + await driver.findComponent(ON.text(resource.resourceToString($r("app.string.modal_transition_label4")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.type('root')); + await aimComponent.longClick(); + await driver.delayMs(1000); + hilog.info(DOMAIN, TAG, 'Animation_ModalTransitionTest_004_end'); + }) + + /* + * @tc.number: Animation_ModalTransitionTest_005 + * @tc.name: Animation_ModalTransitionTest_005 + * @tc.desc: Set modalTransition + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level Level 1 + */ + it(BUNDLE + 'ModalTransitionTest_005', 0, async () => { + hilog.info(DOMAIN, TAG, 'Animation_ModalTransitionTest_005_begin'); + aimComponent = + await driver.findComponent(ON.text(resource.resourceToString($r("app.string.modal_transition_label5")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.text('click')); + await aimComponent.click(); + await driver.delayMs(1000); + await aimComponent.click(); + await driver.delayMs(1000); + hilog.info(DOMAIN, TAG, 'Animation_ModalTransitionTest_005_end'); + }) + + /* + * @tc.number: Animation_ModalTransitionTest_006 + * @tc.name: Animation_ModalTransitionTest_006 + * @tc.desc: Set modalTransition + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level Level 1 + */ + it(BUNDLE + 'ModalTransitionTest_006', 0, async () => { + hilog.info(DOMAIN, TAG, 'Animation_ModalTransitionTest_006_begin'); + aimComponent = + await driver.findComponent(ON.text(resource.resourceToString($r("app.string.modal_transition_label6")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = + await driver.findComponent(ON.text(resource.resourceToString($r("app.string.modal_transition_text31")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.type('Row')); + await aimComponent.click(); + await driver.delayMs(1000); + hilog.info(DOMAIN, TAG, 'Animation_ModalTransitionTest_006_end'); + }) + }) +} \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/ohosTest/ets/test/ShareTransition.test.ets b/ArkUIKit/Animation/entry/src/ohosTest/ets/test/ShareTransition.test.ets index ee41e1c9de7eb37557a0f418eb5c3f07fdb5b251..4df6419cbe39026bb5156ae20b8e2fdda2dbef44 100644 --- a/ArkUIKit/Animation/entry/src/ohosTest/ets/test/ShareTransition.test.ets +++ b/ArkUIKit/Animation/entry/src/ohosTest/ets/test/ShareTransition.test.ets @@ -18,14 +18,14 @@ import { ON } from '@ohos.UiTest'; import resource from '../../../main/ets/common/resource'; import { hilog } from '@kit.PerformanceAnalysisKit'; -const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator() +const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); const driver = Driver.create(); -const BUNDLE = 'Animation_' +const BUNDLE = 'Animation_'; const TAG = '[Sample_Animation]'; -const DOMAIN = 0xF811 +const DOMAIN = 0xF811; -let aimComponent : Component +let aimComponent : Component; export function ShareTransitionTest() { describe('Animation_ShareTransitionTest', () => { @@ -60,7 +60,7 @@ export function ShareTransitionTest() { */ it(BUNDLE + 'ShareTransitionTest_001', 0, async () => { hilog.info(DOMAIN, TAG, 'Animation_ShareTransitionTest_001_begin'); - aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.temp1")))); + aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.shareTransition_label1")))); await aimComponent.click(); await driver.delayMs(1000); @@ -70,5 +70,150 @@ export function ShareTransitionTest() { hilog.info(DOMAIN, TAG, 'Animation_ShareTransitionTest_001_end'); }) + /* + * @tc.number: Animation_ShareTransitionTest_002 + * @tc.name: Animation_ShareTransitionTest_002 + * @tc.desc: The scenario where a new container is not created and the original container is directly modified + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level Level 1 + */ + it(BUNDLE + 'ShareTransitionTest_002', 0, async () => { + hilog.info(DOMAIN, TAG, 'Animation_ShareTransitionTest_002_begin'); + aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.shareTransition_label2")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.text('Alice')); + await aimComponent.click(); + await driver.delayMs(1000); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.text('Bob')); + await aimComponent.click(); + await driver.delayMs(1000); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.text('Carl')); + await aimComponent.click(); + await driver.delayMs(1000); + hilog.info(DOMAIN, TAG, 'Animation_ShareTransitionTest_002_end'); + }) + + /* + * @tc.number: Animation_ShareTransitionTest_003 + * @tc.name: Animation_ShareTransitionTest_003 + * @tc.desc: Create a new container and migrate components across containers with stack + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level Level 1 + */ + it(BUNDLE + 'ShareTransitionTest_003', 0, async () => { + hilog.info(DOMAIN, TAG, 'Animation_ShareTransitionTest_003_begin'); + aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.shareTransition_label3")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.shareTransition_text12")))); + await aimComponent.click(); + await driver.delayMs(1000); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.shareTransition_text13")))); + await aimComponent.click(); + await driver.delayMs(1000); + await aimComponent.click(); + await driver.delayMs(1000); + + await driver.swipe(500, 800, 500, 20); + await driver.delayMs(1000); + aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.shareTransition_text14")))); + await aimComponent.click(); + await driver.delayMs(1000); + hilog.info(DOMAIN, TAG, 'Animation_ShareTransitionTest_003_end'); + }) + + /* + * @tc.number: Animation_ShareTransitionTest_004 + * @tc.name: Animation_ShareTransitionTest_004 + * @tc.desc: Create a new container and migrate components across containers with navigation + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level Level 1 + */ + it(BUNDLE + 'ShareTransitionTest_004', 0, async () => { + hilog.info(DOMAIN, TAG, 'Animation_ShareTransitionTest_004_begin'); + aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.shareTransition_label4")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.type('root')); + await aimComponent.click(); + await driver.delayMs(3000); + hilog.info(DOMAIN, TAG, 'Animation_ShareTransitionTest_004_end'); + }) + + /* + * @tc.number: Animation_ShareTransitionTest_005 + * @tc.name: Animation_ShareTransitionTest_005 + * @tc.desc: Set share transition animate + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level Level 1 + */ + it(BUNDLE + 'ShareTransitionTest_005', 0, async () => { + hilog.info(DOMAIN, TAG, 'Animation_ShareTransitionTest_005_begin'); + aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.shareTransition_label5")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.type('root')); + await aimComponent.click(); + await driver.delayMs(3000); + hilog.info(DOMAIN, TAG, 'Animation_ShareTransitionTest_005_end'); + }) + + /* + * @tc.number: Animation_ShareTransitionTest_006 + * @tc.name: Animation_ShareTransitionTest_006 + * @tc.desc: Set share transition animate + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level Level 1 + */ + it(BUNDLE + 'ShareTransitionTest_006', 0, async () => { + hilog.info(DOMAIN, TAG, 'Animation_ShareTransitionTest_006_begin'); + aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.shareTransition_label6")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.type('root')); + await aimComponent.click(); + await driver.delayMs(3000); + hilog.info(DOMAIN, TAG, 'Animation_ShareTransitionTest_006_end'); + }) + + /* + * @tc.number: Animation_ShareTransitionTest_007 + * @tc.name: Animation_ShareTransitionTest_007 + * @tc.desc: Set share transition animate + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level Level 1 + */ + it(BUNDLE + 'ShareTransitionTest_007', 0, async () => { + hilog.info(DOMAIN, TAG, 'Animation_ShareTransitionTest_007_begin'); + aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.shareTransition_label7")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.type('Image')); + await aimComponent.click(); + await driver.delayMs(3000); + hilog.info(DOMAIN, TAG, 'Animation_ShareTransitionTest_007_end'); + }) }) } \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/ohosTest/ets/test/SpringCurve.test.ets b/ArkUIKit/Animation/entry/src/ohosTest/ets/test/SpringCurve.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..d2a8eb1d87d6b816777e9f6586758afae262f7d9 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/ohosTest/ets/test/SpringCurve.test.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2025 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 { abilityDelegatorRegistry, Component, Driver } from '@kit.TestKit'; +import { afterEach, beforeAll, describe, expect, it } from '@ohos/hypium'; +import { ON } from '@ohos.UiTest'; +import resource from '../../../main/ets/common/resource'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); + +const driver = Driver.create(); +const BUNDLE = 'Animation_'; +const TAG = '[Sample_Animation]'; +const DOMAIN = 0xF811; + +let aimComponent: Component; + +export function SpringCurveTest() { + describe('Animation_SpringCurveTest', () => { + + beforeAll(async () => { + await delegator.startAbility({ + bundleName: 'com.samples.animation', + abilityName: 'EntryAbility' + }); + await driver.delayMs(3000); + await driver.swipe(500, 800, 500, 20); + + aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.springCurve_label")))); + await aimComponent.click(); + await driver.delayMs(1000); + }) + + afterEach(async () => { + aimComponent = await driver.findComponent(ON.text('AnimateIndex')); + do { + await driver.pressBack(); + aimComponent = await driver.findComponent(ON.text('AnimateIndex')); + } while (aimComponent === null) + }) + + /* + * @tc.number: Animation_SpringCurveTest_001 + * @tc.name: Animation_SpringCurveTest_001 + * @tc.desc: Set springCurve + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level Level 1 + */ + it(BUNDLE + 'SpringCurveTest_001', 0, async () => { + hilog.info(DOMAIN, TAG, 'Animation_SpringCurveTest_001_begin'); + aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.temp1")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.type('Column')); + await aimComponent.click(); + await driver.delayMs(5000); + hilog.info(DOMAIN, TAG, 'Animation_SpringCurveTest_001_end'); + }) + }) +} \ No newline at end of file diff --git a/ArkUIKit/Animation/entry/src/ohosTest/ets/test/TraditionalCurve.test.ets b/ArkUIKit/Animation/entry/src/ohosTest/ets/test/TraditionalCurve.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..7ff66bb72190c7363616df3db4fc8aa5b13a2e18 --- /dev/null +++ b/ArkUIKit/Animation/entry/src/ohosTest/ets/test/TraditionalCurve.test.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2025 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 { abilityDelegatorRegistry, Component, Driver } from '@kit.TestKit'; +import { afterEach, beforeAll, describe, expect, it } from '@ohos/hypium'; +import { ON } from '@ohos.UiTest'; +import resource from '../../../main/ets/common/resource'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); + +const driver = Driver.create(); +const BUNDLE = 'Animation_'; +const TAG = '[Sample_Animation]'; +const DOMAIN = 0xF811; + +let aimComponent: Component; + +export function TraditionalCurveTest() { + describe('Animation_TraditionalCurveTest', () => { + + beforeAll(async () => { + await delegator.startAbility({ + bundleName: 'com.samples.animation', + abilityName: 'EntryAbility' + }); + await driver.delayMs(3000); + await driver.swipe(500, 800, 500, 20); + + aimComponent = + await driver.findComponent(ON.text(resource.resourceToString($r("app.string.traditionalCurve_label")))); + await aimComponent.click(); + await driver.delayMs(1000); + }) + + afterEach(async () => { + aimComponent = await driver.findComponent(ON.text('AnimateIndex')); + do { + await driver.pressBack(); + aimComponent = await driver.findComponent(ON.text('AnimateIndex')); + } while (aimComponent === null) + }) + + /* + * @tc.number: Animation_TraditionalCurveTest_001 + * @tc.name: Animation_TraditionalCurveTest_001 + * @tc.desc: Set traditionalCurve + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level Level 1 + */ + it(BUNDLE + 'TraditionalCurveTest_001', 0, async () => { + hilog.info(DOMAIN, TAG, 'Animation_TraditionalCurveTest_001_begin'); + aimComponent = await driver.findComponent(ON.text(resource.resourceToString($r("app.string.temp1")))); + await aimComponent.click(); + await driver.delayMs(1000); + + aimComponent = await driver.findComponent(ON.type('Stack')); + await aimComponent.click(); + await driver.delayMs(5000); + hilog.info(DOMAIN, TAG, 'Animation_TraditionalCurveTest_001_end'); + }) + }) +} \ No newline at end of file diff --git a/ArkUIKit/Animation/ohosTest.md b/ArkUIKit/Animation/ohosTest.md index 68a1aebc1a071af713210d4039367f2e136e912c..87bdb46b7227256e12df0db34efbbd2b856ba3ba 100644 --- a/ArkUIKit/Animation/ohosTest.md +++ b/ArkUIKit/Animation/ohosTest.md @@ -18,3 +18,7 @@ | 共享元素转场示例代码验证 | 设备正常运行 | 点击页面触发动画 | 动画效果正常 | 是 | Pass | | 自定义属性动画示例代码验证 | 设备正常运行 | 点击目标触发动画 | 动画效果正常 | 是 | Pass | | 组件动画示例代码验证 | 设备正常运行 | 点击目标触发动画 | 动画效果正常 | 是 | Pass | +| 模糊动画示例代码验证 | 设备正常运行 | 点击页面触发模糊动画 | 模糊动画效果正常 | 是 | Pass | +| 传统曲线示例代码验证 | 设备正常运行 | 点击页面触发动画 | 动画效果正常 | 是 | Pass | +| 弹簧曲线示例代码验证 | 设备正常运行 | 点击页面触发动画 | 动画效果正常 | 是 | Pass | +| 模态转场示例代码验证 | 设备正常运行 | 点击目标触发动画 | 动画效果正常 | 是 | Pass | diff --git a/ArkUIKit/Animation/screenshots/device/image1.png b/ArkUIKit/Animation/screenshots/device/image1.png index 21beca22c8e570fa4534a29e9b60402c53adf0b6..c6f8774ac37d1946a09bf2b192c74d2c7e26ad0a 100644 Binary files a/ArkUIKit/Animation/screenshots/device/image1.png and b/ArkUIKit/Animation/screenshots/device/image1.png differ diff --git a/ArkUIKit/AnimationNDK/README_zh.md b/ArkUIKit/AnimationNDK/README_zh.md index 6582b8968e4d4c55e9a65e542070adf9987d75e2..4ef84d3bd839a16a2f604057ef072c9309bd6548 100644 --- a/ArkUIKit/AnimationNDK/README_zh.md +++ b/ArkUIKit/AnimationNDK/README_zh.md @@ -8,9 +8,9 @@ ## 效果预览 -| 预览 | -| -------------------------------------------- | - +| 预览 | 组件转场效果预览 | +| -------------------------------------------- |--------------------------------------------------------| +|| | ## 使用说明 1. 安装编译生成的hap包,并打开应用; @@ -19,14 +19,15 @@ 4. 点击transition按键,触发组件显隐动画; 5. 点击create后点击play,触发Animator动画; - ## 工程目录 ``` -TextAreaEventNDK +AnimationNDK entry/src/main/ets/ └── pages - └── Index.ets (显示动画页面) + └── Index.ets + └── TransitionAnimation.ets + └── UseFrameAnimation.ets entry/src/main/ ├── cpp │ ├── types @@ -41,6 +42,7 @@ entry/src/main/ | ├── ArkUINode.h (通用属性实现) | ├── ArkUIScrollNode.h (scroll实现) | ├── ArkUITextNode.h (text组件实现) +| ├── ArkUITransition.h | ├── NativeEntry.cpp (使动画节点挂载到页面节点) │ └── napi_init.cpp └── resources @@ -51,6 +53,16 @@ entry/src/main/ │ │ └── string.json │ └── media ``` +### 具体实现 + +1. 组件出现/消失转场 + 组件内转场通过NODE_XX_TRANSITION属性(XX包括:OPACITY、TRANSLATE、SCALE、ROTATE、MOVE)配置转场参数,在组件插入和删除时显示过渡动效 + (通过NODE_TRANSFORM_CENTER属性设置NODE_SCALE_TRANSITION和NODE_ROTATE_ROTATE动效的中心点坐标)。主要用于容器组件中子组件插入和删除时,提升用户体验。 +2. 使用关键帧动画 + keyframeAnimateTo接口来指定若干个关键帧状态,实现分段的动画。同属性动画,布局类改变宽高的动画,内容都是直接到终点状态。 +3. 使用帧动画 + 帧动画具有逐帧回调的特性,便于开发者在每一帧中调整所需属性。通过提供onFrame逐帧回调,帧动画允许开发者在应用的每一帧设置属性值,从而实现组件属性值变化的自然过渡,营造出流畅的动画效果。帧动画接口可参考createAnimator。 + 与属性动画相比,帧动画能让开发者实时感知动画进程,即时调整UI值,并具备事件即时响应和可暂停的优势,但在性能方面略逊于属性动画。当属性动画能满足需求时,建议优先采用属性动画接口实现。animateTo接口的使用可参考使用属性动画。 ## 相关权限 @@ -75,7 +87,7 @@ entry/src/main/ ``` git init git config core.sparsecheckout true -echo code/DocsSample/ArkUISample/TextAreaEventNDK > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git +echo code/DocsSample/ArkUISample/AnimationNDK > .git/info/sparse-checkout +git remote add origin https://gitcode.com/openharmony/applications_app_samples.git git pull origin master ``` \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/build-profile.json5 b/ArkUIKit/AnimationNDK/entry/build-profile.json5 index 33e618d0df6ff9a85ea9731f510e17e13e59d3ca..8190fe544b6267161a0f8609c4138c0cb8212549 100644 --- a/ArkUIKit/AnimationNDK/entry/build-profile.json5 +++ b/ArkUIKit/AnimationNDK/entry/build-profile.json5 @@ -20,6 +20,7 @@ "arguments": "", "cppFlags": "", "abiFilters": [ + "armeabi-v7a", "arm64-v8a","x86_64", ] } diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIAnimate.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIAnimate.h index ae0c254dc6132477c276078398789744a5b09cd0..69ce6244c45af4eec8dbe3768975c1ae4825a61e 100644 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIAnimate.h +++ b/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUIAnimate.h @@ -77,6 +77,7 @@ struct TransitionData { std::shared_ptr CreateKeyFrameAnimeteto() { + // [Start get_keyframeAnimateTo] auto column = std::make_shared(); column->SetWidth(NUM_300); column->SetHeight(NUM_250); @@ -99,13 +100,17 @@ std::shared_ptr CreateKeyFrameAnimeteto() auto onTouch = [](ArkUI_NodeEvent *event) { // 点击button按钮时触发该逻辑 if (OH_ArkUI_NodeEvent_GetTargetId(event) == NUM_1) { + // [Start get_context] // 获取context对象 ArkUI_ContextHandle context = nullptr; context = OH_ArkUI_GetContextByNode(g_keyframe_button->GetHandle()); + // [End get_context] + // [Start get_Api] // 获取ArkUI_NativeAnimateAPI接口 ArkUI_NativeAnimateAPI_1 *animateApi = nullptr; OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_ANIMATE, ArkUI_NativeAnimateAPI_1, animateApi); + // [End get_Api] // 以下代码为创建关键帧动画的关键流程,包括设置关键帧动画参数、开启关键帧动画 // 设置ArkUI_KeyframeAnimateOption参数,通过提供的C方法设置对应的参数 @@ -173,6 +178,7 @@ std::shared_ptr CreateKeyFrameAnimeteto() column->AddChild(g_keyframe_text); column->AddChild(textNode); column->AddChild(button); + // [End get_keyframeAnimateTo] return column; } @@ -208,6 +214,7 @@ std::shared_ptr CreateAnimeteto() ArkUI_NativeAnimateAPI_1 *animateApi = nullptr; OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_ANIMATE, ArkUI_NativeAnimateAPI_1, animateApi); + // [Start set_option] // 设置动画参数 ArkUI_AnimateOption *option = OH_ArkUI_AnimateOption_Create(); OH_ArkUI_AnimateOption_SetDuration(option, NUM_2000); @@ -224,7 +231,9 @@ std::shared_ptr CreateAnimeteto() range->max = NUM_120; range->expected = NUM_60; OH_ArkUI_AnimateOption_SetExpectedFrameRateRange(option, range); + // [End set_option] + // [Start set_callback] // 设置完成的回调 ArkUI_AnimateCompleteCallback *completeCallback = new ArkUI_AnimateCompleteCallback; completeCallback->type = ARKUI_FINISH_CALLBACK_REMOVED; @@ -269,6 +278,7 @@ std::shared_ptr CreateAnimeteto() }; // 执行对应的动画 animateApi->animateTo(context, option, update, completeCallback); + // [End set_callback] auto duration = OH_ArkUI_AnimateOption_GetDuration(option); auto tempo = OH_ArkUI_AnimateOption_GetTempo(option); @@ -419,6 +429,7 @@ std::shared_ptr CreateTransitionEffect() return column; } +// [Start get_createAnimator] std::shared_ptr CreateAnimator() { auto column = std::make_shared(); @@ -628,6 +639,7 @@ std::shared_ptr CreateAnimator() column->AddChild(buttoColumn); return column; } +// [End get_createAnimator] std::shared_ptr CreateAnimateRootNode() { diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUITransition.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUITransition.h new file mode 100644 index 0000000000000000000000000000000000000000..a3139fc25e551185fa1a21532c04a8cae276b4d3 --- /dev/null +++ b/ArkUIKit/AnimationNDK/entry/src/main/cpp/ArkUITransition.h @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2025 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. + */ + +#ifndef MYAPPLICATION_ARKUITRANSITION_H +#define MYAPPLICATION_ARKUITRANSITION_H + +#include "ArkUIAnimate.h" +#include +#include + +namespace NativeModule { +// [Start main_view_method] +constexpr int32_t BUTTON_CLICK_ID = 1; +bool g_flag = false; +ArkUI_NodeHandle parentNode; +ArkUI_NodeHandle childNode; +ArkUI_NodeHandle buttonNode; +// [StartExclude main_view_method] +// [Start create_child_node] +ArkUI_NodeHandle CreateChildNode() +{ + ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + ArkUI_NodeHandle image = nodeAPI->createNode(ARKUI_NODE_IMAGE); + ArkUI_AttributeItem imageSrcItem = {.string = "/pages/common/scenery.jpg"}; + nodeAPI->setAttribute(image, NODE_IMAGE_SRC, &imageSrcItem); + ArkUI_NumberValue textWidthValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem textWidthItem = {.value = textWidthValue, + .size = sizeof(textWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(image, NODE_WIDTH, &textWidthItem); + ArkUI_NumberValue textHeightValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem textHeightItem = {.value = textHeightValue, + .size = sizeof(textWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(image, NODE_HEIGHT, &textHeightItem); + ArkUI_NumberValue transformCenterValue[] = {0.0f, 0.0f, 0.0f, 0.5f, 0.5f}; + ArkUI_AttributeItem transformCenterItem = {.value = transformCenterValue, + .size = sizeof(transformCenterValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(image, NODE_TRANSFORM_CENTER, &transformCenterItem); + ArkUI_NumberValue rotateAnimationValue[] = { + 0.0f, 0.0f, 1.0f, 360.0f, 0.0f, {.i32 = 500}, {.i32 = static_cast(ARKUI_CURVE_SHARP)}}; + ArkUI_AttributeItem rotateAnimationItem = {.value = rotateAnimationValue, + .size = sizeof(rotateAnimationValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(image, NODE_ROTATE_TRANSITION, &rotateAnimationItem); + ArkUI_NumberValue scaleAnimationValue[] = { + 0.0f, 0.0f, 0.0f, {.i32 = 500}, {.i32 = static_cast(ARKUI_CURVE_SHARP)}}; + ArkUI_AttributeItem scaleAnimationItem = {.value = scaleAnimationValue, + .size = sizeof(scaleAnimationValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(image, NODE_SCALE_TRANSITION, &scaleAnimationItem); + ArkUI_NumberValue translateAnimationValue[] = { + 200, 200, 0.0f, {.i32 = 500}, {.i32 = static_cast(ARKUI_CURVE_SHARP)}}; + ArkUI_AttributeItem translateAnimationItem = {.value = translateAnimationValue, + .size = sizeof(translateAnimationValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(image, NODE_TRANSLATE_TRANSITION, &translateAnimationItem); + return image; +} +// [End create_child_node] +// [Start button_show] +void OnButtonShowClicked(ArkUI_NodeEvent *event) +{ + if (!event) { + return; + } + if (!childNode) { + childNode = CreateChildNode(); + } + ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + if (g_flag) { + g_flag = false; + ArkUI_AttributeItem labelItem = {.string = "show"}; + nodeAPI->setAttribute(buttonNode, NODE_BUTTON_LABEL, &labelItem); + nodeAPI->removeChild(parentNode, childNode); + } else { + g_flag = true; + ArkUI_AttributeItem labelItem = {.string = "hide"}; + nodeAPI->setAttribute(buttonNode, NODE_BUTTON_LABEL, &labelItem); + nodeAPI->addChild(parentNode, childNode); + } +} +// [End button_show] +// [EndExclude main_view_method] +void mainViewMethod(ArkUI_NodeContentHandle handle) +{ + ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + ArkUI_NodeHandle column = nodeAPI->createNode(ARKUI_NODE_COLUMN); + ArkUI_NumberValue widthValue[] = {{.f32 = 500}}; + ArkUI_AttributeItem widthItem = {.value = widthValue, .size = sizeof(widthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(column, NODE_WIDTH, &widthItem); + ArkUI_NumberValue heightValue[] = {{.f32 = 500}}; + ArkUI_AttributeItem heightItem = {.value = heightValue, .size = sizeof(heightValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(column, NODE_HEIGHT, &heightItem); + ArkUI_NodeHandle buttonShow = nodeAPI->createNode(ARKUI_NODE_BUTTON); + ArkUI_NumberValue buttonWidthValue[] = {{.f32 = 200}}; + ArkUI_AttributeItem buttonWidthItem = {.value = buttonWidthValue, + .size = sizeof(buttonWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(buttonShow, NODE_WIDTH, &buttonWidthItem); + ArkUI_NumberValue buttonHeightValue[] = {{.f32 = 50}}; + ArkUI_AttributeItem buttonHeightItem = {.value = buttonHeightValue, + .size = sizeof(buttonHeightValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(buttonShow, NODE_HEIGHT, &buttonHeightItem); + ArkUI_AttributeItem labelItem = {.string = "show"}; + nodeAPI->setAttribute(buttonShow, NODE_BUTTON_LABEL, &labelItem); + ArkUI_NumberValue buttonOpenTypeValue[] = {{.i32 = static_cast(ARKUI_BUTTON_TYPE_NORMAL)}}; + ArkUI_AttributeItem buttonOpenTypeItem = {.value = buttonOpenTypeValue, + .size = sizeof(buttonOpenTypeValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(buttonShow, NODE_BUTTON_TYPE, &buttonOpenTypeItem); + ArkUI_NumberValue buttonShowMarginValue[] = {{.f32 = 20}}; + ArkUI_AttributeItem buttonShowMarginItem = {.value = buttonShowMarginValue, + .size = sizeof(buttonShowMarginValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(buttonShow, NODE_MARGIN, &buttonShowMarginItem); + nodeAPI->registerNodeEvent(buttonShow, NODE_ON_CLICK, BUTTON_CLICK_ID, nullptr); + nodeAPI->addNodeEventReceiver(buttonShow, OnButtonShowClicked); + parentNode = column; + buttonNode = buttonShow; + nodeAPI->addChild(column, buttonShow); + OH_ArkUI_NodeContent_AddNode(handle, column); +} +// [End main_view_method] +} // namespace NativeModule + +#endif // MYAPPLICATION_ARKUITRANSITION_H \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/AnimationNDK/entry/src/main/cpp/CMakeLists.txt index 058cf3cf28158c660e24c4f703b6ebf64c088aea..8da109562dd2df2d6be9993c8ba3dd5c70e9ab1b 100644 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/CMakeLists.txt +++ b/ArkUIKit/AnimationNDK/entry/src/main/cpp/CMakeLists.txt @@ -11,7 +11,7 @@ endif() include_directories(${NATIVERENDER_ROOT_PATH} ${NATIVERENDER_ROOT_PATH}/include) -add_library(entry SHARED napi_init.cpp NativeEntry.cpp) +add_library(entry SHARED NapiInit.cpp NativeEntry.cpp) target_link_libraries(entry PUBLIC libace_napi.z.so libace_ndk.z.so libhilog_ndk.z.so) diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/NapiInit.cpp b/ArkUIKit/AnimationNDK/entry/src/main/cpp/NapiInit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..130f2a8874927cb4dfa4b5dada196d9ca8c1a354 --- /dev/null +++ b/ArkUIKit/AnimationNDK/entry/src/main/cpp/NapiInit.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2025 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. + */ + +#include "napi/native_api.h" +#include "NativeEntry.h" + +EXTERN_C_START +static napi_value Init(napi_env env, napi_value exports) +{ +// 绑定Native侧的创建组件和销毁组件。 + napi_property_descriptor desc[] = { + {"createNativeRoot", nullptr, NativeModule::CreateNativeRoot, nullptr, nullptr, nullptr, napi_default, nullptr}, + {"destroyNativeRoot", nullptr, NativeModule::DestroyNativeRoot, nullptr, nullptr, nullptr, napi_default, + nullptr}, + {"createTransitionEffectRoot", nullptr, NativeModule::CreateTransitionEffectRoot, nullptr, nullptr, nullptr, + napi_default, nullptr}, + }; + napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); + return exports; +} +EXTERN_C_END + +static napi_module demoModule = { + .nm_version = 1, + .nm_flags = 0, + .nm_filename = nullptr, + .nm_register_func = Init, + .nm_modname = "entry", + .nm_priv = ((void *)0), + .reserved = {0}, +}; + +extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); } diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeEntry.cpp b/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeEntry.cpp index 847e28af653947e37565c5a60751a8cbfe4cfe97..e5ef07437741b2f51ec871e347ea2264e02d5676 100644 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeEntry.cpp +++ b/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeEntry.cpp @@ -18,6 +18,7 @@ #include "NativeEntry.h" #include "NormalTextListExample.h" #include "ArkUIAnimate.h" +#include "ArkUITransition.h" namespace NativeModule { @@ -39,6 +40,23 @@ napi_value CreateNativeRoot(napi_env env, napi_callback_info info) return nullptr; } +napi_value CreateTransitionEffectRoot(napi_env env, napi_callback_info info) +{ + size_t argc = 1; + napi_value args[1] = {nullptr}; + + napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); + + // 获取NodeContent + ArkUI_NodeContentHandle contentHandle; + OH_ArkUI_GetNodeContentFromNapiValue(env, args[0], &contentHandle); + NativeEntry::GetInstance()->SetContentHandle(contentHandle); + + // 创建动画 + mainViewMethod(contentHandle); + return nullptr; +} + napi_value DestroyNativeRoot(napi_env env, napi_callback_info info) { // 从管理类中释放Native侧对象。 diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeEntry.h b/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeEntry.h index 789e19d6f9d1dfd54f546dc401f1b3f8c1143dc2..f0e23167d71154059c6ae3f6d18777a10b59d4e7 100644 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeEntry.h +++ b/ArkUIKit/AnimationNDK/entry/src/main/cpp/NativeEntry.h @@ -24,7 +24,7 @@ namespace NativeModule { napi_value CreateNativeRoot(napi_env env, napi_callback_info info); - +napi_value CreateTransitionEffectRoot(napi_env env, napi_callback_info info); napi_value DestroyNativeRoot(napi_env env, napi_callback_info info); // 管理Native组件的生命周期和内存。 diff --git a/ArkUIKit/AnimationNDK/entry/src/main/cpp/types/libentry/index.d.ts b/ArkUIKit/AnimationNDK/entry/src/main/cpp/types/libentry/index.d.ts index 26cb19dfd8fae099d1dc3feca199debd8e3414bd..8be2beac07d3aad191806a5a1546b98f23e6150d 100644 --- a/ArkUIKit/AnimationNDK/entry/src/main/cpp/types/libentry/index.d.ts +++ b/ArkUIKit/AnimationNDK/entry/src/main/cpp/types/libentry/index.d.ts @@ -13,4 +13,5 @@ * limitations under the License. */ export const createNativeRoot: (content: Object) => void; -export const destroyNativeRoot: () => void; \ No newline at end of file +export const destroyNativeRoot: () => void; +export const createTransitionEffectRoot: (content: Object) => void; \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/Index.ets b/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/Index.ets index 5ac5a67649d957dc2b10908056e3d6cc0fbde0c9..a4df3a08741929486ee7c9209754066c769c0eb4 100644 --- a/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/Index.ets @@ -12,46 +12,71 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import nativeNode from 'libentry.so'; -import { NodeContent } from '@kit.ArkUI'; + +interface listItem { + router?: string; + name: string; +} + +let demandList: listItem[] = [ + { + name: "TransitionAnimation", + router: "pages/TransitionAnimation", + }, { + name: "UseFrameAnimation", + router: "pages/UseFrameAnimation", +}, +] @Entry @Component struct Index { - // 初始化NodeContent对象。 - private rootSlot = new NodeContent(); - @State @Watch('changeNativeFlag') showNative: boolean = false; - @State isModuleLoaded: boolean = false; - - changeNativeFlag(): void { - if (nativeNode) { - this.isModuleLoaded = true; - } - if (!this.isModuleLoaded) { - console.info('CXX Please wait, native module is loading...'); - return; - } - - if (this.showNative) { - // 传递NodeContent对象用于Native创建组件的挂载显示 - nativeNode?.createNativeRoot(this.rootSlot) - } else { - // 销毁NativeModule组件 - nativeNode.destroyNativeRoot() - } - } - + @State bgColor: ResourceColor = '#39b5fa'; build() { Column() { - Button(this.showNative ? 'Hide Native UI Animate' : 'Show Native UI Animate').onClick(() => { - this.showNative = !this.showNative - }) - Row() { - // 将NodeContent和ContentSlot占位组件绑定。 - ContentSlot(this.rootSlot) - }.layoutWeight(1) + Text('ListShow') + .height('5.00%') + .width('100%') + .textAlign(TextAlign.Center) + .fontSize(20) + .fontWeight(FontWeight.Bold) + .backgroundColor(this.bgColor) + .fontColor(Color.White) + Column() { + List({ space: 5, initialIndex: 0 }) { + ForEach(demandList, (listitem: listItem, index: number) => { + ListItem() { + Column({ space: 10 }) { + Text(listitem.name) + .fontSize(20) + .maxLines(1) + } + .padding('1%') + .width('100%') + .height(50) + .borderRadius(10) + .backgroundColor(this.bgColor) + .borderColor(this.bgColor) + .borderWidth(1) + .onClick(() => { + if (!!listitem.router) { + this.getUIContext().getRouter().pushUrl({ url: listitem.router }) + } + }) + } + }) + } + .listDirection(Axis.Vertical) // 排列方向 + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + .margin(1) + .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring + .width('90%') + } + .width('100%') + .height('100%') + .backgroundColor('#fff4f3f3') + .padding({ top: 5 }) } - .width('100%') - .height('100%') } } \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/TransitionAnimation.ets b/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/TransitionAnimation.ets new file mode 100644 index 0000000000000000000000000000000000000000..86baf4c79b9f79622482d96d7a8afa0e872ae516 --- /dev/null +++ b/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/TransitionAnimation.ets @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2025 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 nativeNode from 'libentry.so'; +import { NodeContent } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +@Entry +@Component +struct UseFrameAnimation { + // 初始化NodeContent对象。 + private rootSlot = new NodeContent(); + @State @Watch('changeNativeFlag') showNative: boolean = false; + @State isModuleLoaded: boolean = false; + + changeNativeFlag(): void { + if (nativeNode) { + this.isModuleLoaded = true; + } + if (!this.isModuleLoaded) { + hilog.info(0x0000, 'testTag', 'CXX Please wait, native module is loading...'); + return; + } + if (this.showNative) { + // 传递NodeContent对象用于Native创建组件的挂载显示 + nativeNode?.createTransitionEffectRoot(this.rootSlot); + } else { + // 销毁NativeModule组件 + nativeNode.destroyNativeRoot(); + } + } + + build() { + Column() { + Button(this.showNative ? 'Hide Native UI Animate' : 'Show Native UI Animate').onClick(() => { + this.showNative = !this.showNative; + }) + Column() { + // 将NodeContent和ContentSlot占位组件绑定。 + ContentSlot(this.rootSlot); + }.justifyContent(FlexAlign.Center) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/UseFrameAnimation.ets b/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/UseFrameAnimation.ets new file mode 100644 index 0000000000000000000000000000000000000000..b9dc230d2e1a83e2035fa3e8c4c53d28882c385b --- /dev/null +++ b/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/UseFrameAnimation.ets @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2025 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 nativeNode from 'libentry.so'; +import { NodeContent } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +@Entry +@Component +struct Index { + // [Start get_content] + // 初始化NodeContent对象。 + private rootSlot = new NodeContent(); + // [StartExclude get_content] + @State @Watch('changeNativeFlag') showNative: boolean = false; + @State isModuleLoaded: boolean = false; + + changeNativeFlag(): void { + if (nativeNode) { + this.isModuleLoaded = true; + } + if (!this.isModuleLoaded) { + hilog.info(0x0000, 'testTag', 'CXX Please wait, native module is loading...'); + return; + } + + if (this.showNative) { + // [EndExclude get_content] + // 传递NodeContent对象用于Native创建组件的挂载显示 + nativeNode?.createNativeRoot(this.rootSlot) + // [End get_content] + } else { + // 销毁NativeModule组件 + nativeNode.destroyNativeRoot() + } + } + + build() { + Column() { + Button(this.showNative ? 'Hide Native UI Animate' : 'Show Native UI Animate').onClick(() => { + this.showNative = !this.showNative + }) + Row() { + // 将NodeContent和ContentSlot占位组件绑定。 + ContentSlot(this.rootSlot) + }.layoutWeight(1) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/common/scenery.jpg b/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/common/scenery.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b4f27b4d4cea560623ddf9b820e9842d14ee91e7 Binary files /dev/null and b/ArkUIKit/AnimationNDK/entry/src/main/ets/pages/common/scenery.jpg differ diff --git a/ArkUIKit/AnimationNDK/entry/src/main/module.json5 b/ArkUIKit/AnimationNDK/entry/src/main/module.json5 index 4e782f2a33d37350362667cd6243da13fb267a8b..476f4f508edb44dc9edfe115808545c33b284e0b 100644 --- a/ArkUIKit/AnimationNDK/entry/src/main/module.json5 +++ b/ArkUIKit/AnimationNDK/entry/src/main/module.json5 @@ -19,10 +19,7 @@ "description": "$string:module_desc", "mainElement": "EntryAbility", "deviceTypes": [ - "phone", - "tablet", - "2in1", - "wearable" + "default" ], "deliveryWithInstall": true, "installationFree": false, diff --git a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/AnimationNDK/entry/src/main/resources/base/profile/main_pages.json index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..f6c6bbf7a63cd7798b8f0fb803c2567fc672a6de 100644 --- a/ArkUIKit/AnimationNDK/entry/src/main/resources/base/profile/main_pages.json +++ b/ArkUIKit/AnimationNDK/entry/src/main/resources/base/profile/main_pages.json @@ -1,5 +1,7 @@ { "src": [ - "pages/Index" + "pages/Index", + "pages/UseFrameAnimation", + "pages/TransitionAnimation" ] } diff --git a/ArkUIKit/AnimationNDK/entry/src/main/syscap.json b/ArkUIKit/AnimationNDK/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..33e506abcd6baf48b67ddb542650764c1be6bdfb --- /dev/null +++ b/ArkUIKit/AnimationNDK/entry/src/main/syscap.json @@ -0,0 +1,15 @@ +{ + "devices": { + "general": [ + "default" + ], + "custom": [ + { + "xts": [ + "SystemCapability.Account.AppAccount", + "SystemCapability.Account.OsAccount" + ] + } + ] + } +} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/ohosTest/ets/test/Index.test.ets b/ArkUIKit/AnimationNDK/entry/src/ohosTest/ets/test/Index.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..3014235cd12868e44868cc62e93a31e33e197b33 --- /dev/null +++ b/ArkUIKit/AnimationNDK/entry/src/ohosTest/ets/test/Index.test.ets @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2025 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 { describe, it, expect, beforeAll } from '@ohos/hypium'; +import { Driver, ON, MatchPattern } from '@ohos.UiTest'; +import { UIAbility, Want } from '@kit.AbilityKit'; +import hilog from '@ohos.hilog'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; + +let delegator = AbilityDelegatorRegistry.getAbilityDelegator(); +let driver: Driver; +const DOMAIN = 0xF811; +const TAG = '[Sample_Animation_NDK]'; +const BUNDLE = 'AnimationNDK'; +let want: Want; + +export default function AnimationNdkTest() { + describe('AnimationNdkTest', () => { + beforeAll(async () => { + want = { + bundleName: "com.sample.myapplication", + abilityName: 'EntryAbility' + }; + await delegator.startAbility(want); + driver = Driver.create(); + await driver.delayMs(1000); + const ability: UIAbility = await delegator.getCurrentTopAbility(); + hilog.info(DOMAIN, TAG, 'get top ability'); + expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); + }) + + /** + * @tc.number LoadList_001 + * @tc.name test Load List + * @tc.desc 测试首页加载是否成功 + */ + it(BUNDLE + 'LoadList_001', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, BUNDLE + "LoadList_001, begin"); + await driver.delayMs(1000); + const title = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); + expect(title === null).assertFalse(); + hilog.info(DOMAIN, TAG, BUNDLE + "LoadList_001, end"); + done(); + }); + + /** + * @tc.number TransitionAnimation_001 + * @tc.name test TransitionAnimation + * @tc.desc 测试TransitionAnimation页面功能 + */ + it(BUNDLE + 'TransitionAnimation_001', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, BUNDLE + "TransitionAnimation_001, begin"); + await driver.delayMs(1000); + const title = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); + expect(title === null).assertFalse(); + const transition = await driver.findComponent(ON.text('TransitionAnimation', MatchPattern.CONTAINS)); + expect(transition === null).assertFalse(); + await transition.click(); + await driver.delayMs(1000); + const nativeButton = await driver.findComponent(ON.text('Native', MatchPattern.CONTAINS)); + expect(nativeButton === null).assertFalse(); + await nativeButton.click(); + await driver.delayMs(1000); + const showButton = await driver.findComponent(ON.text('show', MatchPattern.CONTAINS)); + expect(showButton === null).assertFalse(); + await showButton.click(); + await driver.delayMs(1000); + const hideButton = await driver.findComponent(ON.text('hide')); + expect(hideButton === null).assertFalse(); + await hideButton.click(); + await driver.delayMs(1000); + hilog.info(DOMAIN, TAG, BUNDLE + "TransitionAnimation_001, end"); + await driver.pressBack(); + done(); + }); + + /** + * @tc.number UseFrameAnimation_001 + * @tc.name test UseFrameAnimation + * @tc.desc 展示UseFrameAnimation_001页面 + */ + it(BUNDLE + 'UseFrameAnimation_001', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, BUNDLE + "UseFrameAnimation_001, begin"); + await driver.delayMs(1000); + const title = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); + expect(title === null).assertFalse(); + const transition = await driver.findComponent(ON.text('UseFrameAnimation', MatchPattern.CONTAINS)); + expect(transition === null).assertFalse(); + await transition.click(); + await driver.delayMs(1000); + const nativeButton = await driver.findComponent(ON.text('Native', MatchPattern.CONTAINS)); + expect(nativeButton === null).assertFalse(); + await nativeButton.click(); + await driver.delayMs(1000); + const hideButton = await driver.findComponent(ON.text('Hide', MatchPattern.CONTAINS)); + expect(hideButton === null).assertFalse(); + await hideButton.click(); + await driver.delayMs(1000); + hilog.info(DOMAIN, TAG, BUNDLE + "UseFrameAnimation_001, end"); + await driver.pressBack(); + done(); + }); + }); +} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/AnimationNDK/entry/src/ohosTest/ets/test/List.test.ets index c64e0b06938d246ce044186d4b2d02b500a89e14..afda3b298ebf1a42cd87bbacc92bf5b877bca2bd 100644 --- a/ArkUIKit/AnimationNDK/entry/src/ohosTest/ets/test/List.test.ets +++ b/ArkUIKit/AnimationNDK/entry/src/ohosTest/ets/test/List.test.ets @@ -13,7 +13,9 @@ * limitations under the License. */ import abilityTest from './Ability.test'; +import AnimationNdkTest from './Index.test'; export default function testsuite() { abilityTest(); + AnimationNdkTest(); } \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/entry/src/ohosTest/module.json5 b/ArkUIKit/AnimationNDK/entry/src/ohosTest/module.json5 index 6aa299de060102fad8a388928a04b1e14c2a751d..59667117c86b64ab9863f7b382c435ae4a3c32fa 100644 --- a/ArkUIKit/AnimationNDK/entry/src/ohosTest/module.json5 +++ b/ArkUIKit/AnimationNDK/entry/src/ohosTest/module.json5 @@ -17,10 +17,7 @@ "name": "entry_test", "type": "feature", "deviceTypes": [ - "phone", - "tablet", - "2in1", - "wearable" + "default" ], "deliveryWithInstall": true, "installationFree": false diff --git a/ArkUIKit/AnimationNDK/entry/src/ohosTest/syscap.json b/ArkUIKit/AnimationNDK/entry/src/ohosTest/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..33e506abcd6baf48b67ddb542650764c1be6bdfb --- /dev/null +++ b/ArkUIKit/AnimationNDK/entry/src/ohosTest/syscap.json @@ -0,0 +1,15 @@ +{ + "devices": { + "general": [ + "default" + ], + "custom": [ + { + "xts": [ + "SystemCapability.Account.AppAccount", + "SystemCapability.Account.OsAccount" + ] + } + ] + } +} \ No newline at end of file diff --git a/ArkUIKit/AnimationNDK/screenshots/Animation2.gif b/ArkUIKit/AnimationNDK/screenshots/Animation2.gif new file mode 100644 index 0000000000000000000000000000000000000000..7b8757bbcb6e466b614e217c641ba491bbe3411c Binary files /dev/null and b/ArkUIKit/AnimationNDK/screenshots/Animation2.gif differ diff --git a/ArkUIKit/AppStorage/entry/.gitignore b/ArkUIKit/AppStorage/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/AppStorage/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageEight.ets b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageEight.ets index 579ad17d06243c133c1db7baae6c7aa71d2db67a..381d88f7d200bd12404c9b9699505ffdfe407416 100644 --- a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageEight.ets +++ b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageEight.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +// [Start appstorage_page_eight] import { emitter } from '@kit.BasicServicesKit'; let nextId: number = 0; @@ -113,4 +113,5 @@ export struct TapImage { .border({ width: 5, style: BorderStyle.Dotted, color: this.tapColor }) } } -} \ No newline at end of file +} +// [End appstorage_page_eight] \ No newline at end of file diff --git a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageFive.ets b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageFive.ets index 62e0b54c9803c3c6e7fadce5335344fed378a997..5814e95524a80c4d2f757e3697df15c5446b3d19 100644 --- a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageFive.ets +++ b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageFive.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +// [Start appstorage_page_five] @Entry @Component struct MapSample { @@ -46,4 +46,5 @@ struct MapSample { } .height('100%') } -} \ No newline at end of file +} +// [End appstorage_page_five] \ No newline at end of file diff --git a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageFour.ets b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageFour.ets index e4c01129dbb44419cb3f3dcd8afac9bf27f5a6db..f8da4e52563d65fc23b1f5001ea94e9ea71e3049 100644 --- a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageFour.ets +++ b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageFour.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start appstorage_page_four] @Entry @Component struct DateSample { @@ -46,4 +47,5 @@ struct DateSample { }) }.width('100%') } -} \ No newline at end of file +} +// [End appstorage_page_four] \ No newline at end of file diff --git a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageNine.ets b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageNine.ets index dc1ccbb93b72ce5d4b70b7bdc330931436ed4e68..f0e3c4aa1952d69c27cb0940dd61605282fdb928 100644 --- a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageNine.ets +++ b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageNine.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start appstorage_page_nine] // xxx.ets class ViewData { public title: string; @@ -76,4 +77,5 @@ export struct TapImage { }) } } -} \ No newline at end of file +} +// [End appstorage_page_nine] \ No newline at end of file diff --git a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageOne.ets b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageOne.ets index 0936bf6b298c07914b6da046c54d43881f0d2f78..872871529e3b8215549615513b8f4111a33e17fc 100644 --- a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageOne.ets +++ b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageOne.ets @@ -12,10 +12,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start appstorage_page_one] @Entry @Component struct StorageDemoPage { // 存储实例与关联对象 + // [StartExclude appstorage_page_one] private storage: LocalStorage = new LocalStorage(); private link1: SubscribedAbstractProperty = AppStorage.link('propA'); private link2: SubscribedAbstractProperty = AppStorage.link('propA'); @@ -43,7 +45,7 @@ struct StorageDemoPage { this.link2Val = this.link2.get(); this.propVal = this.prop.get(); } - + // [EndExclude appstorage_page_one] build() { List() { // 标题 @@ -150,4 +152,5 @@ struct StorageDemoPage { .height('100%') .backgroundColor('#F5F5F5') } -} \ No newline at end of file +} +// [End appstorage_page_one] \ No newline at end of file diff --git a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageSeven.ets b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageSeven.ets index 8eff0a8ee8b0f546b025cc0ee4e1d18a2fc152cc..937e050117a9a44fdcd99dbf81b38b2b59b811bd 100644 --- a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageSeven.ets +++ b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageSeven.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start appstorage_page_seven] // xxx.ets class ViewData { public title: string; @@ -85,4 +86,5 @@ export struct TapImage { } } -} \ No newline at end of file +} +// [End appstorage_page_seven] \ No newline at end of file diff --git a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageSix.ets b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageSix.ets index 6a3f7ebec4a8ef7435251aefdfdb13f9beb00931..3b130100b8464b8a8baa8958cc63ec228dc98e62 100644 --- a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageSix.ets +++ b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageSix.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start appstorage_page_six] @Entry @Component struct SetSample { @@ -46,4 +47,5 @@ struct SetSample { } .height('100%') } -} \ No newline at end of file +} +// [End appstorage_page_six] \ No newline at end of file diff --git a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageTen.ets b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageTen.ets index c1b90074a824e8bd64f289340414cb9935ee4e75..1331956c85d8c935f0ae44e4818d1270f22c6c7a 100644 --- a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageTen.ets +++ b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageTen.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start appstorage_page_ten] AppStorage.setOrCreate('propA', false); @Entry @@ -37,4 +38,5 @@ struct PageTenIndex { }) } } -} \ No newline at end of file +} +// [End appstorage_page_ten] \ No newline at end of file diff --git a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageThree.ets b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageThree.ets index f8816488d21049d0774ad352f6495c60a9453e5b..2942479b09cf9acb81b56fb7febedebce752df91 100644 --- a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageThree.ets +++ b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageThree.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start appstorage_page_three] @Component struct StorageLinkComponent { @StorageLink('linkA') linkA: number | null = null; @@ -63,4 +64,5 @@ struct TestPageThree { } .height('100%') } -} \ No newline at end of file +} +// [End appstorage_page_three] \ No newline at end of file diff --git a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageTwo.ets b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageTwo.ets index 2c1e3b769137f7bdd0eec7ea7164f3a3c1488308..cb2d1c7cbb70f76d5b2577c1cf02a60d30de681a 100644 --- a/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageTwo.ets +++ b/ArkUIKit/AppStorage/entry/src/main/ets/pages/PageTwo.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start appstorage_page_two] class Data { public code: number; @@ -68,4 +69,5 @@ struct TestPageTow { }) } } -} \ No newline at end of file +} +// [End appstorage_page_two] \ No newline at end of file diff --git a/ArkUIKit/ArktsMvvmSample/entry/.gitignore b/ArkUIKit/ArktsMvvmSample/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/ArktsMvvmSample/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/pages/Index.ets b/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/pages/Index.ets index 42baa38cf3cfeab89694201f70bd349a232e04c0..37a528151e3cf035b795e26e8df598d0b115a33e 100644 --- a/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/pages/Index.ets @@ -16,7 +16,7 @@ // [Start mvvm_model_main_index] import { common } from '@kit.AbilityKit'; // import ViewModel -import TodoListViewModel from '../viewModel/TodoListViewModel'; +import TodoListViewModel from '../viewmodel/TodoListViewModel'; // import View import { TodoComponent } from '../views/TodoComponent'; diff --git a/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/views/AllChooseComponent.ets b/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/views/AllChooseComponent.ets index 626575a476e798dd923472ec83199d2a215a0189..07b208e59f9e22ccc5a505a09f85505ada026034 100644 --- a/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/views/AllChooseComponent.ets +++ b/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/views/AllChooseComponent.ets @@ -14,7 +14,7 @@ */ // [Start all_choose_component_view] -import TodoListViewModel from '../viewModel/TodoListViewModel'; +import TodoListViewModel from '../viewmodel/TodoListViewModel'; import { common } from '@kit.AbilityKit'; @Component diff --git a/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/views/ThingComponent.ets b/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/views/ThingComponent.ets index ab19aa3bf053e3be17f6c77894615869e52c7905..f9656480233107797172f3ab96fc75a6044f467d 100644 --- a/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/views/ThingComponent.ets +++ b/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/views/ThingComponent.ets @@ -14,7 +14,7 @@ */ // [Start thing_component_view] -import ThingViewModel from '../viewModel/ThingViewModel'; +import ThingViewModel from '../viewmodel/ThingViewModel'; @Component export struct ThingComponent { diff --git a/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/views/TodoListComponent.ets b/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/views/TodoListComponent.ets index 7dbf070c9cfc5960aeb716929943b70b00617ce2..26db6668dcf3750c9f3a09695b59e0c1679f7478 100644 --- a/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/views/TodoListComponent.ets +++ b/ArkUIKit/ArktsMvvmSample/entry/src/main/ets/views/TodoListComponent.ets @@ -14,8 +14,8 @@ */ // [Start to_do_list_component_view] -import ThingViewModel from '../viewModel/ThingViewModel'; -import { ThingViewModelArray } from '../viewModel/TodoListViewModel' +import ThingViewModel from '../viewmodel/ThingViewModel'; +import { ThingViewModelArray } from '../viewmodel/TodoListViewModel' import { ThingComponent } from './ThingComponent'; @Component diff --git a/ArkUIKit/ArktsNewComputed/entry/.gitignore b/ArkUIKit/ArktsNewComputed/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/ArktsNewComputed/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/ArktsNewComputed/entry/src/main/ets/pages/Index.ets b/ArkUIKit/ArktsNewComputed/entry/src/main/ets/pages/Index.ets index 2f0447abeaf6e7f19a1b04ac78f98fdb8a17a048..462b25ffb0564e8e7130234200ea0b41d7bba6d1 100644 --- a/ArkUIKit/ArktsNewComputed/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/ArktsNewComputed/entry/src/main/ets/pages/Index.ets @@ -16,7 +16,7 @@ import { LengthMetrics } from '@kit.ArkUI'; import { RoutableCard } from '../common/Card'; import { Route } from '../common/Route'; -import resource from '../common/Resource'; +import resource from '../common/resource'; import { CustomComponentUse } from './CustomComponentUse'; import { ObservedV2ClassUser } from './ObservedV2ClassUser'; import { ComputingPropertyResolution } from './ComputingPropertyResolution'; diff --git a/ArkUIKit/ArktsNewOnce/entry/.gitignore b/ArkUIKit/ArktsNewOnce/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/ArktsNewOnce/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/ArktsNewOnce/entry/src/main/ets/pages/MyComponent.ets b/ArkUIKit/ArktsNewOnce/entry/src/main/ets/pages/MyComponent.ets index 7bbfb68cc8b198476923af716581e344f8e31fe8..3ba4fc2ea91d35ed6892d70b1983ebca9ccf0b23 100644 --- a/ArkUIKit/ArktsNewOnce/entry/src/main/ets/pages/MyComponent.ets +++ b/ArkUIKit/ArktsNewOnce/entry/src/main/ets/pages/MyComponent.ets @@ -33,12 +33,12 @@ struct MyComponent { // [StartExclude once_init_sync_noMore] // [StartExclude once_param_order_irrelevant] @Param @Once onceParam: string = 'onceParam'; // 正确用法 - // [EndExclide once_param_order_irrelevant] + // [EndExclude once_param_order_irrelevant] // [StartExclude once_param_componentV2_pair] @Param @Once param1: number = 0; @Once @Param param2: number = 0; // [StartExclude once_param_order_irrelevant] - // [EndExclide once_init_sync_noMore] + // [EndExclude once_init_sync_noMore] @Local message: string = 'Hello World'; build() { @@ -51,8 +51,8 @@ struct MyComponent { ChildComponent({ onceParam: this.message }); } } - // [EndExclide once_param_componentV2_pair] - // [EndExclide once_param_order_irrelevant] + // [EndExclude once_param_componentV2_pair] + // [EndExclude once_param_order_irrelevant] } //[End once_param_componentV2_pair] // [End once_param_order_irrelevant] diff --git a/ArkUIKit/BindSheet/entry/.gitignore b/ArkUIKit/BindSheet/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/BindSheet/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/ButtonAttribute/entry/.gitignore b/ArkUIKit/ButtonAttribute/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/ButtonAttribute/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/ButtonAttribute/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/ButtonAttribute/entry/src/main/ets/entryability/EntryAbility.ets index 0526afd677c7f7a7250fa470c0b5fa7ebf6146c6..5dcfe4635c3c4c887e7e6e92a5bf008f96a7ba3d 100644 --- a/ArkUIKit/ButtonAttribute/entry/src/main/ets/entryability/EntryAbility.ets +++ b/ArkUIKit/ButtonAttribute/entry/src/main/ets/entryability/EntryAbility.ets @@ -36,7 +36,7 @@ export default class EntryAbility extends UIAbility { onWindowStageCreate(windowStage: window.WindowStage): void { hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - windowStage.loadContent('pages/attributeDemo_01', (err) => { + windowStage.loadContent('pages/AttributeDemo01', (err) => { if (err.code) { hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); return; diff --git a/ArkUIKit/ButtonComponent/entry/src/main/ets/pages/ButtonAlignBottom.ets b/ArkUIKit/ButtonComponent/entry/src/main/ets/pages/ButtonAlignBottom.ets index 4fd6f070b698ba23c906a6bc901de2d78c2e2a6e..95688fdb6266cb704e33d7c778fe8bff604cdca7 100644 --- a/ArkUIKit/ButtonComponent/entry/src/main/ets/pages/ButtonAlignBottom.ets +++ b/ArkUIKit/ButtonComponent/entry/src/main/ets/pages/ButtonAlignBottom.ets @@ -25,6 +25,7 @@ struct ButtonAlignBottom { build() { RelativeContainer() { // [Start button_align_bottom] + // [Start button_touch] ArcButton({ options: new ArcButtonOptions({ label: 'OK', @@ -40,6 +41,7 @@ struct ButtonAlignBottom { }) }) + // [End button_touch] // [End button_align_bottom] .alignRules({ middle: { anchor: '__container__', align: HorizontalAlign.Center }, diff --git a/ArkUIKit/ButtonComponent/entry/src/main/ets/pages/ButtonAlignTop.ets b/ArkUIKit/ButtonComponent/entry/src/main/ets/pages/ButtonAlignTop.ets index 754df2be3422242c559899ba91b19b0a4bc372d4..10f760a7c20999e4c01c23ca24c82b9a33a8b56b 100644 --- a/ArkUIKit/ButtonComponent/entry/src/main/ets/pages/ButtonAlignTop.ets +++ b/ArkUIKit/ButtonComponent/entry/src/main/ets/pages/ButtonAlignTop.ets @@ -32,7 +32,7 @@ struct ButtonAlignTop { // [StartExclude button_click] position: ArcButtonPosition.TOP_EDGE, styleMode: ArcButtonStyleMode.EMPHASIZED_LIGHT, - // [End button_click] + // [EndExclude button_click] // [StartExclude button_align_top] onClick: () => { hilog.info(DOMAIN, TAG, 'ArcButton onClick'); diff --git a/ArkUIKit/ButtonComponent/entry/src/main/module.json5 b/ArkUIKit/ButtonComponent/entry/src/main/module.json5 index f101ab97f73a6c4cc05ba389cba708454ecfc13c..312c644e99c24c45098efc1854cf60298d16a6e6 100644 --- a/ArkUIKit/ButtonComponent/entry/src/main/module.json5 +++ b/ArkUIKit/ButtonComponent/entry/src/main/module.json5 @@ -67,5 +67,5 @@ ], // [EndExclude module_json_config] } - // [end module_json_config] + // [End module_json_config] } \ No newline at end of file diff --git a/ArkUIKit/ButtonList/entry/.gitignore b/ArkUIKit/ButtonList/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/ButtonList/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/ColorAdaptionApp/entry/src/main/syscap.json b/ArkUIKit/ColorAdaptionApp/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..598552fb33d0f5c27fed37e607d9163f836ac5af --- /dev/null +++ b/ArkUIKit/ColorAdaptionApp/entry/src/main/syscap.json @@ -0,0 +1,24 @@ + +{ + "devices": { + "general": [ + "default" + ] + }, + "production": { + "removedSysCaps": [ + "SystemCapability.HiviewDFX.HiDumper", + "SystemCapability.Security.DeviceAuth", + "SystemCapability.Multimedia.Media.AVTranscoder", + "SystemCapability.Tee.TeeClient", + "SystemCapability.Communication.Bluetooth.Core", + "SystemCapability.ArkUi.Graphics3D", + "SystemCapability.DistributedHardware.DeviceManager", + "SystemCapability.Multimedia.Drm.Core", + "SystemCapability.Advertising.Ads", + "SystemCapability.Customization.EnterpriseDeviceManager", + "SystemCapability.Security.DeviceSecurityLevel", + "SystemCapability.UserIAM.UserAuth.PinAuth" + ] + } +} diff --git a/ArkUIKit/ColorAdaptionSys/entry/src/main/syscap.json b/ArkUIKit/ColorAdaptionSys/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..598552fb33d0f5c27fed37e607d9163f836ac5af --- /dev/null +++ b/ArkUIKit/ColorAdaptionSys/entry/src/main/syscap.json @@ -0,0 +1,24 @@ + +{ + "devices": { + "general": [ + "default" + ] + }, + "production": { + "removedSysCaps": [ + "SystemCapability.HiviewDFX.HiDumper", + "SystemCapability.Security.DeviceAuth", + "SystemCapability.Multimedia.Media.AVTranscoder", + "SystemCapability.Tee.TeeClient", + "SystemCapability.Communication.Bluetooth.Core", + "SystemCapability.ArkUi.Graphics3D", + "SystemCapability.DistributedHardware.DeviceManager", + "SystemCapability.Multimedia.Drm.Core", + "SystemCapability.Advertising.Ads", + "SystemCapability.Customization.EnterpriseDeviceManager", + "SystemCapability.Security.DeviceSecurityLevel", + "SystemCapability.UserIAM.UserAuth.PinAuth" + ] + } +} diff --git a/ArkUIKit/ComponentExtension/entry/src/main/syscap.json b/ArkUIKit/ComponentExtension/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..598552fb33d0f5c27fed37e607d9163f836ac5af --- /dev/null +++ b/ArkUIKit/ComponentExtension/entry/src/main/syscap.json @@ -0,0 +1,24 @@ + +{ + "devices": { + "general": [ + "default" + ] + }, + "production": { + "removedSysCaps": [ + "SystemCapability.HiviewDFX.HiDumper", + "SystemCapability.Security.DeviceAuth", + "SystemCapability.Multimedia.Media.AVTranscoder", + "SystemCapability.Tee.TeeClient", + "SystemCapability.Communication.Bluetooth.Core", + "SystemCapability.ArkUi.Graphics3D", + "SystemCapability.DistributedHardware.DeviceManager", + "SystemCapability.Multimedia.Drm.Core", + "SystemCapability.Advertising.Ads", + "SystemCapability.Customization.EnterpriseDeviceManager", + "SystemCapability.Security.DeviceSecurityLevel", + "SystemCapability.UserIAM.UserAuth.PinAuth" + ] + } +} diff --git a/ArkUIKit/ComponentStateManagement/entry/src/main/syscap.json b/ArkUIKit/ComponentStateManagement/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..598552fb33d0f5c27fed37e607d9163f836ac5af --- /dev/null +++ b/ArkUIKit/ComponentStateManagement/entry/src/main/syscap.json @@ -0,0 +1,24 @@ + +{ + "devices": { + "general": [ + "default" + ] + }, + "production": { + "removedSysCaps": [ + "SystemCapability.HiviewDFX.HiDumper", + "SystemCapability.Security.DeviceAuth", + "SystemCapability.Multimedia.Media.AVTranscoder", + "SystemCapability.Tee.TeeClient", + "SystemCapability.Communication.Bluetooth.Core", + "SystemCapability.ArkUi.Graphics3D", + "SystemCapability.DistributedHardware.DeviceManager", + "SystemCapability.Multimedia.Drm.Core", + "SystemCapability.Advertising.Ads", + "SystemCapability.Customization.EnterpriseDeviceManager", + "SystemCapability.Security.DeviceSecurityLevel", + "SystemCapability.UserIAM.UserAuth.PinAuth" + ] + } +} diff --git a/ArkUIKit/CustomComponentsMixingUse/entry/src/main/syscap.json b/ArkUIKit/CustomComponentsMixingUse/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..598552fb33d0f5c27fed37e607d9163f836ac5af --- /dev/null +++ b/ArkUIKit/CustomComponentsMixingUse/entry/src/main/syscap.json @@ -0,0 +1,24 @@ + +{ + "devices": { + "general": [ + "default" + ] + }, + "production": { + "removedSysCaps": [ + "SystemCapability.HiviewDFX.HiDumper", + "SystemCapability.Security.DeviceAuth", + "SystemCapability.Multimedia.Media.AVTranscoder", + "SystemCapability.Tee.TeeClient", + "SystemCapability.Communication.Bluetooth.Core", + "SystemCapability.ArkUi.Graphics3D", + "SystemCapability.DistributedHardware.DeviceManager", + "SystemCapability.Multimedia.Drm.Core", + "SystemCapability.Advertising.Ads", + "SystemCapability.Customization.EnterpriseDeviceManager", + "SystemCapability.Security.DeviceSecurityLevel", + "SystemCapability.UserIAM.UserAuth.PinAuth" + ] + } +} diff --git a/ArkUIKit/CustomLifecycle/entry/src/main/ets/pages/Index.ets b/ArkUIKit/CustomLifecycle/entry/src/main/ets/pages/Index.ets index b0e67ab72dded3c0f60b1a8ad5ecfcc446ae130a..d792902194e8d5299c6f6e99a9ebe83ee712ad17 100644 --- a/ArkUIKit/CustomLifecycle/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/CustomLifecycle/entry/src/main/ets/pages/Index.ets @@ -45,7 +45,7 @@ struct ComponentExtension { @Provide('router') router: NavPathStack = new NavPathStack(); @State routes: RouteGroup[] = [ { - name: 'parent', + name: 'Parent', label: $r('app.string.parent'), children: [ { name: 'Index', label: $r('app.string.parentExample') }, @@ -134,7 +134,7 @@ struct ComponentExtension { .width('100%') .onClick(() => { const name = `pages/${routeGroup.name}/${route.name}`; - router.pushUrl({url: name}) + this.getUIContext().getRouter().pushUrl({url: name}); }) } .width('100%') diff --git a/ArkUIKit/CustomLifecycle/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/CustomLifecycle/entry/src/main/resources/base/profile/main_pages.json index 87a109bc5a45a78cc4bbd319f040205c2fdb2282..56f8f1db1083745b5ffbf5138b9d790ac382c225 100644 --- a/ArkUIKit/CustomLifecycle/entry/src/main/resources/base/profile/main_pages.json +++ b/ArkUIKit/CustomLifecycle/entry/src/main/resources/base/profile/main_pages.json @@ -1,6 +1,6 @@ { "src": [ "pages/Index", - "pages/parent/Index" + "pages/Parent/Index" ] } diff --git a/ArkUIKit/CustomLifecycle/entry/src/main/syscap.json b/ArkUIKit/CustomLifecycle/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..d14edde4277db282075a6639d65e40ddbbf0f2a2 --- /dev/null +++ b/ArkUIKit/CustomLifecycle/entry/src/main/syscap.json @@ -0,0 +1,20 @@ +{ + "devices": { + "general": [ + "default" + ], + "custom": [ + { + "xts": [ + "SystemCapability.ArkUI.ArkUI.Full", + "SystemCapability.ArkUI.ArkUI.Circle", + "SystemCapability.Test.UiTest", + "SystemCapability.Ability.AbilityRuntime.Core", + "SystemCapability.Notification.Emitter", + "SystemCapability.MiscServices.Time", + "SystemCapability.FileManagement.File.FileIO" + ] + } + ] + } +} \ No newline at end of file diff --git a/ArkUIKit/DeclarativeUIDescription/.gitignore b/ArkUIKit/DeclarativeUIDescription/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..70e60e495e5acb04db203396eb21b23eed5582b2 --- /dev/null +++ b/ArkUIKit/DeclarativeUIDescription/.gitignore @@ -0,0 +1,11 @@ +/node_modules +/oh_modules +/.idea +**/build +/.hvigor +.cxx +/.clangd +/.clang-format +/.clang-tidy +**/.test +/.appanalyzer \ No newline at end of file diff --git a/ArkUIKit/DrawModifier/entry/src/main/ets/pages/Canvas.ets b/ArkUIKit/DrawModifier/entry/src/main/ets/pages/Canvas.ets index 45f7d999136f039ec4a4fd04799c145906062889..617f270c149ad5963db4773b59a377dae0e03e8d 100644 --- a/ArkUIKit/DrawModifier/entry/src/main/ets/pages/Canvas.ets +++ b/ArkUIKit/DrawModifier/entry/src/main/ets/pages/Canvas.ets @@ -119,4 +119,4 @@ struct Index { } } -// [End Canvas_end] \ No newline at end of file +// [End Canvas_start] \ No newline at end of file diff --git a/ArkUIKit/DrawModifier/entry/src/main/ets/pages/DrawForeground.ets b/ArkUIKit/DrawModifier/entry/src/main/ets/pages/DrawForeground.ets index df7755733d91313f5adbb597d725677279b0b8ce..241417e9f01baefe417e248e9454842eaae71fbd 100644 --- a/ArkUIKit/DrawModifier/entry/src/main/ets/pages/DrawForeground.ets +++ b/ArkUIKit/DrawModifier/entry/src/main/ets/pages/DrawForeground.ets @@ -69,4 +69,4 @@ struct DrawModifierExample { .drawModifier(this.foregroundModifier) } } -// [End drawForeground_end] \ No newline at end of file +// [End drawForeground_start] \ No newline at end of file diff --git a/ArkUIKit/DrawModifier/entry/src/main/ets/pages/DrawFrontDrawContentDrawBehind.ets b/ArkUIKit/DrawModifier/entry/src/main/ets/pages/DrawFrontDrawContentDrawBehind.ets index b08c5ab0965a226830a1e49f1cc7326c3b27468b..8fe59d330ac4dd29f51d845e7dfe59994967a33a 100644 --- a/ArkUIKit/DrawModifier/entry/src/main/ets/pages/DrawFrontDrawContentDrawBehind.ets +++ b/ArkUIKit/DrawModifier/entry/src/main/ets/pages/DrawFrontDrawContentDrawBehind.ets @@ -211,4 +211,4 @@ struct DrawModifierExample { .height('100%') } } -// [End drawFront_drawContent_drawBehind_end] \ No newline at end of file +// [End drawFront_drawContent_drawBehind_start] \ No newline at end of file diff --git a/ArkUIKit/EnvirommentProjet/entry/.gitignore b/ArkUIKit/EnvirommentProjet/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/EnvirommentProjet/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/EventDecorator/entry/src/main/syscap.json b/ArkUIKit/EventDecorator/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..1f94672e471ff27a6714c57c36eb1bff50e35ce7 --- /dev/null +++ b/ArkUIKit/EventDecorator/entry/src/main/syscap.json @@ -0,0 +1,14 @@ +{ + "devices": { + "general": [ + "default" + ], + "custom": [ + { + "xts": [ + "SystemCapability.ArkUI.ArkUI.Full" + ] + } + ] + } +} \ No newline at end of file diff --git a/ArkUIKit/EventProject/entry/.gitignore b/ArkUIKit/EventProject/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/EventProject/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/GestureBinding/entry/src/main/ets/pages/Gesture.ets b/ArkUIKit/GestureBinding/entry/src/main/ets/pages/Gesture.ets index d662dc10ed90b7f8b25bbdff3f1174d9f0df41f9..4875c2aedba31bd0d8b8a07cfce977f251e08e61 100644 --- a/ArkUIKit/GestureBinding/entry/src/main/ets/pages/Gesture.ets +++ b/ArkUIKit/GestureBinding/entry/src/main/ets/pages/Gesture.ets @@ -12,8 +12,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -// [Start Regular_binding] +import { hilog } from '@kit.PerformanceAnalysisKit'; +const DOMAIN = 0x0001; +const TAG = 'Sample_gesturebinding'; +// [Start regular_binding] // xxx.ets @Entry @Component @@ -25,11 +27,11 @@ struct RegularBinding { .gesture( TapGesture() .onAction(() => { - console.info('TapGesture is onAction'); + hilog.info(DOMAIN, TAG,'TapGesture is onAction'); })); } .height(200) .width(250); }; } -// [End Regular_binding] \ No newline at end of file +// [End regular_binding] \ No newline at end of file diff --git a/ArkUIKit/GestureBinding/entry/src/main/ets/pages/ParallelGesture.ets b/ArkUIKit/GestureBinding/entry/src/main/ets/pages/ParallelGesture.ets index ad94f377d29af84c24d1de03360835fbfdb719fc..9083b2392f18b8c9d474058909587dabff252448 100644 --- a/ArkUIKit/GestureBinding/entry/src/main/ets/pages/ParallelGesture.ets +++ b/ArkUIKit/GestureBinding/entry/src/main/ets/pages/ParallelGesture.ets @@ -12,8 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { hilog } from '@kit.PerformanceAnalysisKit'; +const DOMAIN = 0x0001; +const TAG = 'Sample_gesturebinding'; -// [Start Parallel_binding] +// [Start parallel_binding] // xxx.ets @Entry @Component @@ -24,7 +27,7 @@ struct ParallelBinding { .gesture( TapGesture() .onAction(() => { - console.info('Text TapGesture is onAction'); + hilog.info(DOMAIN, TAG,'Text TapGesture is onAction'); })); } .height(200) @@ -33,8 +36,8 @@ struct ParallelBinding { .parallelGesture( TapGesture() .onAction(() => { - console.info('Column TapGesture is onAction'); + hilog.info(DOMAIN, TAG,'Column TapGesture is onAction'); }), GestureMask.Normal); }; } -// [End Parallel_binding] \ No newline at end of file +// [End parallel_binding] \ No newline at end of file diff --git a/ArkUIKit/GestureBinding/entry/src/main/ets/pages/PriorityGesture.ets b/ArkUIKit/GestureBinding/entry/src/main/ets/pages/PriorityGesture.ets index 210aef4079f57c91d351f2eba5c37f6d45eace9f..40d3606e77cebacbbe4b1a50b44cf9e2e3bc0945 100644 --- a/ArkUIKit/GestureBinding/entry/src/main/ets/pages/PriorityGesture.ets +++ b/ArkUIKit/GestureBinding/entry/src/main/ets/pages/PriorityGesture.ets @@ -12,8 +12,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -// [Start Priority_binding] +import { hilog } from '@kit.PerformanceAnalysisKit'; +const DOMAIN = 0x0001; +const TAG = 'Sample_gesturebinding'; +// [Start priority_binding] // xxx.ets @Entry @Component @@ -24,7 +26,7 @@ struct PriorityBinding { .gesture( TapGesture() .onAction(() => { - console.info('Text TapGesture is onAction'); + hilog.info(DOMAIN, TAG,'Text TapGesture is onAction'); })); } .height(200) @@ -33,8 +35,8 @@ struct PriorityBinding { .priorityGesture( TapGesture() .onAction(() => { - console.info('Column TapGesture is onAction'); + hilog.info(DOMAIN, TAG,'Column TapGesture is onAction'); }), GestureMask.IgnoreInternal); }; } -// [End Priority_binding] \ No newline at end of file +// [End priority_binding] \ No newline at end of file diff --git a/ArkUIKit/GestureBinding/entry/src/ohosTest/ets/test/Index.test.ets b/ArkUIKit/GestureBinding/entry/src/ohosTest/ets/test/Index.test.ets index 1ce810b20a65722114da701ca1031046bb73f7b8..93b3e7c960e744eb8ac744f9971aacfa2c0401cc 100644 --- a/ArkUIKit/GestureBinding/entry/src/ohosTest/ets/test/Index.test.ets +++ b/ArkUIKit/GestureBinding/entry/src/ohosTest/ets/test/Index.test.ets @@ -18,7 +18,7 @@ import { UIAbility, Want } from '@kit.AbilityKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; const DOMAIN = 0x0001; -const TAG = 'GestureBinding'; +const TAG = 'Sample_gesturebinding'; const delegator = abilityDelegatorRegistry.getAbilityDelegator(); const bundleName = abilityDelegatorRegistry.getArguments().bundleName; let driver: Driver; diff --git a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/AddFilterEffectsToImages.ets b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/AddFilterEffectsToImages.ets index 87cc7f57d4e7bd29e01a29cb3f6b36d4eb4804cd..76c531a0112e2863a5d227b8242acbae9bc35f39 100644 --- a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/AddFilterEffectsToImages.ets +++ b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/AddFilterEffectsToImages.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [Start ImageFilterEffect] +// [Start image_filtereffect] @Entry @Component struct AddFilterEffectsToImages { @@ -37,4 +37,4 @@ struct AddFilterEffectsToImages { } }; } -// [End ImageFilterEffect] \ No newline at end of file +// [End image_filtereffect] \ No newline at end of file diff --git a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/DisplayVectorDiagram.ets b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/DisplayVectorDiagram.ets index ef23aa27327d3990b4767b9c5f29e102d6fb9eb8..16586cc98cc8f6c5b7a36549ef92415124a9b87a 100644 --- a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/DisplayVectorDiagram.ets +++ b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/DisplayVectorDiagram.ets @@ -20,26 +20,26 @@ struct DisplayVectorDiagram { Column({ space: 10 }) { Row({ space: 50 }) { - // [Start SvgFillColor] + // [Start svg_fillColor] // $r('app.media.cloud')需要替换为开发者所需的资源文件 Image($r('app.media.cloud')) .width(50) .fillColor(Color.Blue) - // [End SvgFillColor] + // [End svg_fillColor] - // [Start LocalSVG] + // [Start local_svg] // 'images/icon.svg' 需要替换为开发者所需的资源文件 Image('images/icon.svg') .width(50) .height(50) - // [End LocalSVG] + // [End local_svg] } - // [Start SynchronousImageLoading] + // [Start synchronous_imageloading] // $r('app.media.icon')需要替换为开发者所需的资源文件 Image($r('app.media.icon')) .syncLoad(true) - // [End SynchronousImageLoading] + // [End synchronous_imageloading] }.height(150).width('100%').padding({ top: 20,right: 10 }) }; } \ No newline at end of file diff --git a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/DrawableDescriptor.ets b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/DrawableDescriptor.ets index cabc81cc35a3ffcfc2adae61fad0917a145cccf3..c0ac086eb7f9b514e3bf6d10d9a32cd1fc3e10b9 100644 --- a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/DrawableDescriptor.ets +++ b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/DrawableDescriptor.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -// [Start DrawableDescriptor] +// [Start drawable_descriptor] import { DrawableDescriptor, PixelMapDrawableDescriptor, @@ -128,4 +128,4 @@ struct DrawableDescriptorType { .margin(50) }; } -// [End DrawableDescriptor] \ No newline at end of file +// [End drawable_descriptor] \ No newline at end of file diff --git a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/EventCall.ets b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/EventCall.ets index 22f970f04f1a305e6c184297a27b5ef880ac6a20..3d573783ab1f068bd78ebcc32032cc14cea03312 100644 --- a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/EventCall.ets +++ b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/EventCall.ets @@ -15,8 +15,8 @@ import { hilog } from '@kit.PerformanceAnalysisKit'; const DOMAIN = 0x0001; -const TAG = 'MyApp'; -// [Start EventInvocation] +const TAG = 'Sample_imagecomponent'; +// [Start event_invocation] @Entry @Component struct EventCall { @@ -53,4 +53,4 @@ struct EventCall { } }; } -// [End EventInvocation] \ No newline at end of file +// [End event_invocation] \ No newline at end of file diff --git a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/ImageInterpolation.ets b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/ImageInterpolation.ets index a6d081ac4a9913d7c8697f8d5e15393fe174f523..dd1b12b956aaab3fca68a32677aa9ab1d53263c9 100644 --- a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/ImageInterpolation.ets +++ b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/ImageInterpolation.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [Start ImageInterpolation] +// [Start image_interpolation] @Entry @Component struct ImageInterpolationType { @@ -57,4 +57,4 @@ struct ImageInterpolationType { .height('100%') }; } -// [End ImageInterpolation] \ No newline at end of file +// [End image_interpolation] \ No newline at end of file diff --git a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/LoadImageResources.ets b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/LoadImageResources.ets index f7f93299dcda88f194056c0c4c2d51141ec1454b..5f5ab7fc39f349afeb12a65b6b871016c80d9f13 100644 --- a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/LoadImageResources.ets +++ b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/LoadImageResources.ets @@ -12,15 +12,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [Start MediaLibraryFile] +// [Start media_libraryfile] import { photoAccessHelper } from '@kit.MediaLibraryKit'; import { BusinessError } from '@kit.BasicServicesKit'; -// [StartExclude MediaLibraryFile_HiLog] +// [StartExclude media_libraryfile] import { hilog } from '@kit.PerformanceAnalysisKit'; const DOMAIN = 0x0001; -const TAG = 'MyApp'; -// [EndExclude MediaLibraryFile_HiLog] +const TAG = 'Sample_imagecomponent'; +// [EndExclude media_libraryfile] @Entry @Component struct MediaLibraryFile { @@ -65,4 +65,4 @@ struct MediaLibraryFile { }.width('100%').height('100%'); }; } -// [End MediaLibraryFile] \ No newline at end of file +// [End media_libraryfile] \ No newline at end of file diff --git a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/LoadingResources.ets b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/LoadingResources.ets index 9f73da4d3ebf16c71c91a351993f32f200ee41a6..f411f849d4e6138da604cd77840b24001681ec08 100644 --- a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/LoadingResources.ets +++ b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/LoadingResources.ets @@ -19,32 +19,32 @@ struct LoadingResources { build() { Column({ space: 10 }) { - // [Start localResource] + // [Start local_resource] // 'images/view.jpg' 需要替换为开发者所需的资源文件 Image('images/view.jpg') .width(200) - // [End localResource] + // [End local_resource] - // [Start netResource] + // [Start net_resource] // $r('app.string.LoadingResources') 需要替换为开发者所需的资源文件 Image($r('app.string.LoadingResources')) // 实际使用时请替换为真实地址 - // [End netResource] + // [End net_resource] - // [Start Resource] + // [Start resource_icon] // $r('app.media.icon') 需要替换为开发者所需的资源文件 Image($r('app.media.icon')) - // [End Resource] + // [End resource_icon] - // [Start rawfileResource] + // [Start rawfile_resource] // $rawfile('example1.png') 需要替换为开发者所需的资源文件 Image($rawfile('example1.png')) - // [End rawfileResource] + // [End rawfile_resource] - // [Start FileLibraryFormat] + // [Start fileLibrary_format] // 'file://media/Photos/5' 需要替换为开发者所需的资源文件 Image('file://media/Photos/5') .width(200) - // [End FileLibraryFormat] + // [End fileLibrary_format] } .height(150) .width('100%') diff --git a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/MultimediaPixelArt.ets b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/MultimediaPixelArt.ets index bd4f854c94ef6665d248146680a2cf83695de07d..552cbb8ebd90ad4cdf92ef4b5248a30d353d5880 100644 --- a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/MultimediaPixelArt.ets +++ b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/MultimediaPixelArt.ets @@ -13,16 +13,16 @@ * limitations under the License. */ -// [Start MultimediaPixel] +// [Start multimedia_pixel] import { http } from '@kit.NetworkKit'; import { image } from '@kit.ImageKit'; import { BusinessError } from '@kit.BasicServicesKit'; -// [StartExclude HttpExample_HiLog] +// [StartExclude multimedia_pixel] import { hilog } from '@kit.PerformanceAnalysisKit'; const DOMAIN = 0x0001; -const TAG = 'MyApp'; -// [EndExclude HttpExample_HiLog] +const TAG = 'Sample_imagecomponent'; +// [EndExclude multimedia_pixel] @Entry @Component struct HttpExample { @@ -61,4 +61,4 @@ struct HttpExample { }; }; } -// [End MultimediaPixel] \ No newline at end of file +// [End multimedia_pixel] \ No newline at end of file diff --git a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageDecodingSize.ets b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageDecodingSize.ets index c4683dab05ef6ed4b4e616835b8aa0afac82d4ff..aea66f624cdb87881a431277af74766898f4c94e 100644 --- a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageDecodingSize.ets +++ b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageDecodingSize.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -// [Start ImageDecodingSize] +// [Start image_decodingsize] @Entry @Component struct SetImageDecodingSize { @@ -46,4 +46,4 @@ struct SetImageDecodingSize { }; }; } -// [End ImageDecodingSize] \ No newline at end of file +// [End image_decodingsize] \ No newline at end of file diff --git a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageRenderingMode.ets b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageRenderingMode.ets index 7e4ede4b460368e2e847ec14e21fec036f4dfd45..043cd874e8a1a9cce9f2c5f30c8ac097c2c69fdd 100644 --- a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageRenderingMode.ets +++ b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageRenderingMode.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -// [Start ImageRenderingMode] +// [Start image_renderingmode] @Entry @Component struct SetImageRenderingMode { @@ -41,4 +41,4 @@ struct SetImageRenderingMode { }.height(150).width('100%').padding({ top: 20,right: 10 }); }; } -// [End ImageRenderingMode] \ No newline at end of file +// [End image_renderingmode] \ No newline at end of file diff --git a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageRepetitionStyle.ets b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageRepetitionStyle.ets index e6ecb0a6166c5cfd2daecac6a9c210e518f34037..e778f085aa7da638769d047ff56bf38f9026a113 100644 --- a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageRepetitionStyle.ets +++ b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageRepetitionStyle.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -// [Start ImageRepetitionStyle] +// [Start image_repetitionstyle] @Entry @Component struct ImageRepetitionStyle { @@ -51,4 +51,4 @@ struct ImageRepetitionStyle { }.height(150).width('100%').padding(8); }; } -// [End ImageRepetitionStyle] \ No newline at end of file +// [End image_repetitionstyle] \ No newline at end of file diff --git a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageZoomType.ets b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageZoomType.ets index d7540f4ba0ecec941eb397148e44e40b314f5914..d73c45ab807da8ca9f3c06517bb6fd0d27717c13 100644 --- a/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageZoomType.ets +++ b/ArkUIKit/ImageComponent/entry/src/main/ets/pages/SetImageZoomType.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -// [Start ImageObjectFit] +// [Start image_objectfit] @Entry @Component struct ImageScalingType { @@ -85,4 +85,4 @@ struct ImageScalingType { }; }; } -// [End ImageObjectFit] \ No newline at end of file +// [End image_objectfit] \ No newline at end of file diff --git a/ArkUIKit/ImageComponent/entry/src/ohosTest/ets/test/Index.test.ets b/ArkUIKit/ImageComponent/entry/src/ohosTest/ets/test/Index.test.ets index 1fccc2779e3ea11151384fc6a2a001482759e969..bcc19c680bb23ea296d88ba637cc44dfcdacab6d 100644 --- a/ArkUIKit/ImageComponent/entry/src/ohosTest/ets/test/Index.test.ets +++ b/ArkUIKit/ImageComponent/entry/src/ohosTest/ets/test/Index.test.ets @@ -17,9 +17,8 @@ import { describe, it, expect, beforeAll } from '@ohos/hypium'; import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; import { UIAbility, Want } from '@kit.AbilityKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; - -const DOMAIN_NUMBER: number = 0xFF00; -const TAG: string = '[EventAbility]'; +const DOMAIN = 0x0001; +const TAG = 'Sample_imagecomponent'; const delegator = abilityDelegatorRegistry.getAbilityDelegator(); const bundleName = abilityDelegatorRegistry.getArguments().bundleName; let driver: Driver; @@ -39,7 +38,7 @@ export default function IndexTest() { // 验证当前页面是否正确 const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); + hilog.info(DOMAIN, TAG,'get top ability'); expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); }); @@ -49,7 +48,7 @@ export default function IndexTest() { * @tc.desc 测试首页加载是否成功 */ it('testHomePageLoad', 0, async (done: Function) => { - console.info('ImageTest: testHomePageLoad begin'); + hilog.info(DOMAIN, TAG,'ImageTest: testHomePageLoad begin'); // 验证标题存在 const title = await driver.findComponent(ON.text('Show Image')); @@ -59,7 +58,7 @@ export default function IndexTest() { const list = await driver.findComponent(ON.type('List')); expect(list === null).assertFalse(); - console.info('ImageTest: testHomePageLoad end'); + hilog.info(DOMAIN, TAG,'ImageTest: testHomePageLoad end'); done(); }); @@ -69,7 +68,7 @@ export default function IndexTest() { * @tc.desc 测试图片缩放类型设置页面跳转 */ it('testImageZoomNavigation', 0, async (done: Function) => { - console.info('ImageTest: testImageZoomNavigation begin'); + hilog.info(DOMAIN, TAG,'ImageTest: testImageZoomNavigation begin'); // 点击"设置图片缩放类型"项 const zoomItem = await driver.findComponent(ON.text('SetImageZoomType')); @@ -85,7 +84,7 @@ export default function IndexTest() { await driver.pressBack(); await driver.delayMs(500); - console.info('ImageTest: testImageZoomNavigation end'); + hilog.info(DOMAIN, TAG,'ImageTest: testImageZoomNavigation end'); done(); }); @@ -95,7 +94,7 @@ export default function IndexTest() { * @tc.desc 测试图片插值页面跳转 */ it('testImageInterpolationNavigation', 0, async (done: Function) => { - console.info('ImageTest: testImageInterpolationNavigation begin'); + hilog.info(DOMAIN, TAG,'ImageTest: testImageInterpolationNavigation begin'); // 点击"图片插值"项 const interpolationItem = await driver.findComponent(ON.text('ImageInterpolation')); @@ -111,7 +110,7 @@ export default function IndexTest() { await driver.pressBack(); await driver.delayMs(500); - console.info('ImageTest: testImageInterpolationNavigation end'); + hilog.info(DOMAIN, TAG,'ImageTest: testImageInterpolationNavigation end'); done(); }); @@ -121,7 +120,7 @@ export default function IndexTest() { * @tc.desc 测试设置图片重复样式页面跳转 */ it('testSetImageRepetitionStyle', 0, async (done: Function) => { - console.info('ImageTest: testSetImageRepetitionStyle begin'); + hilog.info(DOMAIN, TAG,'ImageTest: testSetImageRepetitionStyle begin'); // 点击"设置图片重复样式"项 const interpolationItem = await driver.findComponent(ON.text('SetImageRepetitionStyle')); @@ -137,7 +136,7 @@ export default function IndexTest() { await driver.pressBack(); await driver.delayMs(500); - console.info('ImageTest: testSetImageRepetitionStyle end'); + hilog.info(DOMAIN, TAG,'ImageTest: testSetImageRepetitionStyle end'); done(); }); @@ -147,7 +146,7 @@ export default function IndexTest() { * @tc.desc 测试设置图片渲染模式页面跳转 */ it('testSetImageRenderingMode', 0, async (done: Function) => { - console.info('ImageTest: testSetImageRenderingMode begin'); + hilog.info(DOMAIN, TAG,'ImageTest: testSetImageRenderingMode begin'); // 点击"设置图片渲染模式"项 const interpolationItem = await driver.findComponent(ON.text('SetImageRenderingMode')); @@ -163,7 +162,7 @@ export default function IndexTest() { await driver.pressBack(); await driver.delayMs(500); - console.info('ImageTest: testSetImageRenderingMode end'); + hilog.info(DOMAIN, TAG,'ImageTest: testSetImageRenderingMode end'); done(); }); @@ -174,7 +173,7 @@ export default function IndexTest() { * @tc.desc 测试页面加载性能 */ it('testPageLoadPerformance', 0, async (done: Function) => { - console.info('ImageTest: testPageLoadPerformance begin'); + hilog.info(DOMAIN, TAG,'ImageTest: testPageLoadPerformance begin'); const startTime = new Date().getTime(); @@ -187,12 +186,12 @@ export default function IndexTest() { const endTime = new Date().getTime(); const loadTime = endTime - startTime; - console.info(`Page load time: ${loadTime}ms`); + hilog.info(DOMAIN, TAG,`Page load time: ${loadTime}ms`); expect(loadTime < 3000).assertTrue(); // 加载时间应小于3秒 await driver.pressBack(); - console.info('ImageTest: testPageLoadPerformance end'); + hilog.info(DOMAIN, TAG,'ImageTest: testPageLoadPerformance end'); done(); }); @@ -205,7 +204,7 @@ export default function IndexTest() { * @tc.type: Function */ it('testShadow', 0, async (done: Function) => { - hilog.info(DOMAIN_NUMBER, TAG, 'ImageTest: testShadow begin'); + hilog.info(DOMAIN, TAG, 'ImageTest: testShadow begin'); // Set page scrolling let size = await driver.getDisplaySize() @@ -227,7 +226,7 @@ export default function IndexTest() { await driver.pressBack(); await driver.delayMs(500); - hilog.info(DOMAIN_NUMBER, TAG, 'ImageTest: testShadow end'); + hilog.info(DOMAIN, TAG, 'ImageTest: testShadow end'); done(); }); }); diff --git a/ArkUIKit/ImageComponent/entry/src/ohosTest/ets/test/Index2.test.ets b/ArkUIKit/ImageComponent/entry/src/ohosTest/ets/test/Index2.test.ets index edf8d49fec5181a1d20a1d250bc6966a00ee61cf..a5bebadc74fca6df081b9eacbd0dd8ed56cff0b8 100644 --- a/ArkUIKit/ImageComponent/entry/src/ohosTest/ets/test/Index2.test.ets +++ b/ArkUIKit/ImageComponent/entry/src/ohosTest/ets/test/Index2.test.ets @@ -18,7 +18,7 @@ import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit'; import { UIAbility, Want } from '@kit.AbilityKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; const DOMAIN = 0x0001; -const TAG = 'MyApp'; +const TAG = 'Sample_imagecomponent'; const delegator = abilityDelegatorRegistry.getAbilityDelegator(); const bundleName = abilityDelegatorRegistry.getArguments().bundleName; let driver: Driver; diff --git a/ArkUIKit/LocalStorage/entry/.gitignore b/ArkUIKit/LocalStorage/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/LocalStorage/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/ChangeLocalSetSample.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/ChangeLocalSetSample.ets index f2764073ffec0905bf8fa02836ad9bc79dc1c791..1e17d066f3addfa5497442cb61d9c02570cc236b 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/ChangeLocalSetSample.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/ChangeLocalSetSample.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start localtorage_change_local_set_sample] let storageChange = new LocalStorage(); storageChange.setOrCreate('count', 47); @@ -39,4 +40,5 @@ struct Test { }) } } -} \ No newline at end of file +} +// [End localtorage_change_local_set_sample] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/LocalDateSample.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/LocalDateSample.ets index bd5026211fbdd6ba2f5ce5a5e5e2039e15a5d956..286dbd60bc3bf2e687a6e95a75353d7a9f280fe3 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/LocalDateSample.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/LocalDateSample.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start localtorage_local_date_sample] @Entry @Component struct LocalDateSample { @@ -46,4 +47,5 @@ struct LocalDateSample { }) }.width('100%') } -} \ No newline at end of file +} +// [End localtorage_local_date_sample] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/LocalMapSample.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/LocalMapSample.ets index ccb68aa5f675433c866d173257d0e9f8f27d9686..23451c441b65d776184902a2b866293935e356dc 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/LocalMapSample.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/LocalMapSample.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start localtorage_local_map_sample] @Entry @Component struct LocalMapSample { @@ -45,4 +46,5 @@ struct LocalMapSample { } .height('100%') } -} \ No newline at end of file +} +// [End localtorage_local_map_sample] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/LocalSetSample.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/LocalSetSample.ets index f6fe6d567f2c899d87514f3de25d20f05abca21a..444e6ab25963ccf9a073eb39081e96d56ed8a323 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/LocalSetSample.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/LocalSetSample.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start localtorage_local_set_sample] @Entry @Component struct LocalSetSample { @@ -46,4 +47,5 @@ struct LocalSetSample { } .height('100%') } -} \ No newline at end of file +} +// [End localtorage_local_set_sample] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageFiveShare.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageFiveShare.ets index a9628a59de21db71d08fd00f09bf3324f82a5a22..5a714c05e561b9325fcb68580fe939664c04cb3c 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageFiveShare.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageFiveShare.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start localtorage_page_five_share] // index.ets // 预览器上不支持获取页面共享的LocalStorage实例。 @@ -39,4 +40,5 @@ struct Index { .height('100%') } } -} \ No newline at end of file +} +// [End localtorage_page_five_share] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageFiveShare2.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageFiveShare2.ets index e95edf57c50384487dda642bb7c149d41eeb31db..f0e13bee3d0b7c164435d9fb086aad5c4773c433 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageFiveShare2.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageFiveShare2.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + // [Start localtorage_page_five_share2] // Page.ets @Builder @@ -51,4 +52,5 @@ struct Page { this.pathStack = context.pathStack; }) } -} \ No newline at end of file +} +// [Start localtorage_page_five_share2] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageFourStateVariableSYN.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageFourStateVariableSYN.ets index d9cfa49d12b2aaf3ab625e4330893decffb21f88..a6e3cd01d56959bd304737215681f48c8120a54b 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageFourStateVariableSYN.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageFourStateVariableSYN.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start localtorage_page_four_state_variable_syn] let count: Record = { 'countStorage': 1 }; let storage4: LocalStorage = new LocalStorage(count); @@ -89,4 +90,5 @@ struct Parent4 { .fontSize(12) } } -} \ No newline at end of file +} +// [End localtorage_page_four_state_variable_syn] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageLocalStorageLink.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageLocalStorageLink.ets index 191b118799edc7b9b9fa7938ba6be74f02186920..ae21c41b4c821b19f77179cba52df1c144775915 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageLocalStorageLink.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageLocalStorageLink.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start localtorage_page_local_storage_link] @Component struct LocalStorageLinkComponent { @LocalStorageLink('LinkA') linkA: number | null = null; @@ -76,4 +77,5 @@ struct LinkIndex { } .height('100%') } -} \ No newline at end of file +} +// [End localtorage_page_local_storage_link] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageMyNavigation.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageMyNavigation.ets index 5f2b0661c837397f6afe3bf523e756fb7e508026..d4ab280b714eac1e12a918c261dfdeb1428bcc92 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageMyNavigation.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageMyNavigation.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start localtorage_page_my_navigation] let localStorageA: LocalStorage = new LocalStorage(); localStorageA.setOrCreate('propA', 'propA'); @@ -153,4 +154,5 @@ struct NavigationContentMsgStack { .fontWeight(FontWeight.Bold) } } -} \ No newline at end of file +} +// [End localtorage_page_my_navigation] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageOneDoubleSYN.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageOneDoubleSYN.ets index 0b440d0124172e18c3250c9e76ae26d59ae32c3b..8c934accd7edb76839aaa799da1e0be6ae1f8804 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageOneDoubleSYN.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageOneDoubleSYN.ets @@ -12,6 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +// [Start localtorage_page_one_double_syn] class Data { public code: number; @@ -71,4 +73,5 @@ struct Parent { Child() } } -} \ No newline at end of file +} +// [End localtorage_page_one_double_syn] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageSixLocalStorage.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageSixLocalStorage.ets index 5c4b6b9ed2275b04ff07effb541fa2d2d23347c5..a01d34f95ae27f5dc161dd8355a3f2a191fcaaf5 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageSixLocalStorage.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageSixLocalStorage.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + // [Start localtorage_page_six_local_storage] let localStorage1: LocalStorage = new LocalStorage(); localStorage1.setOrCreate('propA', 'propA'); @@ -52,4 +53,5 @@ struct Child6 { .fontSize(50) .fontWeight(FontWeight.Bold) } -} \ No newline at end of file +} +// [End localtorage_page_six_local_storage] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageSixLocalStorageA.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageSixLocalStorageA.ets index ec82a3141991e8fd1cc11f6eda037138011a820e..72f1ae64008b1e13aabd61718106b146b4b52681 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageSixLocalStorageA.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageSixLocalStorageA.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start localtorage_page_six_local_storageA] let localStorage1A: LocalStorage = new LocalStorage(); localStorage1A.setOrCreate('propA', 'propA'); @@ -47,4 +48,5 @@ struct AChild { .fontSize(50) .fontWeight(FontWeight.Bold) } -} \ No newline at end of file +} +// [End localtorage_page_six_local_storageA] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageSixLocalStorageB.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageSixLocalStorageB.ets index 7b8cc700ce25c026183be19ebee29a22ea81203e..bcb7f5e37f1743dab9f807bdf4779912556ab425 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageSixLocalStorageB.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageSixLocalStorageB.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start localtorage_page_six_local_storageB] let localStorage1B: LocalStorage = new LocalStorage(); localStorage1B.setOrCreate('propA', 'propA'); @@ -51,4 +52,5 @@ struct BChild { .fontSize(50) .fontWeight(FontWeight.Bold) } -} \ No newline at end of file +} +// [End localtorage_page_six_local_storageB] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageTowSigleSYN.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageTowSigleSYN.ets index 44c0c5e460b7e5f9d156ee6fb40ac9f8f3344c7f..93c540ecdc151bb308a28881b5543552c26f9822 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageTowSigleSYN.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageTowSigleSYN.ets @@ -14,6 +14,7 @@ */ // 创建新实例并使用给定对象初始化 // 使LocalStorage可从@Component组件访问 +// [Start localtorage_page_tow_sigle_syn] @Entry @Component struct Parent1 { @@ -43,4 +44,5 @@ struct Child1 { Text(`Parent from LocalStorage ${this.storageProp2}`) } } -} \ No newline at end of file +} +// [End localtorage_page_tow_sigle_syn] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageTwoWaySYN.ets b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageTwoWaySYN.ets index 363782375b50feffb6ed9f4906e39c74b3bcaabf..8478ed0827b92447c88c64f4bf6dda63ef2ce0f4 100644 --- a/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageTwoWaySYN.ets +++ b/ArkUIKit/LocalStorage/entry/src/main/ets/pages/PageTwoWaySYN.ets @@ -13,6 +13,7 @@ * limitations under the License. */ // 构造LocalStorage实例 +// [Start localtorage_page_two_way_syn] let para1: Record = { 'PropA': 47 }; let storage1: LocalStorage = new LocalStorage(para1); // 调用link(api9以上)接口构造'PropA'的双向同步数据,linkToPropA 是全局变量 @@ -38,4 +39,5 @@ struct Parent2 { Text(`@LocalStorageLink: ${this.storageLink} - linkToPropA: ${linkToPropA.get()}`) } } -} \ No newline at end of file +} +// [End localtorage_page_two_way_syn] \ No newline at end of file diff --git a/ArkUIKit/LocalStorage/entry/src/mock/mock-config.json5 b/ArkUIKit/LocalStorage/entry/src/mock/mock-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7a73a41bfdf76d6f793007240d80983a52f15f97 --- /dev/null +++ b/ArkUIKit/LocalStorage/entry/src/mock/mock-config.json5 @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/ArkUIKit/MakeObserved/entry/src/main/ets/View/Page2.ets b/ArkUIKit/MakeObserved/entry/src/main/ets/View/Page2.ets index d2f5722631a9c9b65bb98f8b3246c6b89d6ad333..ba30dd44422d2187d1e7b8f51d409f31dda33899 100644 --- a/ArkUIKit/MakeObserved/entry/src/main/ets/View/Page2.ets +++ b/ArkUIKit/MakeObserved/entry/src/main/ets/View/Page2.ets @@ -38,4 +38,4 @@ struct Page2 { } } } -// [Start MakeObserved_only_applies_to_input_parameters] \ No newline at end of file +// [End MakeObserved_only_applies_to_input_parameters] \ No newline at end of file diff --git a/ArkUIKit/MakeObserved/entry/src/main/ets/View/Page6.ets b/ArkUIKit/MakeObserved/entry/src/main/ets/View/Page6.ets index 0389ce6c71ebccfc34b66f25ed26598c829587aa..e55fc4c85cb9529ee1eefb3e08d6db4a0674d501 100644 --- a/ArkUIKit/MakeObserved/entry/src/main/ets/View/Page6.ets +++ b/ArkUIKit/MakeObserved/entry/src/main/ets/View/Page6.ets @@ -58,4 +58,5 @@ struct Page6 { .height('100%') .width('100%') } -}// [End Array_rom_shallow_copy] +} +// [End Array_rom_shallow_copy] diff --git a/ArkUIKit/MakeObserved/entry/src/main/ets/View/Page8.ets b/ArkUIKit/MakeObserved/entry/src/main/ets/View/Page8.ets index 46c4a0a0c8cc90728ecad25ecab93983a593ebf9..fa3dd5decd7370b028852f8e0c7a32dd26f488d0 100644 --- a/ArkUIKit/MakeObserved/entry/src/main/ets/View/Page8.ets +++ b/ArkUIKit/MakeObserved/entry/src/main/ets/View/Page8.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [start name_change_from_monitor_value] +// [Start name_change_from_monitor_value] import { UIUtils } from '@kit.ArkUI'; class Info { diff --git a/ArkUIKit/MultilevelGestureEvents/entry/.gitignore b/ArkUIKit/MultilevelGestureEvents/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/MultilevelGestureEvents/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/CustomEvent.ets b/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/CustomEvent.ets index a2fb0912501a53d769b2c1fef65ad0c00d5ec2a4..7c0efb1a4226474f9c717eb598ac22238b0a76fc 100644 --- a/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/CustomEvent.ets +++ b/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/CustomEvent.ets @@ -34,7 +34,7 @@ const rect4 : CustomRect = new CustomRect(0, 0, 200, 150); struct CustomEvent { build() { Column() { - // [Start responseRegion] + // [Start response_region] Column() { Column() .id('ComponentB') @@ -46,9 +46,9 @@ struct CustomEvent { .onTouch(() => {}) .gesture(TapGesture({count: 1})) .responseRegion([rect4]); - // [End responseRegion] + // [End response_region] - // [Start hitTestBehavior_first] + // [Start hittestbehavior_first] Column() { Column() .id('ComponentB') @@ -69,9 +69,9 @@ struct CustomEvent { .id('ComponentA') .onTouch(() => {}) .gesture(TapGesture({count: 1})); - // [End hitTestBehavior_first] + // [End hittestbehavior_first] - // [Start responseRegion_second] + // [Start responseregion_second] Stack() { Column() .id('ComponentB') @@ -87,9 +87,9 @@ struct CustomEvent { .id('Stack A') .onTouch(() => {}) .gesture(TapGesture({count: 1})); - // [End responseRegion_second] + // [End responseregion_second] - // [Start responseRegion_thirdly] + // [Start responseregion_thirdly] Column() { Column() .id('ComponentB') @@ -100,9 +100,9 @@ struct CustomEvent { .onTouch(() => {}) .gesture(TapGesture({count: 1})) .hitTestBehavior(HitTestMode.None); - // [End responseRegion_thirdly] + // [End responseregion_thirdly] - // [Start responseRegion_fourth] + // [Start responseregion_fourth] Stack() { Column() .id('ComponentB') @@ -122,9 +122,9 @@ struct CustomEvent { .id('Stack A') .onTouch(() => {}) .gesture(TapGesture({count: 1})); - // [End responseRegion_fourth] + // [End responseregion_fourth] - // [Start responseRegion_fifth] + // [Start responseregion_fifth] Stack() { Column() .id('ComponentB') @@ -144,9 +144,9 @@ struct CustomEvent { .id('Stack A') .onTouch(() => {}) .gesture(TapGesture({count: 1})); - // [End responseRegion_fifth] + // [End responseregion_fifth] - // [Start BindingFirst_gesture] + // [Start bindingfirst_gesture] Column() { Column() .id('ComponentB') @@ -154,9 +154,9 @@ struct CustomEvent { } .id('ComponentA') .gesture(TapGesture({count: 1})); - // [End BindingFirst_gesture] + // [End bindingfirst_gesture] - // [Start BindingSecond_gesture] + // [Start bindingsecond_gesture] Column() { Column() .id('ComponentB') @@ -164,9 +164,9 @@ struct CustomEvent { } .id('ComponentA') .priorityGesture(TapGesture({count: 1})); - // [End BindingSecond_gesture] + // [End bindingsecond_gesture] - // [Start BindingThirdly_gesture] + // [Start bindingthirdly_gesture] Column() { Column() .id('ComponentB') @@ -174,7 +174,7 @@ struct CustomEvent { } .id('ComponentA') .parallelGesture(TapGesture({count: 1})); - // [End BindingThirdly_gesture] + // [End bindingthirdly_gesture] } .width('100%') .height('100%') diff --git a/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/GesturesEvents.ets b/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/GesturesEvents.ets index 75bbfaa76969ad2e91bd636262bfb4b32a478d38..8e1a41ca81992fec451883e338cce98f5719a9d4 100644 --- a/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/GesturesEvents.ets +++ b/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/GesturesEvents.ets @@ -14,16 +14,16 @@ */ @Entry @Component -struct Index1 { +struct Index { build() { Column() { - // [Start priorityFirst_gesture] + // [Start priorityfirst_gesture] Column() { Column().id('ComponentB').gesture(TapGesture({ count: 1 })); }.id('ComponentA').gesture(TapGesture({ count: 1 })); - // [End priorityFirst_gesture] + // [End priorityfirst_gesture] - // [Start prioritySecond_gesture] + // [Start prioritysecond_gesture] Column() .id('ComponentA') .gesture( @@ -33,7 +33,7 @@ struct Index1 { PanGesture({distance: 5}) ) ); - // [End prioritySecond_gesture] + // [End prioritysecond_gesture] } .width('100%') .height('100%') diff --git a/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/Index.ets b/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/Index.ets index 785b4e862aa3cfe1e7e4f322ffcc562be13564c3..b42b7cf5077d18b93ebb3b3a57c62d1b7dcc25e1 100644 --- a/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/Index.ets @@ -41,7 +41,7 @@ let demandList: listItem[] = [ ]; @Entry @Component -struct Index { +struct Home { @State bgColor: ResourceColor = '#39b5fa'; build() { Column() { diff --git a/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/OverlayManager.ets b/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/OverlayManager.ets index a2e771a3d7019fd2584ba806ea1a7114fe288582..07e270d39cbe96c1dde65b6e73954cd21468f5f2 100644 --- a/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/OverlayManager.ets +++ b/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/OverlayManager.ets @@ -27,24 +27,24 @@ class Params { } let uiContext: UIContext; -// [Start OverlayManager] +// [Start overlay_manager] @Builder function builderOverlay(params: Params) { Component1().hitTestBehavior(HitTestMode.Transparent) } -// [StartExclude OverlayManager_CustomEvent] +// [StartExclude overlay_manager] @Entry @Component struct CustomEvent { private overlayManager?: OverlayManager; @State context: UIContext = this.getUIContext(); - // [EndExclude OverlayManager_CustomEvent] + // [EndExclude overlay_manager] aboutToAppear(): void { - // [StartExclude OverlayManager_overlayManager] + // [StartExclude overlay_manager] this.overlayManager = this.context.getOverlayManager(); - // [EndExclude OverlayManager_overlayManager] + // [EndExclude overlay_manager] let componentContent = new ComponentContent( this.context, wrapBuilder<[Params]>(builderOverlay), @@ -52,7 +52,7 @@ struct CustomEvent { ); this.overlayManager.addComponentContent(componentContent, 0); } - // [End OverlayManager] + // [End overlay_manager] build() {} } @Component diff --git a/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/TouchEvent.ets b/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/TouchEvent.ets index 72246ba5f1381aa4a877cfb925d293aba43c6651..4835ace913930fc7add9a5012b5304f6c1665847 100644 --- a/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/TouchEvent.ets +++ b/ArkUIKit/MultilevelGestureEvents/entry/src/main/ets/pages/TouchEvent.ets @@ -17,19 +17,19 @@ struct TouchEvent { build() { Column(){ - // [Start Column_touch] + // [Start column_touch] Column() { Column().id('ComponentB').onTouch(() => {}) Column().id('ComponentC').onTouch(() => {}) }.id('ComponentA').onTouch(() => {}) - // [End Column_touch] + // [End column_touch] - // [Start Stack_touch] + // [Start stack_touch] Stack() { Column().id('ComponentB').onTouch(() => {}) Column().id('ComponentC').onTouch(() => {}) }.id('Stack A').onTouch(() => {}) - // [End Stack_touch] + // [End stack_touch] } } } diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertFail.js b/ArkUIKit/MultilevelGestureEvents/entry/src/mock/mock-config.json5 similarity index 76% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertFail.js rename to ArkUIKit/MultilevelGestureEvents/entry/src/mock/mock-config.json5 index 8ab4ac5caef712c75c4eac49dfbbb91d33669d9a..323d1d611fecf4ecb751976e3a71500b3712a445 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertFail.js +++ b/ArkUIKit/MultilevelGestureEvents/entry/src/mock/mock-config.json5 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -12,12 +12,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -function assertFail() { - return { - pass: false, - message: 'fail ' - }; -} - -export default assertFail; +{ +} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/README.md b/ArkUIKit/NativeDialogSample/README.md index dc7e6f7bf4bc9aaa5b65f89505ea6c37c4af9c94..8a29632c06ed021cf97e122085d012b130e46ad1 100644 --- a/ArkUIKit/NativeDialogSample/README.md +++ b/ArkUIKit/NativeDialogSample/README.md @@ -4,13 +4,14 @@ 本示例展示了如何创建自定义弹窗,设置自定义弹窗的背景颜色、圆角半径、对齐方式、边框颜色、边框样式等功能。该工程中展示的接口详细描述可查如下链接: -[native_dialog.h](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/capi-native-dialog-h) +[native_dialog.h](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/capi-native-dialog-h.md) +[构建弹窗](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/ui/ndk-build-pop-up-window.md) ## 效果预览 -| 首页 | CustomDialogController_CAPI页面 |OpenCustomDialog_CAPI页面 | -| ----------------------------------------------------- |--------------------------------------------------------------| ------------------------------------------------------- | -| | | | +| 首页 | CustomDialogController_CAPI页面 |OpenCustomDialog_CAPI页面 | dialog demo页面 | +|---------------------------------------------------------|--------------------------------------------------------------| ------------------------------------------------------- |-------------------------------------------------------| +| | | | | ## 使用说明 @@ -24,20 +25,31 @@ ``` native_type_sample entry/src/main/ets/ -└── pages - ├── Index.ets (获取导航页面) - ├── IndexController.ets (CustomDialogController_CAPI对接示例界面) - └── IndexCustomDialog.ets (OpenCustomDialog_CAPI对接示例界面) +└───pages +│ ├── DialogDemo.ets (dialog demo界面) +│ ├── Index.ets (获取导航页面) +│ ├── IndexController.ets (CustomDialogController_CAPI对接示例界面) +│ └── IndexCustomDialog.ets (OpenCustomDialog_CAPI对接示例界面) +└───common + └── sky.jpg(图片) entry/src/main/ ├── cpp │ ├── types │ │ └── libentry │ │ └── Index.d.ts (函数对应的js映射) -│ ├── common.h +│ ├── common +│ │ ├── ArkUIBaseNode.h(Node工具类) +│ │ ├── ArkUINode.h(Node工具类) +│ │ ├── ArkUITextNode.h(Text工具类) +│ │ ├── NativeModule.h(NativeMoudle工具类) +│ │ └── common.h │ ├── CMakeLists.txt (CMake脚本) -| ├── customdialogexample.cpp -| ├── customdialogexample.h -│ ├── napi_init.cpp +│ └── napi_init.cpp +└───customdialog +│ ├── customdialogexample.cpp +│ ├── customdialogexample.h +│ ├── nativedialogdemo.cpp +│ ├── nativedialogdemo.h │ └── utils.h └── resources ├── base @@ -47,6 +59,13 @@ entry/src/main/ │ │ └── string.json │ └── media ``` +## 具体实现 + +1. dialog demo页面:通过dialog demo按钮进入页面后,通过按钮触发c++相关代码,实现显示弹窗、关闭弹窗、弹窗生命周期演示示例。源码参考[nativedialogdemo.cpp](https://gitcode.com/openharmony/applications_app_samples/blob/master/code/DocsSample/ArkUISample/NativeDialogSample/entry/src/main/cpp/customdialog/nativedialogdemo.cpp) + + * 定义一个组件,该组件在页面中占位,通过napi接口传递handle给c++侧。 + + * c++代码中使用napi的接口和方法实现一个按钮和一个弹窗,通过按钮控制弹窗的显示和关闭。 ## 相关权限 diff --git a/ArkUIKit/NativeDialogSample/entry/.gitignore b/ArkUIKit/NativeDialogSample/entry/.gitignore index e2713a2779c5a3e0eb879efe6115455592caeea5..eadab4e1522296628f32a70228b2c758ecab4759 100644 --- a/ArkUIKit/NativeDialogSample/entry/.gitignore +++ b/ArkUIKit/NativeDialogSample/entry/.gitignore @@ -3,4 +3,5 @@ /.preview /build /.cxx -/.test \ No newline at end of file +/.test +/oh-package-lock.json5 \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/build-profile.json5 b/ArkUIKit/NativeDialogSample/entry/build-profile.json5 index fccb5e9352a9e9ac8f582affa7367bc85c3029a7..270903c082fc38347fb84889615fbbe56dc158bb 100644 --- a/ArkUIKit/NativeDialogSample/entry/build-profile.json5 +++ b/ArkUIKit/NativeDialogSample/entry/build-profile.json5 @@ -20,7 +20,7 @@ "path": "./src/main/cpp/CMakeLists.txt", "arguments": "", "cppFlags": "", - "abiFilters": ["arm64-v8a","x86_64"] + "abiFilters": ["armeabi-v7a","arm64-v8a","x86_64"] } }, "buildOptionSet": [ diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/CMakeLists.txt b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/CMakeLists.txt index 423f1a1dee0501824f8674b61ee69668ccaaa7b4..6a60dacf2816b469449557741b337167c66bc4f2 100644 --- a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/CMakeLists.txt +++ b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/CMakeLists.txt @@ -11,7 +11,7 @@ include_directories(${NATIVERENDER_ROOT_PATH} add_library(nativerender SHARED napi_init.cpp customdialog/customdialogexample.cpp -) + customdialog/nativedialogdemo.cpp) find_library( # Sets the name of the path variable. diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/ArkUIBaseNode.h b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/ArkUIBaseNode.h new file mode 100644 index 0000000000000000000000000000000000000000..79368e025f12ef2ee690b173f4805574c476ef95 --- /dev/null +++ b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/ArkUIBaseNode.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2025 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. + */ + +#ifndef MYAPPLICATION_ARKUIBASENODE_H +#define MYAPPLICATION_ARKUIBASENODE_H + +#include +#include +#include + +#include "NativeModule.h" + +namespace NativeModule { + +class ArkUIBaseNode { +public: + explicit ArkUIBaseNode(ArkUI_NodeHandle handle) + : handle_(handle), nativeModule_(NativeModuleInstance::GetInstance()->GetNativeNodeAPI()) {} + + virtual ~ArkUIBaseNode() + { + // 封装析构函数,实现子节点移除功能。 + if (!children_.empty()) { + for (const auto& child : children_) { + nativeModule_->removeChild(handle_, child->GetHandle()); + } + children_.clear(); + } + // 封装析构函数,统一回收节点资源。 + nativeModule_->disposeNode(handle_); + } + + void AddChild(const std::shared_ptr &child) + { + children_.emplace_back(child); + OnAddChild(child); + } + + void RemoveChild(const std::shared_ptr &child) + { + children_.remove(child); + OnRemoveChild(child); + } + + void InsertChild(const std::shared_ptr &child, int32_t index) + { + if (index >= children_.size()) { + AddChild(child); + } else { + auto iter = children_.begin(); + std::advance(iter, index); + children_.insert(iter, child); + OnInsertChild(child, index); + } + } + + ArkUI_NodeHandle GetHandle() const + { + return handle_; + } + ArkUI_NativeNodeAPI_1* GetNativeModule() const + { + return nativeModule_; + } + +protected: + // 针对父容器子类需要重载下面的函数,实现组件挂载和卸载。 + virtual void OnAddChild(const std::shared_ptr &child) {} + virtual void OnRemoveChild(const std::shared_ptr &child) {} + virtual void OnInsertChild(const std::shared_ptr &child, int32_t index) {} + + ArkUI_NodeHandle handle_; + ArkUI_NativeNodeAPI_1 *nativeModule_ = nullptr; + +private: + std::list> children_; +}; +} // namespace NativeModule + +#endif // MYAPPLICATION_ARKUIBASENODE_H \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/ArkUINode.h b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/ArkUINode.h new file mode 100644 index 0000000000000000000000000000000000000000..ec7884067ec545078bfc0f07bd212bb6126f48d6 --- /dev/null +++ b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/ArkUINode.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2025 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. + */ + +#ifndef MYAPPLICATION_ARKUINODE_H +#define MYAPPLICATION_ARKUINODE_H + +#include "ArkUIBaseNode.h" +#include "NativeModule.h" +#include +#include +#include + +namespace NativeModule { + +class ArkUINode : public ArkUIBaseNode { +public: + explicit ArkUINode(ArkUI_NodeHandle handle) : ArkUIBaseNode(handle) {} + + ~ArkUINode() override {} + + // 通用属性调用封装 + void SetWidth(float width) + { + ArkUI_NumberValue value[] = {{.f32 = width}}; + ArkUI_AttributeItem item = {value, 1}; + nativeModule_->setAttribute(handle_, NODE_WIDTH, &item); + } + void SetPercentWidth(float percent) + { + ArkUI_NumberValue value[] = {{.f32 = percent}}; + ArkUI_AttributeItem item = {value, 1}; + nativeModule_->setAttribute(handle_, NODE_WIDTH_PERCENT, &item); + } + void SetHeight(float height) + { + ArkUI_NumberValue value[] = {{.f32 = height}}; + ArkUI_AttributeItem item = {value, 1}; + nativeModule_->setAttribute(handle_, NODE_HEIGHT, &item); + } + void SetPercentHeight(float percent) + { + ArkUI_NumberValue value[] = {{.f32 = percent}}; + ArkUI_AttributeItem item = {value, 1}; + nativeModule_->setAttribute(handle_, NODE_HEIGHT_PERCENT, &item); + } + void SetBackgroundColor(uint32_t color) + { + ArkUI_NumberValue value[] = {{.u32 = color}}; + ArkUI_AttributeItem item = {value, 1}; + nativeModule_->setAttribute(handle_, NODE_BACKGROUND_COLOR, &item); + } + void SetPadding(float padding, bool isPercent = false) + { + ArkUI_NumberValue value[] = {{.f32 = padding}}; + ArkUI_AttributeItem item = {value, 1}; + nativeModule_->setAttribute(handle_, isPercent ? NODE_PADDING_PERCENT : NODE_PADDING, &item); + } + void SetVisibility(int visibility) + { + ArkUI_NumberValue value[] = {{.i32 = visibility}}; + ArkUI_AttributeItem item = {value, 1}; + nativeModule_->setAttribute(handle_, NODE_VISIBILITY, &item); + } + + void RegisterNodeEvent(ArkUI_NodeHandle node, + ArkUI_NodeEventType eventType, int32_t targetId, void* userData) + { + nativeModule_->registerNodeEvent(node, eventType, targetId, userData); + } + + void RegisterNodeEventReceiver(void (*eventReceiver)(ArkUI_NodeEvent* event)) + { + nativeModule_->addNodeEventReceiver(handle_, eventReceiver); + } + +protected: + // 组件树操作的实现类对接。 + void OnAddChild(const std::shared_ptr &child) override + { + nativeModule_->addChild(handle_, child->GetHandle()); + } + void OnRemoveChild(const std::shared_ptr &child) override + { + nativeModule_->removeChild(handle_, child->GetHandle()); + } + void OnInsertChild(const std::shared_ptr &child, int32_t index) override + { + nativeModule_->insertChildAt(handle_, child->GetHandle(), index); + } +}; +} // namespace NativeModule + +#endif // MYAPPLICATION_ARKUINODE_H \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/ArkUITextNode.h b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/ArkUITextNode.h new file mode 100644 index 0000000000000000000000000000000000000000..acf58b8d852b0a033498f924111bf376f166e76f --- /dev/null +++ b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/ArkUITextNode.h @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2025 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. + */ + +#ifndef MYAPPLICATION_ARKUITEXTNODE_H +#define MYAPPLICATION_ARKUITEXTNODE_H + +#include "ArkUINode.h" + +#include + +namespace NativeModule { +class ArkUITextNode : public ArkUINode { +public: + ArkUITextNode() + : ArkUINode((NativeModuleInstance::GetInstance()->GetNativeNodeAPI())->createNode(ARKUI_NODE_TEXT)) {} + // 文本属性接口封装。 + void SetFontSize(float fontSize) + { + ArkUI_NumberValue value[] = {{.f32 = fontSize}}; + ArkUI_AttributeItem item = {value, 1}; + nativeModule_->setAttribute(handle_, NODE_FONT_SIZE, &item); + } + void SetFontColor(uint32_t color) + { + ArkUI_NumberValue value[] = {{.u32 = color}}; + ArkUI_AttributeItem item = {value, 1}; + nativeModule_->setAttribute(handle_, NODE_FONT_COLOR, &item); + } + void SetTextContent(const std::string &content) + { + ArkUI_AttributeItem item = {nullptr, 0, content.c_str()}; + nativeModule_->setAttribute(handle_, NODE_TEXT_CONTENT, &item); + } + void SetTextAlign(ArkUI_TextAlignment align) + { + ArkUI_NumberValue value[] = {{.i32 = align}}; + ArkUI_AttributeItem item = {value, 1}; + nativeModule_->setAttribute(handle_, NODE_TEXT_ALIGN, &item); + } + + void AnimatorToString( + int duration = 0, int delay = 0, int iterations = 0, + ArkUI_AnimationFillMode fill = ARKUI_ANIMATION_FILL_MODE_FORWARDS, + ArkUI_AnimationDirection direction = ARKUI_ANIMATION_DIRECTION_REVERSE, float begin = 0.0, float end = 0.0, + const ArkUI_ExpectedFrameRateRange& expectedFrameRateRange = { 0, 0, 0 }, + float keyframeTime = 0.0, float keyframeValue = 0.0) + { + SetTextContent("Animator{ dur:" + std::to_string(duration) + + "; delay:" + std::to_string(delay) + + "; iterations:" + std::to_string(iterations) + + "; fill:" + std::to_string(fill) + + "; direction:" + std::to_string(direction) + + "; begin:" + std::to_string(begin) + + "; end:" + std::to_string(end) + + "; expectedFrameRateRange:[ max:" + + std::to_string(expectedFrameRateRange.max) + ", min:" + + std::to_string(expectedFrameRateRange.min) + ", expected:" + + std::to_string(expectedFrameRateRange.expected) + "]" + + "; keyframeTime:" + std::to_string(keyframeTime) + + "; keyframeValue:" + std::to_string(keyframeValue) + + "}"); + } + + void AnimatetoToString( + int duration = 0, float tempo = 0, int curve = 0, int delay = 0, + int iteration = 0, ArkUI_AnimationPlayMode playmode = ARKUI_ANIMATION_PLAY_MODE_REVERSE, + const ArkUI_ExpectedFrameRateRange& expectedFrameRateRange = { 0, 0, 0 }) + { + SetTextContent("animateto{ dur:" + std::to_string(duration) + + "; tempo:" + std::to_string(tempo) + + "; curve:" + std::to_string(static_cast(curve)) + + "; delay:" + std::to_string(delay) + + "; iteration:" + std::to_string(iteration) + + "; playmode:" + std::to_string(static_cast(playmode)) + + "; expectedFrameRateRange:[ max:" + + std::to_string(expectedFrameRateRange.max) + ", min:" + + std::to_string(expectedFrameRateRange.min) + ", expected:" + + std::to_string(expectedFrameRateRange.expected) + "]}"); + } + + void KeyframeAnimatetoToString( + int durationIndex1 = 0, int durationIndex2 = 0, int delay = 0, + int iteration = 0, + const ArkUI_ExpectedFrameRateRange& expectedFrameRateRange = { 0, 0, 0 }) + { + SetTextContent("KeyframeAnimateto{ dur index:" + std::to_string(durationIndex1) + + "; delay:" + std::to_string(delay) + + "; iteration:" + std::to_string(iteration) + + "; expectedFrameRateRange:[ max:" + + std::to_string(expectedFrameRateRange.max) + ", min:" + + std::to_string(expectedFrameRateRange.min) + ", expected:" + + std::to_string(expectedFrameRateRange.expected) + "]}"); + } +}; +} // namespace NativeModule + +#endif // MYAPPLICATION_ARKUITEXTNODE_H \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/mock/ExtendInterface.js b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/NativeModule.h similarity index 39% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/mock/ExtendInterface.js rename to ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/NativeModule.h index c6a866a6df662ad10a7f6869dcbc2381fa47bcdc..b4ad857bf17898e59082e875d92f56068f677376 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/mock/ExtendInterface.js +++ b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/common/NativeModule.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -13,45 +13,37 @@ * limitations under the License. */ -class ExtendInterface { - constructor(mocker) { - this.mocker = mocker; - } +#ifndef MYAPPLICATION_NATIVEMODULE_H +#define MYAPPLICATION_NATIVEMODULE_H - stub() { - this.params = arguments; - return this; - } +#include +#include +#include - stubMockedCall(returnInfo) { - this.mocker.stubApply(this, this.params, returnInfo); - } +#include - afterReturn(value) { - this.stubMockedCall(function () { - return value; - }); - } +namespace NativeModule { - afterReturnNothing() { - this.stubMockedCall(function () { - return undefined; - }); +class NativeModuleInstance { +public: + static NativeModuleInstance *GetInstance() + { + static NativeModuleInstance instance; + return &instance; } - afterAction(action) { - this.stubMockedCall(action); + NativeModuleInstance() + { + // 获取接口的函数指针结构体对象,用于后续操作。 + OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, arkUINativeNodeApi_); } + // 暴露给其他模块使用。 + ArkUI_NativeNodeAPI_1 *GetNativeNodeAPI() { return arkUINativeNodeApi_; } - afterThrow(msg) { - this.stubMockedCall(function () { - throw msg; - }); - } +private: + ArkUI_NativeNodeAPI_1 *arkUINativeNodeApi_ = nullptr; +}; - clear() { - this.mocker.clear(); - } -} +} // namespace NativeModule -export default ExtendInterface; \ No newline at end of file +#endif // MYAPPLICATION_NATIVEMODULE_H \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/nativedialogdemo.cpp b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/nativedialogdemo.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3fdeed02746cebac2332281175bafe75a0c267f6 --- /dev/null +++ b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/nativedialogdemo.cpp @@ -0,0 +1,689 @@ +/* + * Copyright (c) 2025 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. + */ + +#include "nativedialogdemo.h" +#include "../common/ArkUITextNode.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Dialog_Demo { +const unsigned int LOG_PRINT_DOMAIN = 0xFF00; + +namespace Dialog_Controller_Demo { +ArkUI_NodeHandle CreateDialogContent(); +void ShowDialog(); +void CloseDialog(); +void OnButtonClicked(ArkUI_NodeEvent *event); +void MainViewMethod(ArkUI_NodeContentHandle handle); + +// 创建可交互界面,点击Button后弹窗 +// [Start main_view] +constexpr int32_t BUTTON_CLICK_ID = 1; +bool g_isShown = false; +ArkUI_NativeDialogHandle g_dialogController = nullptr; +ArkUI_NodeHandle g_buttonNode; + +void MainViewMethod(ArkUI_NodeContentHandle handle) +{ + ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + ArkUI_NodeHandle column = nodeAPI->createNode(ARKUI_NODE_COLUMN); + ArkUI_NumberValue widthValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem widthItem = {.value = widthValue, .size = sizeof(widthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(column, NODE_WIDTH, &widthItem); + ArkUI_NumberValue heightValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem heightItem = {.value = heightValue, .size = sizeof(heightValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(column, NODE_HEIGHT, &heightItem); + + g_buttonNode = nodeAPI->createNode(ARKUI_NODE_BUTTON); + ArkUI_NumberValue buttonWidthValue[] = {{.f32 = 200}}; + ArkUI_AttributeItem buttonWidthItem = {.value = buttonWidthValue, + .size = sizeof(buttonWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(g_buttonNode, NODE_WIDTH, &buttonWidthItem); + ArkUI_NumberValue buttonHeightValue[] = {{.f32 = 50}}; + ArkUI_AttributeItem buttonHeightItem = {.value = buttonHeightValue, + .size = sizeof(buttonHeightValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(g_buttonNode, NODE_HEIGHT, &buttonHeightItem); + ArkUI_AttributeItem labelItem = {.string = "点击弹窗"}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_LABEL, &labelItem); + ArkUI_NumberValue buttonTypeValue[] = {{.i32 = static_cast(ARKUI_BUTTON_TYPE_NORMAL)}}; + ArkUI_AttributeItem buttonTypeItem = {.value = buttonTypeValue, + .size = sizeof(buttonTypeValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_TYPE, &buttonTypeItem); + nodeAPI->registerNodeEvent(g_buttonNode, NODE_ON_CLICK, BUTTON_CLICK_ID, nullptr); + nodeAPI->addNodeEventReceiver(g_buttonNode, OnButtonClicked); + nodeAPI->addChild(column, g_buttonNode); + OH_ArkUI_NodeContent_AddNode(handle, column); +} +// [End main_view] + +// [Start create_content] +ArkUI_NodeHandle CreateDialogContent() +{ + ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + ArkUI_NodeHandle text = nodeAPI->createNode(ARKUI_NODE_TEXT); + ArkUI_NumberValue textWidthValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem textWidthItem = {.value = textWidthValue, + .size = sizeof(textWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(text, NODE_WIDTH, &textWidthItem); + ArkUI_NumberValue textHeightValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem textHeightItem = {.value = textHeightValue, + .size = sizeof(textWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(text, NODE_HEIGHT, &textHeightItem); + ArkUI_NodeHandle span = nodeAPI->createNode(ARKUI_NODE_SPAN); + ArkUI_AttributeItem spanItem = {.string = "这是一个弹窗"}; + nodeAPI->setAttribute(span, NODE_SPAN_CONTENT, &spanItem); + ArkUI_NodeHandle imageSpan = nodeAPI->createNode(ARKUI_NODE_IMAGE_SPAN); + ArkUI_AttributeItem imageSpanItem = {.string = "/pages/common/sky.jpg"}; + nodeAPI->setAttribute(imageSpan, NODE_IMAGE_SPAN_SRC, &imageSpanItem); + ArkUI_NumberValue imageSpanWidthValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem imageSpanWidthItem = {.value = imageSpanWidthValue, + .size = sizeof(textWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(imageSpan, NODE_WIDTH, &imageSpanWidthItem); + ArkUI_NumberValue imageSpanHeightValue[] = {{.f32 = 200}}; + ArkUI_AttributeItem imageSpanHeightItem = {.value = imageSpanHeightValue, + .size = sizeof(textWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(imageSpan, NODE_HEIGHT, &imageSpanHeightItem); + nodeAPI->addChild(text, span); + nodeAPI->addChild(text, imageSpan); + return text; +} +// [End create_content] + +// [Start show_dialog] +void ShowDialog() +{ + // [Start dialog_create] + ArkUI_NativeDialogAPI_1 *dialogAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_DIALOG, "ArkUI_NativeDialogAPI_1")); + if (!g_dialogController) { + g_dialogController = dialogAPI->create(); + } + // [End dialog_create] + auto contentNode = CreateDialogContent(); + dialogAPI->setContent(g_dialogController, contentNode); + dialogAPI->setContentAlignment(g_dialogController, static_cast(ARKUI_ALIGNMENT_BOTTOM), 0, 0); + dialogAPI->setBackgroundColor(g_dialogController, 0xffffffff); + dialogAPI->setModalMode(g_dialogController, false); + dialogAPI->setAutoCancel(g_dialogController, true); + dialogAPI->show(g_dialogController, false); +} +// [End show_dialog] + +// [Start close_controller] +void CloseDialog() +{ + ArkUI_NativeDialogAPI_1 *dialogAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_DIALOG, "ArkUI_NativeDialogAPI_1")); + dialogAPI->close(g_dialogController); +} +// [End close_controller] + + +// 触发controller弹窗 +// [Start controller_click] +void OnButtonClicked(ArkUI_NodeEvent *event) +{ + if (!event || !g_buttonNode) { + return; + } + auto eventId = OH_ArkUI_NodeEvent_GetTargetId(event); + if (eventId == BUTTON_CLICK_ID) { + ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + if (g_isShown) { + g_isShown = false; + ArkUI_AttributeItem labelItem = {.string = "显示弹窗"}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_LABEL, &labelItem); + CloseDialog(); + } else { + g_isShown = true; + ArkUI_AttributeItem labelItem = {.string = "关闭弹窗"}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_LABEL, &labelItem); + ShowDialog(); + } + } +} +// [End controller_click] + +// 退出时删除dialogController +napi_value Dispose(napi_env env, napi_callback_info info) +{ + napi_value result; + napi_get_undefined(env, &result); // 返回undefined表示void + + if (g_dialogController) { + // [Start dialog_dispose] + ArkUI_NativeDialogAPI_1 *dialogAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_DIALOG, "ArkUI_NativeDialogAPI_1")); + dialogAPI->dispose(g_dialogController); + g_dialogController = nullptr; + // [End dialog_dispose] + } + return result; +} + +napi_value BuildDemoPage(napi_env env, napi_callback_info info) +{ + size_t argc = 1; + napi_value args; + napi_get_cb_info(env, info, &argc, &args, nullptr, nullptr); + napi_value result; + napi_get_undefined(env, &result); // 返回undefined表示void + + ArkUI_NodeContentHandle contentHandle; + // 将napi_value转为NodeContentHandle + OH_ArkUI_GetNodeContentFromNapiValue(env, args, &contentHandle); + MainViewMethod(contentHandle); + return result; +} + +} // namespace Dialog_Controller_Demo + +namespace Dialog_Option_Demo { + +ArkUI_NodeHandle CreateDialogContent(); +void OpenCustomDialog(); +void CloseCustomDialog(); +void MainViewMethod(ArkUI_NodeContentHandle handle); +void OpenDialogCallBack(int32_t dialogId); +void OnButtonClicked(ArkUI_NodeEvent *event); + +ArkUI_NodeHandle g_buttonNode = nullptr; +ArkUI_CustomDialogOptions* g_dialogOptions = nullptr; +constexpr int32_t BUTTON_CLICK_ID = 1; +bool g_isShown = false; + +ArkUI_NodeHandle CreateDialogContent() +{ + ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + + ArkUI_NodeHandle text = nodeAPI->createNode(ARKUI_NODE_TEXT); + ArkUI_NumberValue textWidthValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem textWidthItem = {.value = textWidthValue, + .size = sizeof(textWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(text, NODE_WIDTH, &textWidthItem); + ArkUI_NumberValue textHeightValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem textHeightItem = {.value = textHeightValue, + .size = sizeof(textWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(text, NODE_HEIGHT, &textHeightItem); + ArkUI_NodeHandle span = nodeAPI->createNode(ARKUI_NODE_SPAN); + ArkUI_AttributeItem spanItem = {.string = "这是一个弹窗"}; + nodeAPI->setAttribute(span, NODE_SPAN_CONTENT, &spanItem); + ArkUI_NodeHandle imageSpan = nodeAPI->createNode(ARKUI_NODE_IMAGE_SPAN); + ArkUI_AttributeItem imageSpanItem = {.string = "/pages/common/sky.jpg"}; + nodeAPI->setAttribute(imageSpan, NODE_IMAGE_SPAN_SRC, &imageSpanItem); + ArkUI_NumberValue imageSpanWidthValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem imageSpanWidthItem = {.value = imageSpanWidthValue, + .size = sizeof(textWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(imageSpan, NODE_WIDTH, &imageSpanWidthItem); + ArkUI_NumberValue imageSpanHeightValue[] = {{.f32 = 200}}; + ArkUI_AttributeItem imageSpanHeightItem = {.value = imageSpanHeightValue, + .size = sizeof(textWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(imageSpan, NODE_HEIGHT, &imageSpanHeightItem); + + nodeAPI->addChild(text, span); + nodeAPI->addChild(text, imageSpan); + return text; +} + +// 触发dialogOptions弹窗 +// [Start open_dialogOption] +int32_t g_id = 0; +void OpenDialogCallBack(int32_t dialogId) +{ + g_id = dialogId; +} + +void OpenCustomDialog() +{ + auto contentNode = CreateDialogContent(); + if (!g_dialogOptions) { + g_dialogOptions = OH_ArkUI_CustomDialog_CreateOptions(contentNode); + } + OH_ArkUI_CustomDialog_SetAlignment(g_dialogOptions, static_cast(ARKUI_ALIGNMENT_BOTTOM), 0, 0); + OH_ArkUI_CustomDialog_SetBackgroundColor(g_dialogOptions, 0xffffffff); + OH_ArkUI_CustomDialog_SetModalMode(g_dialogOptions, false); + OH_ArkUI_CustomDialog_SetAutoCancel(g_dialogOptions, true); + OH_ArkUI_CustomDialog_SetBorderStyle(g_dialogOptions, ARKUI_BORDER_STYLE_SOLID, + ARKUI_BORDER_STYLE_SOLID, ARKUI_BORDER_STYLE_SOLID, ARKUI_BORDER_STYLE_SOLID); + OH_ArkUI_CustomDialog_OpenDialog(g_dialogOptions, OpenDialogCallBack); +} +// [End open_dialogOption] + +// [Start close_option] +void CloseCustomDialog() +{ + OH_ArkUI_CustomDialog_CloseDialog(g_id); +} +// [End close_option] + +// 创建可交互界面,点击Button后弹窗 +void MainViewMethod(ArkUI_NodeContentHandle handle) +{ + ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + ArkUI_NodeHandle column = nodeAPI->createNode(ARKUI_NODE_COLUMN); + ArkUI_NumberValue widthValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem widthItem = {.value = widthValue, .size = sizeof(widthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(column, NODE_WIDTH, &widthItem); + ArkUI_NumberValue heightValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem heightItem = {.value = heightValue, .size = sizeof(heightValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(column, NODE_HEIGHT, &heightItem); + + g_buttonNode = nodeAPI->createNode(ARKUI_NODE_BUTTON); + ArkUI_NumberValue buttonWidthValue[] = {{.f32 = 200}}; + ArkUI_AttributeItem buttonWidthItem = {.value = buttonWidthValue, + .size = sizeof(buttonWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(g_buttonNode, NODE_WIDTH, &buttonWidthItem); + ArkUI_NumberValue buttonHeightValue[] = {{.f32 = 50}}; + ArkUI_AttributeItem buttonHeightItem = {.value = buttonHeightValue, + .size = sizeof(buttonHeightValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(g_buttonNode, NODE_HEIGHT, &buttonHeightItem); + ArkUI_AttributeItem labelItem = {.string = "点击弹窗"}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_LABEL, &labelItem); + ArkUI_NumberValue buttonTypeValue[] = {{.i32 = static_cast(ARKUI_BUTTON_TYPE_NORMAL)}}; + ArkUI_AttributeItem buttonTypeItem = {.value = buttonTypeValue, + .size = sizeof(buttonTypeValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_TYPE, &buttonTypeItem); + nodeAPI->registerNodeEvent(g_buttonNode, NODE_ON_CLICK, BUTTON_CLICK_ID, nullptr); + nodeAPI->addNodeEventReceiver(g_buttonNode, OnButtonClicked); + nodeAPI->addChild(column, g_buttonNode); + OH_ArkUI_NodeContent_AddNode(handle, column); +} + +// [Start option_click] +void OnButtonClicked(ArkUI_NodeEvent *event) +{ + if (!event || !g_buttonNode) { + return; + } + auto eventId = OH_ArkUI_NodeEvent_GetTargetId(event); + if (eventId == BUTTON_CLICK_ID) { + ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + if (g_isShown) { + g_isShown = false; + ArkUI_AttributeItem labelItem = {.string = "显示弹窗"}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_LABEL, &labelItem); + CloseCustomDialog(); + } else { + g_isShown = true; + ArkUI_AttributeItem labelItem = {.string = "关闭弹窗"}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_LABEL, &labelItem); + OpenCustomDialog(); + } + } +} +// [End option_click] + +// 退出时删除dialogController +napi_value Dispose(napi_env env, napi_callback_info info) +{ + napi_value result; + napi_get_undefined(env, &result); // 返回undefined表示void + + if (g_dialogOptions) { + // [Start dialog_disposeOption] + OH_ArkUI_CustomDialog_DisposeOptions(g_dialogOptions); + // [End dialog_disposeOption] + g_dialogOptions = nullptr; + } + return result; +} + +napi_value BuildDemoPage(napi_env env, napi_callback_info info) +{ + size_t argc = 1; + napi_value args; + napi_get_cb_info(env, info, &argc, &args, nullptr, nullptr); + napi_value result; + napi_get_undefined(env, &result); // 返回undefined表示void + + ArkUI_NodeContentHandle contentHandle; + // 将napi_value转为NodeContentHandle + OH_ArkUI_GetNodeContentFromNapiValue(env, args, &contentHandle); + MainViewMethod(contentHandle); + return result; +} + +} // namespace Dialog_Option_Demo + +namespace Dialog_OptionText_Demo { + +void CloseCustomDialog(); +void MainViewMethod(ArkUI_NodeContentHandle handle); +void OpenDialogCallBack(int32_t dialogId); +void OnButtonClicked(ArkUI_NodeEvent *event); + +ArkUI_NodeHandle g_buttonNode = nullptr; +ArkUI_CustomDialogOptions* g_dialogOptions = nullptr; +constexpr int32_t BUTTON_CLICK_ID = 1; +bool g_isShown = false; + +// 触发dialogOptions弹窗 +int32_t g_id = 0; +void OpenDialogCallBack(int32_t dialogId) +{ + g_id = dialogId; +} + +void OpenTextDialog() +{ + // [Start dialog_createOption] + auto textNode = std::make_shared(); + if (!g_dialogOptions) { + g_dialogOptions = OH_ArkUI_CustomDialog_CreateOptions(textNode->GetHandle()); + } + // [End dialog_createOption] + textNode->SetTextContent("this is a demo"); + OH_ArkUI_CustomDialog_SetAlignment(g_dialogOptions, static_cast(ARKUI_ALIGNMENT_BOTTOM), 0, 0); + OH_ArkUI_CustomDialog_SetBackgroundColor(g_dialogOptions, 0xffffffff); + OH_ArkUI_CustomDialog_SetModalMode(g_dialogOptions, false); + OH_ArkUI_CustomDialog_SetAutoCancel(g_dialogOptions, true); + OH_ArkUI_CustomDialog_SetBorderStyle(g_dialogOptions, ARKUI_BORDER_STYLE_SOLID, + ARKUI_BORDER_STYLE_SOLID, ARKUI_BORDER_STYLE_SOLID, ARKUI_BORDER_STYLE_SOLID); + OH_ArkUI_CustomDialog_OpenDialog(g_dialogOptions, OpenDialogCallBack); +} + +void CloseCustomDialog() +{ + OH_ArkUI_CustomDialog_CloseDialog(g_id); +} + +// 创建可交互界面,点击Button后弹窗 +void MainViewMethod(ArkUI_NodeContentHandle handle) +{ + ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + ArkUI_NodeHandle column = nodeAPI->createNode(ARKUI_NODE_COLUMN); + ArkUI_NumberValue widthValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem widthItem = {.value = widthValue, .size = sizeof(widthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(column, NODE_WIDTH, &widthItem); + ArkUI_NumberValue heightValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem heightItem = {.value = heightValue, .size = sizeof(heightValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(column, NODE_HEIGHT, &heightItem); + + g_buttonNode = nodeAPI->createNode(ARKUI_NODE_BUTTON); + ArkUI_NumberValue buttonWidthValue[] = {{.f32 = 200}}; + ArkUI_AttributeItem buttonWidthItem = {.value = buttonWidthValue, + .size = sizeof(buttonWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(g_buttonNode, NODE_WIDTH, &buttonWidthItem); + ArkUI_NumberValue buttonHeightValue[] = {{.f32 = 50}}; + ArkUI_AttributeItem buttonHeightItem = {.value = buttonHeightValue, + .size = sizeof(buttonHeightValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(g_buttonNode, NODE_HEIGHT, &buttonHeightItem); + ArkUI_AttributeItem labelItem = {.string = "点击弹窗"}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_LABEL, &labelItem); + ArkUI_NumberValue buttonTypeValue[] = {{.i32 = static_cast(ARKUI_BUTTON_TYPE_NORMAL)}}; + ArkUI_AttributeItem buttonTypeItem = {.value = buttonTypeValue, + .size = sizeof(buttonTypeValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_TYPE, &buttonTypeItem); + nodeAPI->registerNodeEvent(g_buttonNode, NODE_ON_CLICK, BUTTON_CLICK_ID, nullptr); + nodeAPI->addNodeEventReceiver(g_buttonNode, OnButtonClicked); + nodeAPI->addChild(column, g_buttonNode); + OH_ArkUI_NodeContent_AddNode(handle, column); +} + +void OnButtonClicked(ArkUI_NodeEvent *event) +{ + if (!event || !g_buttonNode) { + return; + } + auto eventId = OH_ArkUI_NodeEvent_GetTargetId(event); + if (eventId == BUTTON_CLICK_ID) { + ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + if (g_isShown) { + g_isShown = false; + ArkUI_AttributeItem labelItem = {.string = "显示弹窗"}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_LABEL, &labelItem); + CloseCustomDialog(); + } else { + g_isShown = true; + ArkUI_AttributeItem labelItem = {.string = "关闭弹窗"}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_LABEL, &labelItem); + OpenTextDialog(); + } + } +} + +// 退出时删除g_dialogOptions +napi_value Dispose(napi_env env, napi_callback_info info) +{ + napi_value result; + napi_get_undefined(env, &result); // 返回undefined表示void + + if (g_dialogOptions) { + OH_ArkUI_CustomDialog_DisposeOptions(g_dialogOptions); + g_dialogOptions = nullptr; + } + return result; +} + +napi_value BuildDemoPage(napi_env env, napi_callback_info info) +{ + size_t argc = 1; + napi_value args; + napi_get_cb_info(env, info, &argc, &args, nullptr, nullptr); + napi_value result; + napi_get_undefined(env, &result); // 返回undefined表示void + + ArkUI_NodeContentHandle contentHandle; + // 将napi_value转为NodeContentHandle + OH_ArkUI_GetNodeContentFromNapiValue(env, args, &contentHandle); + MainViewMethod(contentHandle); + return result; +} + +} + +// 弹窗的生命周期 +namespace Dialog_LifeCycle_Demo { + +ArkUI_NodeHandle CreateDialogContent(); +void ShowDialog(); +void CloseDialog(); +void OnButtonClicked(ArkUI_NodeEvent *event); +void OnWillAppearCallBack(void* userdata); +void OnDidAppearCallBack(void* userdata); +void OnWillDisappearCallBack(void* userdata); +void OnDidDisappearCallBack(void* userdata); +void MainViewMethod(ArkUI_NodeContentHandle handle); + +ArkUI_NativeDialogHandle g_dialogController = nullptr; +ArkUI_NodeHandle g_buttonNode = nullptr; +constexpr int32_t BUTTON_CLICK_ID = 1; +bool g_isShown = false; + +// [Start dialog_lifecycle] +ArkUI_NodeHandle CreateDialogContent() +{ + ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + ArkUI_NodeHandle text = nodeAPI->createNode(ARKUI_NODE_TEXT); + ArkUI_NumberValue textWidthValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem textWidthItem = {.value = textWidthValue, + .size = sizeof(textWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(text, NODE_WIDTH, &textWidthItem); + ArkUI_NumberValue textHeightValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem textHeightItem = {.value = textHeightValue, + .size = sizeof(textWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(text, NODE_HEIGHT, &textHeightItem); + ArkUI_NodeHandle span = nodeAPI->createNode(ARKUI_NODE_SPAN); + ArkUI_AttributeItem spanItem = {.string = "这是一个弹窗"}; + nodeAPI->setAttribute(span, NODE_SPAN_CONTENT, &spanItem); + ArkUI_NodeHandle imageSpan = nodeAPI->createNode(ARKUI_NODE_IMAGE_SPAN); + ArkUI_AttributeItem imageSpanItem = {.string = "/pages/common/sky.jpg"}; + nodeAPI->setAttribute(imageSpan, NODE_IMAGE_SPAN_SRC, &imageSpanItem); + ArkUI_NumberValue imageSpanWidthValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem imageSpanWidthItem = {.value = imageSpanWidthValue, + .size = sizeof(textWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(imageSpan, NODE_WIDTH, &imageSpanWidthItem); + ArkUI_NumberValue imageSpanHeightValue[] = {{.f32 = 200}}; + ArkUI_AttributeItem imageSpanHeightItem = {.value = imageSpanHeightValue, + .size = sizeof(textWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(imageSpan, NODE_HEIGHT, &imageSpanHeightItem); + nodeAPI->addChild(text, span); + nodeAPI->addChild(text, imageSpan); + return text; +} + +void OnWillAppearCallBack(void* userdata) +{ + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogContentTest", "OnWillAppearCallBack"); +} + +void OnDidAppearCallBack(void* userdata) +{ + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogContentTest", "OnDidAppearCallBack"); +} + +void OnWillDisappearCallBack(void* userdata) +{ + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogContentTest", "OnWillDisappearCallBack"); +} + +void OnDidDisappearCallBack(void* userdata) +{ + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "CustomDialogContentTest", "OnDidDisappearCallBack"); +} + +void ShowDialog() +{ + ArkUI_NativeDialogAPI_3 *dialogAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_DIALOG, "ArkUI_NativeDialogAPI_3")); + if (!g_dialogController) { + g_dialogController = dialogAPI->nativeDialogAPI1.create(); + } + auto contentNode = CreateDialogContent(); + dialogAPI->nativeDialogAPI1.setContent(g_dialogController, contentNode); + dialogAPI->nativeDialogAPI1.setAutoCancel(g_dialogController, true); + dialogAPI->registerOnWillAppear(g_dialogController, nullptr, OnWillAppearCallBack); + dialogAPI->registerOnDidAppear(g_dialogController, nullptr, OnDidAppearCallBack); + dialogAPI->registerOnWillDisappear(g_dialogController, nullptr, OnWillDisappearCallBack); + dialogAPI->registerOnDidDisappear(g_dialogController, nullptr, OnDidDisappearCallBack); + dialogAPI->nativeDialogAPI1.show(g_dialogController, false); +} +// [End dialog_lifecycle] + +// 关闭Controller方式dialog +void CloseDialog() +{ + ArkUI_NativeDialogAPI_1 *dialogAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_DIALOG, "ArkUI_NativeDialogAPI_1")); + + dialogAPI->close(g_dialogController); +} + +// 触发controller弹窗 +void OnButtonClicked(ArkUI_NodeEvent *event) +{ + if (!event || !g_buttonNode) { + return; + } + auto eventId = OH_ArkUI_NodeEvent_GetTargetId(event); + if (eventId == BUTTON_CLICK_ID) { + ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + if (g_isShown) { + g_isShown = false; + ArkUI_AttributeItem labelItem = {.string = "显示弹窗"}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_LABEL, &labelItem); + CloseDialog(); + } else { + g_isShown = true; + ArkUI_AttributeItem labelItem = {.string = "关闭弹窗"}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_LABEL, &labelItem); + ShowDialog(); + } + } +} + +// 创建可交互界面,点击Button后弹窗 +void MainViewMethod(ArkUI_NodeContentHandle handle) +{ + ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); + ArkUI_NodeHandle column = nodeAPI->createNode(ARKUI_NODE_COLUMN); + ArkUI_NumberValue widthValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem widthItem = {.value = widthValue, .size = sizeof(widthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(column, NODE_WIDTH, &widthItem); + ArkUI_NumberValue heightValue[] = {{.f32 = 300}}; + ArkUI_AttributeItem heightItem = {.value = heightValue, .size = sizeof(heightValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(column, NODE_HEIGHT, &heightItem); + + g_buttonNode = nodeAPI->createNode(ARKUI_NODE_BUTTON); + ArkUI_NumberValue buttonWidthValue[] = {{.f32 = 200}}; + ArkUI_AttributeItem buttonWidthItem = {.value = buttonWidthValue, + .size = sizeof(buttonWidthValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(g_buttonNode, NODE_WIDTH, &buttonWidthItem); + ArkUI_NumberValue buttonHeightValue[] = {{.f32 = 50}}; + ArkUI_AttributeItem buttonHeightItem = {.value = buttonHeightValue, + .size = sizeof(buttonHeightValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(g_buttonNode, NODE_HEIGHT, &buttonHeightItem); + ArkUI_AttributeItem labelItem = {.string = "点击弹窗"}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_LABEL, &labelItem); + ArkUI_NumberValue buttonTypeValue[] = {{.i32 = static_cast(ARKUI_BUTTON_TYPE_NORMAL)}}; + ArkUI_AttributeItem buttonTypeItem = {.value = buttonTypeValue, + .size = sizeof(buttonTypeValue) / sizeof(ArkUI_NumberValue)}; + nodeAPI->setAttribute(g_buttonNode, NODE_BUTTON_TYPE, &buttonTypeItem); + nodeAPI->registerNodeEvent(g_buttonNode, NODE_ON_CLICK, BUTTON_CLICK_ID, nullptr); + nodeAPI->addNodeEventReceiver(g_buttonNode, OnButtonClicked); + nodeAPI->addChild(column, g_buttonNode); + OH_ArkUI_NodeContent_AddNode(handle, column); +} + +// 退出时删除dialogController +napi_value Dispose(napi_env env, napi_callback_info info) +{ + napi_value result; + napi_get_undefined(env, &result); // 返回undefined表示void + + if (g_dialogController) { + ArkUI_NativeDialogAPI_1 *dialogAPI = reinterpret_cast( + OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_DIALOG, "ArkUI_NativeDialogAPI_1")); + dialogAPI->dispose(g_dialogController); + g_dialogController = nullptr; + } + return result; +} + +napi_value BuildDemoPage(napi_env env, napi_callback_info info) +{ + size_t argc = 1; + napi_value args; + napi_get_cb_info(env, info, &argc, &args, nullptr, nullptr); + napi_value result; + napi_get_undefined(env, &result); // 返回undefined表示void + + ArkUI_NodeContentHandle contentHandle; + // 将napi_value转为NodeContentHandle + OH_ArkUI_GetNodeContentFromNapiValue(env, args, &contentHandle); + MainViewMethod(contentHandle); + return result; +} + +} // Dialog_LifeCycle_Demo +} // Dialog_Demo diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/nativedialogdemo.h b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/nativedialogdemo.h new file mode 100644 index 0000000000000000000000000000000000000000..6b915fd474cb78dcc17c424b73c07d89a35ceb3a --- /dev/null +++ b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/customdialog/nativedialogdemo.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2025 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. + */ + +#ifndef NATIVEDIALOGSAMPLE_NATIVEDIALOGDEMO_H +#define NATIVEDIALOGSAMPLE_NATIVEDIALOGDEMO_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Dialog_Demo { +namespace Dialog_Controller_Demo { + napi_value BuildDemoPage(napi_env env, napi_callback_info info); + napi_value Dispose(napi_env env, napi_callback_info info); +} // Dialog_Controller_Demo + +namespace Dialog_Option_Demo { + napi_value BuildDemoPage(napi_env env, napi_callback_info info); + napi_value Dispose(napi_env env, napi_callback_info info); +} // Dialog_Option_Demo + +namespace Dialog_OptionText_Demo { + napi_value BuildDemoPage(napi_env env, napi_callback_info info); + napi_value Dispose(napi_env env, napi_callback_info info); +} // Dialog_OptionText_Demo + +namespace Dialog_LifeCycle_Demo { + napi_value BuildDemoPage(napi_env env, napi_callback_info info); + napi_value Dispose(napi_env env, napi_callback_info info); +} // Dialog_LifeCycle_Demo + +} // Dialog_Demo + +#endif //NATIVEDIALOGSAMPLE_NATIVEDIALOGDEMO_H diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/napi_init.cpp index ea4d343c9eb3f332fb1244c4cc648f4d7b759d42..6916539bd946247e9b6ebd7fd3876da116e9ee43 100644 --- a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/napi_init.cpp +++ b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/napi_init.cpp @@ -15,6 +15,7 @@ #include "common/common.h" #include "customdialog/customdialogexample.h" +#include "customdialog/nativedialogdemo.h" #include #include "napi/native_api.h" @@ -44,6 +45,22 @@ static napi_value Init(napi_env env, napi_value exports) napi_default, nullptr}, {"resetDialogController", nullptr, CustomDialogTest::ResetDialogController, nullptr, nullptr, nullptr, napi_default, nullptr}, + {"mainPageController", nullptr, Dialog_Demo::Dialog_Controller_Demo::BuildDemoPage, nullptr, nullptr, nullptr, + napi_default, nullptr}, + {"disposeController", nullptr, Dialog_Demo::Dialog_Controller_Demo::Dispose, nullptr, nullptr, nullptr, + napi_default, nullptr}, + {"mainPageOption", nullptr, Dialog_Demo::Dialog_Option_Demo::BuildDemoPage, nullptr, nullptr, nullptr, + napi_default, nullptr}, + {"disposeOption", nullptr, Dialog_Demo::Dialog_Option_Demo::Dispose, nullptr, nullptr, nullptr, + napi_default, nullptr}, + {"mainPageOptionText", nullptr, Dialog_Demo::Dialog_OptionText_Demo::BuildDemoPage, nullptr, nullptr, nullptr, + napi_default, nullptr}, + {"disposeOptionText", nullptr, Dialog_Demo::Dialog_OptionText_Demo::Dispose, nullptr, nullptr, nullptr, + napi_default, nullptr}, + {"mainPageLifecycle", nullptr, Dialog_Demo::Dialog_LifeCycle_Demo::BuildDemoPage, nullptr, nullptr, nullptr, + napi_default, nullptr}, + {"disposeLifecycle", nullptr, Dialog_Demo::Dialog_LifeCycle_Demo::Dispose, nullptr, nullptr, nullptr, + napi_default, nullptr}, }; if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/types/libnativerender/index.d.ts b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/types/libnativerender/index.d.ts index 0d9a8f7551fe9801f58a0a05fd199c8f6b6f6642..826f826b9b6b6e80a141cf5e50c82000fc9bb8c2 100644 --- a/ArkUIKit/NativeDialogSample/entry/src/main/cpp/types/libnativerender/index.d.ts +++ b/ArkUIKit/NativeDialogSample/entry/src/main/cpp/types/libnativerender/index.d.ts @@ -25,4 +25,12 @@ export const CloseCustomDialog: () => void; export const openCustomDialog: () => void; export const setNativeDialog: (nodeType: number, nodeValue: number) => number; export const openNativeDialog: () => void; -export const resetDialogController: () => void; \ No newline at end of file +export const resetDialogController: () => void; +export const mainPageController: (node: NodeContent) => void; +export const mainPageOption: (node: NodeContent) => void; +export const mainPageOptionText: (node: NodeContent) => void; +export const mainPageLifecycle: (node: NodeContent) => void; +export const disposeController: () => void; +export const disposeOption: () => void; +export const disposeOptionText: () => void; +export const disposeLifecycle: () => void; \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/DialogDemo.ets b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/DialogDemo.ets new file mode 100644 index 0000000000000000000000000000000000000000..42ac08b75cc4a1d78da2742adaa4309399317cb9 --- /dev/null +++ b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/DialogDemo.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2025 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 router from '@ohos.router'; +import testNapi2 from 'libnativerender.so'; +import { common } from '@kit.AbilityKit'; +import { NodeContent } from '@kit.ArkUI'; + +@Entry +@Component +struct Index { + nodeContent: NodeContent = new NodeContent(); + + build() { + Column() { + Button($r('app.string.return_dialog')) + .height(25) + .width('10%') + .onClick(() => { + this.getUIContext().getRouter().pushUrl({url: 'pages/Index'}); + testNapi2.disposeController(); + testNapi2.disposeOption(); + testNapi2.disposeOptionText(); + testNapi2.disposeLifecycle(); + }) + Button($r('app.string.dialog_controller_demo')) + .height(30) + .width('85%') + .margin({ top: 20, bottom: 10 }) + .onClick(() => { + testNapi2.mainPageController(this.nodeContent); + }) + Button($r('app.string.dialog_option_demo')) + .height(30) + .width('85%') + .margin({ top: 20, bottom: 10 }) + .onClick(() => { + testNapi2.mainPageOption(this.nodeContent); + }) + Button($r('app.string.dialog_optionText_demo')) + .height(30) + .width('85%') + .margin({ top: 20, bottom: 10 }) + .onClick(() => { + testNapi2.mainPageOptionText(this.nodeContent); + }) + Button($r('app.string.dialog_lifecycle_demo')) + .height(25) + .width('85%') + .margin({ top: 20, bottom: 10 }) + .onClick(() => { + testNapi2.mainPageLifecycle(this.nodeContent); + }) + ContentSlot(this.nodeContent); + } + .width('100%') + } +} \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index.ets index 82920e5f087dd0d778a11989f374da1e0a1c32ce..f5afaca3654ad5e52817e1b9fb9726efebd31613 100644 --- a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index.ets @@ -41,6 +41,13 @@ struct Index { url: 'pages/IndexCustomDialog', }) }) + Button($r('app.string.dialog_demo')) + .height(50) + .width('85%') + .margin({ top: 20, bottom: 10 }) + .onClick(() => { + this.getUIContext().getRouter().pushUrl({url: 'pages/DialogDemo'}); + }) Text($r('app.string.exit_app')) .fontSize(20) .fontColor(0xCCCCCC) diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/common/sky.jpg b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/common/sky.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f3b220f073eabdd8bac68d5436cbae94202dcf4c Binary files /dev/null and b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/common/sky.jpg differ diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/module.json5 b/ArkUIKit/NativeDialogSample/entry/src/main/module.json5 index 776ce01475229d674487a2830790c4c87b777379..9d4b9de44f8eb7a324c8530f3433f3053cdaaf6f 100644 --- a/ArkUIKit/NativeDialogSample/entry/src/main/module.json5 +++ b/ArkUIKit/NativeDialogSample/entry/src/main/module.json5 @@ -20,8 +20,7 @@ "description": "$string:module_desc", "mainElement": "EntryAbility", "deviceTypes": [ - "default", - "tablet" + "default" ], "deliveryWithInstall": true, "installationFree": false, @@ -36,6 +35,7 @@ "startWindowIcon": "$media:startIcon", "startWindowBackground": "$color:start_window_background", "exported": true, + "orientation": "auto_rotation", "skills": [ { "entities": [ diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/element/string.json b/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/element/string.json index 1955517ec7aaed7a8de03ff426d1d4eaa53e9533..5e52490504400674e67cc29d246e47304c6709d5 100644 --- a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/element/string.json +++ b/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/element/string.json @@ -10,7 +10,7 @@ }, { "name": "EntryAbility_label", - "value": "label" + "value": "NativeDialogSample" }, { "name": "dialog_controller", @@ -20,6 +20,34 @@ "name": "custom_dialog", "value": "OpenCustomDialog_CAPI对接示例" }, + { + "name": "dialog_demo", + "value": "dialog demo" + }, + { + "name": "dialog_controller_demo", + "value": "DialogController demo" + }, + { + "name": "dialog_option_demo", + "value": "DialogOption demo" + }, + { + "name": "dialog_optionText_demo", + "value": "Text Option demo" + }, + { + "name": "dialog_lifecycle_demo", + "value": "Dialog lifecycle demo" + }, + { + "name": "demo_open_dialog", + "value": "点击弹窗" + }, + { + "name": "demo_close_dialog", + "value": "关闭弹窗" + }, { "name": "exit_app", "value": "退出应用" diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/profile/main_pages.json index 7ddccbf36dcf3c44b83952bbb33634d4c4ef699b..dec49b2b1b5942179a9ce6e788276c078632f9f0 100644 --- a/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/profile/main_pages.json +++ b/ArkUIKit/NativeDialogSample/entry/src/main/resources/base/profile/main_pages.json @@ -2,6 +2,7 @@ "src": [ "pages/Index", "pages/IndexCustomDialog", - "pages/IndexController" + "pages/IndexController", + "pages/DialogDemo" ] } \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/resources/en_US/element/string.json b/ArkUIKit/NativeDialogSample/entry/src/main/resources/en_US/element/string.json index f94595515a99e0c828807e243494f57f09251930..a82c01e1864d81812bbdb118b46a32bc324fce75 100644 --- a/ArkUIKit/NativeDialogSample/entry/src/main/resources/en_US/element/string.json +++ b/ArkUIKit/NativeDialogSample/entry/src/main/resources/en_US/element/string.json @@ -10,7 +10,7 @@ }, { "name": "EntryAbility_label", - "value": "label" + "value": "NativeDialogSample" } ] } \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/resources/zh_CN/element/string.json b/ArkUIKit/NativeDialogSample/entry/src/main/resources/zh_CN/element/string.json index 597ecf95e61d7e30367c22fe2f8638008361b044..7a7b8873bc00750b46f4d5fa7698a44e8190ff45 100644 --- a/ArkUIKit/NativeDialogSample/entry/src/main/resources/zh_CN/element/string.json +++ b/ArkUIKit/NativeDialogSample/entry/src/main/resources/zh_CN/element/string.json @@ -10,7 +10,7 @@ }, { "name": "EntryAbility_label", - "value": "label" + "value": "NativeDialogSample" } ] } \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/entry/src/ohosTest/ets/test/Ability.test.ets b/ArkUIKit/NativeDialogSample/entry/src/ohosTest/ets/test/Ability.test.ets index 0f8ce9a2c012f8fe36114cef65216ef0b6254f41..e1241a52540995d95e8d05402395e6a9c8776fbe 100644 --- a/ArkUIKit/NativeDialogSample/entry/src/ohosTest/ets/test/Ability.test.ets +++ b/ArkUIKit/NativeDialogSample/entry/src/ohosTest/ets/test/Ability.test.ets @@ -15,13 +15,36 @@ import { hilog } from '@kit.PerformanceAnalysisKit'; import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import { abilityDelegatorRegistry, Driver, ON, MouseButton, Component, MatchPattern } from '@kit.TestKit'; +import { UIAbility, Want } from '@kit.AbilityKit'; + + +const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator() +const bundleName = abilityDelegatorRegistry.getArguments().bundleName; +let want: Want; +const TAG: string = '[Sample_com.example.nativedialogsample]'; +const DOMAIN: number = 0xFF00; + +let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); +let manager = abilityDelegator.getAppContext().resourceManager; + +function sleep(time: number) { + return new Promise((resolve: Function) => setTimeout(resolve, time)); +} export default function abilityTest() { describe('ActsAbilityTest', () => { // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. + beforeAll(async () => { + want = { + bundleName: bundleName, + abilityName: 'EntryAbility' + }; + await delegator.startAbility(want); + await sleep(1000); + const ability: UIAbility = await delegator.getCurrentTopAbility(); + hilog.info(DOMAIN, TAG, '%{public}s', 'get top ability'); + expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); }) beforeEach(() => { // Presets an action, which is performed before each unit test case starts. @@ -37,14 +60,112 @@ export default function abilityTest() { // Presets a clear action, which is performed after all test cases of the test suite end. // This API supports only one parameter: clear action function. }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); + it('testOpenDialogDemoController', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, '%{public}s', 'testOpenDialogDemoController begin'); + let driver = Driver.create(); + let button1 = + await driver.findComponent(ON.text(manager.getStringByNameSync('dialog_demo'), MatchPattern.CONTAINS)); + expect(button1 === null).assertFalse(); + await button1.click(); + await sleep(1000); + let button2 = await driver.findComponent(ON.text(manager.getStringByNameSync('dialog_controller_demo'), + MatchPattern.CONTAINS)); + expect(button2 === null).assertFalse(); + await button2.click(); + await sleep(1000); + let button3 = + await driver.findComponent(ON.text(manager.getStringByNameSync('demo_open_dialog'), MatchPattern.CONTAINS)); + expect(button3 === null).assertFalse(); + await button3.click(); + await sleep(1000); + let button4 = + await driver.findComponent(ON.text(manager.getStringByNameSync('demo_close_dialog'), MatchPattern.CONTAINS)); + expect(button4 === null).assertFalse(); + await button4.click(); + await sleep(1000); + await driver.pressBack(); + done(); + }) + + it('testOpenDialogDemoOption', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, '%{public}s', 'testOpenDialogDemoOption begin'); + let driver = Driver.create(); + let button1 = + await driver.findComponent(ON.text(manager.getStringByNameSync('dialog_demo'), MatchPattern.CONTAINS)); + expect(button1 === null).assertFalse(); + await button1.click(); + await sleep(1000); + let button2 = + await driver.findComponent(ON.text(manager.getStringByNameSync('dialog_option_demo'), MatchPattern.CONTAINS)); + expect(button2 === null).assertFalse(); + await button2.click(); + await sleep(1000); + let button3 = + await driver.findComponent(ON.text(manager.getStringByNameSync('demo_open_dialog'), MatchPattern.CONTAINS)); + expect(button3 === null).assertFalse(); + await button3.click(); + await sleep(1000); + let button4 = + await driver.findComponent(ON.text(manager.getStringByNameSync('demo_close_dialog'), MatchPattern.CONTAINS)); + expect(button4 === null).assertFalse(); + await button4.click(); + await sleep(1000); + await driver.pressBack(); + done(); + }) + + it('testOpenDialogDemoOptionText', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, '%{public}s', 'testOpenDialogDemoOptionText begin'); + let driver = Driver.create(); + let button1 = + await driver.findComponent(ON.text(manager.getStringByNameSync('dialog_demo'), MatchPattern.CONTAINS)); + expect(button1 === null).assertFalse(); + await button1.click(); + await sleep(1000); + let button2 = + await driver.findComponent(ON.text(manager.getStringByNameSync('dialog_optionText_demo'), MatchPattern.CONTAINS)); + expect(button2 === null).assertFalse(); + await button2.click(); + await sleep(1000); + let button3 = + await driver.findComponent(ON.text(manager.getStringByNameSync('demo_open_dialog'), MatchPattern.CONTAINS)); + expect(button3 === null).assertFalse(); + await button3.click(); + await sleep(1000); + let button4 = + await driver.findComponent(ON.text(manager.getStringByNameSync('demo_close_dialog'), MatchPattern.CONTAINS)); + expect(button4 === null).assertFalse(); + await button4.click(); + await sleep(1000); + await driver.pressBack(); + done(); + }) + + it('testOpenDialogDemoLifecycle', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, '%{public}s', 'testOpenDialogDemoLifecycle begin'); + let driver = Driver.create(); + let button1 = + await driver.findComponent(ON.text(manager.getStringByNameSync('dialog_demo'), MatchPattern.CONTAINS)); + expect(button1 === null).assertFalse(); + await button1.click(); + await sleep(1000); + let button2 = await driver.findComponent( + ON.text(manager.getStringByNameSync('dialog_lifecycle_demo'), MatchPattern.CONTAINS)); + expect(button2 === null).assertFalse(); + await button2.click(); + await sleep(1000); + let button3 = + await driver.findComponent(ON.text(manager.getStringByNameSync('demo_open_dialog'), MatchPattern.CONTAINS)); + expect(button3 === null).assertFalse(); + await button3.click(); + await sleep(1000); + let button4 = + await driver.findComponent(ON.text(manager.getStringByNameSync('demo_close_dialog'), MatchPattern.CONTAINS)); + expect(button4 === null).assertFalse(); + await button4.click(); + await sleep(1000); + await driver.pressBack(); + done(); }) }) } \ No newline at end of file diff --git a/ArkUIKit/NativeDialogSample/ohosTest.md b/ArkUIKit/NativeDialogSample/ohosTest.md index bf197ddd4e1bfaeee60c49251773698f332c8232..d1cc27ace76e958c0f504e687d316ab2928b37ac 100644 --- a/ArkUIKit/NativeDialogSample/ohosTest.md +++ b/ArkUIKit/NativeDialogSample/ohosTest.md @@ -2,68 +2,72 @@ ## 用例表 -| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | -|------------------------------------------| -------------- |-------------------------------|-------------------------------------------------------| :------- | -------- | -| 显示弹框成功示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击点此打开弹窗按钮 查看验证结果 | 显示弹框成功 | 是 | Pass | -| 应用退出示例验证 | 应用位于首页 | 1.点击 退出应用 查看验证结果 | 应用退出成功 | 是 | Pass | -| 显示弹框成功示例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果 | 显示弹框成功 | 是 | Pass | -| 弹窗关闭示例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮
3.点击 点此打开弹窗按钮 查看验证结果 | 弹窗关闭成功 | 是 | Pass | -| 系统默认的对齐方式示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置自定义弹窗对齐方式
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹窗位置在顶部成功 | 是 | Pass | -| 是否开启模态样式实例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击设置属性按钮
3.点击 是否开启模态样式的弹窗。
4.点击 点此打开弹窗按钮 查看验证结果
5点击弹框中Close Dialog 按钮
6点击重置属性按钮 | 选择 是 弹框周边为灰色
选择 否 弹窗周边无灰色 | 是 | Pass | -| 是否允许通过点击遮罩层退出示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否允许通过点击遮罩层退出。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 选择 是 点击弹框外弹窗可以退出
选择 否 点击弹框外弹窗不可以退出 | 是 | Pass | -| 设置自定义弹窗遮罩属性示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击设置属性按钮
3.点击 设置自定义弹窗遮罩属性。
4点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮 查看验证结果
6.点击 重置属性按钮 | 弹窗周边为红色 | 是 | Pass | -| 背景颜色示例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击设置属性
3.点击 背景颜色:白色。
4.点击点此打开弹窗按钮 查看验证结果
5.点击弹框中Close Dialog 按钮
6.点击重置属性 | 弹窗中为白色 | 是 | Pass | -| 设置弹窗背板圆角半径示例验证 | 应用位于首页 | 2.点击 .CustomDialogController_CAPI对接示例按钮
3.点击 设置属性按钮
4.点击 设置弹窗背板圆角半径。
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击重置属性按钮 | 弹窗中的圆角比不设置任何属性点击打开弹窗是四边圆角值小 | 是 | Pass | -| 设置弹窗宽度占栅格宽度的个数示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 设置弹窗宽度占栅格宽度的个数。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
Set the number of grid widths that the popup occupies to 20 | 是 | Pass | -| 弹窗容器样式是否可以自定义示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 弹窗容器样式是否可以自定义。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 选择 是 点击弹框无边框
选择 否 点击弹框有边框 | 是 | Pass | -| 弹窗容器是否使用自定义弹窗动画示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 弹窗容器是否使用自定义弹窗动画。
4.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 属性设置结果显示
Not actually displayed | 是 | Pass | -| 系统返回操作关闭弹窗示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 系统返回操作关闭弹窗。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
The system-defined back operation closes the dialog | 是 | Pass | -| 显示弹框示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 显示弹框成功 | 是 | Pass | -| 弹框关闭示例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮
3.点击 弹框中Close Dialog 按钮 查看验证结果
4.点击 重置属性 按钮 | 显示弹框关闭成功 | 是 | Pass | -| 弹窗避让键盘模式示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式的弹窗 选择 否
4.点击 弹窗避让键盘模式
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 输出框最右边 显示出键盘
7.点击 弹框中Close Dialog 按钮
8.点击 重置属性按钮 | 键盘覆盖了弹窗 | 是 | Pass | -| 设置弹窗的显示层级示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的显示层级 选择 ARKUI_LEVEL_MODE_OVERLAY 。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示ARKUI_LEVEL_MODE_OVERLAY | 是 | Pass | -| 设置弹窗的显示层级示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的显示层级 选择 ARKUI_LEVEL_MODE_EMBEDDED。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示ARKUI_LEVEL_MODE_EMBEDDED | 是 | Pass | -| 设置弹窗显示层级页面下的节点id示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击设置弹窗显示层级页面下的节点id。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
Set the level uniqueId to 0 for a custom dialog box | 是 | Pass | -| 设置嵌入式弹窗蒙层的显示区域示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 设置嵌入式弹窗蒙层的显示区域。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
ARKUI_IMMERSIVE_MODE_DEFAULT | 是 | Pass | -| 设置自定义弹窗显示的顺序示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 设置自定义弹窗显示的顺序。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
Set the display order of the custom dialog box to 0 | 是 | Pass | -| 弹框状态变化示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 弹框状态显示
DIALOG_UNINITIALIZED
DIALOG_INITIALIZED
DIALOG_APPEARING
DIALOG_DISAPPEARED | 是 | Pass | -| 边框颜色示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 边框颜色:黄色。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 边框颜色为黄色 | 是 | Pass | -| 边框样式示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 边框样式:点状。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 边框样式为点状 | 是 | Pass | -| 默认边宽示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击点此打开弹窗按钮 查看验证结果
3.点击 重置属性按钮 | 显示弹窗有边宽
属性设置结果中 显示 width: 300vp | 是 | Pass | -| 默认边高示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击点此打开弹窗按钮 查看验证结果
3.点击 重置属性按钮 | 显示弹窗有边宽
属性设置结果中 显示 height: 200vp | 是 | Pass | -| 背板阴影示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背板阴影。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 边框周围有阴影 | 是 | Pass | -| 自定义弹窗的背板阴影示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 自定义弹窗的背板阴影。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内为红色 边框周围有阴影 | 是 | Pass | -| 背板模糊材质示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背板模糊材质。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内为灰色 | 是 | Pass | -| 响应悬停示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 响应悬停。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框响应在下半屏 | 是 | Pass | -| 悬停态下自定义弹窗默认展示区域示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 悬停态下自定义弹窗默认展示区域 选择 上半屏 或 下半屏。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
上半屏:Popup defaults to upper screen area in hover state 下半屏:Popup defaults to lower screen area in hover state | 是 | Pass | -| 是否获取焦点示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式弹窗 选择否
4.点击 是否获取焦点 选择 是。
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 点击输入框 打开键盘 点击弹框内区域 键盘自动回收 | 是 | Pass | -| 是否获取焦点示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式弹窗 选择否
4.点击 是否获取焦点 选择 否。
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 点击输入框 打开键盘 点击弹框内区域 键盘不回收 | 是 | Pass | -| 设置弹窗的背景模糊效果示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的背景模糊效果。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 设置自定义弹窗的背景效果参数 | 是 | Pass | -| 设置自定义弹窗的背景效果参数示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置自定义弹窗的背景效果参数。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内部颜色有变化 | 是 | Pass | -| 返回按钮 示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 返回按钮 | 返回上一层 | 是 | Pass | -| 弹框创建/打开/关闭示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 弹框创建、打开、关闭成功 | 是 | Pass | -| 应用退出示例验证 | 应用位于首页 | 1.点击 关闭应用按钮 | 应用退出 | 是 | Pass | -| 返回按钮 示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 返回按钮 | 返回上一层 | 是 | Pass | -| 设置弹窗的显示层示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的显示层级 是 / 否
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
ARKUI_LEVEL_MODE_OVERLAY / ARKUI_LEVEL_MODE_EMBEDDED | 是 | Pass | -| 设置背景颜色示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背景颜色:红色
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 背景颜色:红色 | 是 | Pass | -| 圆角半径示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 圆角半径:15
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹窗中的圆角比不设置任何属性点击打开弹窗是四边圆角值小 | 是 | Pass | -| 边框颜色示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 边框颜色:黄色
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框边框颜色为 黄色 | 是 | Pass | -| 边框样式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 边框样式:点状
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框边框样式为 点状 | 是 | Pass | -| 边框宽跟高示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 属性设置结果显示
width: 300vp height: 200vp | 是 | Pass | -| 背板阴影示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背板阴影
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框边框有阴影 | 是 | Pass | -| 自定义背板阴影示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 自定义背板阴影
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框边框有阴影 弹框后有黑色边框 | 是 | Pass | -| 背板材质示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 轻薄材质模糊
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内变灰色 | 是 | Pass | -| 对齐模式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 对齐模式:底部开始
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框底部开始 | 是 | Pass | -| 是否开启模态样式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式 是/否
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 是 弹框边框外颜色无变化 否 弹框边框外颜色无变化 | 是 | Pass | -| 弹窗是否在子窗口显示此弹窗示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 弹窗是否在子窗口显示此弹窗 开启/ 关闭
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 开启 再点设置属性栏 属性栏 在弹框页面下 关闭 再点设置属性栏 属性栏 在弹框页面下 | 是 | Pass | -| 自定义弹窗遮罩属性 示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 自定义弹窗遮罩属性
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内外显示红色 | 是 | Pass | -| 避让键盘的模式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态 选择 否
4.点击 避让键盘的模式 避让 / 不避让
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 不避让 弹框在 点击输入框打开显示键盘后 弹框不避让 避让 弹框在 点击输入框打开显示键盘后 弹框向上移动 进行避让键盘 | 是 | Pass | -| 响应悬停示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 响应悬停。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框响应在下半屏 | 是 | Pass | -| 悬停态下弹窗默认展示区域示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮(仅折叠屏显示)
2.点击 设置属性按钮
3点击 悬停态下弹窗默认展示区域 选择 上半屏 / 下半屏
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
上半屏:Popup defaults to upper screen area in hover state 下半屏:Popup defaults to lower screen area in hover state | 是 | Pass | -| 注册系统关闭自定义弹窗的监听事件示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 注册系统关闭自定义弹窗的监听事件。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 系统返回操作失效 | 是 | Pass | -| 弹框状态示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 弹框状态显示
DIALOG_UNINITIALIZED
DIALOG_INITIALIZED
DIALOG_APPEARING
DIALOG_DISAPPEARED | 是 | Pass | -| 背景模糊效果示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背景模糊效果。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内变为深色 | 是 | Pass | -| 背景效果参数示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背景效果参数。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内变为深色 | 是 | Pass | +| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | +|------------------------| -------------- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------| :------- | -------- | +| 显示弹框成功示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击点此打开弹窗按钮 查看验证结果 | 显示弹框成功 | 是 | Pass | +| 应用退出示例验证 | 应用位于首页 | 1.点击 退出应用 查看验证结果 | 应用退出成功 | 是 | Pass | +| 显示弹框成功示例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果 | 显示弹框成功 | 是 | Pass | +| 弹窗关闭示例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮
3.点击 点此打开弹窗按钮 查看验证结果 | 弹窗关闭成功 | 是 | Pass | +| 系统默认的对齐方式示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置自定义弹窗对齐方式
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹窗位置在顶部成功 | 是 | Pass | +| 是否开启模态样式实例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击设置属性按钮
3.点击 是否开启模态样式的弹窗。
4.点击 点此打开弹窗按钮 查看验证结果
5点击弹框中Close Dialog 按钮
6点击重置属性按钮 | 选择 是 弹框周边为灰色
选择 否 弹窗周边无灰色 | 是 | Pass | +| 是否允许通过点击遮罩层退出示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否允许通过点击遮罩层退出。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 选择 是 点击弹框外弹窗可以退出
选择 否 点击弹框外弹窗不可以退出 | 是 | Pass | +| 设置自定义弹窗遮罩属性示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击设置属性按钮
3.点击 设置自定义弹窗遮罩属性。
4点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮 查看验证结果
6.点击 重置属性按钮 | 弹窗周边为红色 | 是 | Pass | +| 背景颜色示例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击设置属性
3.点击 背景颜色:白色。
4.点击点此打开弹窗按钮 查看验证结果
5.点击弹框中Close Dialog 按钮
6.点击重置属性 | 弹窗中为白色 | 是 | Pass | +| 设置弹窗背板圆角半径示例验证 | 应用位于首页 | 2.点击 .CustomDialogController_CAPI对接示例按钮
3.点击 设置属性按钮
4.点击 设置弹窗背板圆角半径。
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击重置属性按钮 | 弹窗中的圆角比不设置任何属性点击打开弹窗是四边圆角值小 | 是 | Pass | +| 设置弹窗宽度占栅格宽度的个数示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 设置弹窗宽度占栅格宽度的个数。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
Set the number of grid widths that the popup occupies to 20 | 是 | Pass | +| 弹窗容器样式是否可以自定义示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 弹窗容器样式是否可以自定义。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 选择 是 点击弹框无边框
选择 否 点击弹框有边框 | 是 | Pass | +| 弹窗容器是否使用自定义弹窗动画示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 弹窗容器是否使用自定义弹窗动画。
4.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 属性设置结果显示
Not actually displayed | 是 | Pass | +| 系统返回操作关闭弹窗示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 系统返回操作关闭弹窗。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
The system-defined back operation closes the dialog | 是 | Pass | +| 显示弹框示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 显示弹框成功 | 是 | Pass | +| 弹框关闭示例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮
3.点击 弹框中Close Dialog 按钮 查看验证结果
4.点击 重置属性 按钮 | 显示弹框关闭成功 | 是 | Pass | +| 弹窗避让键盘模式示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式的弹窗 选择 否
4.点击 弹窗避让键盘模式
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 输出框最右边 显示出键盘
7.点击 弹框中Close Dialog 按钮
8.点击 重置属性按钮 | 键盘覆盖了弹窗 | 是 | Pass | +| 设置弹窗的显示层级示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的显示层级 选择 ARKUI_LEVEL_MODE_OVERLAY 。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示ARKUI_LEVEL_MODE_OVERLAY | 是 | Pass | +| 设置弹窗的显示层级示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的显示层级 选择 ARKUI_LEVEL_MODE_EMBEDDED。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示ARKUI_LEVEL_MODE_EMBEDDED | 是 | Pass | +| 设置弹窗显示层级页面下的节点id示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击设置弹窗显示层级页面下的节点id。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
Set the level uniqueId to 0 for a custom dialog box | 是 | Pass | +| 设置嵌入式弹窗蒙层的显示区域示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 设置嵌入式弹窗蒙层的显示区域。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
ARKUI_IMMERSIVE_MODE_DEFAULT | 是 | Pass | +| 设置自定义弹窗显示的顺序示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 设置自定义弹窗显示的顺序。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
Set the display order of the custom dialog box to 0 | 是 | Pass | +| 弹框状态变化示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 弹框状态显示
DIALOG_UNINITIALIZED
DIALOG_INITIALIZED
DIALOG_APPEARING
DIALOG_DISAPPEARED | 是 | Pass | +| 边框颜色示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 边框颜色:黄色。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 边框颜色为黄色 | 是 | Pass | +| 边框样式示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 边框样式:点状。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 边框样式为点状 | 是 | Pass | +| 默认边宽示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击点此打开弹窗按钮 查看验证结果
3.点击 重置属性按钮 | 显示弹窗有边宽
属性设置结果中 显示 width: 300vp | 是 | Pass | +| 默认边高示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击点此打开弹窗按钮 查看验证结果
3.点击 重置属性按钮 | 显示弹窗有边宽
属性设置结果中 显示 height: 200vp | 是 | Pass | +| 背板阴影示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背板阴影。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 边框周围有阴影 | 是 | Pass | +| 自定义弹窗的背板阴影示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 自定义弹窗的背板阴影。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内为红色 边框周围有阴影 | 是 | Pass | +| 背板模糊材质示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背板模糊材质。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内为灰色 | 是 | Pass | +| 响应悬停示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 响应悬停。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框响应在下半屏 | 是 | Pass | +| 悬停态下自定义弹窗默认展示区域示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 悬停态下自定义弹窗默认展示区域 选择 上半屏 或 下半屏。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
上半屏:Popup defaults to upper screen area in hover state 下半屏:Popup defaults to lower screen area in hover state | 是 | Pass | +| 是否获取焦点示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式弹窗 选择否
4.点击 是否获取焦点 选择 是。
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 点击输入框 打开键盘 点击弹框内区域 键盘自动回收 | 是 | Pass | +| 是否获取焦点示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式弹窗 选择否
4.点击 是否获取焦点 选择 否。
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 点击输入框 打开键盘 点击弹框内区域 键盘不回收 | 是 | Pass | +| 设置弹窗的背景模糊效果示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的背景模糊效果。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 设置自定义弹窗的背景效果参数 | 是 | Pass | +| 设置自定义弹窗的背景效果参数示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置自定义弹窗的背景效果参数。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内部颜色有变化 | 是 | Pass | +| 返回按钮示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 返回按钮 | 返回上一层 | 是 | Pass | +| 弹框创建/打开/关闭示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 弹框创建、打开、关闭成功 | 是 | Pass | +| 应用退出示例验证 | 应用位于首页 | 1.点击 关闭应用按钮 | 应用退出 | 是 | Pass | +| 设置弹窗的显示层示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的显示层级 是 / 否
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
ARKUI_LEVEL_MODE_OVERLAY / ARKUI_LEVEL_MODE_EMBEDDED | 是 | Pass | +| 设置背景颜色示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背景颜色:红色
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 背景颜色:红色 | 是 | Pass | +| 圆角半径示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 圆角半径:15
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹窗中的圆角比不设置任何属性点击打开弹窗是四边圆角值小 | 是 | Pass | +| 边框颜色示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 边框颜色:黄色
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框边框颜色为 黄色 | 是 | Pass | +| 边框样式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 边框样式:点状
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框边框样式为 点状 | 是 | Pass | +| 边框宽跟高示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 属性设置结果显示
width: 300vp height: 200vp | 是 | Pass | +| 背板阴影示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背板阴影
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框边框有阴影 | 是 | Pass | +| 自定义背板阴影示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 自定义背板阴影
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框边框有阴影 弹框后有黑色边框 | 是 | Pass | +| 背板材质示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 轻薄材质模糊
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内变灰色 | 是 | Pass | +| 对齐模式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 对齐模式:底部开始
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框底部开始 | 是 | Pass | +| 是否开启模态样式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式 是/否
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 是 弹框边框外颜色无变化 否 弹框边框外颜色无变化 | 是 | Pass | +| 弹窗是否在子窗口显示此弹窗示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 弹窗是否在子窗口显示此弹窗 开启/ 关闭
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 开启 再点设置属性栏 属性栏 在弹框页面下 关闭 再点设置属性栏 属性栏 在弹框页面下 | 是 | Pass | +| 自定义弹窗遮罩属性 示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 自定义弹窗遮罩属性
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内外显示红色 | 是 | Pass | +| 避让键盘的模式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态 选择 否
4.点击 避让键盘的模式 避让 / 不避让
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 不避让 弹框在 点击输入框打开显示键盘后 弹框不避让 避让 弹框在 点击输入框打开显示键盘后 弹框向上移动 进行避让键盘 | 是 | Pass | +| 响应悬停示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 响应悬停。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框响应在下半屏 | 是 | Pass | +| 悬停态下弹窗默认展示区域示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮(仅折叠屏显示)
2.点击 设置属性按钮
3点击 悬停态下弹窗默认展示区域 选择 上半屏 / 下半屏
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
上半屏:Popup defaults to upper screen area in hover state 下半屏:Popup defaults to lower screen area in hover state | 是 | Pass | +| 注册系统关闭自定义弹窗的监听事件示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 注册系统关闭自定义弹窗的监听事件。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 系统返回操作失效 | 是 | Pass | +| 弹框状态示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 弹框状态显示
DIALOG_UNINITIALIZED
DIALOG_INITIALIZED
DIALOG_APPEARING
DIALOG_DISAPPEARED | 是 | Pass | +| 背景模糊效果示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背景模糊效果。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内变为深色 | 是 | Pass | +| 背景效果参数示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背景效果参数。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内变为深色 | 是 | Pass | +| 返回按钮示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 返回按钮 | 返回上一层 | 是 | Pass | +| 弹窗Demo contorller示例验证 | 应用位于首页 | 1.点击 dialog demo按钮
2.点击 DialogController demo按钮
3.点击 “点击弹窗”按钮。 查看验证结果。
4.点击 “关闭弹窗”按钮。 查看验证结果。 | 弹框正常显示和关闭 | 是 | Pass | +| 弹窗Demo option示例验证 | 应用位于首页 | 1.点击 dialog demo按钮
2.点击 DialogOption demo按钮
3.点击 “点击弹窗”按钮。 查看验证结果。
4.点击 “关闭弹窗”按钮。 查看验证结果。 | 弹框正常显示和关闭 | 是 | Pass | +| 弹窗Demo option Text示例验证 | 应用位于首页 | 1.点击 dialog demo按钮
2.点击 Text Option demo按钮
3.点击 “点击弹窗”按钮。 查看验证结果。
4.点击 “关闭弹窗”按钮。 查看验证结果。 | 弹框正常显示和关闭 | 是 | Pass | +| 弹窗Demo lifecycle示例验证 | 应用位于首页 | 1.点击 dialog demo按钮
2.点击 Dialog lifecycle demo按钮
3.点击 “点击弹窗”按钮。 查看验证结果。
4.点击 “关闭弹窗”按钮。 查看验证结果。 | 弹框正常显示和关闭 | 是 | Pass | diff --git a/ArkUIKit/NativeDialogSample/screenshots/DialogDemo.png b/ArkUIKit/NativeDialogSample/screenshots/DialogDemo.png new file mode 100644 index 0000000000000000000000000000000000000000..a80f2a2f09868ae1110d756cbf084c2167635385 Binary files /dev/null and b/ArkUIKit/NativeDialogSample/screenshots/DialogDemo.png differ diff --git a/ArkUIKit/NativeDialogSample/screenshots/nativeDialog.png b/ArkUIKit/NativeDialogSample/screenshots/nativeDialog.png index 345cc57193787c84c6400614f7ea7e50b01b0d3c..3b366be0b5b24e6b4ae1b2bb8d1e0de6dcb577c4 100644 Binary files a/ArkUIKit/NativeDialogSample/screenshots/nativeDialog.png and b/ArkUIKit/NativeDialogSample/screenshots/nativeDialog.png differ diff --git a/ArkUIKit/NativeDragDrop/entry/build-profile.json5 b/ArkUIKit/NativeDragDrop/entry/build-profile.json5 index fea31f4580540c7c560b62bf531292c471c410f1..471250ade0685f26d9ed6c8fb7761e0f0882c8ec 100644 --- a/ArkUIKit/NativeDragDrop/entry/build-profile.json5 +++ b/ArkUIKit/NativeDragDrop/entry/build-profile.json5 @@ -20,7 +20,7 @@ "path": "./src/main/cpp/CMakeLists.txt", "arguments": "", "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64"] + "abiFilters": ["arm64-v8a", "x86_64", "armeabi-v7a"] } }, "buildOptionSet": [ diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/common.h b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/common.h index a9d83786e3f47d36d0d346328729b2afc76d4dfc..ede5047101e9fcabe4da67d05684a58281c9336d 100644 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/common.h +++ b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/common.h @@ -32,10 +32,11 @@ #define DEFAULT_MARGIN 5.0 #define DEFAULT_BORDER_COLOR 0xFF000000 #define DEFAULT_RADIUS 10.0 +#define DEFAULT_OPACITY 0.1 #define SIZE_20 20 #define SIZE_50 50 -#define SIZE_70 70 +#define SIZE_80 80 #define SIZE_120 120 #define SIZE_140 140 #define SIZE_170 170 @@ -46,10 +47,13 @@ #define BLANK_10 10.0 #define BLANK_20 20.0 +#define DRAG_COUNT 10 #define DEFAULT_TEXT_FONT_SIZE 12 #define TEXT_FONT_SIZE_15 15 #define TEXT_FONT_SIZE_20 20 +#define POINT_POS 200 + #define MAX_LENGTH 128 namespace NativeXComponentSample { @@ -77,6 +81,16 @@ void SetWidth(ArkUI_NodeHandle &node, float width = DEFAULT_WIDTH) nodeAPI->setAttribute(node, NODE_WIDTH, &widthItem); } +void SetWidthPercent(ArkUI_NodeHandle &node, float width = 1) +{ + if (!nodeAPI) { + return; + } + ArkUI_NumberValue widthValue[] = {width}; + ArkUI_AttributeItem widthItem = {widthValue, 1}; + nodeAPI->setAttribute(node, NODE_WIDTH_PERCENT, &widthItem); +} + void SetHeight(ArkUI_NodeHandle &node, float height = DEFAULT_HEIGHT) { if (!nodeAPI) { @@ -87,6 +101,16 @@ void SetHeight(ArkUI_NodeHandle &node, float height = DEFAULT_HEIGHT) nodeAPI->setAttribute(node, NODE_HEIGHT, &heightItem); } +void SetHeightPercent(ArkUI_NodeHandle &node, float height = 1) +{ + if (!nodeAPI) { + return; + } + ArkUI_NumberValue heightValue[] = {height}; + ArkUI_AttributeItem heightItem = {heightValue, 1}; + nodeAPI->setAttribute(node, NODE_HEIGHT_PERCENT, &heightItem); +} + void SetBackgroundColor(ArkUI_NodeHandle &node, uint32_t color = DEFAULT_BG_COLOR) { if (!nodeAPI) { @@ -248,6 +272,7 @@ void SetId(ArkUI_NodeHandle &node, const char *id) nodeAPI->setAttribute(node, NODE_ID, &idItem); } +// [Start prepare_dragAction] void SetPixelMap(std::vector &pixelVector) { uint8_t data[960000]; @@ -288,17 +313,18 @@ void SetDragPreviewOption() void PrintDragActionInfos() { // 设置pointerId - int returnValue = OH_ArkUI_DragAction_SetPointerId(action, 0); // -1 0 10 + int returnValue = OH_ArkUI_DragAction_SetPointerId(action, 0); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "OH_ArkUI_DragAction_SetPointerId returnValue = %{public}d", returnValue); // 设置touchPoint - returnValue = OH_ArkUI_DragAction_SetTouchPointX(action, 200); // -1 0 200 + returnValue = OH_ArkUI_DragAction_SetTouchPointX(action, POINT_POS); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "OH_ArkUI_DragAction_SetTouchPointX returnValue = %{public}d", returnValue); - returnValue = OH_ArkUI_DragAction_SetTouchPointY(action, 200); // -1 0 200 + returnValue = OH_ArkUI_DragAction_SetTouchPointY(action, POINT_POS); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "OH_ArkUI_DragAction_SetTouchPointY returnValue = %{public}d", returnValue); } +// [End prepare_dragAction] } // namespace NativeXComponentSample diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/fifthmodule.h b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/fifthmodule.h new file mode 100644 index 0000000000000000000000000000000000000000..6fad945c75e992cd14940173fe98df54a12b47da --- /dev/null +++ b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/fifthmodule.h @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2025 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. + */ + +#ifndef DRAGANDDROP_FIFTHMODULE_H +#define DRAGANDDROP_FIFTHMODULE_H + +#include "common.h" +#include "container.h" +#include +#include +#include +#include +#include +namespace NativeXComponentSample { + +ArkUI_NodeHandle button5_1 = nullptr; +ArkUI_NodeHandle button5_2 = nullptr; + +void SetTextDataLoadParams() +{ + // 异步传输拖拽数据 + OH_UdmfDataLoadParams *dataLoadParams = OH_UdmfDataLoadParams_Create(); + OH_UdmfDataLoadInfo *info = OH_UdmfDataLoadInfo_Create(); + OH_UdmfDataLoadInfo_SetType(info, UDMF_META_IMAGE); + OH_UdmfDataLoadInfo_SetRecordCount(info, 1); + OH_UdmfDataLoadParams_SetDataLoadInfo(dataLoadParams, info); + OH_Udmf_DataLoadHandler dataLoadHandler = [](OH_UdmfDataLoadInfo *acceptableInfo) { + OH_UdmfRecord *record = OH_UdmfRecord_Create(); + OH_UdsFileUri *imageValue = OH_UdsFileUri_Create(); + int returnValue = OH_UdsFileUri_SetFileUri(imageValue, "/resources/seagull.png"); + returnValue = OH_UdmfRecord_AddFileUri(record, imageValue); + OH_UdmfData *data = OH_UdmfData_Create(); + for (int i = 0; i < 1; i++) { + returnValue = OH_UdmfData_AddRecord(data, record); + } + return data; + }; + OH_UdmfDataLoadParams_SetLoadHandler(dataLoadParams, dataLoadHandler); + OH_ArkUI_DragAction_SetDataLoadParams(action, dataLoadParams); +} + +void StartDataLoadingFifth(ArkUI_DragEvent* dragEvent) +{ + // 异步流程 + OH_Udmf_DataProgressListener dataProgressListener = [](OH_Udmf_ProgressInfo *progressInfo, + OH_UdmfData *data) { + int32_t progress = OH_UdmfProgressInfo_GetProgress(progressInfo); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "OH_ArkUI_DragEvent_StartDataLoading progressInfo = %{public}d", progress); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "dataProgressListener callback"); + bool resultUdmf = OH_UdmfData_HasType(data, UDMF_META_PLAIN_TEXT); + if (resultUdmf) { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "NODE_ON_DROP has UDMF_META_PLAIN_TEXT"); + unsigned int recordsCount = 0; + OH_UdmfRecord **records = OH_UdmfData_GetRecords(data, &recordsCount); + // 获取records中的元素 + int returnStatus; + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "recordsCount= %{public}d", + recordsCount); + for (int i = 0; i < recordsCount; i++) { + // 从OH_UdmfRecord中获取纯文本类型数据 + OH_UdsPlainText *plainTextValue = OH_UdsPlainText_Create(); + returnStatus = OH_UdmfRecord_GetPlainText(records[i], plainTextValue); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "dragTest OH_UdmfRecord_GetPlainText " + "returnStatus = %{public}d", + returnStatus); + auto getAbstract = OH_UdsPlainText_GetAbstract(plainTextValue); + auto getContent = OH_UdsPlainText_GetContent(plainTextValue); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "OH_UdsPlainText_GetAbstract = " + "%{public}s, OH_UdsPlainText_GetContent = " + "%{public}s", + getAbstract, getContent); + // 使用结束后销毁指针 + OH_UdsPlainText_Destroy(plainTextValue); + } + OH_ArkUI_NotifyDragResult(g_requestIdentify, ARKUI_DRAG_RESULT_SUCCESSFUL); + OH_ArkUI_NotifyDragEndPendingDone(g_requestIdentify); + } + }; + OH_UdmfGetDataParams *params = OH_UdmfGetDataParams_Create(); + OH_UdmfGetDataParams_SetFileConflictOptions(params, Udmf_FileConflictOptions::UDMF_OVERWRITE); + OH_UdmfGetDataParams_SetProgressIndicator(params, Udmf_ProgressIndicator::UDMF_DEFAULT); + OH_UdmfGetDataParams_SetDataProgressListener(params, dataProgressListener); + OH_ArkUI_DragEvent_StartDataLoading(dragEvent, params, key, UDMF_KEY_BUFFER_LEN); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "OH_ArkUI_DragEvent_StartDataLoading key = %{public}s", key); + OH_UdmfGetDataParams_Destroy(params); +} + +void RegisterNodeEventFifthReceiver1() +{ + if (!nodeAPI) { + return; + } + + nodeAPI->addNodeEventReceiver(button5_1, [](ArkUI_NodeEvent *event) { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventFifthReceiver called"); + auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); + auto preDragStatus = OH_ArkUI_NodeEvent_GetPreDragStatus(event); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "eventType = %{public}d, preDragStatus = %{public}d", eventType, preDragStatus); + + switch (eventType) { + case NODE_ON_TOUCH_INTERCEPT: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_TOUCH_INTERCEPT EventReceiver"); + // 创建DragAction + auto context = OH_ArkUI_GetContextByNode(button5_1); + action = OH_ArkUI_CreateDragActionWithContext(context); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "OH_ArkUI_CreateDragActionWithContext returnValue = %{public}p", action); + std::vector pixelVector; + // 设置pixelMap + SetPixelMap(pixelVector); + // 设置DragPreviewOption + SetDragPreviewOption(); + PrintDragActionInfos(); + SetTextDataLoadParams(); + // startDrag + int returnValue = OH_ArkUI_StartDrag(action); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "OH_ArkUI_StartDrag returnValue = %{public}d", + returnValue); + OH_ArkUI_DragAction_Dispose(action); + break; + } + default: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "UNKOWN EventReceiver"); + break; + } + } + }); +} + +void RegisterNodeEventFifthReceiver2() +{ + if (!nodeAPI) { + return; + } + + nodeAPI->addNodeEventReceiver(button5_2, [](ArkUI_NodeEvent *event) { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventFifthReceiver called"); + auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); + auto preDragStatus = OH_ArkUI_NodeEvent_GetPreDragStatus(event); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "eventType = %{public}d, preDragStatus = %{public}d", eventType, preDragStatus); + + auto *dragEvent = OH_ArkUI_NodeEvent_GetDragEvent(event); + switch (eventType) { + case NODE_ON_DROP: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DROP EventReceiver"); + StartDataLoadingFifth(dragEvent); + break; + } + default: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "UNKOWN EventReceiver"); + break; + } + } + }); +} + +void FifthModule(ArkUI_NodeHandle &root) +{ + auto column5 = nodeAPI->createNode(ARKUI_NODE_COLUMN); + SetWidthPercent(column5, 1); + SetColumnJustifyContent(column5, ARKUI_FLEX_ALIGNMENT_START); + SetColumnAlignItem(column5, ARKUI_HORIZONTAL_ALIGNMENT_START); + SetPadding(column5, BLANK_10); + SetBorderWidth(column5, BORDER_WIDTH_1); + SetBorderStyle(column5, ARKUI_BORDER_STYLE_DASHED, DEFAULT_RADIUS); + + auto title5 = nodeAPI->createNode(ARKUI_NODE_TEXT); + SetTextAttribute(title5, "主动发起拖拽示例(异步加载):", TEXT_FONT_SIZE_15, SIZE_240, SIZE_20); + nodeAPI->addChild(column5, title5); + + auto row5 = nodeAPI->createNode(ARKUI_NODE_ROW); + SetRowAlignItem(row5, ARKUI_VERTICAL_ALIGNMENT_TOP); + nodeAPI->addChild(column5, row5); + + button5_1 = nodeAPI->createNode(ARKUI_NODE_BUTTON); + SetId(button5_1, "dragBt4"); + SetCommonAttribute(button5_1, SIZE_80, SIZE_50, 0xFFFF0000, BLANK_20); + SetButtonLabel(button5_1, "拖起"); + nodeAPI->registerNodeEvent(button5_1, NODE_ON_TOUCH_INTERCEPT, 1, nullptr); + nodeAPI->addChild(row5, button5_1); + + button5_2 = nodeAPI->createNode(ARKUI_NODE_BUTTON); + SetId(button5_2, "dropBt4"); + SetCommonAttribute(button5_2, SIZE_140, SIZE_50, 0xFFFF0000, BLANK_20); + SetButtonLabel(button5_2, "拖拽至此处"); + nodeAPI->registerNodeEvent(button5_2, NODE_ON_DROP, 1, nullptr); + nodeAPI->addChild(row5, button5_2); + + nodeAPI->addChild(root, column5); + + RegisterNodeEventFifthReceiver1(); + RegisterNodeEventFifthReceiver2(); +} + +} // namespace NativeXComponentSample + +#endif // DRAGANDDROP_FIFTHMODULE_H \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/firstmodule.h b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/firstmodule.h index 091eb1fb4ef6bde8237c115ea6538a2d6e094dc4..f6ea1fab61d9631bd63245990a810ff5b786a591 100644 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/firstmodule.h +++ b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/firstmodule.h @@ -19,6 +19,7 @@ #include "common.h" #include "container.h" #include +#include #include #include #include @@ -70,15 +71,6 @@ void PrintDragStartInfos(ArkUI_DragEvent* dragEvent) SetText(isRemoteText1, g_ss.str().c_str()); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "OH_ArkUI_DragEvent_IsRemote returnValue = %{public}d", isRemote); - uint64_t modifierKeys = ARKUI_MODIFIER_KEY_CTRL; - int32_t modifierKeyState = OH_ArkUI_DragEvent_GetModifierKeyStates(dragEvent, &modifierKeys); - g_ss.str(""); - if (modifierKeyState == 0) { - g_ss << "modifierKeyState: false"; - } else if (modifierKeyState == 1) { - g_ss << "modifierKeyState: true"; - } - SetText(modifierKeyStateText1, g_ss.str().c_str()); } void SetData(ArkUI_DragEvent* dragEvent) @@ -95,14 +87,19 @@ void SetData(ArkUI_DragEvent* dragEvent) void GetDragMoveInfos(ArkUI_DragEvent* dragEvent) { + // 预览图尺寸 + float previewRectWidth = OH_ArkUI_DragEvent_GetPreviewRectWidth(dragEvent); + float previewRectHeight = OH_ArkUI_DragEvent_GetPreviewRectHeight(dragEvent); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "NODE_ON_MOVE previewRectWidth = %{public}f; previewRectHeight = %{public}f", + previewRectWidth, previewRectHeight); float previewTouchPointX = OH_ArkUI_DragEvent_GetPreviewTouchPointX(dragEvent); float previewTouchPointY = OH_ArkUI_DragEvent_GetPreviewTouchPointY(dragEvent); g_ss.str(""); g_ss << "previewTouchPointX/Y: " << previewTouchPointX << "/" << previewTouchPointY; SetText(previewTouchPointText1, g_ss.str().c_str()); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_MOVE GetPreviewTouchPointX pos = %{public}f; ", - "GetPreviewTouchPointY pos = %{public}f", + "NODE_ON_MOVE previewTouchPointX = %{public}f; previewTouchPointY = %{public}f", previewTouchPointX, previewTouchPointY); float touchPointXToWindow = OH_ArkUI_DragEvent_GetTouchPointXToWindow(dragEvent); float touchPointYToWindow = OH_ArkUI_DragEvent_GetTouchPointYToWindow(dragEvent); @@ -110,7 +107,7 @@ void GetDragMoveInfos(ArkUI_DragEvent* dragEvent) g_ss << "touchPointX/YToWindow: " << touchPointXToWindow << "/" << touchPointYToWindow; SetText(touchPointToWindowText1, g_ss.str().c_str()); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_MOVE GetTouchPointXToWindow pos = %{public}f; GetTouchPointYToWindow pos = %{public}f", + "NODE_ON_MOVE touchPointXToWindow = %{public}f; touchPointYToWindow = %{public}f", touchPointXToWindow, touchPointYToWindow); float touchPointXToDisplay = OH_ArkUI_DragEvent_GetTouchPointXToDisplay(dragEvent); float touchPointYToDisplay = OH_ArkUI_DragEvent_GetTouchPointYToDisplay(dragEvent); @@ -118,7 +115,7 @@ void GetDragMoveInfos(ArkUI_DragEvent* dragEvent) g_ss << "touchPointX/YToDisplay: " << touchPointXToDisplay << "/" << touchPointYToDisplay; SetText(touchPointToDisplayText1, g_ss.str().c_str()); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_MOVE GetTouchPointXToDisplay pos = %{public}f; GetTouchPointYToDisplay pos = %{public}f", + "NODE_ON_MOVE touchPointXToDisplay = %{public}f; touchPointYToDisplay = %{public}f", touchPointXToDisplay, touchPointYToDisplay); float touchPointXToGlobalDisplay = OH_ArkUI_DragEvent_GetTouchPointXToGlobalDisplay(dragEvent); float touchPointYToGlobalDisplay = OH_ArkUI_DragEvent_GetTouchPointYToGlobalDisplay(dragEvent); @@ -126,8 +123,7 @@ void GetDragMoveInfos(ArkUI_DragEvent* dragEvent) g_ss << "touchPointX/YToGlobalDisplay: " << touchPointXToDisplay << "/" << touchPointYToDisplay; SetText(touchPointToGlobalDisplayText1, g_ss.str().c_str()); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_MOVE GetTouchPointXToGlobalDisplay pos = %{public}f; ", - "GetTouchPointYToGlobalDisplay pos = %{public}f", + "NODE_ON_MOVE touchPointXToGlobalDisplay = %{public}f; touchPointYToGlobalDisplay = %{public}f", touchPointXToGlobalDisplay, touchPointYToGlobalDisplay); float velocityX = OH_ArkUI_DragEvent_GetVelocityX(dragEvent); float velocityY = OH_ArkUI_DragEvent_GetVelocityY(dragEvent); @@ -136,12 +132,11 @@ void GetDragMoveInfos(ArkUI_DragEvent* dragEvent) g_ss << "velocityX: " << velocityX << " velocityY: " << velocityY << " velocity: " << velocity; SetText(velocityText1, g_ss.str().c_str()); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_MOVE GetVelocityX vx = %{public}f; ", - "GetVelocityY vy = %{public}f; ", - "GetVelocity v = %{public}f", + "NODE_ON_MOVE velocityX = %{public}f; velocityY = %{public}f; velocity = %{public}f", velocityX, velocityY, velocity); } +// [Start on_drop] void GetDragData(ArkUI_DragEvent* dragEvent) { // 获取UDMF data @@ -198,6 +193,7 @@ void GetDragData(ArkUI_DragEvent* dragEvent) "OH_ArkUI_DragEvent_GetDataTypes returnValue = %{public}s", eventTypeArray[i]); } } +// [StartExclude on_drop] void RegisterNodeEventFirstReceiver1(ArkUI_NodeHandle &dragNode) { @@ -205,6 +201,7 @@ void RegisterNodeEventFirstReceiver1(ArkUI_NodeHandle &dragNode) return; } + // [Start event_Type] nodeAPI->addNodeEventReceiver(dragNode, [](ArkUI_NodeEvent *event) { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventFirstReceiver called"); auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); @@ -219,18 +216,15 @@ void RegisterNodeEventFirstReceiver1(ArkUI_NodeHandle &dragNode) } case NODE_ON_DRAG_START: { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_START EventReceiver"); + // [StartExclude event_Type] PrintDragStartInfos(dragEvent); SetData(dragEvent); - // 预览图尺寸 - float previewRectWidth = OH_ArkUI_DragEvent_GetPreviewRectWidth(dragEvent); - float previewRectHeight = OH_ArkUI_DragEvent_GetPreviewRectHeight(dragEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_DRAG_START previewRectWidth = %{public}f; previewRectHeight = %{public}f", - previewRectWidth, previewRectHeight); + // [EndExclude event_Type] break; } case NODE_ON_DRAG_END: { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_END EventReceiver"); + // [StartExclude event_Type] ArkUI_DragResult result; OH_ArkUI_DragEvent_GetDragResult(dragEvent, &result); if (result == ARKUI_DRAG_RESULT_SUCCESSFUL) { @@ -241,6 +235,7 @@ void RegisterNodeEventFirstReceiver1(ArkUI_NodeHandle &dragNode) } else if (result == ARKUI_DRAG_RESULT_FAILED) { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "Drag Failed!"); } + // [EndExclude event_Type] break; } default: { @@ -249,6 +244,7 @@ void RegisterNodeEventFirstReceiver1(ArkUI_NodeHandle &dragNode) } } }); + // [End event_Type] } void RegisterNodeEventFirstReceiver2(ArkUI_NodeHandle node) @@ -266,11 +262,14 @@ void RegisterNodeEventFirstReceiver2(ArkUI_NodeHandle node) auto *dragEvent = OH_ArkUI_NodeEvent_GetDragEvent(event); switch (eventType) { + // [EndExclude on_drop] case NODE_ON_DROP: { + OH_ArkUI_DragEvent_SetSuggestedDropOperation(dragEvent, ARKUI_DROP_OPERATION_COPY); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DROP EventReceiver"); GetDragData(dragEvent); break; } + // [End on_drop] case NODE_ON_DRAG_ENTER: { OH_ArkUI_DragEvent_SetSuggestedDropOperation(dragEvent, ARKUI_DROP_OPERATION_COPY); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_ENTER EventReceiver"); @@ -294,6 +293,37 @@ void RegisterNodeEventFirstReceiver2(ArkUI_NodeHandle node) }); } +void RegisterKeyEventReceiver() +{ + if (!nodeAPI) { + return; + } + + nodeAPI->registerNodeEventReceiver([](ArkUI_NodeEvent *event) { + auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); + if (eventType != NODE_ON_KEY_EVENT) { + return; + } + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterKeyEventReceiver called"); + auto *dragEvent = OH_ArkUI_NodeEvent_GetDragEvent(event); + auto *inputEvent = OH_ArkUI_NodeEvent_GetInputEvent(event); + auto type = OH_ArkUI_KeyEvent_GetType(inputEvent); + uint64_t modifierKeys = ARKUI_MODIFIER_KEY_CTRL; + int32_t modifierKeyState = OH_ArkUI_DragEvent_GetModifierKeyStates(dragEvent, &modifierKeys); + g_ss.str(""); + if (type == ARKUI_KEY_EVENT_DOWN) { + if (modifierKeyState == 0) { + g_ss << "modifierKeyState: false"; + } else { + g_ss << "modifierKeyState: true"; + } + } else if (type == ARKUI_KEY_EVENT_UP) { + g_ss << "modifierKeyState: false"; + } + SetText(modifierKeyStateText1, g_ss.str().c_str()); + }); +} + void DisplayInfo(ArkUI_NodeHandle &column1) { displayIdText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); @@ -309,7 +339,7 @@ void DisplayInfo(ArkUI_NodeHandle &column1) nodeAPI->addChild(column1, isRemoteText1); modifierKeyStateText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetText(modifierKeyStateText1, "modifierKeyState: "); + SetText(modifierKeyStateText1, "modifierKeyState: (首次需按Tab键激活)"); nodeAPI->addChild(column1, modifierKeyStateText1); previewTouchPointText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); @@ -339,10 +369,30 @@ void DisplayInfo(ArkUI_NodeHandle &column1) void SetPreviewOption(ArkUI_NodeHandle &node) { + // [Start create_pixelMap] + // 创建pixelMap + uint8_t data[960000]; + size_t dataSize = 960000; + for (int i = 0; i < dataSize; i++) { + data[i] = i + 1; + } + // 创建参数结构体实例,并设置参数 + OH_Pixelmap_InitializationOptions *createOpts; + OH_PixelmapInitializationOptions_Create(&createOpts); + OH_PixelmapInitializationOptions_SetWidth(createOpts, SIZE_200); + OH_PixelmapInitializationOptions_SetHeight(createOpts, SIZE_200); + OH_PixelmapInitializationOptions_SetPixelFormat(createOpts, PIXEL_FORMAT_BGRA_8888); + OH_PixelmapInitializationOptions_SetAlphaType(createOpts, PIXELMAP_ALPHA_TYPE_UNKNOWN); + // 设置自定义跟手图 + OH_PixelmapNative *pixelmap = nullptr; + OH_PixelmapNative_CreatePixelmap(data, dataSize, createOpts, &pixelmap); + OH_PixelmapNative_Opacity(pixelmap, DEFAULT_OPACITY); + OH_ArkUI_SetNodeDragPreview(node, pixelmap); + // 设置跟手图选项 auto *previewOptionsText = OH_ArkUI_CreateDragPreviewOption(); OH_ArkUI_DragPreviewOption_SetScaleMode(previewOptionsText, ARKUI_DRAG_PREVIEW_SCALE_DISABLED); OH_ArkUI_DragPreviewOption_SetNumberBadgeEnabled(previewOptionsText, true); - OH_ArkUI_DragPreviewOption_SetBadgeNumber(previewOptionsText, -1); + OH_ArkUI_DragPreviewOption_SetBadgeNumber(previewOptionsText, DRAG_COUNT); OH_ArkUI_DragPreviewOption_SetDefaultShadowEnabled(previewOptionsText, true); OH_ArkUI_DragPreviewOption_SetDefaultRadiusEnabled(previewOptionsText, true); int returnValue = OH_ArkUI_DragPreviewOption_SetDefaultAnimationBeforeLiftingEnabled(previewOptionsText, true); @@ -350,6 +400,7 @@ void SetPreviewOption(ArkUI_NodeHandle &node) "dragTest DragPreviewOption_SetDefaultAnimationBeforeLiftingEnabled returnValue = %{public}d", returnValue); OH_ArkUI_SetNodeDragPreviewOption(node, previewOptionsText); + // [End create_pixelMap] OH_ArkUI_DragPreviewOption_Dispose(previewOptionsText); } @@ -391,6 +442,7 @@ void DragAreaFirst(ArkUI_NodeHandle &column1) SetBorderWidth(unDropArea, BORDER_WIDTH_1); SetColumnJustifyContent(unDropArea, ARKUI_FLEX_ALIGNMENT_CENTER); OH_ArkUI_DisallowNodeAnyDropDataTypes(unDropArea); + context = OH_ArkUI_GetContextByNode(unDropArea); OH_ArkUI_EnableDropDisallowedBadge(context, true); auto unDropText1 = nodeAPI->createNode(ARKUI_NODE_TEXT); SetText(unDropText1, "", TEXT_FONT_SIZE_20); @@ -429,7 +481,7 @@ void DropAreaFirst1(ArkUI_NodeHandle &dragRow2) auto unDropArea1 = nodeAPI->createNode(ARKUI_NODE_COLUMN); SetId(unDropArea1, "unDropArea1_1"); - SetCommonAttribute(unDropArea1, SIZE_120, SIZE_70, DEFAULT_BG_COLOR, BLANK_5); + SetCommonAttribute(unDropArea1, SIZE_120, SIZE_80, DEFAULT_BG_COLOR, BLANK_5); SetBorderWidth(unDropArea1, BORDER_WIDTH_1); SetColumnJustifyContent(unDropArea1, ARKUI_FLEX_ALIGNMENT_CENTER); SetColumnAlignItem(unDropArea1, ARKUI_HORIZONTAL_ALIGNMENT_CENTER); @@ -470,12 +522,11 @@ void DropAreaFirst2(ArkUI_NodeHandle &dragRow2) auto unDropArea2 = nodeAPI->createNode(ARKUI_NODE_COLUMN); SetId(unDropArea2, "unDropArea2_1"); - SetCommonAttribute(unDropArea2, SIZE_120, SIZE_70, DEFAULT_BG_COLOR, BLANK_5); + SetCommonAttribute(unDropArea2, SIZE_120, SIZE_80, DEFAULT_BG_COLOR, BLANK_5); SetBorderWidth(unDropArea2, BORDER_WIDTH_1); SetColumnJustifyContent(unDropArea2, ARKUI_FLEX_ALIGNMENT_CENTER); SetColumnAlignItem(unDropArea2, ARKUI_HORIZONTAL_ALIGNMENT_CENTER); - OH_ArkUI_DisallowNodeAnyDropDataTypes(unDropArea2); - const char* types[] = {"general.file"}; + const char* types[] = { UDMF_META_TEXT }; OH_ArkUI_SetNodeAllowedDropDataTypes(unDropArea2, types, 1); nodeAPI->registerNodeEvent(unDropArea2, NODE_ON_DROP, 1, nullptr); auto unDropText2 = nodeAPI->createNode(ARKUI_NODE_TEXT); @@ -489,11 +540,13 @@ void DropAreaFirst2(ArkUI_NodeHandle &dragRow2) void FirstModule(ArkUI_NodeHandle &root) { auto column1 = nodeAPI->createNode(ARKUI_NODE_COLUMN); + SetWidthPercent(column1, 1); SetColumnJustifyContent(column1, ARKUI_FLEX_ALIGNMENT_START); SetColumnAlignItem(column1, ARKUI_HORIZONTAL_ALIGNMENT_START); SetPadding(column1, BLANK_10); SetBorderWidth(column1, BORDER_WIDTH_1); SetBorderStyle(column1, ARKUI_BORDER_STYLE_DASHED, DEFAULT_RADIUS); + nodeAPI->registerNodeEvent(column1, NODE_ON_KEY_EVENT, 1, nullptr); auto title = nodeAPI->createNode(ARKUI_NODE_TEXT); SetTextAttribute(title, "通用拖拽示例:", TEXT_FONT_SIZE_15, SIZE_140, SIZE_20); @@ -527,6 +580,7 @@ void FirstModule(ArkUI_NodeHandle &root) RegisterNodeEventFirstReceiver1(dragText1); RegisterNodeEventFirstReceiver2(dropArea1); RegisterNodeEventFirstReceiver2(dropArea2); + RegisterKeyEventReceiver(); } } // namespace NativeXComponentSample diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/forthmodule.h b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/forthmodule.h index fd778e3b49b68edc4a51709d4f05387dea2f2f6c..0a722e0bac3d34b34aea7383257ac90fea431044 100644 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/forthmodule.h +++ b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/forthmodule.h @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - #ifndef DRAGANDDROP_FORTHMODULE_H #define DRAGANDDROP_FORTHMODULE_H @@ -23,89 +22,22 @@ #include #include #include + namespace NativeXComponentSample { -ArkUI_NodeHandle button4_1 = nullptr; -ArkUI_NodeHandle button4_2 = nullptr; +void SetDragActionData(); +void GetUdmfDataText(ArkUI_DragEvent* dragEvent); -void SetTextDataLoadParams() -{ - // 异步传输拖拽数据 - OH_UdmfDataLoadParams *dataLoadParams = OH_UdmfDataLoadParams_Create(); - OH_UdmfDataLoadInfo *info = OH_UdmfDataLoadInfo_Create(); - OH_UdmfDataLoadInfo_SetRecordCount(info, 1); - OH_UdmfDataLoadParams_SetDataLoadInfo(dataLoadParams, info); - OH_Udmf_DataLoadHandler dataLoadHandler = [](OH_UdmfDataLoadInfo *acceptableInfo) { - OH_UdmfRecord *record = OH_UdmfRecord_Create(); - // 向OH_UdmfRecord中添加纯文本类型数据 - OH_UdsPlainText *plainText = OH_UdsPlainText_Create(); - int returnStatus; - OH_UdsPlainText_SetAbstract(plainText, "this is plainText Abstract example"); - OH_UdsPlainText_SetContent(plainText, "this is plainText Content example"); - returnStatus = OH_UdmfRecord_AddPlainText(record, plainText); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "dragTest OH_UdmfRecord_AddPlainText returnStatus = %{public}d", returnStatus); - // 创建OH_UdmfData对象 - OH_UdmfData *data4 = OH_UdmfData_Create(); - int returnValue; - for (int i = 0; i < 1; i++) { - returnValue = OH_UdmfData_AddRecord(data4, record); - } - return data4; - }; - OH_UdmfDataLoadParams_SetLoadHandler(dataLoadParams, dataLoadHandler); - OH_ArkUI_DragAction_SetDataLoadParams(action, dataLoadParams); -} +ArkUI_NodeHandle dragButton = nullptr; +ArkUI_NodeHandle dropButton = nullptr; -void StartDataLoadingForth(ArkUI_DragEvent* dragEvent) +void DragStatusListener(ArkUI_DragAndDropInfo *info, void *userData) { - // 异步流程 - OH_Udmf_DataProgressListener dataProgressListener = [](OH_Udmf_ProgressInfo *progressInfo, - OH_UdmfData *data) { - int32_t progress = OH_UdmfProgressInfo_GetProgress(progressInfo); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragEvent_StartDataLoading progressInfo = %{public}d", progress); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "dataProgressListener callback"); - bool resultUdmf = OH_UdmfData_HasType(data, UDMF_META_PLAIN_TEXT); - if (resultUdmf) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_DROP has UDMF_META_PLAIN_TEXT"); - unsigned int recordsCount = 0; - OH_UdmfRecord **records = OH_UdmfData_GetRecords(data, &recordsCount); - // 获取records中的元素 - int returnStatus; - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "recordsCount= %{public}d", - recordsCount); - for (int i = 0; i < recordsCount; i++) { - // 从OH_UdmfRecord中获取纯文本类型数据 - OH_UdsPlainText *plainTextValue = OH_UdsPlainText_Create(); - returnStatus = OH_UdmfRecord_GetPlainText(records[i], plainTextValue); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "dragTest OH_UdmfRecord_GetPlainText " - "returnStatus = %{public}d", - returnStatus); - auto getAbstract = OH_UdsPlainText_GetAbstract(plainTextValue); - auto getContent = OH_UdsPlainText_GetContent(plainTextValue); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_UdsPlainText_GetAbstract = " - "%{public}s, OH_UdsPlainText_GetContent = " - "%{public}s", - getAbstract, getContent); - // 使用结束后销毁指针 - OH_UdsPlainText_Destroy(plainTextValue); - } - OH_ArkUI_NotifyDragResult(g_requestIdentify, ARKUI_DRAG_RESULT_SUCCESSFUL); - OH_ArkUI_NotifyDragEndPendingDone(g_requestIdentify); - } - }; - OH_UdmfGetDataParams *params = OH_UdmfGetDataParams_Create(); - OH_UdmfGetDataParams_SetFileConflictOptions(params, Udmf_FileConflictOptions::UDMF_OVERWRITE); - OH_UdmfGetDataParams_SetProgressIndicator(params, Udmf_ProgressIndicator::UDMF_DEFAULT); - OH_UdmfGetDataParams_SetDataProgressListener(params, dataProgressListener); - OH_ArkUI_DragEvent_StartDataLoading(dragEvent, params, key, UDMF_KEY_BUFFER_LEN); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragEvent_StartDataLoading key = %{public}s", key); - OH_UdmfGetDataParams_Destroy(params); + auto dragStatus = OH_ArkUI_DragAndDropInfo_GetDragStatus(info); + auto dragEvent = OH_ArkUI_DragAndDropInfo_GetDragEvent(info); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "DragStatusListener called"); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "dragStatus = %{public}d, &dragEvent = %{public}p", + dragStatus, dragEvent); } void RegisterNodeEventForthReceiver1() @@ -114,42 +46,50 @@ void RegisterNodeEventForthReceiver1() return; } - nodeAPI->addNodeEventReceiver(button4_1, [](ArkUI_NodeEvent *event) { + // [Start on_touchIntercept] + nodeAPI->addNodeEventReceiver(dragButton, [](ArkUI_NodeEvent *event) { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventForthReceiver called"); auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); auto preDragStatus = OH_ArkUI_NodeEvent_GetPreDragStatus(event); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "eventType = %{public}d, preDragStatus = %{public}d", eventType, preDragStatus); + auto *dragEvent = OH_ArkUI_NodeEvent_GetDragEvent(event); switch (eventType) { + // [Start set_dragAction] case NODE_ON_TOUCH_INTERCEPT: { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_TOUCH_INTERCEPT EventReceiver"); + // [StartExclude on_touchIntercept] // 创建DragAction - auto context = OH_ArkUI_GetContextByNode(button4_1); - action = OH_ArkUI_CreateDragActionWithContext(context); + action = OH_ArkUI_CreateDragActionWithNode(dragButton); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_CreateDragActionWithContext returnValue = %{public}p", action); - std::vector pixelVector; + "OH_ArkUI_CreateDragActionWithNode returnValue = %{public}p", action); // 设置pixelMap + std::vector pixelVector; SetPixelMap(pixelVector); // 设置DragPreviewOption SetDragPreviewOption(); + // 设置pointerId、touchPoint PrintDragActionInfos(); - SetTextDataLoadParams(); + // 设置unifiedData + SetDragActionData(); // startDrag int returnValue = OH_ArkUI_StartDrag(action); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "OH_ArkUI_StartDrag returnValue = %{public}d", returnValue); OH_ArkUI_DragAction_Dispose(action); + // [EndExclude on_touchIntercept] break; } + // [StartExclude set_dragAction] default: { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "UNKOWN EventReceiver"); break; } } }); + // [End on_touchIntercept] } void RegisterNodeEventForthReceiver2() @@ -158,7 +98,7 @@ void RegisterNodeEventForthReceiver2() return; } - nodeAPI->addNodeEventReceiver(button4_2, [](ArkUI_NodeEvent *event) { + nodeAPI->addNodeEventReceiver(dropButton, [](ArkUI_NodeEvent *event) { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventForthReceiver called"); auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); auto preDragStatus = OH_ArkUI_NodeEvent_GetPreDragStatus(event); @@ -167,11 +107,14 @@ void RegisterNodeEventForthReceiver2() auto *dragEvent = OH_ArkUI_NodeEvent_GetDragEvent(event); switch (eventType) { + // [Start get_dragAction] case NODE_ON_DROP: { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DROP EventReceiver"); - StartDataLoadingForth(dragEvent); + GetUdmfDataText(dragEvent); + OH_ArkUI_DragAction_UnregisterStatusListener(action); break; } + // [StartExclude get_dragAction] default: { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "UNKOWN EventReceiver"); break; @@ -183,6 +126,7 @@ void RegisterNodeEventForthReceiver2() void ForthModule(ArkUI_NodeHandle &root) { auto column4 = nodeAPI->createNode(ARKUI_NODE_COLUMN); + SetWidthPercent(column4, 1); SetColumnJustifyContent(column4, ARKUI_FLEX_ALIGNMENT_START); SetColumnAlignItem(column4, ARKUI_HORIZONTAL_ALIGNMENT_START); SetPadding(column4, BLANK_10); @@ -190,26 +134,33 @@ void ForthModule(ArkUI_NodeHandle &root) SetBorderStyle(column4, ARKUI_BORDER_STYLE_DASHED, DEFAULT_RADIUS); auto title4 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(title4, "主动发起拖拽示例(异步加载):", TEXT_FONT_SIZE_15, SIZE_240, SIZE_20); + SetTextAttribute(title4, "主动发起拖拽示例:", TEXT_FONT_SIZE_15, SIZE_170, SIZE_20); nodeAPI->addChild(column4, title4); - auto row4 = nodeAPI->createNode(ARKUI_NODE_ROW); - SetRowAlignItem(row4, ARKUI_VERTICAL_ALIGNMENT_TOP); - nodeAPI->addChild(column4, row4); + auto dragRow = nodeAPI->createNode(ARKUI_NODE_ROW); + SetRowAlignItem(dragRow, ARKUI_VERTICAL_ALIGNMENT_TOP); + nodeAPI->addChild(column4, dragRow); - button4_1 = nodeAPI->createNode(ARKUI_NODE_BUTTON); - SetId(button4_1, "dragBt4"); - SetCommonAttribute(button4_1, SIZE_70, SIZE_50, 0xFFFF0000, BLANK_20); - SetButtonLabel(button4_1, "拖起"); - nodeAPI->registerNodeEvent(button4_1, NODE_ON_TOUCH_INTERCEPT, 1, nullptr); - nodeAPI->addChild(row4, button4_1); + // [Start touch_intercept] + // buttonTouch作为targetId,用于区分不同target的事件。 + enum { + BUTTON_TOUCH = 1 + }; - button4_2 = nodeAPI->createNode(ARKUI_NODE_BUTTON); - SetId(button4_2, "dropBt4"); - SetCommonAttribute(button4_2, SIZE_140, SIZE_50, 0xFFFF0000, BLANK_20); - SetButtonLabel(button4_2, "拖拽至此处"); - nodeAPI->registerNodeEvent(button4_2, NODE_ON_DROP, 1, nullptr); - nodeAPI->addChild(row4, button4_2); + dragButton = nodeAPI->createNode(ARKUI_NODE_BUTTON); + SetId(dragButton, "dragBt3"); + SetCommonAttribute(dragButton, SIZE_80, SIZE_50, 0xFFFF0000, BLANK_20); + SetButtonLabel(dragButton, "拖起"); + nodeAPI->registerNodeEvent(dragButton, NODE_ON_TOUCH_INTERCEPT, BUTTON_TOUCH, nullptr); + // [End touch_intercept] + nodeAPI->addChild(dragRow, dragButton); + + dropButton = nodeAPI->createNode(ARKUI_NODE_BUTTON); + SetId(dropButton, "dropBt3"); + SetCommonAttribute(dropButton, SIZE_140, SIZE_50, 0xFFFF0000, BLANK_20); + SetButtonLabel(dropButton, "拖拽至此处"); + nodeAPI->registerNodeEvent(dropButton, NODE_ON_DROP, 1, nullptr); + nodeAPI->addChild(dragRow, dropButton); nodeAPI->addChild(root, column4); @@ -217,6 +168,77 @@ void ForthModule(ArkUI_NodeHandle &root) RegisterNodeEventForthReceiver2(); } +// [EndExclude set_dragAction] +void SetDragActionData() +{ + // 创建OH_UdmfRecord对象 + OH_UdmfRecord *record = OH_UdmfRecord_Create(); + // 向OH_UdmfRecord中添加纯文本类型数据 + OH_UdsPlainText *plainText = OH_UdsPlainText_Create(); + int returnStatus; + OH_UdsPlainText_SetAbstract(plainText, "this is plainText Abstract example"); + OH_UdsPlainText_SetContent(plainText, "this is plainText Content example"); + returnStatus = OH_UdmfRecord_AddPlainText(record, plainText); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "dragTest OH_UdmfRecord_AddPlainText returnStatus = %{public}d", returnStatus); + // 创建OH_UdmfData对象 + OH_UdmfData *data = OH_UdmfData_Create(); + // 向OH_UdmfData中添加OH_UdmfRecord + returnStatus = OH_UdmfData_AddRecord(data, record); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "dragTest OH_UdmfData_AddRecord returnStatus = %{public}d", returnStatus); + int returnValue = OH_ArkUI_DragAction_SetData(action, data); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "OH_ArkUI_DragAction_SetData returnValue = %{public}d", returnValue); + // 注册拖拽状态监听回调 + OH_ArkUI_DragAction_RegisterStatusListener(action, data, &DragStatusListener); +} +// [Start set_dragAction] + +// [EndExclude get_dragAction] +void GetUdmfDataText(ArkUI_DragEvent* dragEvent) +{ + // 获取UDMF data + int returnValue; + // 创建OH_UdmfData对象 + OH_UdmfData *data = OH_UdmfData_Create(); + returnValue = OH_ArkUI_DragEvent_GetUdmfData(dragEvent, data); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "OH_ArkUI_DragEvent_GetUdmfData returnValue = %{public}d", returnValue); + // 判断OH_UdmfData是否有对应的类型 + bool resultUdmf = OH_UdmfData_HasType(data, UDMF_META_PLAIN_TEXT); + if (resultUdmf) { + // 获取OH_UdmfData的记录 + unsigned int recordsCount = 0; + OH_UdmfRecord **records = OH_UdmfData_GetRecords(data, &recordsCount); + // 获取records中的元素 + int returnStatus; + for (int i = 0; i < recordsCount; i++) { + // 从OH_UdmfRecord中获取纯文本类型数据 + OH_UdsPlainText *plainTextValue = OH_UdsPlainText_Create(); + returnStatus = OH_UdmfRecord_GetPlainText(records[i], plainTextValue); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "dragTest OH_UdmfRecord_GetPlainText " + "returnStatus= %{public}d", + returnStatus); + auto getAbstract = OH_UdsPlainText_GetAbstract(plainTextValue); + auto getContent = OH_UdsPlainText_GetContent(plainTextValue); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "OH_UdsPlainText_GetAbstract = " + "%{public}s, OH_UdsPlainText_GetContent = " + "%{public}s", + getAbstract, getContent); + // 使用结束后销毁指针 + OH_UdsPlainText_Destroy(plainTextValue); + } + } else { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", + "OH_UdmfData_HasType not contain UDMF_META_PLAIN_TEXT"); + } + OH_UdmfData_Destroy(data); +} +// [End get_dragAction] + } // namespace NativeXComponentSample #endif // DRAGANDDROP_FORTHMODULE_H \ No newline at end of file diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/manager.cpp b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/manager.cpp index d58e78d745aa310692a718251a4069d3d04650a3..71729166555bba0a2546912f10d2f749c30c103a 100644 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/manager.cpp +++ b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/manager.cpp @@ -13,11 +13,12 @@ * limitations under the License. */ +#include "thirdmodule.h" #include "common.h" #include "firstmodule.h" #include "secondmodule.h" -#include "thirdmodule.h" #include "forthmodule.h" +#include "fifthmodule.h" #include "napi/native_api.h" #include #include @@ -34,7 +35,6 @@ #include #include -#include #include "manager.h" @@ -89,6 +89,12 @@ void SampleEntry(napi_env env, napi_value arg, OH_NativeXComponent *component) ForthModule(column); + auto blank4 = nodeAPI->createNode(ARKUI_NODE_COLUMN); + SetHeight(blank4, BLANK_10); + nodeAPI->addChild(column, blank4); + + FifthModule(column); + OH_NativeXComponent_AttachNativeRootNode(component, column); } @@ -138,7 +144,11 @@ napi_value Manager::CreateNativeNode(napi_env env, napi_callback_info info) if (component == nullptr) { return nullptr; } - OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nodeAPI); + // [Start get_nodeAPI] + ArkUI_NativeNodeAPI_1 *nativeNodeAPI = nullptr; + OH_ArkUI_GetModuleInterface(ARKUI_NATIVE_NODE, ArkUI_NativeNodeAPI_1, nativeNodeAPI); + nodeAPI = nativeNodeAPI; + // [End get_nodeAPI] if (nodeAPI != nullptr) { if (nodeAPI->createNode != nullptr && nodeAPI->addChild != nullptr) { diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/secondmodule.h b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/secondmodule.h index 14b7079512604191ff12bf25d8cd88648987e3ba..bfb82a23ce6c4c782d2c4c8968f9a86ed48879ac 100644 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/secondmodule.h +++ b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/secondmodule.h @@ -30,16 +30,9 @@ namespace NativeXComponentSample { ArkUI_NodeHandle dragImage = nullptr; ArkUI_NodeHandle dropImage = nullptr; -ArkUI_NodeHandle displayIdText2 = nullptr; -ArkUI_NodeHandle bundleNameText2 = nullptr; -ArkUI_NodeHandle isRemoteText2 = nullptr; -ArkUI_NodeHandle previewTouchPointText2 = nullptr; -ArkUI_NodeHandle touchPointToWindowText2 = nullptr; -ArkUI_NodeHandle touchPointToDisplayText2 = nullptr; -ArkUI_NodeHandle touchPointToGlobalDisplayText2 = nullptr; -ArkUI_NodeHandle velocityText2 = nullptr; +bool dragResult = true; -void SetImageDataLoadParams(ArkUI_DragEvent* dragEvent) +void SetImageDataLoadParams1(ArkUI_DragEvent* dragEvent) { // 异步传输拖拽数据 OH_UdmfDataLoadParams *dataLoadParams = OH_UdmfDataLoadParams_Create(); @@ -53,7 +46,8 @@ void SetImageDataLoadParams(ArkUI_DragEvent* dragEvent) int returnValue = OH_UdsFileUri_SetFileUri(imageValue, "/resources/seagull.png"); returnValue = OH_UdmfRecord_AddFileUri(record, imageValue); OH_UdmfData *data = OH_UdmfData_Create(); - for (int i = 0; i < 1; i++) { + int dataCount = 3000; + for (int i = 0; i < dataCount; i++) { returnValue = OH_UdmfData_AddRecord(data, record); } return data; @@ -62,7 +56,7 @@ void SetImageDataLoadParams(ArkUI_DragEvent* dragEvent) OH_ArkUI_DragEvent_SetDataLoadParams(dragEvent, dataLoadParams); } -void StartDataLoadingSecond(ArkUI_DragEvent* dragEvent) +void StartDataLoadingSecond1(ArkUI_DragEvent* dragEvent) { // 异步流程 int32_t count = 0; @@ -120,17 +114,18 @@ void StartDataLoadingSecond(ArkUI_DragEvent* dragEvent) OH_UdmfGetDataParams_Destroy(params); } -void GetSecondDragResult(ArkUI_DragEvent* dragEvent) +void GetSecondDragResult1(ArkUI_DragEvent* dragEvent) { ArkUI_DragResult result; OH_ArkUI_DragEvent_GetDragResult(dragEvent, &result); - if (result == ARKUI_DRAG_RESULT_SUCCESSFUL) { + if (result == ARKUI_DRAG_RESULT_SUCCESSFUL && dragResult == true) { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "Drag Successful!"); nodeAPI->resetAttribute(dragImage, NODE_IMAGE_SRC); SetImageSrc(dropImage, "/resources/seagull.png"); - } else if (result == ARKUI_DRAG_RESULT_FAILED) { + } else { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "Drag Failed!"); } + dragResult = true; } void RegisterNodeEventSecondReceiver1(ArkUI_NodeHandle &dragNode) @@ -154,18 +149,12 @@ void RegisterNodeEventSecondReceiver1(ArkUI_NodeHandle &dragNode) } case NODE_ON_DRAG_START: { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_START EventReceiver"); - SetImageDataLoadParams(dragEvent); - // 预览图尺寸 - float previewRectWidth = OH_ArkUI_DragEvent_GetPreviewRectWidth(dragEvent); - float previewRectHeight = OH_ArkUI_DragEvent_GetPreviewRectHeight(dragEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "NODE_ON_DRAG_START previewRectWidth = %{public}f; previewRectHeight = %{public}f", - previewRectWidth, previewRectHeight); + SetImageDataLoadParams1(dragEvent); break; } case NODE_ON_DRAG_END: { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_END EventReceiver"); - GetSecondDragResult(dragEvent); + GetSecondDragResult1(dragEvent); break; } default: { @@ -198,7 +187,7 @@ void RegisterNodeEventSecondReceiver2(ArkUI_NodeHandle &dropNode) OH_ArkUI_DragEvent_RequestDragEndPending(dragEvent, &g_requestIdentify); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "OH_ArkUI_DragEvent_RequestDragEndPending called"); - StartDataLoadingSecond(dragEvent); + StartDataLoadingSecond1(dragEvent); break; } case NODE_ON_DRAG_ENTER: { @@ -246,28 +235,31 @@ void SecondButtonModule(ArkUI_NodeHandle &column) nodeAPI->registerNodeEvent(cancelLoadButton, NODE_ON_CLICK_EVENT, 1, nullptr); nodeAPI->addNodeEventReceiver(cancelLoadButton, [](ArkUI_NodeEvent *event) { int ret = OH_ArkUI_CancelDataLoading(context, key); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "30079408 button test ret:%{public}s", key); + if (ret == 0) { + dragResult = false; + } }); nodeAPI->addChild(buttonRow, cancelLoadButton); } void SecondModule(ArkUI_NodeHandle &root) { - auto column = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetColumnJustifyContent(column, ARKUI_FLEX_ALIGNMENT_START); - SetColumnAlignItem(column, ARKUI_HORIZONTAL_ALIGNMENT_START); - SetPadding(column, BLANK_10); - SetBorderWidth(column, BORDER_WIDTH_1); - SetBorderStyle(column, ARKUI_BORDER_STYLE_DASHED, DEFAULT_RADIUS); + auto column2 = nodeAPI->createNode(ARKUI_NODE_COLUMN); + SetWidthPercent(column2, 1); + SetColumnJustifyContent(column2, ARKUI_FLEX_ALIGNMENT_START); + SetColumnAlignItem(column2, ARKUI_HORIZONTAL_ALIGNMENT_START); + SetPadding(column2, BLANK_10); + SetBorderWidth(column2, BORDER_WIDTH_1); + SetBorderStyle(column2, ARKUI_BORDER_STYLE_DASHED, DEFAULT_RADIUS); auto title = nodeAPI->createNode(ARKUI_NODE_TEXT); SetTextAttribute(title, "异步拖拽示例:", TEXT_FONT_SIZE_15, SIZE_140, SIZE_20); - nodeAPI->addChild(column, title); + nodeAPI->addChild(column2, title); auto dragRow = nodeAPI->createNode(ARKUI_NODE_ROW); SetRowAlignItem(dragRow, ARKUI_VERTICAL_ALIGNMENT_TOP); - nodeAPI->addChild(column, dragRow); + nodeAPI->addChild(column2, dragRow); // 拖拽图像 auto dragColumn = nodeAPI->createNode(ARKUI_NODE_COLUMN); @@ -305,9 +297,9 @@ void SecondModule(ArkUI_NodeHandle &root) nodeAPI->addChild(dragRow, dropColumn); - SecondButtonModule(column); + SecondButtonModule(column2); - nodeAPI->addChild(root, column); + nodeAPI->addChild(root, column2); RegisterNodeEventSecondReceiver1(dragImage); RegisterNodeEventSecondReceiver2(dropImage); diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/thirdmodule.h b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/thirdmodule.h index 483f43c653ca108ecb34c9ad63891215507f4037..7eda79b749369bfcd5d2963ff2e7e6363db72be6 100644 --- a/ArkUIKit/NativeDragDrop/entry/src/main/cpp/thirdmodule.h +++ b/ArkUIKit/NativeDragDrop/entry/src/main/cpp/thirdmodule.h @@ -12,134 +12,96 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #ifndef DRAGANDDROP_THIRDMODULE_H #define DRAGANDDROP_THIRDMODULE_H #include "common.h" #include "container.h" #include -#include #include #include -#include #include -namespace NativeXComponentSample { +#include +#include -ArkUI_NodeHandle dragButton = nullptr; -ArkUI_NodeHandle dropButton = nullptr; +namespace NativeXComponentSample { -void DragStatusListener(ArkUI_DragAndDropInfo *info, void *userData) +ArkUI_NodeHandle dragImage2 = nullptr; +ArkUI_NodeHandle dropImage2 = nullptr; +// [Start drag_start] +void SetImageData(ArkUI_DragEvent* dragEvent) { - auto dragStatus = OH_ArkUI_DragAndDropInfo_GetDragStatus(info); - auto dragEvent = OH_ArkUI_DragAndDropInfo_GetDragEvent(info); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "DragStatusListener called"); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "dragStatus = %{public}d, &dragEvent = %{public}p", - dragStatus, dragEvent); + int returnValue; + OH_UdmfRecord *record = OH_UdmfRecord_Create(); + OH_UdsFileUri *imageValue = OH_UdsFileUri_Create(); + returnValue = OH_UdsFileUri_SetFileUri(imageValue, "/resources/seagull.png"); + returnValue = OH_UdmfRecord_AddFileUri(record, imageValue); + OH_UdmfData *data = OH_UdmfData_Create(); + returnValue = OH_UdmfData_AddRecord(data, record); + returnValue = OH_ArkUI_DragEvent_SetData(dragEvent, data); } +// [StartExclude drag_start] -void SetDragActionData() +void ExecuteDragPending(ArkUI_DragEvent* dragEvent) { - // 创建OH_UdmfRecord对象 - OH_UdmfRecord *record = OH_UdmfRecord_Create(); - // 向OH_UdmfRecord中添加纯文本类型数据 - OH_UdsPlainText *plainText = OH_UdsPlainText_Create(); - int returnStatus; - OH_UdsPlainText_SetAbstract(plainText, "this is plainText Abstract example"); - OH_UdsPlainText_SetContent(plainText, "this is plainText Content example"); - returnStatus = OH_UdmfRecord_AddPlainText(record, plainText); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "dragTest OH_UdmfRecord_AddPlainText returnStatus = %{public}d", returnStatus); - // 创建OH_UdmfData对象 - OH_UdmfData *data = OH_UdmfData_Create(); - // 向OH_UdmfData中添加OH_UdmfRecord - returnStatus = OH_UdmfData_AddRecord(data, record); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "dragTest OH_UdmfData_AddRecord returnStatus = %{public}d", returnStatus); - int returnValue = OH_ArkUI_DragAction_SetData(action, data); + int32_t requestId = -1; + auto ret = OH_ArkUI_DragEvent_RequestDragEndPending(dragEvent, &requestId); + if (ret == ARKUI_ERROR_CODE_DRAG_DROP_OPERATION_NOT_ALLOWED) { + OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "dragTest", "The operation is not allowed!"); + return; + } OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragAction_SetData returnValue = %{public}d", returnValue); - // 注册拖拽状态监听回调 - OH_ArkUI_DragAction_RegisterStatusListener(action, data, &DragStatusListener); + "NODE_ON_DROP get id = %{public}d, ret = %{public}d", requestId, ret); + std::thread tt([requestId]() { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DROP_ASYNC 1"); + sleep(1); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DROP_ASYNC 2"); + OH_ArkUI_NotifyDragResult(requestId, ARKUI_DRAG_RESULT_SUCCESSFUL); + OH_ArkUI_NotifyDragEndPendingDone(requestId); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DROP_ASYNC"); + }); + tt.detach(); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DROP_DONE"); } -void GetUdmfDataText(ArkUI_DragEvent* dragEvent) +void GetThirdDragResult(ArkUI_DragEvent* dragEvent) { - // 获取UDMF data - int returnValue; - // 创建OH_UdmfData对象 - OH_UdmfData *data = OH_UdmfData_Create(); - returnValue = OH_ArkUI_DragEvent_GetUdmfData(dragEvent, data); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_DragEvent_GetUdmfData returnValue = %{public}d", returnValue); - // 判断OH_UdmfData是否有对应的类型 - bool resultUdmf = OH_UdmfData_HasType(data, UDMF_META_PLAIN_TEXT); - if (resultUdmf) { - // 获取OH_UdmfData的记录 - unsigned int recordsCount = 0; - OH_UdmfRecord **records = OH_UdmfData_GetRecords(data, &recordsCount); - // 获取records中的元素 - int returnStatus; - for (int i = 0; i < recordsCount; i++) { - // 从OH_UdmfRecord中获取纯文本类型数据 - OH_UdsPlainText *plainTextValue = OH_UdsPlainText_Create(); - returnStatus = OH_UdmfRecord_GetPlainText(records[i], plainTextValue); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "dragTest OH_UdmfRecord_GetPlainText " - "returnStatus= %{public}d", - returnStatus); - auto getAbstract = OH_UdsPlainText_GetAbstract(plainTextValue); - auto getContent = OH_UdsPlainText_GetContent(plainTextValue); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_UdsPlainText_GetAbstract = " - "%{public}s, OH_UdsPlainText_GetContent = " - "%{public}s", - getAbstract, getContent); - // 使用结束后销毁指针 - OH_UdsPlainText_Destroy(plainTextValue); - } - } else { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_UdmfData_HasType not contain UDMF_META_PLAIN_TEXT"); + ArkUI_DragResult result; + OH_ArkUI_DragEvent_GetDragResult(dragEvent, &result); + if (result == ARKUI_DRAG_RESULT_SUCCESSFUL) { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "Drag Successful!"); + nodeAPI->resetAttribute(dragImage2, NODE_IMAGE_SRC); + SetImageSrc(dropImage2, "/resources/seagull.png"); + } else if (result == ARKUI_DRAG_RESULT_FAILED) { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "Drag Failed!"); } - OH_UdmfData_Destroy(data); } -void RegisterNodeEventThirdReceiver1() +void RegisterNodeEventThirdReceiver1(ArkUI_NodeHandle &dragNode) { if (!nodeAPI) { return; } - nodeAPI->addNodeEventReceiver(dragButton, [](ArkUI_NodeEvent *event) { + nodeAPI->addNodeEventReceiver(dragNode, [](ArkUI_NodeEvent *event) { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventThirdReceiver called"); auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); auto preDragStatus = OH_ArkUI_NodeEvent_GetPreDragStatus(event); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "eventType = %{public}d, preDragStatus = %{public}d", eventType, preDragStatus); - auto *dragEvent = OH_ArkUI_NodeEvent_GetDragEvent(event); switch (eventType) { - case NODE_ON_TOUCH_INTERCEPT: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_TOUCH_INTERCEPT EventReceiver"); - // 创建DragAction - action = OH_ArkUI_CreateDragActionWithNode(dragButton); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_CreateDragActionWithNode returnValue = %{public}p", action); - // 设置pixelMap - std::vector pixelVector; - SetPixelMap(pixelVector); - // 设置DragPreviewOption - SetDragPreviewOption(); - // 设置pointerId、touchPoint - PrintDragActionInfos(); - // 设置unifiedData - SetDragActionData(); - // startDrag - int returnValue = OH_ArkUI_StartDrag(action); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "OH_ArkUI_StartDrag returnValue = %{public}d", - returnValue); - OH_ArkUI_DragAction_Dispose(action); + // [EndExclude drag_start] + case NODE_ON_DRAG_START: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_START EventReceiver"); + SetImageData(dragEvent); + break; + } + // [End drag_start] + case NODE_ON_DRAG_END: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DRAG_END EventReceiver"); + GetThirdDragResult(dragEvent); break; } default: { @@ -150,25 +112,24 @@ void RegisterNodeEventThirdReceiver1() }); } -void RegisterNodeEventThirdReceiver2() +void RegisterNodeEventThirdReceiver2(ArkUI_NodeHandle &dropNode) { if (!nodeAPI) { return; } - nodeAPI->addNodeEventReceiver(dropButton, [](ArkUI_NodeEvent *event) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventThirdReceiver called"); + nodeAPI->addNodeEventReceiver(dropNode, [](ArkUI_NodeEvent *event) { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "RegisterNodeEventSecondReceiver called"); auto eventType = OH_ArkUI_NodeEvent_GetEventType(event); auto preDragStatus = OH_ArkUI_NodeEvent_GetPreDragStatus(event); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", - "eventType = %{public}d, preDragStatus = %{public}d", eventType, preDragStatus); - + "eventType = %{public}d, preDragStatus = %{public}d", + eventType, preDragStatus); auto *dragEvent = OH_ArkUI_NodeEvent_GetDragEvent(event); switch (eventType) { case NODE_ON_DROP: { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "dragTest", "NODE_ON_DROP EventReceiver"); - GetUdmfDataText(dragEvent); - OH_ArkUI_DragAction_UnregisterStatusListener(action); + ExecuteDragPending(dragEvent); break; } default: { @@ -179,41 +140,77 @@ void RegisterNodeEventThirdReceiver2() }); } +void ResetButton(ArkUI_NodeHandle &column) +{ + auto resetButton = nodeAPI->createNode(ARKUI_NODE_BUTTON); + SetButtonLabel(resetButton, "复位"); + nodeAPI->registerNodeEvent(resetButton, NODE_ON_CLICK_EVENT, 1, nullptr); + nodeAPI->addNodeEventReceiver(resetButton, [](ArkUI_NodeEvent *event) { + nodeAPI->resetAttribute(dropImage2, NODE_IMAGE_SRC); + SetImageSrc(dragImage2, "/resources/seagull.png"); + }); + nodeAPI->addChild(column, resetButton); +} + void ThirdModule(ArkUI_NodeHandle &root) { auto column3 = nodeAPI->createNode(ARKUI_NODE_COLUMN); + SetWidthPercent(column3, 1); SetColumnJustifyContent(column3, ARKUI_FLEX_ALIGNMENT_START); SetColumnAlignItem(column3, ARKUI_HORIZONTAL_ALIGNMENT_START); SetPadding(column3, BLANK_10); SetBorderWidth(column3, BORDER_WIDTH_1); SetBorderStyle(column3, ARKUI_BORDER_STYLE_DASHED, DEFAULT_RADIUS); - auto title3 = nodeAPI->createNode(ARKUI_NODE_TEXT); - SetTextAttribute(title3, "主动发起拖拽示例:", TEXT_FONT_SIZE_15, SIZE_170, SIZE_20); - nodeAPI->addChild(column3, title3); + auto title = nodeAPI->createNode(ARKUI_NODE_TEXT); + SetTextAttribute(title, "延迟处理拖拽示例:", TEXT_FONT_SIZE_15, SIZE_140, SIZE_20); + nodeAPI->addChild(column3, title); auto dragRow = nodeAPI->createNode(ARKUI_NODE_ROW); SetRowAlignItem(dragRow, ARKUI_VERTICAL_ALIGNMENT_TOP); - nodeAPI->addChild(column3, dragRow); - dragButton = nodeAPI->createNode(ARKUI_NODE_BUTTON); - SetId(dragButton, "dragBt3"); - SetCommonAttribute(dragButton, SIZE_70, SIZE_50, 0xFFFF0000, BLANK_20); - SetButtonLabel(dragButton, "拖起"); - nodeAPI->registerNodeEvent(dragButton, NODE_ON_TOUCH_INTERCEPT, 1, nullptr); - nodeAPI->addChild(dragRow, dragButton); + nodeAPI->addChild(column3, dragRow); - dropButton = nodeAPI->createNode(ARKUI_NODE_BUTTON); - SetId(dropButton, "dropBt3"); - SetCommonAttribute(dropButton, SIZE_140, SIZE_50, 0xFFFF0000, BLANK_20); - SetButtonLabel(dropButton, "拖拽至此处"); - nodeAPI->registerNodeEvent(dropButton, NODE_ON_DROP, 1, nullptr); - nodeAPI->addChild(dragRow, dropButton); + // 拖拽图像 + auto dragColumn = nodeAPI->createNode(ARKUI_NODE_COLUMN); + auto dragText = nodeAPI->createNode(ARKUI_NODE_TEXT); + SetTextAttribute(dragText, "请长按拖拽图像", TEXT_FONT_SIZE_15, SIZE_140, SIZE_20); + // [Start create_imageNode] + dragImage2 = nodeAPI->createNode(ARKUI_NODE_IMAGE); + SetId(dragImage2, "dragImage"); + SetCommonAttribute(dragImage2, SIZE_140, SIZE_140, DEFAULT_BG_COLOR, BLANK_5); + SetImageSrc(dragImage2, "/resources/seagull.png"); + OH_ArkUI_SetNodeDraggable(dragImage2, true); + nodeAPI->registerNodeEvent(dragImage2, NODE_ON_DRAG_START, 1, nullptr); + // [End create_imageNode] + nodeAPI->registerNodeEvent(dragImage2, NODE_ON_DRAG_END, 1, nullptr); + nodeAPI->addChild(dragColumn, dragText); + nodeAPI->addChild(dragColumn, dragImage2); + + nodeAPI->addChild(dragRow, dragColumn); + + // 拖拽落入区域 + auto dropColumn = nodeAPI->createNode(ARKUI_NODE_COLUMN); + auto dropText = nodeAPI->createNode(ARKUI_NODE_TEXT); + SetTextAttribute(dropText, "拖拽落入区域", TEXT_FONT_SIZE_15, SIZE_140, SIZE_20); + dropImage2 = nodeAPI->createNode(ARKUI_NODE_IMAGE); + SetId(dropImage2, "dropImage"); + SetCommonAttribute(dropImage2, SIZE_140, SIZE_140, DEFAULT_BG_COLOR, BLANK_5); + SetBorderWidth(dropImage2, BORDER_WIDTH_1); + OH_ArkUI_SetNodeDraggable(dropImage2, false); + OH_ArkUI_DisableDropDataPrefetchOnNode(dropImage2, true); + nodeAPI->registerNodeEvent(dropImage2, NODE_ON_DROP, 1, nullptr); + nodeAPI->addChild(dropColumn, dropText); + nodeAPI->addChild(dropColumn, dropImage2); + + nodeAPI->addChild(dragRow, dropColumn); + + ResetButton(column3); nodeAPI->addChild(root, column3); - RegisterNodeEventThirdReceiver1(); - RegisterNodeEventThirdReceiver2(); + RegisterNodeEventThirdReceiver1(dragImage2); + RegisterNodeEventThirdReceiver2(dropImage2); } } // namespace NativeXComponentSample diff --git a/ArkUIKit/NativeDragDrop/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NativeDragDrop/entry/src/main/ets/pages/Index.ets index 45f3c16017e53efdeafcb740d714c0980d9110c5..f884b3cd34ebef9f89b19165ff2963d1f2482542 100644 --- a/ArkUIKit/NativeDragDrop/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/NativeDragDrop/entry/src/main/ets/pages/Index.ets @@ -45,7 +45,7 @@ struct NativeDragDropExample { type: XComponentType.NODE, libraryname: 'nativeNode' }) - .height(1150) + .height(1450) .onAppear(() => { nativeNode.createNativeNode('dragAndDrop', this.getUIContext()); }) diff --git a/ArkUIKit/NativeXComponentSample/entry/build-profile.json5 b/ArkUIKit/NativeXComponentSample/entry/build-profile.json5 index a35f5de28aeed0d7c8d6df195a806a24b825b9de..389f73da7fce48c89b81ebb6350df849fdc30d84 100644 --- a/ArkUIKit/NativeXComponentSample/entry/build-profile.json5 +++ b/ArkUIKit/NativeXComponentSample/entry/build-profile.json5 @@ -22,7 +22,8 @@ "cppFlags": "", "abiFilters": [ "arm64-v8a", - "x86_64" + "x86_64", + "armeabi-v7a" ] } }, @@ -32,7 +33,7 @@ "arkOptions": { "obfuscation": { "ruleOptions": { - "enable": false, + "enable": true, "files": [ "./obfuscation-rules.txt" ] @@ -49,7 +50,8 @@ ], "targets": [ { - "name": "default" + "name": "default", + "runtimeOS": "OpenHarmony" }, { "name": "ohosTest", diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/manager/plugin_manager.cpp b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/manager/plugin_manager.cpp index 8d92150e619d14d46c26ff4078b1ccd8eeae2f30..db6e882c01cc7f0c91b720aaca483eb696ce1721 100644 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/manager/plugin_manager.cpp +++ b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/manager/plugin_manager.cpp @@ -30,13 +30,15 @@ #define ARG_CNT 2 namespace NativeXComponentSample { +// [Start plugin_manager_cpp] +// plugin_manager.cpp std::unordered_map PluginManager::nodeHandleMap_; std::unordered_map PluginManager::callbackMap_; std::unordered_map PluginManager::surfaceHolderMap_; ArkUI_AccessibilityProvider *PluginManager::provider_ = nullptr; ArkUI_NativeNodeAPI_1 *nodeAPI = reinterpret_cast( OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_NODE, "ArkUI_NativeNodeAPI_1")); - +// [StartExclude plugin_manager_cpp] PluginManager PluginManager::pluginManager_; OH_NativeXComponent_Callback PluginManager::callback_; ArkUI_NodeHandle xc; @@ -61,6 +63,7 @@ PluginManager::~PluginManager() pluginManagerMap_.clear(); } +// [Start surface_holder] void OnSurfaceCreatedNative(OH_ArkUI_SurfaceHolder *holder) { auto window = OH_ArkUI_XComponent_GetNativeWindow(holder); // 获取native window @@ -116,7 +119,8 @@ void onEvent(ArkUI_NodeEvent *event) OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "onBind", "on touch"); } } - +// [End surface_holder] +// [EndExclude plugin_manager_cpp] static std::string value2String(napi_env env, napi_value value) { size_t stringSize = 0; @@ -126,6 +130,7 @@ static std::string value2String(napi_env env, napi_value value) napi_get_value_string_utf8(env, value, &valueString[0], stringSize+1, &stringSize); return valueString; } +// [StartExclude plugin_manager_cpp] napi_value PluginManager::GetXComponentStatus(napi_env env, napi_callback_info info) { napi_value hasDraw; @@ -164,14 +169,17 @@ napi_value PluginManager::GetXComponentStatus(napi_env env, napi_callback_info i } return obj; } - +// [Start plugin_draw_pattern] napi_value PluginManager::NapiDrawPattern(napi_env env, napi_callback_info info) { + // [StartExclude plugin_draw_pattern] OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginManager", "NapiDrawPattern"); if ((env == nullptr) || (info == nullptr)) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "NapiDrawPattern: env or info is null"); return nullptr; } + // [EndExclude plugin_draw_pattern] + // 获取环境变量参数 napi_value thisArg; if (napi_get_cb_info(env, info, nullptr, nullptr, &thisArg, nullptr) != napi_ok) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "NapiDrawPattern: napi_get_cb_info fail"); @@ -179,14 +187,18 @@ napi_value PluginManager::NapiDrawPattern(napi_env env, napi_callback_info info) } auto *pluginManger = PluginManager::GetInstance(); + // 调用绘制方法 pluginManger->eglcore_->Draw(hasDraw_); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "PluginManager", "render->eglCore_->Draw() executed"); return nullptr; } - +// [End plugin_draw_pattern] +// [Start plugin_on_surface_created] +// 定义一个函数OnSurfaceCreatedCB(),封装初始化环境与绘制背景 void OnSurfaceCreatedCB(OH_NativeXComponent* component, void* window) { + // [StartExclude plugin_on_surface_created] OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "OnSurfaceCreatedCB"); int32_t ret; char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; @@ -199,11 +211,17 @@ void OnSurfaceCreatedCB(OH_NativeXComponent* component, void* window) std::string id(idStr); OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "OnSurfaceCreatedCB id=%{public}s", id.c_str()); + // [EndExclude plugin_on_surface_created] + // 初始化环境与绘制背景 auto *pluginManger = PluginManager::GetInstance(); pluginManger->OnSurfaceCreated(component, window); } +// [End plugin_on_surface_created] +// [Start plugin_on_surface_changed] +// 定义一个函数OnSurfaceChangedCB() void OnSurfaceChangedCB(OH_NativeXComponent* component, void* window) { + // [StartExclude plugin_on_surface_changed] OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "OnSurfaceChangedCB"); int32_t ret; char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; @@ -213,11 +231,17 @@ void OnSurfaceChangedCB(OH_NativeXComponent* component, void* window) return; } std::string id(idStr); + // [EndExclude plugin_on_surface_changed] auto *pluginManger = PluginManager::GetInstance(); + // 封装OnSurfaceChanged方法 pluginManger->OnSurfaceChanged(component, window); } +// [End plugin_on_surface_changed] +// [Start plugin_on_surface_destroyed] +// 定义一个函数OnSurfaceDestroyedCB(),将PluginRender类内释放资源的方法Release()封装在其中 void OnSurfaceDestroyedCB(OH_NativeXComponent* component, void* window) { + // [StartExclude plugin_on_surface_destroyed] OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceDestroyedCB"); int32_t ret; char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; @@ -227,11 +251,16 @@ void OnSurfaceDestroyedCB(OH_NativeXComponent* component, void* window) return; } std::string id(idStr); + // [EndExclude plugin_on_surface_destroyed] auto *pluginManger = PluginManager::GetInstance(); pluginManger->OnSurfaceDestroyed(component, window); } +// [End plugin_on_surface_destroyed] +// [Start plugin_dispatch_touch_event] +// 定义一个函数DispatchTouchEventCB(),响应触摸事件时触发该回调 void DispatchTouchEventCB(OH_NativeXComponent* component, void* window) { + // [StartExclude plugin_dispatch_touch_event] OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "DispatchTouchEventCB"); int32_t ret; char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {}; @@ -241,9 +270,11 @@ void DispatchTouchEventCB(OH_NativeXComponent* component, void* window) return; } std::string id(idStr); + // [EndExclude plugin_dispatch_touch_event] auto *pluginManger = PluginManager::GetInstance(); pluginManger->DispatchTouchEvent(component, window); } +// [End plugin_dispatch_touch_event] PluginManager::PluginManager() { eglcore_ = new EGLCore(); @@ -252,7 +283,7 @@ PluginManager::PluginManager() callback_.OnSurfaceDestroyed = OnSurfaceDestroyedCB; callback_.DispatchTouchEvent = DispatchTouchEventCB; } - +// [Start plugin_create_native_node] ArkUI_NodeHandle CreateNodeHandle(const std::string &tag) { ArkUI_NodeHandle column = nodeAPI->createNode(ARKUI_NODE_COLUMN); @@ -263,7 +294,9 @@ ArkUI_NodeHandle CreateNodeHandle(const std::string &tag) nodeAPI->setAttribute(column, NODE_WIDTH, &item); value[0].f32 = COLUMN_MARGIN; nodeAPI->setAttribute(column, NODE_MARGIN, &item); + // 创建XComponent组件 xc = nodeAPI->createNode(ARKUI_NODE_XCOMPONENT); + // 设置XComponent组件属性 value[0].u32 = ARKUI_XCOMPONENT_TYPE_SURFACE; nodeAPI->setAttribute(xc, NODE_XCOMPONENT_TYPE, &item); nodeAPI->setAttribute(xc, NODE_XCOMPONENT_ID, &item); @@ -287,6 +320,7 @@ ArkUI_NodeHandle CreateNodeHandle(const std::string &tag) return column; } OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "GetNativeXComponent success"); + // 注册XComponent回调函数 OH_NativeXComponent_RegisterCallback(nativeXComponent, &PluginManager::callback_); auto typeRet = nodeAPI->getAttribute(xc, NODE_XCOMPONENT_TYPE); OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "PluginManager", "xcomponent type: %{public}d", @@ -346,7 +380,7 @@ napi_value PluginManager::createNativeNode(napi_env env, napi_callback_info info } return nullptr; } - +// [End plugin_create_native_node] void PluginManager::OnSurfaceCreated(OH_NativeXComponent* component, void* window) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "XComponent_Native", "PluginManager::OnSurfaceCreated"); @@ -513,7 +547,7 @@ PluginRender* PluginManager::GetRender(std::string& id) return pluginRenderMap_[id]; } - +// [EndExclude plugin_manager_cpp] napi_value PluginManager::BindNode(napi_env env, napi_callback_info info) { size_t argc = 2; @@ -545,7 +579,7 @@ napi_value PluginManager::BindNode(napi_env env, napi_callback_info info) provider_ = OH_ArkUI_AccessibilityProvider_Create(handle); // 创建一个ArkUI_AccessibilityProvider类型的对象 /** * 获取ArkUI_AccessibilityProvider后,如果注册无障碍回调函数请参考: - * https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/ui/ndk-accessibility-xcomponent.md + * https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/ui/ndk-accessibility-xcomponent.md * **/ return nullptr; } @@ -618,7 +652,7 @@ napi_value PluginManager::SetNeedSoftKeyboard(napi_env env, napi_callback_info i OH_ArkUI_XComponent_SetNeedSoftKeyboard(node, needSoftKeyboard); // 设置是否需要软键盘 return nullptr; } - +// [End plugin_manager_cpp] napi_value PluginManager::Initialize(napi_env env, napi_callback_info info) { size_t argc = 1; diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/manager/plugin_manager.h b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/manager/plugin_manager.h index 73812e165801bf353abe53e6ad677a57edc7dad5..58110607fe244b42a3a72fd58f4265346cad1be4 100644 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/manager/plugin_manager.h +++ b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/manager/plugin_manager.h @@ -28,15 +28,20 @@ #include "arkui/native_node_napi.h" #include "../render/plugin_render.h" - +// [Start plugin_manager_h_part] +// plugin_manager.h namespace NativeXComponentSample { +// [StartExclude plugin_manager_h_part] constexpr const int FIRST_ARG = 1; constexpr const int SECOND_ARG = 2; constexpr const int THIRD_ARG = 3; constexpr const int FRAME_COUNT = 50; +// [Start plugin_manager_h] +// 在头文件中定义PluginManager类 +// [EndExclude plugin_manager_h_part] class PluginManager { public: - + // [StartExclude plugin_manager_h_part] static OH_NativeXComponent_Callback callback_; PluginManager(); ~PluginManager(); @@ -48,44 +53,56 @@ public: static napi_value createNativeNode(napi_env env, napi_callback_info info); static napi_value GetXComponentStatus(napi_env env, napi_callback_info info); static napi_value NapiDrawPattern(napi_env env, napi_callback_info info); + // [StartExclude plugin_manager_h] static napi_value GetContext(napi_env env, napi_callback_info info); - + // [EndExclude plugin_manager_h_part] static napi_value BindNode(napi_env env, napi_callback_info info); static napi_value UnbindNode(napi_env env, napi_callback_info info); static napi_value SetFrameRate(napi_env env, napi_callback_info info); static napi_value SetNeedSoftKeyboard(napi_env env, napi_callback_info info); + // [StartExclude plugin_manager_h_part] static napi_value Initialize(napi_env env, napi_callback_info info); static napi_value Finalize(napi_env env, napi_callback_info info); static napi_value DrawStar(napi_env env, napi_callback_info info); - + // [EndExclude plugin_manager_h] // CApi XComponent void OnSurfaceChanged(OH_NativeXComponent* component, void* window); void OnSurfaceDestroyed(OH_NativeXComponent* component, void* window); void DispatchTouchEvent(OH_NativeXComponent* component, void* window); void OnSurfaceCreated(OH_NativeXComponent* component, void* window); - + // [StartExclude plugin_manager_h] void SetNativeXComponent(std::string& id, OH_NativeXComponent* nativeXComponent); PluginRender* GetRender(std::string& id); void Export(napi_env env, napi_value exports); + // [EndExclude plugin_manager_h] private: static PluginManager pluginManager_; std::unordered_map nativeXComponentMap_; + // [StartExclude plugin_manager_h] std::unordered_map pluginRenderMap_; + // [EndExclude plugin_manager_h] std::unordered_map pluginManagerMap_; + // [EndExclude plugin_manager_h_part] public: + // [StartExclude plugin_manager_h_part] EGLCore *eglcore_; uint64_t width_; uint64_t height_; OH_NativeXComponent_TouchEvent touchEvent_; static int32_t hasDraw_; static int32_t hasChangeColor_; + // [EndExclude plugin_manager_h_part] + // [StartExclude plugin_manager_h] static std::unordered_map nodeHandleMap_; static std::unordered_map callbackMap_; static std::unordered_map surfaceHolderMap_; static ArkUI_AccessibilityProvider *provider_; + // [EndExclude plugin_manager_h] }; +// [End plugin_manager_h] } // namespace NativeXComponentSample +// [End plugin_manager_h_part] #endif // NATIVE_XCOMPONENT_PLUGIN_MANAGER_H diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/napi_init.cpp b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/napi_init.cpp index fa96bb11a8b5d8394dc489c444fd9714de104dc2..c3fe678e924e1226e2376503535deff4b78b4bc4 100644 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/napi_init.cpp +++ b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/napi_init.cpp @@ -12,60 +12,77 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +// [Start napi_init_part] +// [Start napi_init] #include #include "common/common.h" #include "manager/plugin_manager.h" namespace NativeXComponentSample { +// 在napi_init.cpp文件中,Init方法注册接口函数,从而将封装的C++方法传递出来,供ArkTS侧调用 EXTERN_C_START static napi_value Init(napi_env env, napi_value exports) { + // [StartExclude napi_init] OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "Init", "Init begins"); if ((env == nullptr) || (exports == nullptr)) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "env or exports is null"); return nullptr; } - + // [EndExclude napi_init] + // 向ArkTS侧暴露接口 napi_property_descriptor desc[] = { + // [StartExclude napi_init_part] {"createNativeNode", nullptr, PluginManager::createNativeNode, nullptr, nullptr, nullptr, napi_default, nullptr }, {"getStatus", nullptr, PluginManager::GetXComponentStatus, nullptr, nullptr, nullptr, napi_default, nullptr}, {"drawPattern", nullptr, PluginManager::NapiDrawPattern, nullptr, nullptr, nullptr, napi_default, nullptr}, + // [StartExclude napi_init] {"getContext", nullptr, PluginManager::GetContext, nullptr, nullptr, nullptr, napi_default, nullptr }, + // [EndExclude napi_init_part] {"bindNode", nullptr, PluginManager::BindNode, nullptr, nullptr, nullptr, napi_default, nullptr}, {"unbindNode", nullptr, PluginManager::UnbindNode, nullptr, nullptr, nullptr, napi_default, nullptr}, {"setFrameRate", nullptr, PluginManager::SetFrameRate, nullptr, nullptr, nullptr, napi_default, nullptr}, {"setNeedSoftKeyboard", nullptr, PluginManager::SetNeedSoftKeyboard, nullptr, nullptr, nullptr, napi_default, nullptr}, + // [StartExclude napi_init_part] {"initialize", nullptr, PluginManager::Initialize, nullptr, nullptr, nullptr, napi_default, nullptr}, {"finalize", nullptr, PluginManager::Finalize, nullptr, nullptr, nullptr, napi_default, nullptr}, {"drawStar", nullptr, PluginManager::DrawStar, nullptr, nullptr, nullptr, napi_default, nullptr}, + // [EndExclude napi_init] + // [EndExclude napi_init_part] }; if (napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc) != napi_ok) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Init", "napi_define_properties failed"); return nullptr; } - + // [StartExclude napi_init] PluginManager::GetInstance()->Export(env, exports); + // [EndExclude napi_init] return exports; } EXTERN_C_END +// 编写接口的描述信息,根据实际需要可以修改对应参数 static napi_module nativerenderModule = { .nm_version = 1, .nm_flags = 0, .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "nativerender", + // 入口函数 + .nm_register_func = Init, // 指定加载对应模块时的回调函数 + // 模块名称 + .nm_modname = "nativerender", // 指定模块名称,对于XComponent相关开发,这个名称必须和ArkTS侧XComponent中libraryname的值保持一致 .nm_priv = ((void*)0), .reserved = { 0 } }; +// __attribute__((constructor))修饰的方法由系统自动调用,使用Node-API接口napi_module_register()传入模块描述信息进行模块注册 extern "C" __attribute__((constructor)) void RegisterModule(void) { napi_module_register(&nativerenderModule); } } // namespace NativeXComponentSample +// [End napi_init] +// [End napi_init_part] diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLConst.h b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLConst.h index 898610fb6961e8b788a2f50fb544afb53e0ffa2a..b0739f5a3c86f1c1be10ea155ef8c13c8e396328 100644 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLConst.h +++ b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLConst.h @@ -15,6 +15,8 @@ #ifndef NATIVEXCOMPONENT_EGLCONST_H #define NATIVEXCOMPONENT_EGLCONST_H +// [Start egl_const_h] +// EGLConst.h #include #include #include @@ -22,65 +24,66 @@ const unsigned int LOG_PRINT_DOMAIN = 0xFF00; /** - * Program error. + * Program 错误 */ const GLuint PROGRAM_ERROR = 0; /** - * Position error. + * 位置错误。 */ const GLint POSITION_ERROR = -1; /** - * Default x position. + * 默认x坐标。 */ const int DEFAULT_X_POSITION = 0; /** - * Default y position. + * 默认y坐标。 */ const int DEFAULT_Y_POSITION = 0; /** - * Gl red default. + * Gl 红色默认值。 */ const GLfloat GL_RED_DEFAULT = 0.0; /** - * Gl green default. + * Gl 绿色默认值。 */ const GLfloat GL_GREEN_DEFAULT = 0.0; /** - * Gl blue default. + * Gl 蓝色默认值。 */ const GLfloat GL_BLUE_DEFAULT = 0.0; /** - * Gl alpha default. + * Gl 透明度。 */ const GLfloat GL_ALPHA_DEFAULT = 1.0; /** - * Pointer size. + * Pointer 数量。 */ const GLint POINTER_SIZE = 2; /** - * Triangle fan size. + * Triangle fan 尺寸。 */ const GLsizei TRIANGLE_FAN_SIZE = 4; /** - * Fifty percent. + * 50%。 */ const float FIFTY_PERCENT = 0.5; /** - * Position handle name. + * 位置句柄名字。 */ const char POSITION_NAME[] = "a_position"; +// [StartExclude egl_const_h] /** * numeric value 0. */ @@ -90,43 +93,46 @@ const int NUM_0 = 0; * numeric value 4. */ const int NUM_4 = 4; +// [EndExclude egl_const_h] /** - * Background color #f4f4f4. + * 背景色 #f4f4f4. */ const GLfloat BACKGROUND_COLOR[] = {244.0f / 255, 244.0f / 255, 244.0f / 255, 1.0f}; +// [StartExclude egl_const_h] /** * Background color #ffffff00. */ const GLfloat TRANSPARENT_COLOR[] = {255.0f / 255, 255.0f / 255, 255.0f / 255, 0.0f}; +// [EndExclude egl_const_h] /** - * Draw color #7E8FFB. + * Draw 颜色 #7E8FFB. */ const GLfloat DRAW_COLOR[] = {126.0f / 255, 143.0f / 255, 251.0f / 255, 1.0f}; /** - * Change color #92D6CC. + * Change 颜色 #92D6CC. */ const GLfloat CHANGE_COLOR[] = {146.0f / 255, 214.0f / 255, 204.0f / 255, 1.0f}; /** - * Background area. + * 背景区域。 */ const GLfloat BACKGROUND_RECTANGLE_VERTICES[] = {-1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f}; const EGLint ATTRIB_LIST[] = { - // Key,value. + // 键,值。 EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_ALPHA_SIZE, 8, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - // End. + // 结束。 EGL_NONE}; const EGLint CONTEXT_ATTRIBS[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE}; /** - * Vertex shader. + * 顶点着色器 */ const char VERTEX_SHADER[] = "#version 300 es\n" "layout(location = 0) in vec4 a_position;\n" @@ -139,7 +145,7 @@ const char VERTEX_SHADER[] = "#version 300 es\n" "} \n"; /** - * Fragment shader. + * 片元着色器。 */ const char FRAGMENT_SHADER[] = "#version 300 es\n" "precision mediump float; \n" @@ -149,4 +155,5 @@ const char FRAGMENT_SHADER[] = "#version 300 es\n" "{ \n" " fragColor = v_color; \n" "} \n"; +// [End egl_const_h] #endif // NATIVEXCOMPONENT_EGLCONST_H diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLRender.cpp b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLRender.cpp index f82795fc79e40b56fb40674430c0e8f34e62fd68..bc7fd2607875f15b650dd109e05a54939b28c8df 100644 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLRender.cpp +++ b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLRender.cpp @@ -12,7 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +// [Start egl_render] +// EGLRender.cpp #include "EGLRender.h" #include "EGLConst.h" #include @@ -75,6 +76,7 @@ GLuint LoadShader(GLenum type, const char *shaderSrc) return PROGRAM_ERROR; } +// 创建program GLuint CreateProgram(const char *vertexShader, const char *fragShader) { if ((vertexShader == nullptr) || (fragShader == nullptr)) { @@ -103,7 +105,7 @@ GLuint CreateProgram(const char *vertexShader, const char *fragShader) return PROGRAM_ERROR; } - // The gl function has no return value. + // 该gl函数没有返回值。 glAttachShader(program, vertex); glAttachShader(program, fragment); glLinkProgram(program); @@ -138,7 +140,7 @@ bool EGLRender::SetUpEGLContext(void *window) { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLRender", "EglContextInit execute"); eglWindow_ = (EGLNativeWindowType)(window); - // Init display. + // 初始化display。 eglDisplay_ = eglGetDisplay(EGL_DEFAULT_DISPLAY); if (eglDisplay_ == EGL_NO_DISPLAY) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "eglGetDisplay: unable to get EGL display"); @@ -151,15 +153,15 @@ bool EGLRender::SetUpEGLContext(void *window) "eglInitialize: unable to get initialize EGL display"); return false; }; - // Select configuration. + // 选择配置。 const EGLint maxConfigSize = 1; EGLint numConfigs; if (!eglChooseConfig(eglDisplay_, ATTRIB_LIST, &eglConfig_, maxConfigSize, &numConfigs)) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "eglChooseConfig: unable to choose configs"); return false; }; - // CreateEnvironment. - // Create surface. + // 创建环境。 + // 创建 Surface。 eglSurface_ = eglCreateWindowSurface(eglDisplay_, eglConfig_, eglWindow_, NULL); if (eglSurface_ == nullptr) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", @@ -171,13 +173,13 @@ bool EGLRender::SetUpEGLContext(void *window) "eglCreateWindowSurface: unable to create surface"); return false; } - // Create context. + // 创建上下文。 eglContext_ = eglCreateContext(eglDisplay_, eglConfig_, EGL_NO_CONTEXT, CONTEXT_ATTRIBS); if (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_)) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "eglMakeCurrent failed"); return false; } - // Create program. + // 创建program。 program_ = CreateProgram(VERTEX_SHADER, FRAGMENT_SHADER); if (program_ == PROGRAM_ERROR) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "CreateProgram: unable to create program"); @@ -194,7 +196,7 @@ GLint EGLRender::PrepareDraw() return POSITION_ERROR; } - // The gl function has no return value. + // 该gl函数没有返回值。 glViewport(DEFAULT_X_POSITION, DEFAULT_Y_POSITION, width_, height_); glClearColor(GL_RED_DEFAULT, GL_GREEN_DEFAULT, GL_BLUE_DEFAULT, GL_ALPHA_DEFAULT); glClear(GL_COLOR_BUFFER_BIT); @@ -203,6 +205,7 @@ GLint EGLRender::PrepareDraw() return glGetAttribLocation(program_, POSITION_NAME); } +// 绘制五角星 void EGLRender::DrawStar(bool drawColor) { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLRender", "Draw"); @@ -212,24 +215,26 @@ void EGLRender::DrawStar(bool drawColor) return; } + // 绘制背景 if (!ExecuteDraw(position, BACKGROUND_COLOR, BACKGROUND_RECTANGLE_VERTICES)) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "Draw execute draw background failed"); return; } - // Divided into five quadrilaterals and calculate one of the quadrilateral's Vertices + // 将其划分为五个四边形,并计算其中一个四边形的顶点 GLfloat rotateX = 0; GLfloat rotateY = FIFTY_PERCENT * height_; GLfloat centerX = 0; - // Convert DEG(54° & 18°) to RAD + // 将角度 54° 和 18° 转换为弧度 GLfloat centerY = -rotateY * (M_PI / 180 * 54) * (M_PI / 180 * 18); - // Convert DEG(18°) to RAD + // 将角度 18° 转换为弧度 GLfloat leftX = -rotateY * (M_PI / 180 * 18); GLfloat leftY = 0; - // Convert DEG(18°) to RAD + // 将角度 18° 转换为弧度 GLfloat rightX = rotateY * (M_PI / 180 * 18); GLfloat rightY = 0; + // 确定绘制四边形的顶点,使用绘制区域的百分比表示 const GLfloat shapeVertices[] = {centerX / width_, centerY / height_, leftX / width_, leftY / height_, rotateX / width_, rotateY / height_, rightX / width_, rightY / height_}; auto color = drawColor ? DRAW_COLOR : CHANGE_COLOR; @@ -238,17 +243,20 @@ void EGLRender::DrawStar(bool drawColor) return; } - // Convert DEG(72°) to RAD + // 将角度 72° 转换为弧度 GLfloat rad = M_PI / 180 * 72; - // Rotate four times + // 旋转四次。 for (int i = NUM_0; i < NUM_4; ++i) { + // 旋转得其他四个四边形的顶点 Rotate2d(centerX, centerY, &rotateX, &rotateY, rad); Rotate2d(centerX, centerY, &leftX, &leftY, rad); Rotate2d(centerX, centerY, &rightX, &rightY, rad); + // 确定绘制四边形的顶点,使用绘制区域的百分比表示 const GLfloat shapeVertices[] = {centerX / width_, centerY / height_, leftX / width_, leftY / height_, rotateX / width_, rotateY / height_, rightX / width_, rightY / height_}; + // 绘制图形 if (!ExecuteDraw(position, color, shapeVertices)) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLRender", "Draw execute draw shape failed"); return; @@ -263,6 +271,7 @@ void EGLRender::DrawStar(bool drawColor) } } +// [StartExclude egl_render] void EGLRender::Clear() { if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (eglContext_ == nullptr) || @@ -279,6 +288,7 @@ void EGLRender::Clear() glFinish(); eglSwapBuffers(eglDisplay_, eglSurface_); } +// [EndExclude egl_render] bool EGLRender::ExecuteDraw(GLint position, const GLfloat *color, const GLfloat shapeVertices[]) { @@ -287,7 +297,7 @@ bool EGLRender::ExecuteDraw(GLint position, const GLfloat *color, const GLfloat return false; } - // The gl function has no return value. + // 该gl函数没有返回值。 glVertexAttribPointer(position, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, shapeVertices); glEnableVertexAttribArray(position); glVertexAttrib4fv(1, color); @@ -303,6 +313,7 @@ void EGLRender::SetEGLWindowSize(int width, int height) height_ = height; } +// 释放相关资源 void EGLRender::DestroySurface() { if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (!eglDestroySurface(eglDisplay_, eglSurface_))) { @@ -319,4 +330,5 @@ void EGLRender::DestroySurface() eglDisplay_ = EGL_NO_DISPLAY; eglSurface_ = EGL_NO_SURFACE; eglContext_ = EGL_NO_CONTEXT; -} \ No newline at end of file +} +// [End egl_render] \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLRender.h b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLRender.h index eeed4f21d33a9e32b989bd45694eccd723a10815..a4b380c7f5e48fd3b7c38c9cd2e10dc93b2fb6c6 100644 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLRender.h +++ b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/EGLRender.h @@ -15,7 +15,8 @@ #ifndef NATIVEXCOMPONENT_EGLRENDER_H #define NATIVEXCOMPONENT_EGLRENDER_H - +// [Start egl_render_h] +// EGLRender.h #include "EGLConst.h" #include #include @@ -29,7 +30,9 @@ public: void SetEGLWindowSize(int width, int height); void DrawStar(bool drawColor); void DestroySurface(); + // [StartExclude egl_render_h] void Clear(); + // [EndExclude egl_render_h] std::string xcomponentId; EGLNativeWindowType eglWindow_; @@ -46,4 +49,5 @@ private: GLint PrepareDraw(); bool ExecuteDraw(GLint position, const GLfloat *color, const GLfloat shapeVertices[]); }; +// [End egl_render_h] #endif // NATIVEXCOMPONENT_EGLRENDER_H diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/egl_core.cpp b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/egl_core.cpp index 7ee82f7ce0bf21ee29ab86d4f823962d9d75c2c9..26079f38563734eeb581014f34171d73d680eb03 100644 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/egl_core.cpp +++ b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/egl_core.cpp @@ -53,31 +53,31 @@ const char FRAGMENT_SHADER[] = "#version 300 es\n" "{ \n" " fragColor = v_color; \n" "} \n"; - +// [Start native_color] /** - * Background color #f4f4f4. + * 绘制背景颜色 #f4f4f4. */ const GLfloat BACKGROUND_COLOR[] = {244.0f / 255, 244.0f / 255, 244.0f / 255, 1.0f}; /** - * Draw color #7E8FFB. + * 绘制图案颜色 #7E8FFB. */ const GLfloat DRAW_COLOR[] = {126.0f / 255, 143.0f / 255, 251.0f / 255, 1.0f}; /** - * Change color #92D6CC. + * 绘制图案改变后的颜色 #92D6CC. */ const GLfloat CHANGE_COLOR[] = {146.0f / 255, 214.0f / 255, 204.0f / 255, 1.0f}; /** - * Background area. + * 绘制背景顶点 */ const GLfloat BACKGROUND_RECTANGLE_VERTICES[] = { -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f}; - +// [End native_color] /** * Get context parameter count. */ @@ -189,24 +189,26 @@ const EGLint CONTEXT_ATTRIBS[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE}; } // namespace +// [Start native_create_context_init] bool EGLCore::EglContextInit(void* window, int width, int height) { + // [StartExclude native_create_context_init] OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "EGLCore", "EglContextInit execute"); if ((window == nullptr) || (width <= 0) || (height <= 0)) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "EglContextInit: param error"); return false; } - + // [EndExclude native_create_context_init] UpdateSize(width, height); eglWindow_ = static_cast(window); - // Init display. + // 初始化display eglDisplay_ = eglGetDisplay(EGL_DEFAULT_DISPLAY); if (eglDisplay_ == EGL_NO_DISPLAY) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglGetDisplay: unable to get EGL display"); return false; } - + // 初始化EGL EGLint majorVersion; EGLint minorVersion; if (!eglInitialize(eglDisplay_, &majorVersion, &minorVersion)) { @@ -215,20 +217,21 @@ bool EGLCore::EglContextInit(void* window, int width, int height) return false; } - // Select configuration. + // 选择配置 const EGLint maxConfigSize = 1; EGLint numConfigs; if (!eglChooseConfig(eglDisplay_, ATTRIB_LIST, &eglConfig_, maxConfigSize, &numConfigs)) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglChooseConfig: unable to choose configs"); return false; } - + // 创建环境 return CreateEnvironment(); } - +// [End native_create_context_init] +// [Start native_create_environment] bool EGLCore::CreateEnvironment() { - // Create surface. + // 创建Surface if (eglWindow_ == nullptr) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglWindow_ is null"); return false; @@ -239,13 +242,13 @@ bool EGLCore::CreateEnvironment() LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglCreateWindowSurface: unable to create surface"); return false; } - // Create context. + // 创建context eglContext_ = eglCreateContext(eglDisplay_, eglConfig_, EGL_NO_CONTEXT, CONTEXT_ATTRIBS); if (!eglMakeCurrent(eglDisplay_, eglSurface_, eglSurface_, eglContext_)) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "eglMakeCurrent failed"); return false; } - // Create program. + // 创建program program_ = CreateProgram(VERTEX_SHADER, FRAGMENT_SHADER); if (program_ == PROGRAM_ERROR) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "CreateProgram: unable to create program"); @@ -253,7 +256,9 @@ bool EGLCore::CreateEnvironment() } return true; } - +// [End native_create_environment] +// [Start native_background] +// 绘制背景颜色 void EGLCore::Background() { GLint position = PrepareDraw(); @@ -273,7 +278,8 @@ void EGLCore::Background() return; } } - +// [End native_background] +// [Start native_draw] void EGLCore::Draw(int& hasDraw) { flag_ = false; @@ -284,13 +290,14 @@ void EGLCore::Draw(int& hasDraw) return; } + // 绘制背景 if (!ExecuteDraw(position, BACKGROUND_COLOR, BACKGROUND_RECTANGLE_VERTICES, sizeof(BACKGROUND_RECTANGLE_VERTICES))) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw background failed"); return; } - // Divided into five quadrilaterals and calculate one of the quadrilateral's Vertices + // 将五角星分为五个四边形,计算其中一个四边形的四个顶点 GLfloat rotateX = 0; GLfloat rotateY = FIFTY_PERCENT * height_; GLfloat centerX = 0; @@ -303,6 +310,7 @@ void EGLCore::Draw(int& hasDraw) GLfloat rightX = rotateY * (M_PI / 180 * 18); GLfloat rightY = 0; + // 确定绘制四边形的顶点,使用绘制区域的百分比表示 const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; @@ -315,19 +323,23 @@ void EGLCore::Draw(int& hasDraw) GLfloat rad = M_PI / 180 * 72; // Rotate four times for (int i = 0; i < NUM_4; ++i) { + // 旋转得其他四个四边形的顶点 Rotate2d(centerX, centerY, &rotateX, &rotateY, rad); Rotate2d(centerX, centerY, &leftX, &leftY, rad); Rotate2d(centerX, centerY, &rightX, &rightY, rad); + // 确定绘制四边形的顶点,使用绘制区域的百分比表示 const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; + // 绘制图形 if (!ExecuteDrawStar(position, DRAW_COLOR, shapeVertices, sizeof(shapeVertices))) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); return; } } + // 结束绘制 if (!FinishDraw()) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw FinishDraw failed"); return; @@ -336,7 +348,8 @@ void EGLCore::Draw(int& hasDraw) flag_ = true; } - +// [End native_draw] +// [Start native_change_color] void EGLCore::ChangeColor(int& hasChangeColor) { if (!flag_) { @@ -349,13 +362,14 @@ void EGLCore::ChangeColor(int& hasChangeColor) return; } + // 绘制背景 if (!ExecuteDraw(position, BACKGROUND_COLOR, BACKGROUND_RECTANGLE_VERTICES, sizeof(BACKGROUND_RECTANGLE_VERTICES))) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ChangeColor execute draw background failed"); return; } - // Divided into five quadrilaterals and calculate one of the quadrilateral's Vertices + // 确定绘制四边形的顶点,使用绘制区域的百分比表示 GLfloat rotateX = 0; GLfloat rotateY = FIFTY_PERCENT * height_; GLfloat centerX = 0; @@ -368,9 +382,11 @@ void EGLCore::ChangeColor(int& hasChangeColor) GLfloat rightX = rotateY * (M_PI / 180 * 18); GLfloat rightY = 0; + // 确定绘制四边形的顶点,使用绘制区域的百分比表示 const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; + // 使用新的颜色绘制 if (!ExecuteDrawNewStar(0, CHANGE_COLOR, shapeVertices, sizeof(shapeVertices))) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); return; @@ -380,24 +396,30 @@ void EGLCore::ChangeColor(int& hasChangeColor) GLfloat rad = M_PI / 180 * 72; // Rotate four times for (int i = 0; i < NUM_4; ++i) { + // 旋转得其他四个四边形的顶点 Rotate2d(centerX, centerY, &rotateX, &rotateY, rad); Rotate2d(centerX, centerY, &leftX, &leftY, rad); Rotate2d(centerX, centerY, &rightX, &rightY, rad); + // 确定绘制四边形的顶点,使用绘制区域的百分比表示 const GLfloat shapeVertices[] = { centerX / width_, centerY / height_, leftX / width_, leftY / height_, rotateX / width_, rotateY / height_, rightX / width_, rightY / height_ }; + // 使用新的颜色绘制 if (!ExecuteDrawNewStar(position, CHANGE_COLOR, shapeVertices, sizeof(shapeVertices))) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Draw execute draw shape failed"); return; } } + // 结束绘制 if (!FinishDraw()) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "ChangeColor FinishDraw failed"); } hasChangeColor = 1; } - +// [StartExclude native_change_color] +// [Start native_prepare_draw] +// 绘前准备,获取position,创建成功时position值从0开始 GLint EGLCore::PrepareDraw() { if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (eglContext_ == nullptr) || @@ -406,7 +428,7 @@ GLint EGLCore::PrepareDraw() return POSITION_ERROR; } - // The gl function has no return value. + // 该gl函数没有返回值。 glViewport(DEFAULT_X_POSITION, DEFAULT_Y_POSITION, width_, height_); glClearColor(GL_RED_DEFAULT, GL_GREEN_DEFAULT, GL_BLUE_DEFAULT, GL_ALPHA_DEFAULT); glClear(GL_COLOR_BUFFER_BIT); @@ -414,7 +436,9 @@ GLint EGLCore::PrepareDraw() return glGetAttribLocation(program_, POSITION_NAME); } - +// [End native_prepare_draw] +// [Start native_execute_draw] +// 依据传入参数在指定区域绘制指定颜色 bool EGLCore::ExecuteDraw(GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize) { if ((position > 0) || (color == nullptr) || (vertSize / sizeof(shapeVertices[0])) != SHAPE_VERTICES_SIZE) { @@ -422,7 +446,7 @@ bool EGLCore::ExecuteDraw(GLint position, const GLfloat* color, const GLfloat sh return false; } - // The gl function has no return value. + // 该gl函数没有返回值。 glVertexAttribPointer(position, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, shapeVertices); glEnableVertexAttribArray(position); glVertexAttrib4fv(1, color); @@ -431,7 +455,7 @@ bool EGLCore::ExecuteDraw(GLint position, const GLfloat* color, const GLfloat sh return true; } - +// [End native_execute_draw] bool EGLCore::ExecuteDrawStar( GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize) { @@ -452,7 +476,7 @@ bool EGLCore::ExecuteDrawStar( return true; } - +// [EndExclude native_change_color] bool EGLCore::ExecuteDrawNewStar( GLint position, const GLfloat* color, const GLfloat shapeVertices[], unsigned long vertSize) { @@ -461,7 +485,7 @@ bool EGLCore::ExecuteDrawNewStar( return false; } - // The gl function has no return value. + // 该gl函数没有返回值。 glVertexAttribPointer(position, POINTER_SIZE, GL_FLOAT, GL_FALSE, 0, shapeVertices); glEnableVertexAttribArray(position); glVertexAttrib4fv(1, color); @@ -470,7 +494,7 @@ bool EGLCore::ExecuteDrawNewStar( return true; } - +// [End native_change_color] void EGLCore::Rotate2d(GLfloat centerX, GLfloat centerY, GLfloat* rotateX, GLfloat* rotateY, GLfloat theta) { GLfloat tempX = cos(theta) * (*rotateX - centerX) - sin(theta) * (*rotateY - centerY); @@ -478,15 +502,17 @@ void EGLCore::Rotate2d(GLfloat centerX, GLfloat centerY, GLfloat* rotateX, GLflo *rotateX = tempX + centerX; *rotateY = tempY + centerY; } - +// [Start native_finish_draw] +// 结束绘制操作 bool EGLCore::FinishDraw() { - // The gl function has no return value. + // 强制刷新缓冲 glFlush(); glFinish(); return eglSwapBuffers(eglDisplay_, eglSurface_); } - +// [End native_finish_draw] +// [Start native_load_shader] GLuint EGLCore::LoadShader(GLenum type, const char* shaderSrc) { if ((type <= 0) || (shaderSrc == nullptr)) { @@ -500,7 +526,7 @@ GLuint EGLCore::LoadShader(GLenum type, const char* shaderSrc) return PROGRAM_ERROR; } - // The gl function has no return value. + // 该gl函数没有返回值。 glShaderSource(shader, 1, &shaderSrc, nullptr); glCompileShader(shader); @@ -528,7 +554,8 @@ GLuint EGLCore::LoadShader(GLenum type, const char* shaderSrc) glDeleteShader(shader); return PROGRAM_ERROR; } - +// [End native_load_shader] +// [Start native_create_program] GLuint EGLCore::CreateProgram(const char* vertexShader, const char* fragShader) { if ((vertexShader == nullptr) || (fragShader == nullptr)) { @@ -557,7 +584,7 @@ GLuint EGLCore::CreateProgram(const char* vertexShader, const char* fragShader) return PROGRAM_ERROR; } - // The gl function has no return value. + // 该gl函数没有返回值。 glAttachShader(program, vertex); glAttachShader(program, fragment); glLinkProgram(program); @@ -586,28 +613,33 @@ GLuint EGLCore::CreateProgram(const char* vertexShader, const char* fragShader) glDeleteProgram(program); return PROGRAM_ERROR; } - +// [End native_create_program] +// [Start native_update_size] void EGLCore::UpdateSize(int width, int height) { + // width_和height_在头文件中定义 width_ = width; height_ = height; if (width_ > 0) { widthPercent_ = FIFTY_PERCENT * height_ / width_; } } - +// [End native_update_size] +// [Start native_release] void EGLCore::Release() { + // 释放Surface if ((eglDisplay_ == nullptr) || (eglSurface_ == nullptr) || (!eglDestroySurface(eglDisplay_, eglSurface_))) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglDestroySurface failed"); } - + // 释放context if ((eglDisplay_ == nullptr) || (eglContext_ == nullptr) || (!eglDestroyContext(eglDisplay_, eglContext_))) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglDestroyContext failed"); } - + // 释放display if ((eglDisplay_ == nullptr) || (!eglTerminate(eglDisplay_))) { OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "EGLCore", "Release eglTerminate failed"); } } +// [End native_release] } // namespace NativeXComponentSample diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/plugin_render.cpp b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/plugin_render.cpp index 8b3ee120c674d83e2a9b3ff208294ccefa6617b4..8ead17f992388a0f0ec913eb625f744eb3ca1d9a 100644 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/plugin_render.cpp +++ b/ArkUIKit/NativeXComponentSample/entry/src/main/cpp/render/plugin_render.cpp @@ -33,7 +33,7 @@ void OnSurfaceCreatedCB(OH_NativeXComponent* component, void* window) LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Callback", "OnSurfaceCreatedCB: component or window is null"); return; } - + char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' }; uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1; if (OH_NativeXComponent_GetXComponentId(component, idStr, &idSize) != OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { @@ -380,7 +380,7 @@ void PluginRender::OnTouchEvent(OH_NativeXComponent* component, void* window) OH_NativeXComponent_GetTouchEventSourceType(component, pointId, &sourceType); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OnTouchEvent", "touch info: toolType = %{public}d, tiltX = %{public}lf, tiltY = %{public}lf", toolType, tiltX, tiltY); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OnTouchEvent", + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "OnTouchEvent", "touch info: max_touch_points_number = %{public}d", OH_MAX_TOUCH_POINTS_NUMBER); bool isshowSample = 0; if (isshowSample == 1) { diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageOne.ets b/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageOne.ets index 99a1dddbcb38addeb3d44ccaf7fe7e6a580e50a3..b305cc14a8bcbea1d036c9ef03a1f9cc2ddb216d 100644 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageOne.ets +++ b/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageOne.ets @@ -12,19 +12,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +// [Start page_one] import nativeNode from 'libnativerender.so'; import {NodeContent} from '@kit.ArkUI'; +// [StartExclude page_one] @Builder export function PageOneBuilder(name: string, param: Object){ PageOne() } +// [EndExclude page_one] @Component export struct PageOne { @State currentStatus: string = 'init'; private nodeContent: NodeContent = new NodeContent(); aboutToAppear():void{ + // 通过C-API创建节点,并添加到管理器nodeContent上 nativeNode.createNativeNode(this.nodeContent,'CreatNativeNode'); } @@ -45,6 +48,7 @@ export struct PageOne { .height(56) Column({ space: 10 }) { + // 显示nodeContent管理器里存放的Native侧的组件 ContentSlot(this.nodeContent); Column().height(20) Text(this.currentStatus) @@ -53,6 +57,7 @@ export struct PageOne { } .onClick(() => { let hasChangeColor: boolean = false; + // 获取当前绘制内容状态 if (nativeNode.getStatus()) { hasChangeColor = nativeNode.getStatus().hasChangeColor; } @@ -74,8 +79,10 @@ export struct PageOne { .fontWeight(500) .margin({ bottom: 24 }) .onClick(() => { + // 调用drawPattern绘制内容 nativeNode.drawPattern(); let hasDraw: boolean = false; + // 获取当前绘制内容状态 if (nativeNode.getStatus()) { hasDraw = nativeNode.getStatus().hasDraw; } @@ -95,4 +102,5 @@ export struct PageOne { .height('100%') } } -} \ No newline at end of file +} +// [End page_one] \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageThree.ets b/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageThree.ets index 0cb210d1a4c3fddb6a495ab3921beb13474e5232..eb4acc54f8d7ca808bb07e32cc8a597998694bfa 100644 --- a/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageThree.ets +++ b/ArkUIKit/NativeXComponentSample/entry/src/main/ets/pages/PageThree.ets @@ -12,7 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start page_three] import native from 'libnativerender.so'; +// [StartExclude page_three] import { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; class MyNodeController extends NodeController { @@ -64,6 +66,7 @@ class MyNodeController extends NodeController { export function PageThreeBuilder(name: string, param: Object){ PageThree() } +// [EndExclude page_three] @Component export struct PageThree { @State isShow: boolean = true; @@ -170,6 +173,7 @@ export struct PageThree { left: 12, right: 12 }) + // [StartExclude page_three] Button('Initialize') .onClick(()=>{ native.initialize(this.myNodeController.xComponentId) @@ -190,8 +194,10 @@ export struct PageThree { left: 12, right: 12 }) + // [EndExclude page_three] } .width('100%') } } -} \ No newline at end of file +} +// [End page_three] \ No newline at end of file diff --git a/ArkUIKit/NativeXComponentSample/entry/src/main/syscap.json b/ArkUIKit/NativeXComponentSample/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..598552fb33d0f5c27fed37e607d9163f836ac5af --- /dev/null +++ b/ArkUIKit/NativeXComponentSample/entry/src/main/syscap.json @@ -0,0 +1,24 @@ + +{ + "devices": { + "general": [ + "default" + ] + }, + "production": { + "removedSysCaps": [ + "SystemCapability.HiviewDFX.HiDumper", + "SystemCapability.Security.DeviceAuth", + "SystemCapability.Multimedia.Media.AVTranscoder", + "SystemCapability.Tee.TeeClient", + "SystemCapability.Communication.Bluetooth.Core", + "SystemCapability.ArkUi.Graphics3D", + "SystemCapability.DistributedHardware.DeviceManager", + "SystemCapability.Multimedia.Drm.Core", + "SystemCapability.Advertising.Ads", + "SystemCapability.Customization.EnterpriseDeviceManager", + "SystemCapability.Security.DeviceSecurityLevel", + "SystemCapability.UserIAM.UserAuth.PinAuth" + ] + } +} diff --git a/ArkUIKit/Navigation/entry/src/main/ets/pages/pageRouter/jumpPage/Index.ets b/ArkUIKit/Navigation/entry/src/main/ets/pages/pageRouter/jumpPage/Index.ets index 53e431c7eb7abe95a2fc5ed1ec8f3c5d2307401a..9f2cba5db26f1ed4bf669ea5960608a13f4fc17c 100644 --- a/ArkUIKit/Navigation/entry/src/main/ets/pages/pageRouter/jumpPage/Index.ets +++ b/ArkUIKit/Navigation/entry/src/main/ets/pages/pageRouter/jumpPage/Index.ets @@ -19,7 +19,7 @@ import { DOMAIN, TAG } from '../../common/Common'; @Entry @Component struct Index { - // [Start home_click] + // [Start jump_click] // 在Home页面中 onJumpClick(): void { this.getUIContext().getRouter().pushUrl({ @@ -32,7 +32,7 @@ struct Index { hilog.info(DOMAIN, TAG,'Invoke pushUrl succeeded.'); }); } - // [End home_click] + // [End jump_click] @State message: string = 'Home Page'; diff --git a/ArkUIKit/Navigation/entry/src/main/ets/pages/pageRouter/lifeCycle/Page.ets b/ArkUIKit/Navigation/entry/src/main/ets/pages/pageRouter/lifeCycle/Page.ets index 36e26e2106e057dc2b923d49b091e4a53709d4de..b4e88716ea8a159668e6a2508923165103fe58b4 100644 --- a/ArkUIKit/Navigation/entry/src/main/ets/pages/pageRouter/lifeCycle/Page.ets +++ b/ArkUIKit/Navigation/entry/src/main/ets/pages/pageRouter/lifeCycle/Page.ets @@ -57,4 +57,4 @@ struct Page { .width('100%') } } -// [Start life_page] \ No newline at end of file +// [End life_page] \ No newline at end of file diff --git a/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Index.ets b/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Index.ets index b8115628561ac9c43cd793496ba04d4fefaa5027..d40848bb4b41be0443a297b0747276558423d48a 100644 --- a/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Index.ets +++ b/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Index.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -// [Start router_page_one] +// [Start router_index] // Index.ets import { router } from '@kit.ArkUI'; import { hilog } from '@kit.PerformanceAnalysisKit'; @@ -123,4 +123,4 @@ struct Index { .height('100%') } } -// [End router_page_one] \ No newline at end of file +// [End router_index] \ No newline at end of file diff --git a/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Router2.ets b/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Router2.ets index 822225acacb866ef5eac0ef39b7a1ad1810ac50f..516645c7274ffe3aa865a2269bbe930251d5fa55 100644 --- a/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Router2.ets +++ b/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Router2.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -// [Start router_index] +// [Start router_2] @Entry @Component export struct PageOne { @@ -28,4 +28,4 @@ export struct PageOne { }) } } -// [End router_index] \ No newline at end of file +// [End router_2] \ No newline at end of file diff --git a/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Router3.ets b/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Router3.ets index eb0e49b54098a2531bab32c9b0609276d580aab8..84b8c418a0cd8b3ff409624a48887d27c64d8bc5 100644 --- a/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Router3.ets +++ b/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Router3.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -// [Start router_index] +// [Start router_3] @Entry @Component struct Index { @@ -45,4 +45,4 @@ export struct PageOne { .title('PageOne') } } -// [End router_index] \ No newline at end of file +// [End router_3] \ No newline at end of file diff --git a/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Router4.ets b/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Router4.ets index 7b0fda806416a6a02442c60061cdd115d6be0e4b..8a851c98b3be78d0069f5a329945e17930ea9a95 100644 --- a/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Router4.ets +++ b/ArkUIKit/Navigation/entry/src/main/ets/pages/routerToNavigation/router/Router4.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -// [Start router_index] +// [Start router_4] // 子页面中的自定义组件 @Entry @Component @@ -37,4 +37,4 @@ struct CustomNode { } } } -// [End router_index] \ No newline at end of file +// [End router_4] \ No newline at end of file diff --git a/ArkUIKit/NdkGestureSetting/screenshots/device/image1.jpeg b/ArkUIKit/NdkGestureSetting/screenshots/device/image1.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..e1c07bfdb910d2866d6edc7a1c0e4cd3383d5d47 Binary files /dev/null and b/ArkUIKit/NdkGestureSetting/screenshots/device/image1.jpeg differ diff --git a/ArkUIKit/NdkInputEvent/entry/build-profile.json5 b/ArkUIKit/NdkInputEvent/entry/build-profile.json5 index fea31f4580540c7c560b62bf531292c471c410f1..471250ade0685f26d9ed6c8fb7761e0f0882c8ec 100644 --- a/ArkUIKit/NdkInputEvent/entry/build-profile.json5 +++ b/ArkUIKit/NdkInputEvent/entry/build-profile.json5 @@ -20,7 +20,7 @@ "path": "./src/main/cpp/CMakeLists.txt", "arguments": "", "cppFlags": "", - "abiFilters": ["arm64-v8a", "x86_64"] + "abiFilters": ["arm64-v8a", "x86_64", "armeabi-v7a"] } }, "buildOptionSet": [ diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/common.h b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/common.h index 8dc603fe057c31515105088f23e7a450b7811fa4..7ce97f909edfced0da44bd9dedff10c512f1ce77 100644 --- a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/common.h +++ b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/common.h @@ -19,8 +19,8 @@ #include "container.h" #include #include -#include #include +#include #define DEFAULT_WIDTH 200.0 #define DEFAULT_HEIGHT 200.0 @@ -31,7 +31,12 @@ #define DEFAULT_BORDER_COLOR 0xFF000000 #define DEFAULT_RADIUS 10.0 -#define SIZE_200 200 +#define BUTTON_WIDTH_S 0.3 +#define BUTTON_WIDTH_L 0.55 + +#define SIZE_50 50 +#define SIZE_80 80 +#define SIZE_100 100 #define SIZE_300 300 #define BLANK_10 10.0 @@ -46,14 +51,6 @@ namespace NativeXComponentSample { ArkUI_NativeNodeAPI_1 *nodeAPI = nullptr; ArkUI_ContextHandle context; -enum ArkUIModifierKeyName { - ARKUI_MODIFIER_KEY_CTRL = 1 << 0, // Ctrl 键 - ARKUI_MODIFIER_KEY_SHIFT = 1 << 1, // Shift 键 - ARKUI_MODIFIER_KEY_ALT = 1 << 2, // Alt 键 - ARKUI_MODIFIER_KEY_FN = 1 << 3 // Fn 键(如适用) -}; - -std::stringstream g_ss; void SetWidth(ArkUI_NodeHandle &node, float width = DEFAULT_WIDTH) { @@ -171,15 +168,6 @@ void SetText(ArkUI_NodeHandle &node, const char *str, float size = DEFAULT_TEXT_ nodeAPI->setAttribute(node, NODE_TEXT_FONT, &fontItem); } -void SetImageSrc(ArkUI_NodeHandle &node, const char *src) -{ - if (!nodeAPI) { - return; - } - ArkUI_AttributeItem imageSrcItem = {.string = src}; - nodeAPI->setAttribute(node, NODE_IMAGE_SRC, &imageSrcItem); -} - void SetCommonAttribute(ArkUI_NodeHandle &node, float width = DEFAULT_WIDTH, float height = DEFAULT_HEIGHT, unsigned int color = DEFAULT_BG_COLOR, float margin = DEFAULT_MARGIN) { @@ -249,6 +237,16 @@ void SetRowAlignItem(ArkUI_NodeHandle &node, int32_t alignment) nodeAPI->setAttribute(node, NODE_ROW_ALIGN_ITEMS, &alignItem); } +void SetHitTestMode(ArkUI_NodeHandle &node, int32_t mode) +{ + if (!nodeAPI) { + return; + } + ArkUI_NumberValue modeValue[] = {{.i32 = mode}}; + ArkUI_AttributeItem modeItem = {modeValue, 1}; + nodeAPI->setAttribute(node, NODE_HIT_TEST_BEHAVIOR, &modeItem); +} + void SetButtonLabel(ArkUI_NodeHandle &node, const char *label) { if (!nodeAPI) { diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/function.h b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/function.h index 137c8db9310141eaba8220fbce924ea7cdaf9563..d91ca70be33608a5b21dcddc4ae1f6eb94c929c8 100644 --- a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/function.h +++ b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/function.h @@ -16,8 +16,8 @@ #ifndef NDKINPUTEVENT_FUNCTION_H #define NDKINPUTEVENT_FUNCTION_H -#include "common.h" #include "container.h" +#include "infos.h" #include #include #include @@ -26,240 +26,190 @@ namespace NativeXComponentSample { -ArkUI_NodeHandle column1; -ArkUI_NodeHandle infoText = nullptr; -ArkUI_NodeHandle titleText = nullptr; - -void PrintMultiHistoryInfos(ArkUI_UIInputEvent* inputEvent, uint32_t pointerIndex) -{ - auto size = OH_ArkUI_PointerEvent_GetHistorySize(inputEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "%{public}d: historySize = %{public}d", pointerIndex, size); - for (int historyIndex = 0; historyIndex < size; historyIndex++) { - auto time = OH_ArkUI_PointerEvent_GetHistoryEventTime(inputEvent, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyEventTime = %{public}ld", time); - auto pointerCount = OH_ArkUI_PointerEvent_GetHistoryPointerCount(inputEvent, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyPointerCount = %{public}d", pointerCount); - auto pointerId = OH_ArkUI_PointerEvent_GetHistoryPointerId(inputEvent, pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyPointerId = %{public}d", pointerId); - auto historyX = OH_ArkUI_PointerEvent_GetHistoryX(inputEvent, pointerIndex, historyIndex); - auto historyY = OH_ArkUI_PointerEvent_GetHistoryY(inputEvent, pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyX/Y = %{public}f/%{public}f", historyX, historyY); - auto historyWindowX = OH_ArkUI_PointerEvent_GetHistoryWindowX(inputEvent, pointerIndex, historyIndex); - auto historyWindowY = OH_ArkUI_PointerEvent_GetHistoryWindowY(inputEvent, pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyWindowX/Y = %{public}f/%{public}f", historyWindowX, historyWindowY); - auto historyDisplayX = OH_ArkUI_PointerEvent_GetHistoryDisplayX(inputEvent, pointerIndex, historyIndex); - auto historyDisplayY = OH_ArkUI_PointerEvent_GetHistoryDisplayY(inputEvent, pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyDisplayX/Y = %{public}f/%{public}f", historyDisplayX, historyDisplayY); - auto historyGlobalDisplayX = OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayX(inputEvent, - pointerIndex, historyIndex); - auto historyGlobalDisplayY = OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayY(inputEvent, - pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyGlobalDisplayX/Y = %{public}f/%{public}f", historyGlobalDisplayX, historyGlobalDisplayY); - auto historyPressure = OH_ArkUI_PointerEvent_GetHistoryPressure(inputEvent, pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyPressure = %{public}f", historyPressure); - auto historyTiltX = OH_ArkUI_PointerEvent_GetHistoryTiltX(inputEvent, pointerIndex, historyIndex); - auto historyTiltY = OH_ArkUI_PointerEvent_GetHistoryTiltY(inputEvent, pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyTiltX/Y = %{public}f/%{public}f", historyTiltX, historyTiltY); - auto historyTouchAreaWidth = OH_ArkUI_PointerEvent_GetHistoryTouchAreaWidth(inputEvent, - pointerIndex, historyIndex); - auto historyTouchAreaHeight = OH_ArkUI_PointerEvent_GetHistoryTouchAreaHeight(inputEvent, - pointerIndex, historyIndex); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "historyTouchAreaWidth/Height = %{public}f/%{public}f", historyTouchAreaWidth, historyTouchAreaHeight); - } -} - -void ShowMultiInfos(ArkUI_UIInputEvent* inputEvent) -{ - g_ss.str(""); - uint32_t pointerIndex = 0; - OH_ArkUI_PointerEvent_GetChangedPointerId(inputEvent, &pointerIndex); - g_ss << "pointerIndex: " << pointerIndex << std::endl; - auto id = OH_ArkUI_PointerEvent_GetPointerId(inputEvent, pointerIndex); - g_ss << "pointerId: " << id << std::endl; - auto pressedTime = OH_ArkUI_PointerEvent_GetPressedTimeByIndex(inputEvent, pointerIndex); - g_ss << "pressedTime: " << pressedTime << std::endl; - auto x = OH_ArkUI_PointerEvent_GetXByIndex(inputEvent, pointerIndex); - auto y = OH_ArkUI_PointerEvent_GetYByIndex(inputEvent, pointerIndex); - g_ss << "x/y: " << x << "/" << y << std::endl; - auto windowX = OH_ArkUI_PointerEvent_GetWindowXByIndex(inputEvent, pointerIndex); - auto windowY = OH_ArkUI_PointerEvent_GetWindowYByIndex(inputEvent, pointerIndex); - g_ss << "windowX/Y: " << windowX << "/" << windowY << std::endl; - auto displayX = OH_ArkUI_PointerEvent_GetDisplayXByIndex(inputEvent, pointerIndex); - auto displayY = OH_ArkUI_PointerEvent_GetDisplayYByIndex(inputEvent, pointerIndex); - g_ss << "displayX/Y: " << displayX << "/" << displayY << std::endl; - auto globalDisplayX = OH_ArkUI_PointerEvent_GetGlobalDisplayXByIndex(inputEvent, pointerIndex); - auto globalDisplayY = OH_ArkUI_PointerEvent_GetGlobalDisplayYByIndex(inputEvent, pointerIndex); - g_ss << "globalDisplayX/Y: " << globalDisplayX << "/" << globalDisplayY << std::endl; - auto pressure = OH_ArkUI_PointerEvent_GetPressure(inputEvent, pointerIndex); - g_ss << "pressure: " << pressure << std::endl; - auto tiltX = OH_ArkUI_PointerEvent_GetTiltX(inputEvent, pointerIndex); - auto tiltY = OH_ArkUI_PointerEvent_GetTiltY(inputEvent, pointerIndex); - g_ss << "tiltX/Y: " << tiltX << "/" << tiltY << std::endl; - ArkUI_InteractionHand hand; - OH_ArkUI_PointerEvent_GetInteractionHandByIndex(inputEvent, pointerIndex, &hand); - if (hand == ARKUI_EVENT_HAND_LEFT) { - g_ss << "hand: LEFT" << std::endl; - } else if (hand == ARKUI_EVENT_HAND_RIGHT) { - g_ss << "hand: RIGHT" << std::endl; - } else { - g_ss << "hand: NONE" << std::endl; - } - auto touchAreaWidth = OH_ArkUI_PointerEvent_GetTouchAreaWidth(inputEvent, pointerIndex); - auto touchAreaHeight = OH_ArkUI_PointerEvent_GetTouchAreaHeight(inputEvent, pointerIndex); - g_ss << "touchAreaWidth/Height: " << touchAreaWidth << "/" << touchAreaHeight << std::endl; - SetText(infoText, g_ss.str().c_str(), TEXT_FONT_SIZE_15); - PrintMultiHistoryInfos(inputEvent, pointerIndex); -} - -void ShowSimplePosInfo(ArkUI_UIInputEvent *inputEvent) -{ - auto x = OH_ArkUI_PointerEvent_GetX(inputEvent); - auto y = OH_ArkUI_PointerEvent_GetY(inputEvent); - g_ss << "x/y: " << x << "/" << y << std::endl; - auto windowX = OH_ArkUI_PointerEvent_GetWindowX(inputEvent); - auto windowY = OH_ArkUI_PointerEvent_GetWindowY(inputEvent); - g_ss << "windowX/Y: " << windowX << "/" << windowY << std::endl; - auto displayX = OH_ArkUI_PointerEvent_GetDisplayX(inputEvent); - auto displayY = OH_ArkUI_PointerEvent_GetDisplayY(inputEvent); - g_ss << "displayX/Y: " << displayX << "/" << displayY << std::endl; - auto globalDisplayX = OH_ArkUI_PointerEvent_GetGlobalDisplayX(inputEvent); - auto globalDisplayY = OH_ArkUI_PointerEvent_GetGlobalDisplayY(inputEvent); - g_ss << "globalDisplayX/Y: " << globalDisplayX << "/" << globalDisplayY << std::endl; -} - -void ShowSimpleTarInfo(ArkUI_UIInputEvent *inputEvent) -{ - auto targetWidth = OH_ArkUI_UIInputEvent_GetEventTargetWidth(inputEvent); - g_ss << "targetWidth: " << targetWidth << std::endl; - auto targetHeight = OH_ArkUI_UIInputEvent_GetEventTargetHeight(inputEvent); - g_ss << "targetHeight: " << targetHeight << std::endl; - auto positionX = OH_ArkUI_UIInputEvent_GetEventTargetPositionX(inputEvent); - auto positionY = OH_ArkUI_UIInputEvent_GetEventTargetPositionY(inputEvent); - g_ss << "targetPositionX/Y: " << positionX << "/" << positionY << std::endl; - auto globalPositionX = OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionX(inputEvent); - auto globalPositionY = OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionY(inputEvent); - g_ss << "targetGlobalPositionX/Y: " << globalPositionX << "/" << globalPositionY << std::endl; -} - -void ShowSimpleInfo(ArkUI_UIInputEvent* inputEvent) +void TouchEventOperator(ArkUI_UIInputEvent* inputEvent, ArkUI_NodeHandle* button) { - g_ss.str(""); - auto displayId = OH_ArkUI_UIInputEvent_GetTargetDisplayId(inputEvent); - g_ss << "displayId: " << displayId << std::endl; - auto eventTime = OH_ArkUI_UIInputEvent_GetEventTime(inputEvent); - g_ss << "eventTime: " << eventTime << std::endl; - // 触摸事件位置信息 - ShowSimplePosInfo(inputEvent); - // 手指触摸事件显示信息 - auto type = OH_ArkUI_UIInputEvent_GetToolType(inputEvent); - if (type == UI_INPUT_EVENT_TOOL_TYPE_FINGER) { - ArkUI_InteractionHand hand; - OH_ArkUI_PointerEvent_GetInteractionHand(inputEvent, &hand); - if (hand == ARKUI_EVENT_HAND_LEFT) { - g_ss << "hand: LEFT" << std::endl; - } else if (hand == ARKUI_EVENT_HAND_RIGHT) { - g_ss << "hand: RIGHT" << std::endl; - } else { - g_ss << "hand: NONE" << std::endl; + auto sourceType = OH_ArkUI_UIInputEvent_GetSourceType(inputEvent); + switch (sourceType) { + case UI_INPUT_EVENT_SOURCE_TYPE_TOUCH_SCREEN: { + TouchScreenEventOperator(inputEvent, button); + break; + } + case UI_INPUT_EVENT_SOURCE_TYPE_MOUSE: + case UI_INPUT_EVENT_SOURCE_TYPE_UNKNOWN: + default: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "TouchEvent is only dispatched in touchscreen scenarios!"); + break; } - } else if (type == UI_INPUT_EVENT_TOOL_TYPE_PEN) { - double rollAngle = 0; - OH_ArkUI_PointerEvent_GetRollAngle(inputEvent, &rollAngle); - g_ss << "rollAngle: " << rollAngle << std::endl; } - // 命中组件信息 - ShowSimpleTarInfo(inputEvent); - SetText(infoText, g_ss.str().c_str(), TEXT_FONT_SIZE_15); } -void PrintClonedEventInfos(ArkUI_UIInputEvent* inputEvent, ArkUI_UIInputEvent* clonedEvent) +void MouseEventOperator(ArkUI_UIInputEvent* inputEvent, ArkUI_NodeHandle *button) { - float x = 0; - float y = 0; - OH_ArkUI_PointerEvent_SetClonedEventLocalPosition(clonedEvent, x, y); - OH_ArkUI_PointerEvent_SetClonedEventActionType(clonedEvent, UI_TOUCH_EVENT_ACTION_DOWN); - OH_ArkUI_PointerEvent_SetClonedEventChangedFingerId(clonedEvent, 0); - if (OH_ArkUI_UIInputEvent_GetLatestStatus() == ARKUI_ERROR_CODE_NO_ERROR) { - OH_ArkUI_PointerEvent_PostClonedEvent(column1, clonedEvent); + if (OH_ArkUI_UIInputEvent_GetToolType(inputEvent) == UI_INPUT_EVENT_TOOL_TYPE_MOUSE) { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "ARKUI_UIINPUTEVENT_TYPE_MOUSE EventReceiver"); + auto action = OH_ArkUI_MouseEvent_GetMouseAction(inputEvent); + auto mouseButton = OH_ArkUI_MouseEvent_GetMouseButton(inputEvent); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "MOUSE BUTTON %{public}d", mouseButton); + if (action == UI_MOUSE_EVENT_ACTION_PRESS && mouseButton == UI_MOUSE_EVENT_BUTTON_MIDDLE) { + return; + } + switch (action) { + case UI_MOUSE_EVENT_ACTION_PRESS: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "UI_MOUSE_EVENT_ACTION_PRESS EventReceiver"); + SetBackgroundColor(*button, 0xFFFF0000); + break; + } + case UI_MOUSE_EVENT_ACTION_MOVE: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "UI_MOUSE_EVENT_ACTION_MOVE EventReceiver"); + g_ss.str(""); + auto rawDeltaX = OH_ArkUI_MouseEvent_GetRawDeltaX(inputEvent); + auto rawDeltaY = OH_ArkUI_MouseEvent_GetRawDeltaY(inputEvent); + g_ss << "rawDeltaX: " << rawDeltaX << std::endl << "rawDeltaY: " << rawDeltaY << std::endl; + SetText(infoText, g_ss.str().c_str(), TEXT_FONT_SIZE_20); + break; + } + case UI_MOUSE_EVENT_ACTION_RELEASE: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "UI_MOUSE_EVENT_ACTION_RELEASE EventReceiver"); + SetBackgroundColor(*button, 0xFF0000FF); + SetBackgroundColor(column1, 0xFFF6F6F6); + break; + } + case UI_MOUSE_EVENT_ACTION_CANCEL: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "UI_MOUSE_EVENT_ACTION_CANCEL EventReceiver"); + break; + } + case UI_MOUSE_EVENT_ACTION_UNKNOWN: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "UI_MOUSE_EVENT_ACTION_UNKNOWN EventReceiver"); + break; + } + default: { + break; + } + } } } -void PrintMultiClonedEventInfos(ArkUI_UIInputEvent* clonedEvent) +void KeyEventOperator(ArkUI_UIInputEvent* inputEvent) { - float x = 0; - float y = 0; - OH_ArkUI_PointerEvent_SetClonedEventLocalPositionByIndex(clonedEvent, x, y, 0); - OH_ArkUI_PointerEvent_SetClonedEventActionType(clonedEvent, UI_TOUCH_EVENT_ACTION_DOWN); - OH_ArkUI_PointerEvent_SetClonedEventFingerIdByIndex(clonedEvent, 0, 0); - if (OH_ArkUI_UIInputEvent_GetLatestStatus() == ARKUI_ERROR_CODE_NO_ERROR) { - OH_ArkUI_PointerEvent_PostClonedEvent(column1, clonedEvent); + SetText(titleText, ""); + SetText(infoText, ""); + auto type = OH_ArkUI_KeyEvent_GetType(inputEvent); + switch (type) { + case ARKUI_KEY_EVENT_DOWN: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "ARKUI_KEY_EVENT_DOWN EventReceiver"); + int32_t pressedKeyCodes[BUTTON_LENGTH] = {}; + int32_t length = BUTTON_LENGTH; + OH_ArkUI_UIInputEvent_GetPressedKeys(inputEvent, pressedKeyCodes, &length); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "pressedKeyCodes = %{public}d", pressedKeyCodes[0]); + auto deviceId = OH_ArkUI_UIInputEvent_GetDeviceId(inputEvent); + uint64_t keys = 0; + OH_ArkUI_UIInputEvent_GetModifierKeyStates(inputEvent, &keys); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "deviceId = %{public}d, keys = %{public}lu", deviceId, keys); + break; + } + case ARKUI_KEY_EVENT_UP: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "ARKUI_KEY_EVENT_UP EventReceiver"); + break; + } + case ARKUI_KEY_EVENT_LONG_PRESS: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "ARKUI_KEY_EVENT_LONG_PRESS EventReceiver"); + break; + } + case ARKUI_KEY_EVENT_CLICK: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "ARKUI_KEY_EVENT_CLICK EventReceiver"); + break; + } + case ARKUI_KEY_EVENT_UNKNOWN: + default: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "ARKUI_KEY_EVENT_UNKNOWN EventReceiver"); + break; + } } } -void BgEventReceiver(ArkUI_NodeHandle& node) +void Bt1EventReceiver(ArkUI_NodeHandle& button) { - nodeAPI->registerNodeEvent(node, NODE_TOUCH_EVENT, 1, &node); - nodeAPI->registerNodeEvent(node, NODE_ON_AXIS, 1, &node); - nodeAPI->addNodeEventReceiver(node, [](ArkUI_NodeEvent *event) { - ArkUI_NodeHandle *node = (ArkUI_NodeHandle *)OH_ArkUI_NodeEvent_GetUserData(event); - SetBackgroundColor(*node, 0xFFFFFF00); + nodeAPI->registerNodeEvent(button, NODE_TOUCH_EVENT, 1, &button); + nodeAPI->registerNodeEvent(button, NODE_ON_MOUSE, 1, &button); + nodeAPI->registerNodeEvent(button, NODE_ON_HOVER_EVENT, 1, &button); + nodeAPI->registerNodeEvent(button, NODE_ON_KEY_EVENT, 1, &button); + nodeAPI->addNodeEventReceiver(button, [](ArkUI_NodeEvent *event) { + auto *inputEvent = OH_ArkUI_NodeEvent_GetInputEvent(event); + auto eventType = OH_ArkUI_UIInputEvent_GetType(inputEvent); + ArkUI_NodeHandle *button = (ArkUI_NodeHandle *)OH_ArkUI_NodeEvent_GetUserData(event); + if (OH_ArkUI_NodeEvent_GetEventType(event) == NODE_ON_HOVER_EVENT) { + auto isHovered = OH_ArkUI_HoverEvent_IsHovered(inputEvent); + if (isHovered) { + SetBackgroundColor(*button, 0xFF009F40); + } else { + SetBackgroundColor(*button, 0xFF0000FF); + } + } else if (OH_ArkUI_NodeEvent_GetEventType(event) == NODE_ON_FOCUS_AXIS) { + OH_ArkUI_FocusAxisEvent_SetStopPropagation(inputEvent, true); + auto abs_x = OH_ArkUI_FocusAxisEvent_GetAxisValue(inputEvent, UI_FOCUS_AXIS_EVENT_ABS_X); + auto abs_y = OH_ArkUI_FocusAxisEvent_GetAxisValue(inputEvent, UI_FOCUS_AXIS_EVENT_ABS_Y); + auto abs_z = OH_ArkUI_FocusAxisEvent_GetAxisValue(inputEvent, UI_FOCUS_AXIS_EVENT_ABS_Z); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "abs_x/abs_y/abs_z = %{public}f/%{public}f/%{public}f", abs_x, abs_y, abs_z); + } + if (eventType == ARKUI_UIINPUTEVENT_TYPE_TOUCH) { + TouchEventOperator(inputEvent, button); + } else if (eventType == ARKUI_UIINPUTEVENT_TYPE_MOUSE) { + auto action = OH_ArkUI_MouseEvent_GetMouseAction(inputEvent); + // 鼠标按键数 + int32_t pressedButtons[BUTTON_LENGTH] = {}; + int32_t length; + OH_ArkUI_MouseEvent_GetPressedButtons(inputEvent, pressedButtons, &length); + g_ss.str(""); + g_ss << "pressedButtonCount: " << length << std::endl << "pressedButtons:" << std::endl; + for (int i = 0; i < length; i++) { + g_ss << MouseButtonNames[pressedButtons[i]] << std::endl; + } + SetText(titleText, g_ss.str().c_str(), TEXT_FONT_SIZE_20); + MouseEventOperator(inputEvent, button); + } else if (eventType == ARKUI_UIINPUTEVENT_TYPE_KEY) { + KeyEventOperator(inputEvent); + } else if (eventType == ARKUI_UIINPUTEVENT_TYPE_UNKNOWN) { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "UNKNOWN UIINPUTEVENT!"); + } }); } -void TouchEventOperator(ArkUI_UIInputEvent* inputEvent, ArkUI_NodeHandle* button) +void ExtraTouchEventOperator(ArkUI_UIInputEvent* inputEvent, ArkUI_NodeHandle* button) { - auto count = OH_ArkUI_PointerEvent_GetPointerCount(inputEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "pointerCount = %{public}d", count); - if (OH_ArkUI_UIInputEvent_GetSourceType(inputEvent) != UI_INPUT_EVENT_SOURCE_TYPE_TOUCH_SCREEN) { - return; - } - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "ARKUI_UIINPUTEVENT_TYPE_TOUCH EventReceiver"); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "ARKUI_UIINPUTEVENT_TYPE_TOUCH EventReceiver"); OH_ArkUI_PointerEvent_SetStopPropagation(inputEvent, true); - ArkUI_UIInputEvent* clonedEvent = nullptr; - OH_ArkUI_PointerEvent_CreateClonedEvent(inputEvent, &clonedEvent); + SetText(titleText, ""); + SetText(infoText, ""); + auto type = OH_ArkUI_UIInputEvent_GetToolType(inputEvent); + auto count = OH_ArkUI_PointerEvent_GetPointerCount(inputEvent); switch (OH_ArkUI_UIInputEvent_GetAction(inputEvent)) { case UI_TOUCH_EVENT_ACTION_DOWN: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_TOUCH_EVENT_ACTION_DOWN EventReceiver"); - SetText(titleText, ""); - if (count == 1) { - SetBackgroundColor(*button, 0xFFFF0000); - PrintClonedEventInfos(inputEvent, clonedEvent); - } else if (count > 1) { - SetBackgroundColor(*button, 0xFF932F60); - PrintMultiClonedEventInfos(clonedEvent); - } + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "UI_TOUCH_EVENT_ACTION_DOWN EventReceiver"); + SetBackgroundColor(*button, 0xFFFF0000); break; } case UI_TOUCH_EVENT_ACTION_MOVE: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_TOUCH_EVENT_ACTION_MOVE EventReceiver"); - if (count == 1) { - ShowSimpleInfo(inputEvent); - } else if (count > 1) { - ShowMultiInfos(inputEvent); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "UI_TOUCH_EVENT_ACTION_MOVE EventReceiver"); + if (type == UI_INPUT_EVENT_TOOL_TYPE_PEN) { + ShowTiltInfos(inputEvent); } break; } case UI_TOUCH_EVENT_ACTION_UP: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_TOUCH_EVENT_ACTION_UP EventReceiver"); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "UI_TOUCH_EVENT_ACTION_UP EventReceiver"); SetBackgroundColor(*button, 0xFF0000FF); - SetBackgroundColor(column1, 0xFFF6F6F6); - OH_ArkUI_PointerEvent_DestroyClonedEvent(clonedEvent); + SetBackgroundColor(column1, 0xFFFFFFFF); break; } default: { @@ -268,24 +218,11 @@ void TouchEventOperator(ArkUI_UIInputEvent* inputEvent, ArkUI_NodeHandle* button } } -void ShowAxisInfos(ArkUI_UIInputEvent* inputEvent) -{ - g_ss.str(""); - auto verticalAxisValue = OH_ArkUI_AxisEvent_GetVerticalAxisValue(inputEvent); - g_ss << "verticalAxisValue: " << verticalAxisValue << std::endl; - auto horizontalAxisValue = OH_ArkUI_AxisEvent_GetHorizontalAxisValue(inputEvent); - g_ss << "horizontalAxisValue: " << horizontalAxisValue << std::endl; - auto pinchAxisScaleValue = OH_ArkUI_AxisEvent_GetPinchAxisScaleValue(inputEvent); - g_ss << "pinchAxisScaleValue: " << pinchAxisScaleValue << std::endl; - auto scrollStep = OH_ArkUI_AxisEvent_GetScrollStep(inputEvent); - g_ss << "scrollStep: " << scrollStep << std::endl; - SetText(infoText, g_ss.str().c_str(), TEXT_FONT_SIZE_20); -} - void AxisEventOperator(ArkUI_UIInputEvent* inputEvent) { + SetText(titleText, ""); auto toolType = OH_ArkUI_UIInputEvent_GetToolType(inputEvent); - if (toolType == UI_INPUT_EVENT_TOOL_TYPE_TOUCHPAD) { + if (toolType == UI_INPUT_EVENT_TOOL_TYPE_MOUSE) { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "ARKUI_UIINPUTEVENT_TYPE_AXIS EventReceiver"); OH_ArkUI_AxisEvent_SetPropagation(inputEvent, false); @@ -308,123 +245,203 @@ void AxisEventOperator(ArkUI_UIInputEvent* inputEvent) SetBackgroundColor(column1, 0xFFF6F6F6); break; } - default: { + case UI_AXIS_EVENT_ACTION_CANCEL: { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_AXIS_EVENT_ACTION_UNKNOWN EventReceiver"); + "UI_AXIS_EVENT_ACTION_CANCEL EventReceiver"); break; } - } - } -} - -void MouseEventOperator(ArkUI_UIInputEvent* inputEvent, ArkUI_NodeHandle *button) -{ - OH_ArkUI_PointerEvent_SetInterceptHitTestMode(inputEvent, HTM_DEFAULT); - auto toolType = OH_ArkUI_UIInputEvent_GetToolType(inputEvent); - if (toolType == UI_INPUT_EVENT_TOOL_TYPE_MOUSE) { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "ARKUI_UIINPUTEVENT_TYPE_MOUSE EventReceiver"); - auto action = OH_ArkUI_MouseEvent_GetMouseAction(inputEvent); - auto mouseButton = OH_ArkUI_MouseEvent_GetMouseButton(inputEvent); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "MOUSE BUTTON %{public}d", mouseButton); - if (action == UI_MOUSE_EVENT_ACTION_PRESS && mouseButton == UI_MOUSE_EVENT_BUTTON_MIDDLE) { - return; - } - switch (action) { - case UI_MOUSE_EVENT_ACTION_PRESS: { + case UI_AXIS_EVENT_ACTION_NONE: { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_MOUSE_EVENT_ACTION_PRESS EventReceiver"); - SetBackgroundColor(*button, 0xFFFF0000); - break; - } - case UI_MOUSE_EVENT_ACTION_MOVE: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_MOUSE_EVENT_ACTION_MOVE EventReceiver"); - g_ss.str(""); - auto rawDeltaX = OH_ArkUI_MouseEvent_GetRawDeltaX(inputEvent); - auto rawDeltaY = OH_ArkUI_MouseEvent_GetRawDeltaY(inputEvent); - g_ss << "rawDeltaX: " << rawDeltaX << std::endl << "rawDeltaY: " << rawDeltaY << std::endl; - SetText(infoText, g_ss.str().c_str(), TEXT_FONT_SIZE_20); - break; - } - case UI_MOUSE_EVENT_ACTION_RELEASE: { - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_MOUSE_EVENT_ACTION_RELEASE EventReceiver"); - SetBackgroundColor(*button, 0xFF0000FF); - SetBackgroundColor(column1, 0xFFF6F6F6); + "UI_AXIS_EVENT_ACTION_NONE EventReceiver"); break; } default: { OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "UI_MOUSE_EVENT_ACTION_UNKNOWN EventReceiver"); + "UI_AXIS_EVENT_ACTION_UNKNOWN EventReceiver"); break; } } } } -void KeyEventOperator(ArkUI_UIInputEvent* inputEvent) -{ - auto type = OH_ArkUI_KeyEvent_GetType(inputEvent); - if (type == ARKUI_KEY_EVENT_DOWN) { - int32_t pressedKeyCodes[BUTTON_LENGTH] = {}; - int32_t length = BUTTON_LENGTH; - OH_ArkUI_UIInputEvent_GetPressedKeys(inputEvent, pressedKeyCodes, &length); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "pressedKeyCodes = %{public}d", pressedKeyCodes[0]); - auto deviceId = OH_ArkUI_UIInputEvent_GetDeviceId(inputEvent); - uint64_t keys = 0; - OH_ArkUI_UIInputEvent_GetModifierKeyStates(inputEvent, &keys); - OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", - "deviceId = %{public}d, keys = %{public}lu", deviceId, keys); - } -} - -void BtEventReceiver(ArkUI_NodeHandle& button) +void Bt2EventReceiver(ArkUI_NodeHandle& button) { nodeAPI->registerNodeEvent(button, NODE_TOUCH_EVENT, 1, &button); nodeAPI->registerNodeEvent(button, NODE_ON_AXIS, 1, &button); - nodeAPI->registerNodeEvent(button, NODE_ON_MOUSE, 1, &button); - nodeAPI->registerNodeEvent(button, NODE_ON_HOVER_EVENT, 1, &button); - nodeAPI->registerNodeEvent(button, NODE_ON_KEY_EVENT, 1, &button); + nodeAPI->registerNodeEvent(button, NODE_ON_FOCUS_AXIS, 1, &button); nodeAPI->addNodeEventReceiver(button, [](ArkUI_NodeEvent *event) { auto *inputEvent = OH_ArkUI_NodeEvent_GetInputEvent(event); auto eventType = OH_ArkUI_UIInputEvent_GetType(inputEvent); ArkUI_NodeHandle *button = (ArkUI_NodeHandle *)OH_ArkUI_NodeEvent_GetUserData(event); - if (OH_ArkUI_NodeEvent_GetEventType(event) == NODE_ON_HOVER_EVENT) { - auto isHovered = OH_ArkUI_HoverEvent_IsHovered(inputEvent); - if (isHovered) { - SetBackgroundColor(*button, 0xFF009F40); - } else { - SetBackgroundColor(*button, 0xFF0000FF); - } - } else if (OH_ArkUI_NodeEvent_GetEventType(event) == NODE_ON_FOCUS_AXIS) { + if (OH_ArkUI_NodeEvent_GetEventType(event) == NODE_ON_FOCUS_AXIS) { OH_ArkUI_FocusAxisEvent_SetStopPropagation(inputEvent, true); auto abs_x = OH_ArkUI_FocusAxisEvent_GetAxisValue(inputEvent, UI_FOCUS_AXIS_EVENT_ABS_X); auto abs_y = OH_ArkUI_FocusAxisEvent_GetAxisValue(inputEvent, UI_FOCUS_AXIS_EVENT_ABS_Y); auto abs_z = OH_ArkUI_FocusAxisEvent_GetAxisValue(inputEvent, UI_FOCUS_AXIS_EVENT_ABS_Z); OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "abs_x/abs_y/abs_z = %{public}f/%{public}f/%{public}f", abs_x, abs_y, abs_z); - } else if (OH_ArkUI_NodeEvent_GetEventType(event) == NODE_ON_KEY_EVENT) { - KeyEventOperator(inputEvent); } if (eventType == ARKUI_UIINPUTEVENT_TYPE_TOUCH) { - TouchEventOperator(inputEvent, button); + ExtraTouchEventOperator(inputEvent, button); } else if (eventType == ARKUI_UIINPUTEVENT_TYPE_AXIS) { AxisEventOperator(inputEvent); - } else if (eventType == ARKUI_UIINPUTEVENT_TYPE_MOUSE) { - // 鼠标按键数 - int32_t pressedButtons[BUTTON_LENGTH] = {}; - int32_t length; - OH_ArkUI_MouseEvent_GetPressedButtons(inputEvent, pressedButtons, &length); - g_ss.str(""); - g_ss << "PressedButtonCount: " << length << std::endl; - SetText(titleText, g_ss.str().c_str(), TEXT_FONT_SIZE_20); - MouseEventOperator(inputEvent, button); + } else if (eventType == ARKUI_UIINPUTEVENT_TYPE_UNKNOWN) { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "UNKNOWN UIINPUTEVENT!"); + } + }); +} + +void TitTestReceiver(ArkUI_NodeHandle& node, const char* str, bool test = false) +{ + if (test) { + nodeAPI->registerNodeEvent(node, NODE_ON_TOUCH_INTERCEPT, 1, (void *)str); + nodeAPI->addNodeEventReceiver(node, [](ArkUI_NodeEvent *event) { + auto *inputEvent = OH_ArkUI_NodeEvent_GetInputEvent(event); + if (OH_ArkUI_NodeEvent_GetEventType(event) == NODE_ON_TOUCH_INTERCEPT) { + HitTestMode mode = static_cast(hitTestModes[hitIdx]); + OH_ArkUI_PointerEvent_SetInterceptHitTestMode(inputEvent, mode); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "nodeTest hit!"); + } + }); + return; + } + nodeAPI->registerNodeEvent(node, NODE_TOUCH_EVENT, 1, (void *)str); + nodeAPI->addNodeEventReceiver(node, [](ArkUI_NodeEvent *event) { + char *str = (char *)OH_ArkUI_NodeEvent_GetUserData(event); + if (std::string(str) == "nodeParent") { + auto *inputEvent = OH_ArkUI_NodeEvent_GetInputEvent(event); + OH_ArkUI_PointerEvent_SetStopPropagation(inputEvent, true); + } + if (OH_ArkUI_NodeEvent_GetEventType(event) == NODE_TOUCH_EVENT) { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "%{public}s hit!", str); } }); } +void SwitchBtReceiver(ArkUI_NodeHandle& button) +{ + nodeAPI->registerNodeEvent(button, NODE_ON_CLICK_EVENT, 1, &button); + nodeAPI->addNodeEventReceiver(button, [](ArkUI_NodeEvent *event) { + auto *inputEvent = OH_ArkUI_NodeEvent_GetInputEvent(event); + ArkUI_NodeHandle *button = (ArkUI_NodeHandle *)OH_ArkUI_NodeEvent_GetUserData(event); + int32_t length = 6; + hitIdx = (hitIdx + 1) % length; + g_ss.str(""); + g_ss << "触摸测试模式: " << HitTestNames[hitIdx]; + SetButtonLabel(*button, g_ss.str().c_str()); + }); +} + +void ExplainReceiver(ArkUI_NodeHandle& button) +{ + nodeAPI->registerNodeEvent(button, NODE_ON_CLICK_EVENT, 1, nullptr); + nodeAPI->addNodeEventReceiver(button, [](ArkUI_NodeEvent *event) { + SetText(infoText, explain.c_str()); + }); +} + +void TitTestModule() +{ + auto nodeParent = nodeAPI->createNode(ARKUI_NODE_STACK); + SetWidthPercent(nodeParent, 1); + SetHeight(nodeParent, SIZE_100); + SetBorderWidth(nodeParent, BORDER_WIDTH_1); + SetBorderStyle(nodeParent, ARKUI_BORDER_STYLE_DASHED, DEFAULT_RADIUS); + TitTestReceiver(nodeParent, "nodeParent"); + + auto nodeBro = nodeAPI->createNode(ARKUI_NODE_COLUMN); + SetWidthPercent(nodeBro, 1); + SetHeight(nodeBro, SIZE_100); + nodeAPI->addChild(nodeParent, nodeBro); + TitTestReceiver(nodeBro, "nodeBro"); + + auto nodeTest = nodeAPI->createNode(ARKUI_NODE_COLUMN); + SetWidthPercent(nodeTest, 1); + SetHeight(nodeTest, SIZE_100); + nodeAPI->addChild(nodeParent, nodeTest); + TitTestReceiver(nodeTest, "nodeTest", true); + + auto nodeSon = nodeAPI->createNode(ARKUI_NODE_ROW); + SetWidthPercent(nodeSon, 1); + SetHeight(nodeSon, SIZE_100); + SetRowJustifyContent(nodeSon, ARKUI_FLEX_ALIGNMENT_SPACE_BETWEEN); + TitTestReceiver(nodeSon, "nodeSon"); + nodeAPI->addChild(nodeTest, nodeSon); + + nodeAPI->addChild(column1, nodeParent); +} + +void ButtonModule() +{ + static auto button1 = nodeAPI->createNode(ARKUI_NODE_BUTTON); + SetId(button1, "bt"); + SetButtonLabel(button1, "测试按钮1"); + SetWidthPercent(button1, 1); + SetHeight(button1, SIZE_100); + SetBackgroundColor(button1, 0xFF0000FF); + ArkUI_NumberValue enable[] = {1}; + ArkUI_AttributeItem focusableItem = {enable, 1}; + nodeAPI->setAttribute(button1, NODE_FOCUSABLE, &focusableItem); + Bt1EventReceiver(button1); + nodeAPI->addChild(column1, button1); + + auto blank1 = nodeAPI->createNode(ARKUI_NODE_COLUMN); + SetHeight(blank1, BLANK_10); + nodeAPI->addChild(column1, blank1); + + static auto button2 = nodeAPI->createNode(ARKUI_NODE_BUTTON); + SetId(button2, "bt2"); + SetButtonLabel(button2, "测试按钮2"); + SetWidthPercent(button2, 1); + SetHeight(button2, SIZE_100); + SetBackgroundColor(button2, 0xFF0000FF); + nodeAPI->setAttribute(button2, NODE_FOCUSABLE, &focusableItem); + Bt2EventReceiver(button2); + nodeAPI->addChild(column1, button2); + + auto blank2 = nodeAPI->createNode(ARKUI_NODE_COLUMN); + SetHeight(blank2, BLANK_10); + nodeAPI->addChild(column1, blank2); + + TitTestModule(); + + auto row = nodeAPI->createNode(ARKUI_NODE_ROW); + SetWidthPercent(row, 1); + SetHeight(row, SIZE_80); + SetRowJustifyContent(row, ARKUI_FLEX_ALIGNMENT_SPACE_AROUND); + SetHitTestMode(row, ARKUI_HIT_TEST_MODE_BLOCK_HIERARCHY); + nodeAPI->addChild(column1, row); + + button3 = nodeAPI->createNode(ARKUI_NODE_BUTTON); + SetId(button3, "bt3"); + SetButtonLabel(button3, "点击查看说明"); + SetWidthPercent(button3, BUTTON_WIDTH_S); + SetHeight(button3, SIZE_50); + ExplainReceiver(button3); + nodeAPI->addChild(row, button3); + + static auto button4 = nodeAPI->createNode(ARKUI_NODE_BUTTON); + SetId(button4, "bt4"); + SetButtonLabel(button4, "触摸测试模式:Default"); + SetWidthPercent(button4, BUTTON_WIDTH_L); + SetHeight(button4, SIZE_50); + SwitchBtReceiver(button4); + nodeAPI->addChild(row, button4); +} + +void BgEventReceiver(ArkUI_NodeHandle& node) +{ + nodeAPI->registerNodeEvent(node, NODE_TOUCH_EVENT, 1, &node); + nodeAPI->registerNodeEvent(node, NODE_ON_AXIS, 1, &node); + nodeAPI->registerNodeEvent(node, NODE_ON_FOCUS_AXIS, 1, &node); + nodeAPI->addNodeEventReceiver(node, [](ArkUI_NodeEvent *event) { + ArkUI_NodeHandle *node = (ArkUI_NodeHandle *)OH_ArkUI_NodeEvent_GetUserData(event); + SetBackgroundColor(*node, 0xFFFFFF00); + }); +} + void FirstModule(ArkUI_NodeHandle &root) { column1 = nodeAPI->createNode(ARKUI_NODE_COLUMN); @@ -435,31 +452,22 @@ void FirstModule(ArkUI_NodeHandle &root) SetColumnAlignItem(column1, ARKUI_HORIZONTAL_ALIGNMENT_CENTER); SetPadding(column1, BLANK_10); BgEventReceiver(column1); - - static auto button = nodeAPI->createNode(ARKUI_NODE_BUTTON); - SetId(button, "bt"); - SetButtonLabel(button, "输入事件测试按键"); - SetWidthPercent(button, 1); - SetHeight(button, SIZE_200); - SetBackgroundColor(button, 0xFF0000FF); - ArkUI_NumberValue enable[] = {1}; - ArkUI_AttributeItem focusableItem = {enable, 1}; - nodeAPI->setAttribute(button, NODE_FOCUSABLE, &focusableItem); - BtEventReceiver(button); - nodeAPI->addChild(column1, button); - - auto blank = nodeAPI->createNode(ARKUI_NODE_COLUMN); - SetHeight(blank, BLANK_10); - nodeAPI->addChild(column1, blank); - + + ButtonModule(); + titleText = nodeAPI->createNode(ARKUI_NODE_TEXT); SetId(titleText, "title"); + SetWidthPercent(titleText, 1); + SetPadding(titleText, BLANK_10); nodeAPI->addChild(column1, titleText); - + infoText = nodeAPI->createNode(ARKUI_NODE_TEXT); SetId(infoText, "info"); + SetText(infoText, explain.c_str()); + SetWidthPercent(infoText, 1); + SetPadding(infoText, BLANK_10); nodeAPI->addChild(column1, infoText); - + nodeAPI->addChild(root, column1); } diff --git a/ArkUIKit/NdkInputEvent/entry/src/main/cpp/infos.h b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/infos.h new file mode 100644 index 0000000000000000000000000000000000000000..520705a6a6e3059c4c5c21c30dafc81bcc265140 --- /dev/null +++ b/ArkUIKit/NdkInputEvent/entry/src/main/cpp/infos.h @@ -0,0 +1,370 @@ +/* + * Copyright (c) 2025 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. + */ + +#ifndef NDKINPUTEVENT_INFOS_H +#define NDKINPUTEVENT_INFOS_H + +#include "common.h" +#include "container.h" +#include +#include +#include +#include + +#define DEFAULT_WIDTH 200.0 +#define DEFAULT_HEIGHT 200.0 +#define DEFAULT_BG_COLOR 0xFFFFFFFF +#define DEFAULT_BORDER_WIDTH 0.0 +#define BORDER_WIDTH_1 1.0 +#define DEFAULT_MARGIN 5.0 +#define DEFAULT_BORDER_COLOR 0xFF000000 +#define DEFAULT_RADIUS 10.0 + +#define SIZE_100 100 +#define SIZE_300 300 +#define BLANK_10 10.0 + +#define DEFAULT_TEXT_FONT_SIZE 12 +#define TEXT_FONT_SIZE_15 15 +#define TEXT_FONT_SIZE_20 20 + +#define BUTTON_LENGTH 10 +#define MAX_LENGTH 128 + +namespace NativeXComponentSample { + +std::string explain = "通过本示例可以测试输入事件C-API的各项功能。\n" + "1、测试按钮1:通过手指点击该按钮可测试触摸事件;\n" + " 在触摸事件中通过克隆事件分发到背景,验证克隆事件相关接口的能力;\n" + " 通过鼠标移动、点击可以测试鼠标事件和鼠标悬停事件。\n" + "2、测试按钮2:通过鼠标滚轮或触控屏可以测试轴事件;\n" + " 通过手写笔工具获取触控事件中的操作角度;\n" + " 通过本按钮可以验证事件冒泡的接口的相关能力。\n" + "3、测试框:点击测试框验证触摸测试接口的能力,点击按钮可切换模式。\n" + "4、连接键盘可以测试按键事件,但需要首先按Tab键使界面获焦,之后可以通过日志观察按键事件的相关信息。"; + +enum ArkUIModifierKeyName { + ARKUI_MODIFIER_KEY_CTRL = 1 << 0, // Ctrl 键 + ARKUI_MODIFIER_KEY_SHIFT = 1 << 1, // Shift 键 + ARKUI_MODIFIER_KEY_ALT = 1 << 2, // Alt 键 + ARKUI_MODIFIER_KEY_FN = 1 << 3 // Fn 键(如适用) +}; +std::string HitTestNames[] = {"Default", "Block", "Transparent", "None", "Hierarchy", "Descendants"}; +int32_t hitTestModes[] = {HTM_DEFAULT, HTM_BLOCK, HTM_TRANSPARENT, + HTM_NONE, HTM_BLOCK_HIERARCHY, HTM_BLOCK_DESCENDANTS}; +int hitIdx = 0; +std::string MouseButtonNames[] = {"MOUSE_BUTTON_NONE", "MOUSE_BUTTON_LEFT", "MOUSE_BUTTON_RIGHT", + "MOUSE_BUTTON_MIDDLE", "MOUSE_BUTTON_BACK", "MOUSE_BUTTON_FORWARD"}; + +std::stringstream g_ss; + +ArkUI_NodeHandle column1; +ArkUI_NodeHandle infoText = nullptr; +ArkUI_NodeHandle titleText = nullptr; +ArkUI_NodeHandle button3 = nullptr; + +void PrintMultiHistoryInfos(ArkUI_UIInputEvent* inputEvent, uint32_t pointerIndex) +{ + auto size = OH_ArkUI_PointerEvent_GetHistorySize(inputEvent); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "%{public}d: historySize = %{public}d", pointerIndex, size); + for (int historyIndex = 0; historyIndex < size; historyIndex++) { + auto time = OH_ArkUI_PointerEvent_GetHistoryEventTime(inputEvent, historyIndex); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "historyEventTime = %{public}ld", time); + auto pointerCount = OH_ArkUI_PointerEvent_GetHistoryPointerCount(inputEvent, historyIndex); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "historyPointerCount = %{public}d", pointerCount); + auto pointerId = OH_ArkUI_PointerEvent_GetHistoryPointerId(inputEvent, pointerIndex, historyIndex); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "historyPointerId = %{public}d", pointerId); + auto historyX = OH_ArkUI_PointerEvent_GetHistoryX(inputEvent, pointerIndex, historyIndex); + auto historyY = OH_ArkUI_PointerEvent_GetHistoryY(inputEvent, pointerIndex, historyIndex); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "historyX/Y = %{public}f/%{public}f", historyX, historyY); + auto historyWindowX = OH_ArkUI_PointerEvent_GetHistoryWindowX(inputEvent, pointerIndex, historyIndex); + auto historyWindowY = OH_ArkUI_PointerEvent_GetHistoryWindowY(inputEvent, pointerIndex, historyIndex); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "historyWindowX/Y = %{public}f/%{public}f", historyWindowX, historyWindowY); + auto historyDisplayX = OH_ArkUI_PointerEvent_GetHistoryDisplayX(inputEvent, pointerIndex, historyIndex); + auto historyDisplayY = OH_ArkUI_PointerEvent_GetHistoryDisplayY(inputEvent, pointerIndex, historyIndex); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "historyDisplayX/Y = %{public}f/%{public}f", historyDisplayX, historyDisplayY); + auto historyGlobalDisplayX = OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayX(inputEvent, + pointerIndex, historyIndex); + auto historyGlobalDisplayY = OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayY(inputEvent, + pointerIndex, historyIndex); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "historyGlobalDisplayX/Y = %{public}f/%{public}f", historyGlobalDisplayX, historyGlobalDisplayY); + auto historyPressure = OH_ArkUI_PointerEvent_GetHistoryPressure(inputEvent, pointerIndex, historyIndex); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "historyPressure = %{public}f", historyPressure); + auto historyTouchAreaWidth = OH_ArkUI_PointerEvent_GetHistoryTouchAreaWidth(inputEvent, + pointerIndex, historyIndex); + auto historyTouchAreaHeight = OH_ArkUI_PointerEvent_GetHistoryTouchAreaHeight(inputEvent, + pointerIndex, historyIndex); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "historyTouchAreaWidth/Height = %{public}f/%{public}f", historyTouchAreaWidth, historyTouchAreaHeight); + } +} + +void ShowMultiInfos(ArkUI_UIInputEvent* inputEvent) +{ + g_ss.str(""); + uint32_t pointerIndex = 0; + OH_ArkUI_PointerEvent_GetChangedPointerId(inputEvent, &pointerIndex); + g_ss << "pointerIndex: " << pointerIndex << std::endl; + auto id = OH_ArkUI_PointerEvent_GetPointerId(inputEvent, pointerIndex); + g_ss << "pointerId: " << id << std::endl; + auto pressedTime = OH_ArkUI_PointerEvent_GetPressedTimeByIndex(inputEvent, pointerIndex); + g_ss << "pressedTime: " << pressedTime << std::endl; + auto x = OH_ArkUI_PointerEvent_GetXByIndex(inputEvent, pointerIndex); + auto y = OH_ArkUI_PointerEvent_GetYByIndex(inputEvent, pointerIndex); + g_ss << "x/y: " << x << "/" << y << std::endl; + auto windowX = OH_ArkUI_PointerEvent_GetWindowXByIndex(inputEvent, pointerIndex); + auto windowY = OH_ArkUI_PointerEvent_GetWindowYByIndex(inputEvent, pointerIndex); + g_ss << "windowX/Y: " << windowX << "/" << windowY << std::endl; + auto displayX = OH_ArkUI_PointerEvent_GetDisplayXByIndex(inputEvent, pointerIndex); + auto displayY = OH_ArkUI_PointerEvent_GetDisplayYByIndex(inputEvent, pointerIndex); + g_ss << "displayX/Y: " << displayX << "/" << displayY << std::endl; + auto globalDisplayX = OH_ArkUI_PointerEvent_GetGlobalDisplayXByIndex(inputEvent, pointerIndex); + auto globalDisplayY = OH_ArkUI_PointerEvent_GetGlobalDisplayYByIndex(inputEvent, pointerIndex); + g_ss << "globalDisplayX/Y: " << globalDisplayX << "/" << globalDisplayY << std::endl; + auto pressure = OH_ArkUI_PointerEvent_GetPressure(inputEvent, pointerIndex); + g_ss << "pressure: " << pressure << std::endl; + ArkUI_InteractionHand hand; + OH_ArkUI_PointerEvent_GetInteractionHandByIndex(inputEvent, pointerIndex, &hand); + if (hand == ARKUI_EVENT_HAND_LEFT) { + g_ss << "hand: LEFT" << std::endl; + } else if (hand == ARKUI_EVENT_HAND_RIGHT) { + g_ss << "hand: RIGHT" << std::endl; + } else if (hand == ARKUI_EVENT_HAND_NONE) { + g_ss << "hand: NONE" << std::endl; + } + auto touchAreaWidth = OH_ArkUI_PointerEvent_GetTouchAreaWidth(inputEvent, pointerIndex); + auto touchAreaHeight = OH_ArkUI_PointerEvent_GetTouchAreaHeight(inputEvent, pointerIndex); + g_ss << "touchAreaWidth/Height: " << touchAreaWidth << "/" << touchAreaHeight << std::endl; + SetText(infoText, g_ss.str().c_str(), TEXT_FONT_SIZE_15); + PrintMultiHistoryInfos(inputEvent, pointerIndex); +} + +void ShowSimplePosInfo(ArkUI_UIInputEvent *inputEvent) +{ + auto x = OH_ArkUI_PointerEvent_GetX(inputEvent); + auto y = OH_ArkUI_PointerEvent_GetY(inputEvent); + g_ss << "x/y: " << x << "/" << y << std::endl; + auto windowX = OH_ArkUI_PointerEvent_GetWindowX(inputEvent); + auto windowY = OH_ArkUI_PointerEvent_GetWindowY(inputEvent); + g_ss << "windowX/Y: " << windowX << "/" << windowY << std::endl; + auto displayX = OH_ArkUI_PointerEvent_GetDisplayX(inputEvent); + auto displayY = OH_ArkUI_PointerEvent_GetDisplayY(inputEvent); + g_ss << "displayX/Y: " << displayX << "/" << displayY << std::endl; + auto globalDisplayX = OH_ArkUI_PointerEvent_GetGlobalDisplayX(inputEvent); + auto globalDisplayY = OH_ArkUI_PointerEvent_GetGlobalDisplayY(inputEvent); + g_ss << "globalDisplayX/Y: " << globalDisplayX << "/" << globalDisplayY << std::endl; +} + +void ShowSimpleTarInfo(ArkUI_UIInputEvent *inputEvent) +{ + auto targetWidth = OH_ArkUI_UIInputEvent_GetEventTargetWidth(inputEvent); + g_ss << "targetWidth: " << targetWidth << std::endl; + auto targetHeight = OH_ArkUI_UIInputEvent_GetEventTargetHeight(inputEvent); + g_ss << "targetHeight: " << targetHeight << std::endl; + auto positionX = OH_ArkUI_UIInputEvent_GetEventTargetPositionX(inputEvent); + auto positionY = OH_ArkUI_UIInputEvent_GetEventTargetPositionY(inputEvent); + g_ss << "targetPositionX/Y: " << positionX << "/" << positionY << std::endl; + auto globalPositionX = OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionX(inputEvent); + auto globalPositionY = OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionY(inputEvent); + g_ss << "targetGlobalPositionX/Y: " << globalPositionX << "/" << globalPositionY << std::endl; +} + +void ShowSimpleInfo(ArkUI_UIInputEvent* inputEvent) +{ + g_ss.str(""); + auto displayId = OH_ArkUI_UIInputEvent_GetTargetDisplayId(inputEvent); + g_ss << "displayId: " << displayId << std::endl; + auto eventTime = OH_ArkUI_UIInputEvent_GetEventTime(inputEvent); + g_ss << "eventTime: " << eventTime << std::endl; + // 触摸事件位置信息 + ShowSimplePosInfo(inputEvent); + // 手指触摸事件显示信息 + auto type = OH_ArkUI_UIInputEvent_GetToolType(inputEvent); + if (type == UI_INPUT_EVENT_TOOL_TYPE_FINGER) { + ArkUI_InteractionHand hand; + OH_ArkUI_PointerEvent_GetInteractionHand(inputEvent, &hand); + if (hand == ARKUI_EVENT_HAND_LEFT) { + g_ss << "hand: LEFT" << std::endl; + } else if (hand == ARKUI_EVENT_HAND_RIGHT) { + g_ss << "hand: RIGHT" << std::endl; + } else { + g_ss << "hand: NONE" << std::endl; + } + } else if (type == UI_INPUT_EVENT_TOOL_TYPE_PEN) { + double rollAngle = 0; + OH_ArkUI_PointerEvent_GetRollAngle(inputEvent, &rollAngle); + g_ss << "rollAngle: " << rollAngle << std::endl; + } + // 命中组件信息 + ShowSimpleTarInfo(inputEvent); + SetText(infoText, g_ss.str().c_str(), TEXT_FONT_SIZE_15); +} + +void PrintClonedEventInfos(ArkUI_UIInputEvent* inputEvent, ArkUI_UIInputEvent* clonedEvent) +{ + float x = 0; + float y = 0; + OH_ArkUI_PointerEvent_SetClonedEventLocalPosition(clonedEvent, x, y); + OH_ArkUI_PointerEvent_SetClonedEventActionType(clonedEvent, UI_TOUCH_EVENT_ACTION_DOWN); + OH_ArkUI_PointerEvent_SetClonedEventChangedFingerId(clonedEvent, 0); + if (OH_ArkUI_UIInputEvent_GetLatestStatus() == ARKUI_ERROR_CODE_NO_ERROR) { + // 此前接口调用无误,执行克隆事件分发 + int ret = OH_ArkUI_PointerEvent_PostClonedEvent(column1, clonedEvent); + if (ret == ARKUI_ERROR_CODE_NOT_CLONED_POINTER_EVENT) { + OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "inputTest", + "The event is not cloned event!"); + } else if (ret == ARKUI_ERROR_CODE_POST_CLONED_COMPONENT_STATUS_ABNORMAL) { + OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "inputTest", + "The component status abnormal!"); + } else if (ret == ARKUI_ERROR_CODE_POST_CLONED_NO_COMPONENT_HIT_TO_RESPOND_TO_THE_EVENT) { + OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "inputTest", + "No component hit to respond to the event!"); + } + } +} + +void PrintMultiClonedEventInfos(ArkUI_UIInputEvent* clonedEvent) +{ + float x = 0; + float y = 0; + OH_ArkUI_PointerEvent_SetClonedEventLocalPositionByIndex(clonedEvent, x, y, 0); + OH_ArkUI_PointerEvent_SetClonedEventActionType(clonedEvent, UI_TOUCH_EVENT_ACTION_DOWN); + OH_ArkUI_PointerEvent_SetClonedEventFingerIdByIndex(clonedEvent, 0, 0); + if (OH_ArkUI_UIInputEvent_GetLatestStatus() == ARKUI_ERROR_CODE_NO_ERROR) { + // 此前接口调用无误,执行克隆事件分发 + OH_ArkUI_PointerEvent_PostClonedEvent(column1, clonedEvent); + } +} + +void ShowTiltInfos(ArkUI_UIInputEvent* inputEvent) +{ + g_ss.str(""); + uint32_t pointerIndex = 0; + OH_ArkUI_PointerEvent_GetChangedPointerId(inputEvent, &pointerIndex); + g_ss << "pointerIndex: " << pointerIndex << std::endl; + auto id = OH_ArkUI_PointerEvent_GetPointerId(inputEvent, pointerIndex); + g_ss << "pointerId: " << id << std::endl; + auto tiltX = OH_ArkUI_PointerEvent_GetTiltX(inputEvent, pointerIndex); + auto tiltY = OH_ArkUI_PointerEvent_GetTiltY(inputEvent, pointerIndex); + g_ss << "tiltX/Y: " << tiltX << "/" << tiltY << std::endl; + SetText(infoText, g_ss.str().c_str(), TEXT_FONT_SIZE_15); + // 日志输出原始Tilt信息 + auto size = OH_ArkUI_PointerEvent_GetHistorySize(inputEvent); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "%{public}d: historySize = %{public}d", pointerIndex, size); + for (int historyIndex = 0; historyIndex < size; historyIndex++) { + auto pointerCount = OH_ArkUI_PointerEvent_GetHistoryPointerCount(inputEvent, historyIndex); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "historyPointerCount = %{public}d", pointerCount); + auto pointerId = OH_ArkUI_PointerEvent_GetHistoryPointerId(inputEvent, pointerIndex, historyIndex); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "historyPointerId = %{public}d", pointerId); + auto historyTiltX = OH_ArkUI_PointerEvent_GetHistoryTiltX(inputEvent, pointerIndex, historyIndex); + auto historyTiltY = OH_ArkUI_PointerEvent_GetHistoryTiltY(inputEvent, pointerIndex, historyIndex); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "historyTiltX/Y = %{public}f/%{public}f", historyTiltX, historyTiltY); + } +} + +void ShowAxisInfos(ArkUI_UIInputEvent* inputEvent) +{ + g_ss.str(""); + auto toolType = OH_ArkUI_UIInputEvent_GetToolType(inputEvent); + switch (toolType) { + case UI_INPUT_EVENT_TOOL_TYPE_MOUSE: { + auto scrollStep = OH_ArkUI_AxisEvent_GetScrollStep(inputEvent); + g_ss << "scrollStep: " << scrollStep << std::endl; + auto verticalAxisValue = OH_ArkUI_AxisEvent_GetVerticalAxisValue(inputEvent); + g_ss << "verticalAxisValue: " << verticalAxisValue << std::endl; + auto hasAxis = OH_ArkUI_AxisEvent_HasAxis(inputEvent, UI_AXIS_TYPE_VERTICAL_AXIS); + g_ss << "HasAxis VERTICAL_AXIS: " << hasAxis << std::endl; + break; + } + case UI_INPUT_EVENT_TOOL_TYPE_TOUCHPAD: { + auto verticalAxisValue = OH_ArkUI_AxisEvent_GetVerticalAxisValue(inputEvent); + g_ss << "verticalAxisValue: " << verticalAxisValue << std::endl; + auto horizontalAxisValue = OH_ArkUI_AxisEvent_GetHorizontalAxisValue(inputEvent); + g_ss << "horizontalAxisValue: " << horizontalAxisValue << std::endl; + auto pinchAxisScaleValue = OH_ArkUI_AxisEvent_GetPinchAxisScaleValue(inputEvent); + g_ss << "pinchAxisScaleValue: " << pinchAxisScaleValue << std::endl; + break; + } + default: { + break; + } + } + SetText(infoText, g_ss.str().c_str(), TEXT_FONT_SIZE_20); +} + +void TouchScreenEventOperator(ArkUI_UIInputEvent* inputEvent, ArkUI_NodeHandle* button) +{ + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "ARKUI_UIINPUTEVENT_TYPE_TOUCH EventReceiver"); + auto count = OH_ArkUI_PointerEvent_GetPointerCount(inputEvent); + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "pointerCount = %{public}d", count); + OH_ArkUI_PointerEvent_SetStopPropagation(inputEvent, true); + ArkUI_UIInputEvent* clonedEvent = nullptr; + OH_ArkUI_PointerEvent_CreateClonedEvent(inputEvent, &clonedEvent); + switch (OH_ArkUI_UIInputEvent_GetAction(inputEvent)) { + case UI_TOUCH_EVENT_ACTION_DOWN: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "UI_TOUCH_EVENT_ACTION_DOWN EventReceiver"); + SetText(titleText, ""); + if (count == 1) { + SetBackgroundColor(*button, 0xFFFF0000); + PrintClonedEventInfos(inputEvent, clonedEvent); + } else if (count > 1) { + SetBackgroundColor(*button, 0xFF932F60); + PrintMultiClonedEventInfos(clonedEvent); + } + break; + } + case UI_TOUCH_EVENT_ACTION_MOVE: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "UI_TOUCH_EVENT_ACTION_MOVE EventReceiver"); + if (count == 1) { + ShowSimpleInfo(inputEvent); + } else if (count > 1) { + ShowMultiInfos(inputEvent); + } + break; + } + case UI_TOUCH_EVENT_ACTION_UP: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", "UI_TOUCH_EVENT_ACTION_UP EventReceiver"); + SetBackgroundColor(*button, 0xFF0000FF); + SetBackgroundColor(column1, 0xFFF6F6F6); + OH_ArkUI_PointerEvent_DestroyClonedEvent(clonedEvent); + break; + } + case UI_TOUCH_EVENT_ACTION_CANCEL: { + OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, "inputTest", + "UI_TOUCH_EVENT_ACTION_CANCEL EventReceiver"); + break; + } + default: { + break; + } + } +} + +} // namespace NativeXComponentSample + +#endif //NDKINPUTEVENT_INFOS_H diff --git a/ArkUIKit/NdkInputEvent/entry/src/ohosTest/ets/test/InputEventTest.test.ets b/ArkUIKit/NdkInputEvent/entry/src/ohosTest/ets/test/InputEventTest.test.ets index 53e93fa90f9c23e070e9bc32ae21eda59c133306..68d143316b1e8379ac1feb0ff13e539e32409d54 100644 --- a/ArkUIKit/NdkInputEvent/entry/src/ohosTest/ets/test/InputEventTest.test.ets +++ b/ArkUIKit/NdkInputEvent/entry/src/ohosTest/ets/test/InputEventTest.test.ets @@ -59,7 +59,7 @@ export default function InputEventTest() { try { let driver = Driver.create(); await driver.delayMs(1000); - // 点击按钮触发事件 + // 点击按钮1触发事件 const button = await driver.findComponent(ON.id('bt')); await button.longClick(); await driver.delayMs(1000); @@ -82,13 +82,13 @@ export default function InputEventTest() { let driver = Driver.create(); await driver.delayMs(1000); // 移动鼠标,触发悬停事件 - await driver.mouseMoveWithTrack({x:300, y:600}, {x:300, y:400}); + await driver.mouseMoveWithTrack({x:300, y:400}, {x:300, y:200}); let btObj: ESObject = JSON.parse(getInspectorByKey('bt')); hilog.info(0x0000, 'InputEventTest', 'testMouseInput buttonColor: %{public}s', JSON.stringify(btObj.$attrs.backgroundColor)); expect(btObj.$attrs.backgroundColor).assertEqual('#FF009F40'); await driver.delayMs(1000); // 鼠标左键单击,触发鼠标按下/释放事件 - await driver.mouseLongClick({x:300, y:400}, MouseButton.MOUSE_BUTTON_LEFT); + await driver.mouseLongClick({x:300, y:200}, MouseButton.MOUSE_BUTTON_LEFT); await driver.delayMs(1000); } catch (error) { hilog.error(0x0000, 'InputEventTest', 'testMouseInput failed: %{public}s', error.message); @@ -100,6 +100,49 @@ export default function InputEventTest() { /** * @tc.number InputEventTest_003 + * @tc.name testMouseScrollInput + * @tc.desc 测试轴事件接口 - 测试鼠标滚轮触发轴事件信息 + */ + it('testMouseScrollInput', TestType.FUNCTION, async (done: Function) => { + hilog.info(0x0000, 'InputEventTest', 'testMouseScrollInput begin'); + try { + let driver = Driver.create(); + await driver.delayMs(1000); + // 鼠标滚轮滚动,触发轴事件 + await driver.mouseScroll({x:300, y:400}, true, 30); + await driver.delayMs(1000); + } catch (error) { + hilog.error(0x0000, 'InputEventTest', 'testMouseScrollInput failed: %{public}s', error.message); + expect().assertFail(); + } + done(); + hilog.info(0x0000, 'InputEventTest', 'testMouseScrollInput end'); + }) + + /** + * @tc.number InputEventTest_004 + * @tc.name testTouchProInput + * @tc.desc 测试触摸事件冒泡接口 - 监听触摸事件,并阻止事件向上冒泡 + */ + it('testTouchProInput', TestType.FUNCTION, async (done: Function) => { + hilog.info(0x0000, 'InputEventTest', 'testTouchProInput begin'); + try { + let driver = Driver.create(); + await driver.delayMs(1000); + // 点击按钮2触发事件,由于阻止事件冒泡,背景不会发生改变 + const button = await driver.findComponent(ON.id('bt2')); + await button.longClick(); + await driver.delayMs(1000); + } catch (error) { + hilog.error(0x0000, 'InputEventTest', 'testTouchProInput failed: %{public}s', error.message); + expect().assertFail(); + } + done(); + hilog.info(0x0000, 'InputEventTest', 'testTouchProInput end'); + }) + + /** + * @tc.number InputEventTest_005 * @tc.name testKeyInput * @tc.desc 测试按键输入事件接口 - 测试按键事件监听 */ diff --git a/ArkUIKit/ParadigmStateManagement/entry/.gitignore b/ArkUIKit/ParadigmStateManagement/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/ParadigmStateManagement/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/PersistentStorage/entry/.gitignore b/ArkUIKit/PersistentStorage/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/PersistentStorage/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageFivePersistedDate.ets b/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageFivePersistedDate.ets index 2f27a92c4e102100bafca7b603218c87e280a5b3..6fc56ef6bd4e54d6ed98f05ae547a8abe8991c58 100644 --- a/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageFivePersistedDate.ets +++ b/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageFivePersistedDate.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +// [Start Persistent_page_five] PersistentStorage.persistProp('persistedDate', new Date()); @Entry @@ -64,4 +64,5 @@ struct PersistedDate { } } } -} \ No newline at end of file +} +// [End Persistent_page_five] \ No newline at end of file diff --git a/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageFourMessageChange.ets b/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageFourMessageChange.ets index 7e93cf0e851cd7ac056f220f67c79f07b1ad88b3..dab25764f63c9fbdd352f69da265bd1f49c89af3 100644 --- a/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageFourMessageChange.ets +++ b/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageFourMessageChange.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + // [Start Persistent_page_four] // 定义常量替代魔法值,明确数值含义 const DEFAULT_NUMBER: number = 10; // 默认数字值 const FONT_SIZE_LARGE: number = 50; // 大字体尺寸 @@ -48,4 +49,5 @@ struct TestCase6 { } .height(HEIGHT_FULL) } -} \ No newline at end of file +} +// [End Persistent_page_four] \ No newline at end of file diff --git a/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageOneMessageStorage.ets b/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageOneMessageStorage.ets index e71db4fa98f6ed7c04544be37146cfbb405c5df2..13f2874e09c91ed2e4fd8df6626442532b34edb9 100644 --- a/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageOneMessageStorage.ets +++ b/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageOneMessageStorage.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start Persistent_page_one] PersistentStorage.persistProp('aProp', 47); @Entry @@ -33,4 +34,5 @@ struct testPageOne { } } } -} \ No newline at end of file +} +// [End Persistent_page_one] \ No newline at end of file diff --git a/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageSevenPersistedSet.ets b/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageSevenPersistedSet.ets index b700e0c00f576ec433a1884ea6ff2a866b338d49..ab6dc655db19fcdf522665126cc697cb1239f5e5 100644 --- a/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageSevenPersistedSet.ets +++ b/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageSevenPersistedSet.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start Persistent_page_seven] PersistentStorage.persistProp('persistedSet', new Set([])); @Entry @@ -76,4 +77,5 @@ struct PersistedSet { } } } -} \ No newline at end of file +} +// [End Persistent_page_seven] \ No newline at end of file diff --git a/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageSixPersistedMap.ets b/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageSixPersistedMap.ets index fbe3461f7a911628ee3f6733197030ca1747c0ad..36b16afd83d02dcd70c03f617ecbdfc774045c72 100644 --- a/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageSixPersistedMap.ets +++ b/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageSixPersistedMap.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start Persistent_page_six] PersistentStorage.persistProp('persistedMapString', new Map([])); @Entry @@ -54,4 +55,5 @@ struct PersistedMap { } } } -} \ No newline at end of file +} +// [End Persistent_page_six] \ No newline at end of file diff --git a/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageThreeAppStorage.ets b/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageThreeAppStorage.ets index 612d9bc558b67822a6bce46f4192bc12374bd4ab..1d9bf7575953596aca21153dbec862cfbb638be9 100644 --- a/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageThreeAppStorage.ets +++ b/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageThreeAppStorage.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +// [Start Persistent_page_three] const MAX_NUM: number = 50; // 大字体尺寸 @Entry @@ -40,4 +40,5 @@ struct testPageThree { } } } -} \ No newline at end of file +} +// [End Persistent_page_three] \ No newline at end of file diff --git a/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageTowPersistentStorage.ets b/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageTowPersistentStorage.ets index 5686b195af0754a13d4be0ef9f8ead4e46e32cb8..43d012345af0bdc42139f047a37612c75f3eaecf 100644 --- a/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageTowPersistentStorage.ets +++ b/ArkUIKit/PersistentStorage/entry/src/main/ets/pages/PageTowPersistentStorage.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start Persistent_page_tow] let aProp = AppStorage.setOrCreate('aProp', 47); PersistentStorage.persistProp('aProp', 48); @@ -34,4 +35,5 @@ struct testPageTow { } } } -} \ No newline at end of file +} +// [End Persistent_page_tow] \ No newline at end of file diff --git a/ArkUIKit/RenderingControl/entry/src/main/syscap.json b/ArkUIKit/RenderingControl/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..598552fb33d0f5c27fed37e607d9163f836ac5af --- /dev/null +++ b/ArkUIKit/RenderingControl/entry/src/main/syscap.json @@ -0,0 +1,24 @@ + +{ + "devices": { + "general": [ + "default" + ] + }, + "production": { + "removedSysCaps": [ + "SystemCapability.HiviewDFX.HiDumper", + "SystemCapability.Security.DeviceAuth", + "SystemCapability.Multimedia.Media.AVTranscoder", + "SystemCapability.Tee.TeeClient", + "SystemCapability.Communication.Bluetooth.Core", + "SystemCapability.ArkUi.Graphics3D", + "SystemCapability.DistributedHardware.DeviceManager", + "SystemCapability.Multimedia.Drm.Core", + "SystemCapability.Advertising.Ads", + "SystemCapability.Customization.EnterpriseDeviceManager", + "SystemCapability.Security.DeviceSecurityLevel", + "SystemCapability.UserIAM.UserAuth.PinAuth" + ] + } +} diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/build-profile.json5 b/ArkUIKit/RenderingControl/entry/src/mock/mock-config.json5 similarity index 78% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/build-profile.json5 rename to ArkUIKit/RenderingControl/entry/src/mock/mock-config.json5 index 12fe2d844bdb69584fd05ebaa3e1cb197a25c3f1..b9a78e201535765168a92d3543c690273ecdc019 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/build-profile.json5 +++ b/ArkUIKit/RenderingControl/entry/src/mock/mock-config.json5 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -14,12 +14,4 @@ */ { - "apiType": "stageMode", - "buildOption": { - }, - "targets": [ - { - "name": "default" - } - ] -} +} \ No newline at end of file diff --git a/ArkUIKit/RenderingControlContentslotNDK/entry/build-profile.json5 b/ArkUIKit/RenderingControlContentslotNDK/entry/build-profile.json5 index 2d8b081b615348a99aa197f90186f3d8891b7dc1..719a66926d067a32b88cbcb02098155a90d508ee 100644 --- a/ArkUIKit/RenderingControlContentslotNDK/entry/build-profile.json5 +++ b/ArkUIKit/RenderingControlContentslotNDK/entry/build-profile.json5 @@ -22,6 +22,7 @@ "cppFlags": "", "abiFilters": [ "arm64-v8a", + "armeabi-v7a", "x86_64" ] } diff --git a/ArkUIKit/RenderingControlContentslotNDK/entry/src/main/syscap.json b/ArkUIKit/RenderingControlContentslotNDK/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..598552fb33d0f5c27fed37e607d9163f836ac5af --- /dev/null +++ b/ArkUIKit/RenderingControlContentslotNDK/entry/src/main/syscap.json @@ -0,0 +1,24 @@ + +{ + "devices": { + "general": [ + "default" + ] + }, + "production": { + "removedSysCaps": [ + "SystemCapability.HiviewDFX.HiDumper", + "SystemCapability.Security.DeviceAuth", + "SystemCapability.Multimedia.Media.AVTranscoder", + "SystemCapability.Tee.TeeClient", + "SystemCapability.Communication.Bluetooth.Core", + "SystemCapability.ArkUi.Graphics3D", + "SystemCapability.DistributedHardware.DeviceManager", + "SystemCapability.Multimedia.Drm.Core", + "SystemCapability.Advertising.Ads", + "SystemCapability.Customization.EnterpriseDeviceManager", + "SystemCapability.Security.DeviceSecurityLevel", + "SystemCapability.UserIAM.UserAuth.PinAuth" + ] + } +} diff --git a/ArkUIKit/ScrollableComponent/README_zh.md b/ArkUIKit/ScrollableComponent/README_zh.md index 5b7104c0f73d6d420c9e319f290a47ec33725a75..98191a1a6a31edfe57f8bbd1c838cb52b905e56a 100644 --- a/ArkUIKit/ScrollableComponent/README_zh.md +++ b/ArkUIKit/ScrollableComponent/README_zh.md @@ -2,24 +2,28 @@ ### 介绍 -本示例通过使用[ArkUI指南文档](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-ui-development)中各场景的开发示例,展示在工程中,帮助开发者更好地理解ArkUI提供的组件及组件属性并合理使用。该工程中展示的代码详细描述可查如下链接: - -1. [创建列表 (List)](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-layout-development-create-list)。 -2. [创建弧形列表 (ArcList)](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-layout-development-create-arclist)(圆形屏幕推荐使用) -3. [创建网格 (Grid/GridItem)](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-layout-development-create-grid)。 -4. [创建瀑布流 (WaterFlow)](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-layout-development-create-waterflow) -5. [创建轮播 (Swiper)](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-layout-development-create-looping)。 -6. [创建弧形轮播 (ArcSwiper)](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-layout-development-arcswiper)(圆形屏幕推荐使用) -7. [选项卡 (Tabs)](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-navigation-tabs) +本示例通过使用[ArkUI指南文档](https://gitcode.com/openharmony/docs/tree/master/zh-cn/application-dev/ui)中各场景的开发示例,展示在工程中,帮助开发者更好地理解ArkUI提供的组件及组件属性并合理使用。该工程中展示的代码详细描述可查如下链接: + +1. [创建列表 (List)](https://gitcode.com/openharmony/docs/blob/OpenHarmony-5.1.0-Release/zh-cn/application-dev/ui/arkts-layout-development-create-list.md)。 +2. [创建弧形列表 (ArcList)](https://gitcode.com/openharmony/docs/blob/OpenHarmony-5.1.0-Release/zh-cn/application-dev/ui/arkts-layout-development-create-arclist.md)(圆形屏幕推荐使用) +3. [创建网格 (Grid/GridItem)](https://gitcode.com/openharmony/docs/blob/OpenHarmony-5.1.0-Release/zh-cn/application-dev/ui/arkts-layout-development-create-grid.md)。 +4. [创建瀑布流 (WaterFlow)](https://gitcode.com/openharmony/docs/blob/OpenHarmony-5.1.0-Release/zh-cn/application-dev/ui/arkts-layout-development-create-waterflow.md) +5. [创建轮播 (Swiper)](https://gitcode.com/openharmony/docs/blob/OpenHarmony-5.1.0-Release/zh-cn/application-dev/ui/arkts-layout-development-create-looping.md)。 +6. [创建弧形轮播 (ArcSwiper)](https://gitcode.com/openharmony/docs/blob/OpenHarmony-5.1.0-Release/zh-cn/application-dev/ui/arkts-layout-development-arcswiper.md)(圆形屏幕推荐使用) +7. [选项卡 (Tabs)](https://gitcode.com/openharmony/docs/blob/OpenHarmony-5.1.0-Release/zh-cn/application-dev/ui/arkts-navigation-tabs.md) ### 效果预览 | 首页 | 列表类组件目录 | 列表中显示数据示例 | |------------------------------------|------------------------------------|------------------------------------| | ![](screenshots/device/image1.png) | ![](screenshots/device/image2.png) | ![](screenshots/device/image3.png) | + 缓存数预览图 + ![](screenshots/device/image4.jpeg) + 标签与内容不联动预览图 + ![](screenshots/device/image5.jpeg) ### 使用说明 -1. 在主界面,可以点击对应卡片,选择需要参考的组件示例。 +1. 在主界面,可以点击对应页面,选择需要参考的组件示例。 2. 在组件目录选择详细的示例参考。 @@ -37,6 +41,7 @@ entry/src/main/ets/ | | |---ArcListArcIndexerBar.ets | | |---arcListBuiltInScrollerBar.ets | | |---ArcListContents.ets +| | |---ArcListCreate.ets | | |---ArcListCrown.ets | | |---ArcListShow.ets | | |---ArcListSideSlip.ets @@ -78,6 +83,7 @@ entry/src/main/ets/ | | |---LongList.ets | | |---ResponsiveScrollPositionList.ets | | |---StickyHeaderList.ets +| | |---SupportSlidingHand.ets | | |---SwipeListItem.ets | | |---TaggedListItems.ets | |---swiper //轮播 @@ -85,12 +91,14 @@ entry/src/main/ets/ | | |---SwiperAndTabsLinkage.ets | | |---SwiperAutoPlay.ets | | |---SwiperCustomAnimation.ets +| | |---SwiperDigitIndicatorIgnoreComponentSize.ets | | |---SwiperDirection.ets | | |---SwiperIgnoreComponentSize.ets | | |---SwiperIndicatorStyle.ets | | |---SwiperLoop.ets | | |---SwiperMultiPage.ets | | |---SwiperPageSwitchMethod.ets +| | |---SwiperVisibleContentPosition.ets | |---tabs //选项卡 | | |---AgeFriendlyTabs.ets | | |---BottomTabBar.ets @@ -121,6 +129,31 @@ entry/src/ohosTest/ |---ets | |---index.test.ets // 示例代码测试代码 ``` +### 具体实现 + +1. 初始化List,可设置space(列表项间距)控制项间距离。 +2. 每个ListItem内通过容器组件(如Row/Column)组合内容(如头像 + 文字)。 +3. 配置divider添加分隔线(设置粗细、颜色、左右边距),并通过scrollBar(BarState.Auto)开启按需显示的滚动条。 +4. 固定List的高度,确保超出时触发滚动。 +5. 定义数据源(如TodoItem模型类,含id/title/isCompleted等属性,id用于ForEach的唯一 key)。 +6. 在List内用ForEach遍历数据源,每个循环项生成ListItem,并绑定数据(如文字显示title,复选框关联isCompleted)。 +7. 添加交互逻辑(如 “删除” 按钮触发数组filter移除对应项,“新增” 按钮触发数组push添加新项)。 +8. 配置divider和scrollBar,保证列表样式和滚动功能。 +9. 定义分组数据源(如GroupData接口,含groupName(分组标题)和items(组内子项数组))。 +10. 弧形列表 (ArcList)(圆形屏幕推荐使用) + 固定List的高度,确保超出时触发滚动。 + 使用弧形列表可以通过在ArcList组件中按垂直方向线性排列子组件ArcListItem,可以为弧形列表中的每一项提供独立视图。此外,可以使用循环渲染来迭代一组列表项,或结合任意数量的单个视图与ForEach结构,构建复杂的弧形列表。ArcList组件支持多种渲染控制方式,包括条件渲染、循环渲染和懒加载,以生成子组件。 + 定义数据源(如TodoItem模型类,含id/title/isCompleted等属性,id用于ForEach的唯一 key)。 +11. 创建瀑布流(WaterFlow) + 在List内用ForEach遍历数据源,每个循环项生成ListItem,并绑定数据(如文字显示title,复选框关联isCompleted)。 + ArkUI提供了WaterFlow容器组件,用于构建瀑布流布局。WaterFlow组件支持条件渲染、循环渲染和懒加载等方式生成子组件 + +## 具体实现 + +1. 弧形列表 (ArcList)(圆形屏幕推荐使用) + 使用弧形列表可以通过在ArcList组件中按垂直方向线性排列子组件ArcListItem,可以为弧形列表中的每一项提供独立视图。此外,可以使用循环渲染来迭代一组列表项,或结合任意数量的单个视图与ForEach结构,构建复杂的弧形列表。ArcList组件支持多种渲染控制方式,包括条件渲染、循环渲染和懒加载,以生成子组件。 +2. 创建瀑布流(WaterFlow) + ArkUI提供了WaterFlow容器组件,用于构建瀑布流布局。WaterFlow组件支持条件渲染、循环渲染和懒加载等方式生成子组件 ### 相关权限 @@ -134,9 +167,9 @@ entry/src/ohosTest/ 1.本示例仅支持标准系统上运行, 支持设备:RK3568。 -2.本示例为Stage模型,支持API18版本full-SDK,版本号:5.1.0.107,镜像版本号:OpenHarmony_5.1.0 Release。 +2.本示例为Stage模型,支持API20版本full-SDK,版本号:6.0.0.47,镜像版本号:OpenHarmony_6.0.0 Release。 -3.本示例需要使用DevEco Studio 5.0.5 Release (Build Version: 5.0.13.200, built on May 13, 2025)及以上版本才可编译运行。 +3.本示例需要使用DevEco Studio 6.0.0 Release (Build Version: 6.0.0.858, built on September 24, 2025)及以上版本才可编译运行。 ### 下载 @@ -145,7 +178,7 @@ entry/src/ohosTest/ ```` git init git config core.sparsecheckout true -echo code/DocsSample/ArkUIDocSample/ScrollableComponent > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git +echo code/DocsSample/ArkUISample/ScrollableComponent > .git/info/sparse-checkout +git remote add origin https://gitcode.com/openharmony/applications_app_samples.git git pull origin master ```` \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListAcrScrollBar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListAcrScrollBar.ets index 6cb9df1e993b96d6c2dd6864df78c656fad4c23d..27c49955149b512919c4bf4be5fcf48e55cdc967 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListAcrScrollBar.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListAcrScrollBar.ets @@ -20,19 +20,38 @@ import { ArcListItemAttribute, LengthMetrics, ArcScrollBar, + ComponentContent, } from '@kit.ArkUI'; import { ComponentCard } from '../../common/Card'; +@Builder +function customHeader() { + Column() { + Text($r('app.string.ArcListCrown_set')) + .fontColor('#FFFFFFFF') + .fontSize('19fp') + } +} + @Entry @Component export struct ArcListAcrScrollBar { + // [Start create_arcListScroller_start] private arcListScroller: Scroller = new Scroller(); + // [End create_arcListScroller_start] + + + context: UIContext = this.getUIContext(); + arcListHeader: ComponentContent = new ComponentContent(this.context, wrapBuilder(customHeader)); build() { NavDestination() { Column({ space: 12 }) { ComponentCard({ title: $r('app.string.ArcListAcrScrollBar_title') }) { - ArcList({ scroller: this.arcListScroller }) { + // [Start bind_arcList_start] + // 将arcListScroller用于初始化ArcList组件的scroller参数,完成arcListScroller与弧形列表的绑定。 + ArcList({ scroller: this.arcListScroller, header: this.arcListHeader }) { + // [StartExclude bind_arcList_start] ArcListItem() { Row() { Image($r('app.media.wlan')).width('99px').height('99px') @@ -119,14 +138,20 @@ export struct ArcListAcrScrollBar { .width('414px') .height('129px') .backgroundColor('#26FFFFFF') + + // [EndExclude bind_arcList_start] } + // [End bind_arcList_start] .width('466px') .height('466px') .space(LengthMetrics.px(10)) .borderRadius('233px') .backgroundColor(Color.Black) + // [Start bind_arcScrollBar_start] + // 将arcListScroller用于初始化ArcScrollBar组件的scroller参数,完成arcListScroller与滚动条的绑定。 ArcScrollBar({ scroller: this.arcListScroller }) + // [End bind_arcScrollBar_start] } } .width('100%') diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListArcIndexerBar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListArcIndexerBar.ets index ca16ea3554d04747c3e6b5d323ab0bb5f56d9442..8be18dbcbc58be44291e75858e39071ebd72bf14 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListArcIndexerBar.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListArcIndexerBar.ets @@ -12,13 +12,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +// [Start arcAlphabetIndexer_start] import { ArcList, ArcListAttribute, ArcListItemAttribute, ArcListItem, LengthMetrics } from '@kit.ArkUI'; import { ColorMetrics, ComponentContent } from '@ohos.arkui.node'; import { util } from '@kit.ArkTS'; import { ArcAlphabetIndexer, ArcAlphabetIndexerAttribute } from '@ohos.arkui.ArcAlphabetIndexer'; import { ComponentCard } from '../../common/Card'; +// [StartExclude arcAlphabetIndexer_start] class Contact { key: string = util.generateRandomUUID(true); name: string; @@ -29,20 +30,28 @@ class Contact { this.firstChar = firstChar; } } + @Builder function buildText() { Column() { - Text('Contacts') + Text($r('app.string.contacts')) .fontColor('#FFFFFF') .fontSize('19fp') - } } +// [EndExclude arcAlphabetIndexer_start] +const alphabets: string[] = [ + '#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' +]; @Entry @Component export struct ArcListArcIndexerBar { + // [StartExclude arcAlphabetIndexer_start] + private watchSize: string = '600px'; // 手表默认宽高:233*233 + @State contacts: Array = [ new Contact('阿哈', 'A'), new Contact('贝贝', 'B'), @@ -64,23 +73,26 @@ export struct ArcListArcIndexerBar { new Contact('叔叔', 'S'), new Contact('天天', 'T'), ]; - private scrollerForList: Scroller = new Scroller(); - private watchSize: string = '600px'; // 手表默认宽高:233*233 - private fullValue: string[] = [ - '#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', - 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' - ]; + // [EndExclude arcAlphabetIndexer_start] + // 索引条选中项索引 @State indexerIndex: number = 0; + // 列表绑定的滚动控制器 + private arcListScroller: Scroller = new Scroller(); + // [StartExclude arcAlphabetIndexer_start] context: UIContext = this.getUIContext(); tabBar1: ComponentContent = new ComponentContent(this.context, wrapBuilder(buildText)); + // [EndExclude arcAlphabetIndexer_start] build() { + // [StartExclude arcAlphabetIndexer_start] NavDestination() { Column({ space: 12 }) { ComponentCard({ title: $r('app.string.ArcListArcIndexerBar_title') }) { - Stack() { - ArcList({ initialIndex: 0, header:this.tabBar1, scroller:this.scrollerForList }) { + // [EndExclude arcAlphabetIndexer_start] + Stack({alignContent: Alignment.End}) { + ArcList({ initialIndex: 0, header:this.tabBar1, scroller:this.arcListScroller }) { + // [StartExclude arcAlphabetIndexer_start] ForEach(this.contacts, (item: Contact) => { ArcListItem() { Row() { @@ -101,27 +113,36 @@ export struct ArcListArcIndexerBar { .height('130px') .backgroundColor('#26FFFFFF') }, (item: Contact) => JSON.stringify(item)) + // [EndExclude arcAlphabetIndexer_start] } + // [StartExclude arcAlphabetIndexer_start] .space(LengthMetrics.px(10)) .scrollBar(BarState.Off) .width(this.watchSize) .height(this.watchSize) .borderRadius(this.watchSize) .backgroundColor(Color.Black) + // [EndExclude arcAlphabetIndexer_start] .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { + // 根据列表滚动到的索引值,重新计算对应索引条的位置this.selectedIndex this.indexerIndex = centerIndex + 1; }) - - ArcAlphabetIndexer({ arrayValue: this.fullValue, selected: this.indexerIndex}) - .autoCollapse(true) - .width(this.watchSize) - .height(this.watchSize) - .usePopup(false) + // [StartExclude arcAlphabetIndexer_start] + .id('arcIndexTest') + // [EndExclude arcAlphabetIndexer_start] + // 弧形索引条组件 + ArcAlphabetIndexer({ arrayValue: alphabets, selected: this.indexerIndex}) .selected(this.indexerIndex!!) .onSelect((index: number) => { + // 选中索引项后,列表跳转到相应位置 this.indexerIndex = index - this.scrollerForList.scrollToIndex(this.indexerIndex - 1) + this.arcListScroller.scrollToIndex(this.indexerIndex - 1) }) + // [StartExclude arcAlphabetIndexer_start] + .autoCollapse(true) + .width(this.watchSize) + .height(this.watchSize) + .usePopup(false) .hitTestBehavior(HitTestMode.Transparent) .selectedColor(ColorMetrics.resourceColor(0xFFFFFF)) .selectedBackgroundColor(ColorMetrics.resourceColor(0x1F71FF)) @@ -141,8 +162,10 @@ export struct ArcListArcIndexerBar { weight: 500, family: 'HarmonyOS Sans' }) - - }.width('600px') + // [EndExclude arcAlphabetIndexer_start] + } + // [StartExclude arcAlphabetIndexer_start] + .width('600px') } } .width('100%') @@ -151,5 +174,7 @@ export struct ArcListArcIndexerBar { } .backgroundColor('#f1f2f3') .title($r('app.string.ArcListArcIndexerBar_title')) + // [EndExclude arcAlphabetIndexer_start] } } +// [End arcAlphabetIndexer_start] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListContents.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListContents.ets index 007f3911dd50fe7ca9eaa42f51c2be455f09b0ad..8a2561f885089eb5c373808d83407db141d82e5c 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListContents.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListContents.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +// [Start arcListContentsTitle_start] import { ArcList, ArcListAttribute, ArcListItemAttribute, ArcListItem, LengthMetrics } from '@kit.ArkUI'; import { util } from '@kit.ArkTS'; import { ComponentCard } from '../../common/Card'; @@ -78,4 +78,5 @@ export struct ArcListContents { .backgroundColor('#f1f2f3') .title($r('app.string.ArcListContents_title')) } -} \ No newline at end of file +} +// [End arcListContentsTitle_start] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListCreate.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListCreate.ets new file mode 100644 index 0000000000000000000000000000000000000000..cf7506b4be57bd4855d58a0e9c0b4b18a271a28b --- /dev/null +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListCreate.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2025 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 { ColorMetrics, LengthMetrics } from '@kit.ArkUI'; +import { ArcList, ArcListItem, ArcListAttribute, ArcListItemAttribute } from '@kit.ArkUI'; +import { ComponentCard } from '../../common/Card'; + +@Entry +@Component +export struct ArcListCreate { + private watchSize: string = '466px'; // 手表默认宽高:466*466 + + build() { + NavDestination() { + Column() { + ComponentCard({ title: $r('app.string.ArcListCreate_title') }) { + Stack() { + // [Start arcList_create_start] + ArcList({ + initialIndex: 2 + }) { + ArcListItem() { + // [StartExclude arcList_create_start] + Row() { + Text($r('app.string.First_subassembly')).fontSize('38px').fontColor('#FFFFFFFF') + } + // [EndExclude arcList_create_start] + } + ArcListItem() { + // [StartExclude arcList_create_start] + Row() { + Text($r('app.string.Second_subassembly')).fontSize('38px').fontColor('#FFFFFFFF') + } + // [EndExclude arcList_create_start] + } + // [StartExclude arcList_create_start] + ArcListItem() { + Row() { + Text($r('app.string.Third_subassembly')).fontSize('38px').fontColor('#FFFFFFFF') + } + } + // [EndExclude arcList_create_start] + } + // [End arcList_create_start] + .digitalCrownSensitivity(CrownSensitivity.MEDIUM) + .space(LengthMetrics.px(10)) + .scrollBarWidth(LengthMetrics.px(10)) + .scrollBarColor(ColorMetrics.resourceColor(Color.White)) + .borderRadius(this.watchSize) + } + .align(Alignment.Center) + .width(this.watchSize) + .height(this.watchSize) + .borderRadius(this.watchSize) + .backgroundColor(Color.Black) + } + } + .width('100%') + .height('100%') + .padding({ left: 12, right: 12 }) + } + .backgroundColor('#f1f2f3') + .title($r('app.string.ArcListCreate_title')) + } +} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListCrown.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListCrown.ets index cc76cdd3cb9dcb943ca881973e60b9eb965a8712..1ae5539fb69e2761241001e67f913a5bfe17dfd2 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListCrown.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListCrown.ets @@ -37,9 +37,13 @@ export struct ArcListCrown { Column({ space: 12 }) { ComponentCard({ title: $r('app.string.ArcListCrown_title') }) { Stack() { + // [Start arcListCrown_start] + // [Start arcListCrownDigitalCrownSensitivity_start] ArcList({ initialIndex: 2, }) { + // [StartExclude arcListCrown_start] + // [StartExclude arcListCrownDigitalCrownSensitivity_start] ArcListItem() { Text('Network').fontSize('38px').fontColor('#FFFFFFFF') } @@ -109,14 +113,24 @@ export struct ArcListCrown { .width('414px') .height('100px') .backgroundColor('#26FFFFFF') + // [EndExclude arcListCrown_start] + // [EndExclude arcListCrownDigitalCrownSensitivity_start] } + // [StartExclude arcListCrownDigitalCrownSensitivity_start] + // 设置弧形列表支持获焦 + .focusable(true) + // 设置弧形列表支持点击获焦 + .focusOnTouch(true) + // 设置弧形列表为所在页面上的默认焦点 + .defaultFocus(true) + // [End arcListCrown_start] + // [EndExclude arcListCrownDigitalCrownSensitivity_start] + .digitalCrownSensitivity(CrownSensitivity.MEDIUM) + // [End arcListCrownDigitalCrownSensitivity_start] .space(LengthMetrics.px(10)) .scrollBarWidth(LengthMetrics.px(10)) .scrollBarColor(ColorMetrics.resourceColor(Color.White)) .borderRadius(this.watchSize) - .focusable(true) - .focusOnTouch(true) - .defaultFocus(true) } .align(Alignment.Center) .width(this.watchSize) diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListShow.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListShow.ets index 932600a062460483ac317ddba7abce9249dbe6bc..cc3a376339dc669f4ed620dcfbbea0d0b6d22435 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListShow.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListShow.ets @@ -12,9 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -import { ArcList, ArcListItem, ArcListAttribute, ArcListItemAttribute, LengthMetrics, } from '@kit.ArkUI'; import { ComponentCard } from '../../common/Card'; +// [Start arcListShow_start] +import { ArcList, ArcListItem, ArcListAttribute, ArcListItemAttribute, LengthMetrics, } from '@kit.ArkUI'; @Entry @Component @@ -125,4 +125,5 @@ export struct ArcListShow { .backgroundColor('#f1f2f3') .title($r('app.string.ArcListShow_title')) } -} \ No newline at end of file +} +// [End arcListShow_start] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListSideSlip.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListSideSlip.ets index ce364a1d3495111550eda7d0bca4206abf81f1f9..0f8e53a66e238dab0b1be53459c8c2a8d6398b76 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListSideSlip.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListSideSlip.ets @@ -28,6 +28,7 @@ class Contact { this.firstChar = firstChar; } } + @Builder function buildText() { Column() { @@ -67,18 +68,17 @@ export struct ArcListSideSlip { new Contact('叔叔', 'S'), new Contact('天天', 'T'), ]; - private scrollerForList: Scroller = new Scroller(); - @State indexerIndex: number = 0; context: UIContext = this.getUIContext(); tabBar1: ComponentContent = new ComponentContent(this.context, wrapBuilder(buildText)); + // [Start create_SideSlip_start] @Builder itemEnd(item: Contact) { // 构建尾端滑出组件 Button({ type: ButtonType.Circle }) { - Image($r('app.media.MaterialSymbolsDelete')) + Image($r('app.media.ic_public_delete_filled')) .width(20) .height(20) } @@ -92,12 +92,14 @@ export struct ArcListSideSlip { iterations: 1, playMode: PlayMode.Normal, }, () => { + // this.contacts为列表数据源,可根据实际场景构造,indexOf方法可获取将被删除数据在数据源中的索引 let index = this.contacts.indexOf(item); + // 从数据源删除指定数据项 this.contacts.splice(index, 1); }) - }) } + // [End create_SideSlip_start] build() { NavDestination() { @@ -106,7 +108,10 @@ export struct ArcListSideSlip { Stack() { ArcList({ initialIndex: 0, header: this.tabBar1, scroller: this.scrollerForList }) { ForEach(this.contacts, (item: Contact) => { + // [Start bind_swipeAction_start] + // 构建ArcList时,通过ForEach基于数据源this.contacts循环渲染ArcListItem ArcListItem() { + // [StartExclude bind_swipeAction_start] Row() { Text(item.firstChar) .textAlign(TextAlign.Center) @@ -121,6 +126,7 @@ export struct ArcListSideSlip { .borderRadius('65px') .width('90%') .justifyContent(FlexAlign.Start) + // [EndExclude bind_swipeAction_start] } .swipeAction({ end: { @@ -130,6 +136,7 @@ export struct ArcListSideSlip { }, } }) // 设置侧滑属性. + // [End bind_swipeAction_start] .borderRadius('65px') .width('400px') .height('130px') diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListStyles.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListStyles.ets index d3452e6ba7f8f05c5df4a15dee0d94cab2ff54b7..2545e281bbac4d81ace1f84de8c655728d30d0c7 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListStyles.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcListStyles.ets @@ -23,6 +23,7 @@ import { } from '@kit.ArkUI'; import { ComponentCard } from '../../common/Card'; +//[Start create_customHeader_start] @Builder function customHeader() { Column() { @@ -31,22 +32,26 @@ function customHeader() { .fontSize('19fp') } } - +//[End create_customHeader_start] @Entry @Component export struct ArcListStyles { + //[Start componentContent_start] context: UIContext = this.getUIContext(); arcListHeader: ComponentContent = new ComponentContent(this.context, wrapBuilder(customHeader)); + //[End componentContent_start] build() { NavDestination() { Column({ space: 12 }) { - List(){ - ListItem(){ + List() { + ListItem() { ComponentCard({ title: $r('app.string.ArcListStyles_head') }) { + //[Start arcListHeader_start] ArcList({ header: this.arcListHeader }) { ArcListItem() { + // [StartExclude arcListHeader_start] Row() { Image($r('app.media.wlan')).width('99px').height('99px') .borderRadius('50px').margin({ left: 7 }) @@ -58,13 +63,17 @@ export struct ArcListStyles { Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') .borderRadius('50px') } + // [EndExclude arcListHeader_start] } + // [StartExclude arcListHeader_start] .borderRadius('65px') .width('414px') .height('129px') .backgroundColor('#26FFFFFF') + // [EndExclude arcListHeader_start] ArcListItem() { + // [StartExclude arcListHeader_start] Row() { Image($r('app.media.blueTooth')).width('99px').height('99px') .borderRadius('50px').margin({ left: 7 }) @@ -76,7 +85,9 @@ export struct ArcListStyles { Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') .borderRadius('50px') } + // [EndExclude arcListHeader_start] } + // [StartExclude arcListHeader_start] .borderRadius('65px') .width('414px') .height('129px') @@ -132,7 +143,9 @@ export struct ArcListStyles { .width('414px') .height('129px') .backgroundColor('#26FFFFFF') + // [EndExclude arcListHeader_start] } + //[End arcListHeader_start] .width('466px') .height('466px') .space(LengthMetrics.px(10)) @@ -141,9 +154,11 @@ export struct ArcListStyles { } } - ListItem(){ + ListItem() { ComponentCard({ title: $r('app.string.ArcListStyles_titleSpacing') }) { + // [Start arcListSpace_start] ArcList({ initialIndex: 2 }) { + // [StartExclude arcListSpace_start] ArcListItem() { Row() { Image($r('app.media.wlan')).width('99px').height('99px') @@ -230,17 +245,18 @@ export struct ArcListStyles { .width('414px') .height('129px') .backgroundColor('#26FFFFFF') + // [EndExclude arcListSpace_start] } + .space(LengthMetrics.px(30)) + // [End arcListSpace_start] .width('466px') .height('466px') - .space(LengthMetrics.px(30)) .borderRadius('233px') .backgroundColor(Color.Black) - } } - ListItem(){ + ListItem() { ComponentCard({ title: $r('app.string.ArcListStyles_titleScale') }) { ArcList({ initialIndex: 2 }) { ArcListItem() { @@ -278,8 +294,9 @@ export struct ArcListStyles { .width('414px') .height('129px') .backgroundColor('#26FFFFFF') - + // [Start arcListScale_start] ArcListItem() { + // [StartExclude arcListScale_start] Row() { Image($r('app.media.mobileData')).width('99px').height('99px') .borderRadius('50px').margin({ left: 7 }) @@ -290,12 +307,14 @@ export struct ArcListStyles { Image($r('app.media.ic_settings_arrow')).width('92px').height('92px') .borderRadius('50px') } + // [EndExclude arcListScale_start] } + .autoScale(false) + // [End arcListScale_start] .borderRadius('65px') .width('414px') .height('129px') .backgroundColor('#26FFFFFF') - .autoScale(false) ArcListItem() { Row() { diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcLongList.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcLongList.ets index 6ddd21ef91d42add85eb674413d50693f0df0a36..72677d37f055b2f97c9dcece1a08f29d51f445c3 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcLongList.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/ArcLongList.ets @@ -122,7 +122,9 @@ export struct ArcLongList { NavDestination() { Column({ space: 12 }) { ComponentCard({ title: $r('app.string.ArcLongList_title') }) { + // [Start arcLongList_start] ArcList() { + // [StartExclude arcLongList_start] LazyForEach(this.data, (item: StringData, index: number) => { ArcListItem() { Text(item.message).fontSize(30).fontColor(Color.White) @@ -131,7 +133,9 @@ export struct ArcLongList { item.message += '0'; }) }, (item: StringData, index: number) => JSON.stringify(item) + index.toString()) + // [EndExclude arcLongList_start] }.cachedCount(3) + // [End arcLongList_start] .space(LengthMetrics.px(10)) .scrollBar(BarState.Auto) .width('466px') diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/arcListBuiltInScrollerBar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/arcListBuiltInScrollerBar.ets index f38604db4abcad1d3eb7fe6d91386fcb1c9d411f..99148c2f4331257e3f4c77d105429abc9318d634 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/arcListBuiltInScrollerBar.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/arcListBuiltInScrollerBar.ets @@ -13,18 +13,39 @@ * limitations under the License. */ -import { ArcList, ArcListItem, ArcListAttribute, ArcListItemAttribute, LengthMetrics, ColorMetrics } from '@kit.ArkUI'; +import { + ArcList, + ArcListItem, + ArcListAttribute, + ArcListItemAttribute, + LengthMetrics, + ColorMetrics, + ComponentContent +} from '@kit.ArkUI'; import { ComponentCard } from '../../common/Card'; +@Builder +function customHeader() { + Column() { + Text($r('app.string.ArcListCrown_set')) + .fontColor('#FFFFFFFF') + .fontSize('19fp') + } +} + @Entry @Component export struct arcListBuiltInScrollerBar { + context: UIContext = this.getUIContext(); + arcListHeader: ComponentContent = new ComponentContent(this.context, wrapBuilder(customHeader)); build() { NavDestination() { Column({ space: 12 }) { ComponentCard({ title: $r('app.string.arcListBuiltInScrollerBar_title') }) { - ArcList() { + // [Start arcListBuiltInScrollBar_start] + ArcList({ header: this.arcListHeader }) { + // [StartExclude arcListBuiltInScrollBar_start] ArcListItem() { Row() { Image($r('app.media.wlan')).width('99px').height('99px') @@ -111,7 +132,12 @@ export struct arcListBuiltInScrollerBar { .width('414px') .height('129px') .backgroundColor('#26FFFFFF') + // [EndExclude arcListBuiltInScrollBar_start] } + .scrollBar(BarState.Auto) + .scrollBarWidth(LengthMetrics.px(10)) + .scrollBarColor(ColorMetrics.resourceColor(Color.White)) + // [End arcListBuiltInScrollBar_start] .width('466px') .height('466px') .space(LengthMetrics.px(10)) diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/index.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/index.ets index b2b874b86cf2ef6da31a8d4aa1a8d3ac845e95fd..6c85cf8aa7753d21f8ea2b2fa339bd7732a592b2 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/index.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcList/index.ets @@ -24,6 +24,7 @@ import { ArcListShow } from './ArcListShow'; import { ArcListSideSlip } from './ArcListSideSlip'; import { ArcListStyles } from './ArcListStyles'; import { ArcLongList } from './ArcLongList'; +import { ArcListCreate } from './ArcListCreate'; import resource from '../../common/resource'; @@ -74,6 +75,11 @@ const routes: Route[] = [ name: `${ARCLIST_ROUTE_PREFIX}/ArcListCrown`, title: resource.resourceToString($r('app.string.ArcListCrown_title')), description: $r('app.string.ArcListCrown_description') + }, + { + name: `${ARCLIST_ROUTE_PREFIX}/ArcListCreate`, + title: resource.resourceToString($r('app.string.ArcListCreate_title')), + description: $r('app.string.ArcListCreate_description') } ]; @@ -99,6 +105,8 @@ export function arcListDestination(name: string) { ArcLongList(); } else if (name === routes[8].name) { ArcListCrown(); + } else if (name === routes[9].name) { + ArcListCreate(); } } diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperAction.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperAction.ets index d7f1f0af987e314896998fd453ee0d0905692d02..192755d6ef97866e2a130afea4bf0fd4210f8825 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperAction.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperAction.ets @@ -13,10 +13,11 @@ * limitations under the License. */ +// [Start action] import { Decimal } from '@kit.ArkTS'; import { ArcSwiper, - ArcSwiperAttribute, + ArcSwiperAttribute, // ArcSwiper的属性依赖ArcSwiperAttribute对象导入,不建议删除该对象的引入。 } from '@kit.ArkUI'; import { ComponentCard } from '../../common/Card'; @@ -36,9 +37,13 @@ export struct ArcSwiperAction { } build() { + // [StartExclude action] NavDestination() { + // [EndExclude action] Column({ space: 12 }) { + // [StartExclude action] ComponentCard({ title: $r('app.string.ArcSwiperAction_title') }) { + // [EndExclude action] ArcSwiper() { ForEach(this.backgroundColors, (backgroundColor: Color, index: number) => { Text(index.toString()) @@ -66,13 +71,18 @@ export struct ArcSwiperAction { } } }) + // [StartExclude action] } + // [EndExclude action] } .width('100%') .height('100%') .padding({ left: 12, right: 12 }) + // [StartExclude action] } .backgroundColor('#f1f2f3') .title($r('app.string.ArcSwiperAction_title')) + // [EndExclude action] } -} \ No newline at end of file +} +// [End action] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperHorizontal.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperHorizontal.ets index 47d538edcbc3bac7bba2cea7f8e10c588061d6b0..cee0ecf817ca87b21a7e9411d2f8428729d572a2 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperHorizontal.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperHorizontal.ets @@ -28,7 +28,9 @@ export struct ArcSwiperHorizontal { NavDestination() { Column({ space: 12 }) { ComponentCard({ title: $r('app.string.ArcSwiperHorizontal_title') }) { + // [Start horizontal] ArcSwiper() { + // [StartExclude horizontal] Text('0') .width(233) .height(233) @@ -49,9 +51,11 @@ export struct ArcSwiperHorizontal { .backgroundColor(Color.Pink) .textAlign(TextAlign.Center) .fontSize(30) + // [EndExclude horizontal] } .indicator(true) .vertical(false) + // [End horizontal] } } .width('100%') diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperSideSlip.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperSideSlip.ets index af64879aee82cd2758e3bab79a60b911c54b904e..5b2ff9e861d524eaa5128ca7a5ff4014b923a97b 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperSideSlip.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperSideSlip.ets @@ -13,9 +13,10 @@ * limitations under the License. */ +// [Start side_slip] import { ArcSwiper, - ArcSwiperAttribute, + ArcSwiperAttribute, // ArcSwiper的属性依赖ArcSwiperAttribute对象导入,不建议删除该对象的引入。 ArcDotIndicator, ArcDirection, ArcSwiperController @@ -29,9 +30,13 @@ export struct ArcSwiperSideSlip { innerSelectedIndex: number = 0; build() { + // [StartExclude side_slip] NavDestination() { + // [EndExclude side_slip] Column({ space: 12 }) { + // [StartExclude side_slip] ComponentCard({ title: $r('app.string.ArcSwiperSideSlip_title') }) { + // [EndExclude side_slip] ArcSwiper() { ForEach(this.backgroundColors, (backgroundColor: Color, index: number) => { Text(index.toString()) @@ -62,13 +67,18 @@ export struct ArcSwiperSideSlip { } return GestureJudgeResult.CONTINUE; }) + // [StartExclude side_slip] } + // [EndExclude side_slip] } .width('100%') .height('100%') .padding({ left: 12, right: 12 }) + // [StartExclude side_slip] } .backgroundColor('#f1f2f3') .title($r('app.string.ArcSwiperSideSlip_title')) + // [EndExclude side_slip] } -} \ No newline at end of file +} +// [End side_slip] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperStyles.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperStyles.ets index 11bf5dd57c629e5e812e2d555e3e8d07c1f51a1a..d0e66d80fe08ee098e4eb4623844e1cbe254d77c 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperStyles.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperStyles.ets @@ -13,6 +13,7 @@ * limitations under the License. */ +// [Start import] import { ArcSwiper, ArcSwiperAttribute, @@ -20,6 +21,7 @@ import { ArcDirection, ArcSwiperController } from '@kit.ArkUI'; +// [End import] import { ComponentCard } from '../../common/Card'; @Entry @@ -31,6 +33,7 @@ export struct ArcSwiperStyles { NavDestination() { Column({ space: 12 }) { ComponentCard({ title: $r('app.string.ArcSwiperStyles_titleDefault') }) { + // [Start styles_default] ArcSwiper() { Text('0') .width(233) @@ -52,11 +55,14 @@ export struct ArcSwiperStyles { .backgroundColor(Color.Pink) .textAlign(TextAlign.Center) .fontSize(30) + // [End styles_default] } } ComponentCard({ title: $r('app.string.ArcSwiperStyles_titleCustomize') }) { + // [Start styles_customize] ArcSwiper() { + // [StartExclude styles_customize] Text('0') .width(233) .height(233) @@ -77,6 +83,7 @@ export struct ArcSwiperStyles { .backgroundColor(Color.Pink) .textAlign(TextAlign.Center) .fontSize(30) + // [EndExclude styles_customize] } .indicator( new ArcDotIndicator() @@ -84,6 +91,7 @@ export struct ArcSwiperStyles { .itemColor(Color.Red) // 设置导航点颜色为红色 .selectedItemColor(Color.Blue) // 设置选中导航点颜色为蓝色 ) + // [End styles_customize] } } .width('100%') diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperToggle.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperToggle.ets index 143dab03e084c9835a635891065543a62626a1f9..69a06937f586e7c23fa41a1302f96c94577fad4a 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperToggle.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperToggle.ets @@ -13,6 +13,8 @@ * limitations under the License. */ +// [Start toggle] +// 导入ArcButton和ArcSwiper模块 import { ArcButton, ArcButtonOptions, @@ -20,24 +22,36 @@ import { ArcButtonStyleMode, ArcButtonPosition, ArcSwiper, - ArcSwiperAttribute, + ArcSwiperAttribute, // ArcSwiper的属性依赖ArcSwiperAttribute对象导入,不建议删除该对象的引入。 ArcDotIndicator, + // [StartExclude toggle] ArcDirection, ArcSwiperController + // [EndExclude toggle] } from '@kit.ArkUI'; +// [StartExclude toggle] import { ComponentCard } from '../../common/Card'; - +// [EndExclude toggle] @Entry @Component export struct ArcSwiperToggle { private wearableSwiperController: ArcSwiperController = new ArcSwiperController(); build() { + // [StartExclude toggle] NavDestination() { + // [EndExclude toggle] Column({ space: 12 }) { + // [StartExclude toggle] ComponentCard({ title: $r('app.string.ArcSwiperToggle_title') }) { + // [EndExclude toggle] Stack() { + // [Start toggle_sensitivity] + // [Start toggle_focus] ArcSwiper(this.wearableSwiperController) { + // [StartExclude toggle] + // [StartExclude toggle_focus] + // [StartExclude toggle_sensitivity] Text('0') .width(233) .height(233) @@ -58,9 +72,27 @@ export struct ArcSwiperToggle { .backgroundColor(Color.Pink) .textAlign(TextAlign.Center) .fontSize(30) + // [EndExclude toggle_sensitivity] + // [EndExclude toggle_focus] + // [EndExclude toggle] } + // [StartExclude toggle_sensitivity] + // [StartExclude toggle_focus] .vertical(true) .indicator(false) + // [EndExclude toggle_focus] + + // [StartExclude toggle] + .focusable(true) + .focusOnTouch(true) + .defaultFocus(true) + // [EndExclude toggle_sensitivity] + // [End toggle_focus] + + .digitalCrownSensitivity(CrownSensitivity.MEDIUM) + // [EndExclude toggle] + // [End toggle_sensitivity] + Column() { ArcButton({ @@ -88,13 +120,18 @@ export struct ArcSwiperToggle { }) }.width('100%').height('100%') } + // [StartExclude toggle] } + // [EndExclude toggle] } .width('100%') .height('100%') .padding({ left: 12, right: 12 }) + // [StartExclude toggle] } .backgroundColor('#f1f2f3') .title($r('app.string.ArcSwiperToggle_title')) + // [EndExclude toggle] } -} \ No newline at end of file +} +// [End toggle] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperVertical.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperVertical.ets index 4e27070ed8f885ad6ff9a12113450e85ffa0c8cd..c0834d9e36bc8d3e4184b499e69aca002d882c07 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperVertical.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/arcSwiper/ArcSwiperVertical.ets @@ -31,7 +31,9 @@ export struct ArcSwiperVertical { NavDestination() { Column({ space: 12 }) { ComponentCard({ title: $r('app.string.ArcSwiperVertical_title') }) { + // [Start vertical] ArcSwiper() { + // [StartExclude vertical] Text('0') .width(233) .height(233) @@ -52,10 +54,12 @@ export struct ArcSwiperVertical { .backgroundColor(Color.Pink) .textAlign(TextAlign.Center) .fontSize(30) + // [EndExclude vertical] } .indicator(new ArcDotIndicator() .arcDirection(ArcDirection.THREE_CLOCK_DIRECTION)) .vertical(true) + // [End vertical] } } .width('100%') diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/DataInGrid.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/DataInGrid.ets index 998e35a9c3588b59688047ef09b801272c69d287..d50caec9495e54436d79452d716c94d80221f76a 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/DataInGrid.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/DataInGrid.ets @@ -14,13 +14,23 @@ */ import { ComponentCard } from '../../common/Card'; - // [Start build_a_office_services_grid_of_foreach] +import common from '@ohos.app.ability.common'; @Entry @Component export struct DataInGrid { - @State services: Array = ['Meeting', 'Voting', 'Check-in', 'Printing']; - + @State services: Array = []; + aboutToAppear(): void { + const context = this.getUIContext().getHostContext() as common.UIAbilityContext; + const meeting = context.resourceManager.getStringByNameSync('Meeting') + this.services.push(meeting) + const check = context.resourceManager.getStringByNameSync('Check_in') + this.services.push(check) + const voting = context.resourceManager.getStringByNameSync('Voting') + this.services.push(voting) + const printing = context.resourceManager.getStringByNameSync('Printing') + this.services.push(printing) + } build() { // [StartExclude build_a_office_services_grid_of_foreach] NavDestination() { @@ -29,25 +39,31 @@ export struct DataInGrid { // [StartExclude build_a_office_services_grid_of_foreach] ComponentCard({ title: $r('app.string.DataInGrid_titleOfficeServices') }) { // [EndExclude build_a_office_services_grid_of_foreach] + // $r('app.string.build_a_office_services_grid')需要替换为开发者所需的字符串资源 // [Start build_a_office_services_grid] + Grid() { GridItem() { - Text('Meeting') + // $r('app.string.Meeting')需要替换为开发者所需的资源文件 + Text($r('app.string.Meeting')) .fontSize(24) }.backgroundColor('#FFF1F3F5') GridItem() { - Text('Check-in') + // $r('app.string.Check_in')需要替换为开发者所需的资源文件 + Text($r('app.string.Check_in')) .fontSize(24) }.backgroundColor('#FFF1F3F5') GridItem() { - Text('Voting') + // $r('app.string.Voting')需要替换为开发者所需的资源文件 + Text($r('app.string.Voting')) .fontSize(24) }.backgroundColor('#FFF1F3F5') GridItem() { - Text('Printing') + // $r('app.string.Printing')需要替换为开发者所需的资源文件 + Text($r('app.string.Printing')) .fontSize(24) }.backgroundColor('#FFF1F3F5') } @@ -62,6 +78,7 @@ export struct DataInGrid { } // [StartExclude build_a_office_services_grid_of_foreach] + // $r('app.string.DataInGrid_titleForEach')需要替换为开发者所需的资源文件 ComponentCard({ title: $r('app.string.DataInGrid_titleForEach') }) { // [EndExclude build_a_office_services_grid_of_foreach] Grid() { diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridCalculator.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridCalculator.ets index bb1fe49ef5bb281a53c80353f9aaf1dd3324ff19..b44c0e5b11b18ef250f7ea040a07f1cd588328bf 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridCalculator.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridCalculator.ets @@ -21,6 +21,7 @@ export struct GridCalculator { private buttonArray: string[] = ['CE', 'C', '/', 'X', '7', '8', '9', '-', '4', '5', '6', '+', '1', '2', '3', '=', '0', '.']; @State res: string = '0'; + //[Start Set_numberrows_columns] layoutOptions: GridLayoutOptions = { regularSize: [1, 1], onGetRectByIndex: (index: number) => { @@ -64,12 +65,14 @@ export struct GridCalculator { return [0, 0, 2, 4]; } } - + // [StartExclude Set_numberrows_columns] build() { NavDestination() { Column({ space: 12 }) { ComponentCard({ title: $r('app.string.GridCalculator_title') }) { + // [EndExclude Set_numberrows_columns] Grid(undefined, this.layoutOptions) { + // [StartExclude Set_numberrows_columns] ForEach(this.buttonArray, (item: string) => { GridItem() { Button(item) @@ -87,13 +90,17 @@ export struct GridCalculator { GridItem() { Text(this.res).width('100%').height('100%').textAlign(TextAlign.End).fontSize(30) }.backgroundColor(0x55555555).borderRadius(10) + // [EndExclude Set_numberrows_columns] } .columnsTemplate('1fr 1fr 1fr 1fr') .rowsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr') + // [StartExclude Set_numberrows_columns] .rowsGap(8) .columnsGap(5) .width('100%') .height('80%') + // [EndExclude Set_numberrows_columns] + // [End Set_numberrows_columns] } } } diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridScrollbar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridScrollbar.ets index 74443ede7231b3c0ef3b7f976a730a51cb05e45c..46a91a71913300ac634495f5a6c5585982c68ce5 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridScrollbar.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridScrollbar.ets @@ -20,7 +20,9 @@ import { ComponentCard } from '../../common/Card'; @Component export struct GridScrollbar { numbers: GridDataSource = new GridDataSource([]); + // [Start Add_external_scrollbar] scroller: Scroller = new Scroller(); + // [StartExclude Add_external_scrollbar] @State gridPosition: number = 0; //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 aboutToAppear() { @@ -32,13 +34,17 @@ export struct GridScrollbar { } this.numbers = new GridDataSource(list); } - + // [EndExclude Add_external_scrollbar] build() { + // [StartExclude Add_external_scrollbar] NavDestination() { Column({ space: 12 }) { + // $r('app.string.GridScrollbar_title')需要替换为开发者所需的资源文件 ComponentCard({ title: $r('app.string.GridScrollbar_title') }) { Row({ space: 5 }) { + // [EndExclude Add_external_scrollbar] Grid(this.scroller) { + // [StartExclude Add_external_scrollbar] LazyForEach(this.numbers, (day: string) => { GridItem() { Text() @@ -49,7 +55,9 @@ export struct GridScrollbar { .textAlign(TextAlign.Center) } }, (index: number) => index.toString()) + // [EndExclude Add_external_scrollbar] } + // [StartExclude Add_external_scrollbar] .columnsTemplate('1fr 1fr 1fr 1fr 1fr') .columnsGap(10) .rowsGap(10) @@ -57,7 +65,7 @@ export struct GridScrollbar { .enableScrollInteraction(true) .supportAnimation(false) .multiSelectable(false) - .edgeEffect(EdgeEffect.Spring) + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true, effectEdge: EffectEdge.START }) .scrollBar(BarState.Off) .scrollBarColor(Color.Grey) .scrollBarWidth(4) @@ -65,8 +73,10 @@ export struct GridScrollbar { .backgroundColor(0xFAEEE0) .height(300) .margin({left:10}) + // [EndExclude Add_external_scrollbar] ScrollBar({ scroller: this.scroller }).height(300) - + // [End Add_external_scrollbar] + // [StartExclude Add_external_scrollbar] }.width('100%').margin({ top: 5 }) } } @@ -74,6 +84,7 @@ export struct GridScrollbar { .height('100%') .padding({ left: 12, right: 12 }) } + // [EndExclude Add_external_scrollbar] .backgroundColor('#f1f2f3') .title($r('app.string.GridScrollbar_title')) } diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridSideToSide.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridSideToSide.ets index fd30401da34682d2b17f44b8411c2cb5d81de55a..0ce1ed7f213ee46defad266c2feb066cded66dec 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridSideToSide.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/GridSideToSide.ets @@ -41,9 +41,12 @@ export struct GridSideToSide { build() { NavDestination() { Column({ space: 12 }) { + // $r('app.string.GridSideToSide_title')需要替换为开发者所需的资源文件 ComponentCard({ title: $r('app.string.GridSideToSide_title') }) { + // [Start Control_scrolling_position] Column(){ Grid(this.scroller) { + // [StartExclude Control_scrolling_position] LazyForEach(this.numbers, (day: string) => { GridItem() { Text(day) @@ -54,23 +57,25 @@ export struct GridSideToSide { .textAlign(TextAlign.Center) } }, (index: number) => index.toString()) + // [EndExclude Control_scrolling_position] } .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr') + // [StartExclude Control_scrolling_position] .columnsGap(10) .rowsGap(10) .width('90%') .height(300) .scrollBar(BarState.Off) - + // [EndExclude Control_scrolling_position] Row({ space: 20 }) { - Button('上一页') + Button($r('app.string.Previous_Page')) .onClick(() => { this.scroller.scrollPage({ next: false }); }) - Button('下一页') + Button($r('app.string.Next_page')) .onClick(() => { this.scroller.scrollPage({ next: true @@ -78,6 +83,7 @@ export struct GridSideToSide { }) } } + // [Start Control_scrolling_position] } } .width('100%') diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/LongGrid.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/LongGrid.ets index 073655c3e3024bba52fa4496f8f9ece2e03c2774..ac5c3b462f1d358fae6b563141315ef28976c253 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/LongGrid.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/LongGrid.ets @@ -35,20 +35,29 @@ export struct LongGrid { build() { NavDestination() { Column({ space: 12 }) { + // $r('app.string.LongGrid_title')需要替换为开发者所需的资源文件 ComponentCard({ title: $r('app.string.LongGrid_title') }) { Column({ space: 5 }) { + // [Start long_list] Grid(this.scroller) { LazyForEach(this.numbers, (day: string) => { GridItem() { + // [StartExclude long_list] Text(day) .fontSize(16) .backgroundColor(0xF9CF93) .width('100%') .height(80) .textAlign(TextAlign.Center) + // [EndExclude long_list] } - }, (index: number) => index.toString()) + } + // [StartExclude long_list] + , (index: number) => index.toString()) + // [EndExclude long_list] } + .cachedCount(3) + // [End long_list] .columnsTemplate('1fr 1fr 1fr 1fr 1fr') .columnsGap(10) .rowsGap(20) diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/ScrollPositionGrid.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/ScrollPositionGrid.ets index da773f1c37ed27e85c02d98ec3db72585f7fa335..06e537606b0b8f075e839d9b19a5f0bf0cd789b4 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/ScrollPositionGrid.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/ScrollPositionGrid.ets @@ -28,6 +28,7 @@ export struct ScrollPosition { build() { NavDestination() { Column({ space: 12 }) { + // $r('app.string.ScrollPosition_titleExample')需要替换为开发者所需的资源文件 ComponentCard({ title: $r('app.string.ScrollPosition_titleExample') }) { // [Start control_the_grid_scroll] Column({ space: 12 }) { diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/ScrollableGrid.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/ScrollableGrid.ets index 288ed72065440598d7edf5a99e8c68c7e4bfde69..f15991d1ecb04e62593fc1e510496ffe72445015 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/ScrollableGrid.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/grid/ScrollableGrid.ets @@ -14,18 +14,43 @@ */ import { ComponentCard } from '../../common/Card'; - // [Start build_scrollable_horizontally_grid_layouts] +import common from '@ohos.app.ability.common'; @Entry @Component export struct ScrollableGrid { - @State services: Array = ['Live Streaming', 'Imported', 'Categories', 'Recharge', - 'Membership', 'Claim Coupon', 'Lottery', 'Favorites', 'Points', 'More']; - + @State services: Array = []; + aboutToAppear(): void { + const context = this.getUIContext().getHostContext() as common.UIAbilityContext; + const streaming = context.resourceManager.getStringByNameSync('Live_Streaming') + this.services.push(streaming) + const imported = context.resourceManager.getStringByNameSync('Imported') + this.services.push(imported) + const categories = context.resourceManager.getStringByNameSync('Categories') + this.services.push(categories) + const recharge = context.resourceManager.getStringByNameSync('Recharge') + this.services.push(recharge) + const membership = context.resourceManager.getStringByNameSync('Membership') + this.services.push(membership) + const claim = context.resourceManager.getStringByNameSync('Claim_Coupon') + this.services.push(claim) + const lottery = context.resourceManager.getStringByNameSync('Lottery') + this.services.push(lottery) + const favorites = context.resourceManager.getStringByNameSync('Favorites') + this.services.push(favorites) + const points = context.resourceManager.getStringByNameSync('Points') + this.services.push(points) + const more = context.resourceManager.getStringByNameSync('More') + this.services.push(more) + } build() { + // [StartExclude build_scrollable_horizontally_grid_layouts] NavDestination() { + // [EndExclude build_scrollable_horizontally_grid_layouts] Column({ space: 12 }) { + // [StartExclude build_scrollable_horizontally_grid_layouts] ComponentCard({ title: $r('app.string.ScrollableGrid_titleHorizontal') }) { + // [EndExclude build_scrollable_horizontally_grid_layouts] Grid() { ForEach(this.services, (service: string) => { GridItem() { @@ -39,14 +64,18 @@ export struct ScrollableGrid { // [EndExclude build_scrollable_horizontally_grid_layouts] .rowsGap(15) .rowsTemplate('1fr 1fr') // 只设置rowsTemplate属性,当内容超出Grid区域时,可水平滚动。 + // [StartExclude build_scrollable_horizontally_grid_layouts] } + // [EndExclude build_scrollable_horizontally_grid_layouts] } - // [End build_scrollable_horizontally_grid_layouts] .width('100%') .height('100%') .padding({ left: 12, right: 12 }) + // [StartExclude build_scrollable_horizontally_grid_layouts] } .backgroundColor('#f1f2f3') .title($r('app.string.ScrollableGrid_title')) + // [EndExclude build_scrollable_horizontally_grid_layouts] } -} \ No newline at end of file +} +// [End build_scrollable_horizontally_grid_layouts] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/AddListItem.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/AddListItem.ets index befa4ca236b5c617a222d87786323ebb9fbb7cd9..4257e0d86f7767efa382c22976bc17d661defac4 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/AddListItem.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/AddListItem.ets @@ -16,8 +16,12 @@ import { ComponentCard } from '../../common/Card'; // [Start define_the_data_to_be_done] import { util } from '@kit.ArkTS'; +import { UIContext } from '@kit.ArkUI'; +// [Start build_list_layouts_and_list_items] +import common from '@ohos.app.ability.common'; - +// [StartExclude build_list_layouts_and_list_items] +// [Start build_the_overall_list_layout_and_list_items] export class ToDo { public key: string = util.generateRandomUUID(true); public name: string; @@ -28,7 +32,6 @@ export class ToDo { } // [End define_the_data_to_be_done] -// [Start build_the_overall_list_layout_and_list_items] @Component export struct ToDoListItem { @Link isEditMode: boolean; @@ -54,16 +57,16 @@ export struct ToDoListItem { // [StartExclude build_the_overall_list_layout_and_list_items] GestureGroup(GestureMode.Exclusive, LongPressGesture() - // [EndExclude build_the_overall_list_layout_and_list_items] + // [EndExclude build_the_overall_list_layout_and_list_items] .onAction(() => { }) ) ) } } -// [End build_the_overall_list_layout_and_list_items] -// [Start build_list_layouts_and_list_items] +// [End build_the_overall_list_layout_and_list_items] +// [EndExclude build_list_layouts_and_list_items] @Entry @Component export struct AddListItem { @@ -75,7 +78,23 @@ export struct AddListItem { // [EndExclude build_list_layouts_and_list_items] @Watch('onEditModeChange') @State isEditMode: boolean = false @State selectedItems: ToDo[] = [] - private availableThings: string[] = ['Reading', 'Exercise', 'Travel', 'Listening Music', 'Watching Films', 'Singing']; + private availableThings: string [] = []; + + aboutToAppear(): void { + const context = this.getUIContext().getHostContext() as common.UIAbilityContext; + const reading = context.resourceManager.getStringByNameSync('Reading') + this.availableThings.push(reading) + const exercise = context.resourceManager.getStringByNameSync('Exercise') + this.availableThings.push(exercise) + const travel = context.resourceManager.getStringByNameSync('Travel') + this.availableThings.push(travel) + const listening = context.resourceManager.getStringByNameSync('Listening_Music') + this.availableThings.push(listening) + const watching = context.resourceManager.getStringByNameSync('Watching_Films') + this.availableThings.push(watching) + const singing = context.resourceManager.getStringByNameSync('Singing') + this.availableThings.push(singing) + } onEditModeChange() { if (!this.isEditMode) { @@ -89,6 +108,7 @@ export struct AddListItem { // [EndExclude build_list_layouts_and_list_items] Column({ space: 12 }) { // [StartExclude build_list_layouts_and_list_items] + // $r('app.string.AddListItem_titleExample')需要替换为开发者所需的资源文件 ComponentCard({ title: $r('app.string.AddListItem_titleExample') }) { // [EndExclude build_list_layouts_and_list_items] Column({ space: 12 }) { @@ -101,6 +121,7 @@ export struct AddListItem { }) .margin({ left: 20, right: 20 }) } else { + // $r('app.string.TodoItem')需要替换为开发者所需的资源文件 Text($r('app.string.TodoItem')) .fontSize(30) .margin({ left: 20 }) @@ -126,6 +147,7 @@ export struct AddListItem { .backgroundColor('#FFF1F3F5') .borderRadius(12) .height(45) + // [EndExclude build_list_layouts_and_list_items] List({ space: 12 }) { diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/CollapseAndExpand.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/CollapseAndExpand.ets index 52fd69387c7086e8b86b6aff6b4e075f119a6f3b..f78b76ec5b96fe99baa37a3916a1a8465c9e5b1c 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/CollapseAndExpand.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/CollapseAndExpand.ets @@ -13,9 +13,12 @@ * limitations under the License. */ +//[Start List_item_data_structures] import { curves } from '@kit.ArkUI'; +//[StartExclude List_item_data_structures] import { ComponentCard } from '../../common/Card'; +// [EndExclude List_item_data_structures] interface ItemInfo { index: number, name: string, @@ -27,43 +30,45 @@ interface ItemGroupInfo extends ItemInfo { children: ItemInfo[] } +//[End List_item_data_structures] @Entry @Component export struct CollapseAndExpand { + //[Start List_item_data_structure] @State routes: ItemGroupInfo[] = [ { index: 0, name: 'basicInfo', - label: '个人基本资料', + label: 'Personal_Basic_Information', children: [ { index: 0, - name: '昵称', + name: 'nick_name', label: 'xxxx', type: 'Text' }, { index: 1, - name: '头像', + name: 'avatar', label: $r('sys.media.ohos_user_auth_icon_face'), type: 'Image' }, { index: 2, - name: '年龄', + name: 'age', label: 'xxxx', type: 'Text' }, { index: 3, - name: '生日', + name: 'birthday', label: 'xxxxxxxxx', type: 'Text' }, { index: 4, - name: '性别', + name: 'gender', label: 'xxxxxxxx', type: 'Text' }, @@ -72,38 +77,38 @@ export struct CollapseAndExpand { { index: 1, name: 'equipInfo', - label: '设备信息', + label: 'Device_Information', children: [] }, { index: 2, name: 'appInfo', - label: '应用使用信息', + label: 'Application_usage_information', children: [] }, { index: 3, name: 'uploadInfo', - label: '您主动上传的数据', + label: 'data_you_voluntarily_uploaded', children: [] }, { index: 4, name: 'tradeInfo', - label: '交易与资产信息', + label: 'Trading_and_asset_information', children: [] }, { index: 5, name: 'otherInfo', - label: '其他资料', + label: 'Other_materials', children: [] }, ]; - @State expandedItems: boolean[] = Array(this.routes.length).fill(false); @State selection: string | null = null; + //[Start List_item_data_ItemGroupInfo] @Builder ListItemGroupHeader(itemGroup: ItemGroupInfo) { Row() { @@ -127,10 +132,15 @@ export struct CollapseAndExpand { } }) } + + //[End List_item_data_ItemGroupInfo] build() { + //[StartExclude List_item_data_structure] NavDestination() { Column({ space: 12 }) { + // $r('app.string.CollapseAndExpand_title')需要替换为开发者所需的资源文件 ComponentCard({ title: $r('app.string.CollapseAndExpand_title') }) { + // [EndExclude List_item_data_structure] Column() { List({ space: 10 }) { ForEach(this.routes, (itemGroup: ItemGroupInfo) => { @@ -151,7 +161,9 @@ export struct CollapseAndExpand { } else { Text(item.label) } + // $r('app.string.ohos_ic_public_arrow_right')需要替换为开发者所需的资源文件 Image($r('sys.media.ohos_ic_public_arrow_right')) + // $r('app.string.ohos_id_color_fourth')需要替换为开发者所需的资源文件 .fillColor($r('sys.color.ohos_id_color_fourth')) .height(30) .width(30) @@ -170,15 +182,19 @@ export struct CollapseAndExpand { .width('100%') .height('100%') .justifyContent(FlexAlign.Start) + // $r('app.string.ohos_id_color_sub_background')需要替换为开发者所需的资源文件 .backgroundColor($r('sys.color.ohos_id_color_sub_background')) } + + //[End List_item_data_structure] } + //[StartExclude List_item_data_structure] .width('100%') .height('100%') .padding({ left: 12, right: 12 }) } + // [EndExclude List_item_data_structure] .backgroundColor('#f1f2f3') .title($r('app.string.CollapseAndExpand_title')) } - } \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ControlledScrollPositionList.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ControlledScrollPositionList.ets index fe9700cfd7503197f185a9d8299472e3644df987..68f3cdf1e82a40d47bfff5170e1cd1798fb30221 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ControlledScrollPositionList.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ControlledScrollPositionList.ets @@ -61,9 +61,10 @@ export struct ControlledScrollPositionList { .onClick(() => { // 点击按钮时,指定跳转位置,返回列表顶部 this.listScroller.scrollToIndex(0); - // [End control_scrolling] }) - }.height('90%') + } + // [End control_scrolling] + .height('90%') } } .width('100%') diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/DeleteListItem.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/DeleteListItem.ets index 6948f3a13eb5a1a4fe63646227f8f51bf42ac8fa..18bba2445c3129f7f152ff98eb158d4969a74283 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/DeleteListItem.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/DeleteListItem.ets @@ -12,10 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +// [Start structural_references] import { util } from '@kit.ArkTS'; +import { UIContext } from '@kit.ArkUI'; +import common from '@ohos.app.ability.common'; -// [Start structural_references] export class ToDo { public key: string = util.generateRandomUUID(true); public name: string; @@ -24,6 +25,7 @@ export class ToDo { this.name = name; } } + // [End structural_references] @Component @@ -40,15 +42,23 @@ export struct ToDoListItem { .fontSize(16) .width('80%') .margin({ left: 20 }) + // [StartExclude enter_edit_mode] + // [Start is_EditMode] if (this.isEditMode) { Checkbox() - .onChange((value: boolean) => { - if (value) { - this.selectedItems.push(new ToDo(this.toDoItem.name)); - this.isEditMode = true; + .onChange((isSelected) => { + if (isSelected) { + this.selectedItems.push(new ToDo(this.toDoItem.name)); // this.selectedItems为勾选时,记录选中的列表项,可根据实际场景构造 + } else { + let index = this.selectedItems.indexOf(new ToDo(this.toDoItem.name)); + if (index !== -1) { + this.selectedItems.splice(index, 1); // 取消勾选时,则将此项从selectedItems中删除 + } } }) } + // [End is_EditMode] + // [EndExclude enter_edit_mode] } .backgroundColor('#FFF1F3F5') .width('100%') @@ -65,6 +75,7 @@ export struct ToDoListItem { ) } } + // [End enter_edit_mode] @Entry @@ -73,13 +84,29 @@ export struct DeleteListItem { @State arr: number[] = [0, 1, 2, 3]; @State toDoData: ToDo[] = []; @Watch('onEditModeChange') @State isEditMode: boolean = false; - @State selectedItems: ToDo[] = []; - private availableThings: string[] = ['Reading', 'Exercise', 'Travel', 'Listening Music', 'Watching Films', 'Singing']; + @State selectedItems: ToDo[] = [] + private availableThings: string [] = []; public deleteToDoData() { this.toDoData = []; } + aboutToAppear(): void { + const context = this.getUIContext().getHostContext() as common.UIAbilityContext; + const reading = context.resourceManager.getStringByNameSync('Reading') + this.availableThings.push(reading) + const exercise = context.resourceManager.getStringByNameSync('Exercise') + this.availableThings.push(exercise) + const travel = context.resourceManager.getStringByNameSync('Travel') + this.availableThings.push(travel) + const listening = context.resourceManager.getStringByNameSync('Listening_Music') + this.availableThings.push(listening) + const watching = context.resourceManager.getStringByNameSync('Watching_Films') + this.availableThings.push(watching) + const singing = context.resourceManager.getStringByNameSync('Singing') + this.availableThings.push(singing) + } + onEditModeChange() { if (!this.isEditMode) { this.selectedItems = []; @@ -90,6 +117,7 @@ export struct DeleteListItem { NavDestination() { Column({ space: 12 }) { Column({ space: 8 }) { + // $r('app.string.DeleteListItem_titleExample')需要替换为开发者所需的资源文件 Text($r('app.string.DeleteListItem_titleExample')) .fontSize(14) .fontColor('#666') @@ -103,6 +131,7 @@ export struct DeleteListItem { }) .margin({ left: 20, right: 20 }) } else { + // $r('app.string.TodoItem')需要替换为开发者所需的资源文件 Text($r('app.string.TodoItem')) .fontSize(30) .margin({ left: 20 }) @@ -127,8 +156,9 @@ export struct DeleteListItem { .backgroundColor('#FFF1F3F5') .borderRadius(12) .height(45) - + // [Start implement_cachedCount] List({ space: 12 }) { + // [StartExclude implement_cachedCount] ForEach(this.toDoData, (toDoItem: ToDo) => { ListItem() { // 将toDoData的每个数据放入到以model的形式放进ListItem里 @@ -139,7 +169,9 @@ export struct DeleteListItem { }) } }, (toDoItem: ToDo) => toDoItem.name.toString()) - } + // [EndExclude implement_cachedCount] + }.cachedCount(3) + // [End implement_cachedCount] } } .alignItems(HorizontalAlign.Start) diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/Index.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/Index.ets index fbc9b904b59bc686e7158a4b6355c0c8091880cd..4e6c407828cb538caba2417bee8e4b0c214b91b9 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/Index.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/Index.ets @@ -30,6 +30,7 @@ import { TaggedListItems } from './TaggedListItems'; import { CollapseAndExpand } from './CollapseAndExpand'; import { LongList } from './LongList'; import { ListChatRoom } from './ListChatRoom'; +import { SupportSlidingHand } from './SupportSlidingHand'; import resource from '../../common/resource'; export const List_ROUTE_PREFIX: string = 'list'; @@ -109,6 +110,11 @@ const routes: Route[] = [ name: `${List_ROUTE_PREFIX}/ListChatRoom`, title: resource.resourceToString($r('app.string.ListChatRoom_title')), description: $r('app.string.ListChatRoom_description') + }, + { + name: `${List_ROUTE_PREFIX}/SupportSlidingHand`, + title: resource.resourceToString($r('app.string.Support_Sliding_Hand_Event')), + description: $r('app.string.Sliding_Hand_Event') } ]; @@ -146,6 +152,8 @@ export function listDestination(name: string) { CollapseAndExpand(); } else if (name === routes[14].name) { ListChatRoom(); + } else if (name === routes[15].name) { + SupportSlidingHand() } } @@ -164,6 +172,7 @@ struct ListExample { .width('100%') .onClick(() => { this.pathStack.pushPath({ name: route.name }); + console.log(route.name +'点击滑动离手事件') }) }) } diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListChatRoom.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListChatRoom.ets index f71e5b69ea6f1359b877688bee7de8f97092fe9f..fe9cce884f8a3615bf48eeba9ff0fe31b47ff2f1 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListChatRoom.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListChatRoom.ets @@ -14,13 +14,14 @@ */ import { ComponentCard } from '../../common/Card' +// [Start Listitem_data_structure] // 消息类型定义 interface Message { id: number content: string sender: string } - +// [End Listitem_data_structure] @Entry @Component export struct ListChatRoom { @@ -32,7 +33,7 @@ export struct ListChatRoom { .fontSize(16) .textAlign(TextAlign.Start) .padding(10) - .backgroundColor(message.sender === '系统' ? '#F0F0F0' : '#E6F3FF') + .backgroundColor(message.sender === 'system' ? '#F0F0F0' : '#E6F3FF') .borderRadius(8) } .width('100%') @@ -46,24 +47,28 @@ export struct ListChatRoom { this.messages = [...this.messages, { id: Date.now(), content: this.inputText, - sender: '观众' + sender: 'audience' }] this.inputText = '' } } + // [Start Construct_list_structure] // 消息列表数据 @State messages: Message[] = [ - { id: 1, content: '欢迎来到直播间!', sender: '系统' }, - { id: 2, content: '大家好啊~', sender: '主播' } + { id: 1, content: 'Welcome to the live streaming room!', sender: 'system' }, + { id: 2, content: 'Hello everyone!~', sender: 'system' } ] // 输入框内容 @State inputText: string = '' build() { + // [StartExclude Construct_list_structure] NavDestination() { Column({ space: 12 }) { + // $r('app.string.ListChatRoom_title')需要替换为开发者所需的资源文件 ComponentCard({ title: $r('app.string.ListChatRoom_title') }) { + // [EndExclude Construct_list_structure] Column() { // 聊天消息区域 List({ space: 10 }) { @@ -78,7 +83,7 @@ export struct ListChatRoom { // 输入区域 Row({ space: 10 }) { - TextInput({ text: this.inputText, placeholder: '说点什么...' }) + TextInput({ text: this.inputText, placeholder: 'Say something...' }) .layoutWeight(1) .onChange((value: string) => { this.inputText = value @@ -87,7 +92,7 @@ export struct ListChatRoom { this.sendMessage() }) - Button('发送', { type: ButtonType.Capsule }) + Button($r('app.string.message'), { type: ButtonType.Capsule }) .backgroundColor('#007AFF') .onClick(() => { this.sendMessage() @@ -98,6 +103,7 @@ export struct ListChatRoom { } .width('100%') .height('100%') + // [StartExclude Construct_list_structure] } } .width('100%') @@ -106,5 +112,7 @@ export struct ListChatRoom { } .backgroundColor('#f1f2f3') .title($r('app.string.ListChatRoom_title')) + // [EndExclude Construct_list_structure] } + // [End Construct_list_structure] } \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListLayout.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListLayout.ets index 742098ded73f871f74bbee3487d4c3d87cb93fdf..852da2f0372f0a7ad1a90b0199d3575314808892 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListLayout.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ListLayout.ets @@ -14,15 +14,18 @@ */ import { ComponentCard } from '../../common/Card'; - +// [Start egLanes_add] @Entry @Component export struct ListLayout { @State egLanes: LengthConstrain = { minLength: 200, maxLength: 300 }; build() { + // [StartExclude egLanes_add] NavDestination() { Column({ space: 12 }) { + // [EndExclude egLanes_add] + // [StartExclude egLanes_add] ComponentCard({ title: $r('app.string.ListLayout_titleMainAxis') }) { // [Start build_a_horizontal_scrolling_list] List({ space: 8 }) { @@ -40,8 +43,9 @@ export struct ListLayout { // [End build_a_horizontal_scrolling_list] .height(30) } - + // [EndExclude egLanes_add] ComponentCard({ title: $r('app.string.ListLayout_titleCrossAxisLanes') }) { + // [EndExclude egLanes_add] // [Start build_list_by_size] List({ space: 8 }) { ListItem() { @@ -62,9 +66,10 @@ export struct ListLayout { .lanes(this.egLanes) // [End build_list_by_size] } - + // [StartExclude egLanes_add] ComponentCard({ title: $r('app.string.ListLayout_titleCrossAxisAlignment') }) { // [Start build_list_with_align_horizontally_in_the_center] + // [End lanes_add] List({ space: 8 }) { // [StartExclude build_list_with_align_horizontally_in_the_center] ListItem() { @@ -79,11 +84,14 @@ export struct ListLayout { Text('ListItem tree') } // [EndExclude build_list_with_align_horizontally_in_the_center] - } + }.lanes(2) + // [End lanes_add] // 此处alignListItem设置水平方向对齐 .alignListItem(ListItemAlign.Center) // [End build_list_with_align_horizontally_in_the_center] } + // [StartExclude egLanes_add] + // [StartExclude egLanes_add] } .width('100%') .height('100%') @@ -91,5 +99,7 @@ export struct ListLayout { } .backgroundColor('#f1f2f3') .title($r('app.string.ListLayout_title')) + // [EndExclude egLanes_add] } + // [End egLanes_add] } \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/LongList.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/LongList.ets index 6c5fd86c5de5d90eab101c5a74fe607903e1b9ee..e038509380e75d1dad57d5412529372ac6a67d8b 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/LongList.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/LongList.ets @@ -38,7 +38,7 @@ export struct LongList { .scrollBar(BarState.Off) .friction(0.6) .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) // 每行之间的分界线 - .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true, effectEdge: EffectEdge.START }) .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { console.info('first' + firstIndex); console.info('last' + lastIndex); diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ResponsiveScrollPositionList.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ResponsiveScrollPositionList.ets index 06c536cdbd230d39acab2ff89c16e21b37debfbb..7f02abd9fed87a24f219e44b8a8a3378b2ad3b1f 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ResponsiveScrollPositionList.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/ResponsiveScrollPositionList.ets @@ -12,11 +12,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +// [Start respond_to_scroll_position] import { util } from '@kit.ArkTS'; import { ComponentCard } from '../../common/Card'; -// [Start respond_to_scroll_position] const alphabets = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; @@ -42,6 +41,7 @@ export let contactsGroups: object[] = [ { title: 'A', contacts: [ + // $r('app.string.xxx')需要替换为开发者所需的资源文件 new Contact($r('app.string.contacts_A_one'), $r('sys.media.clone_app_badge_1')), new Contact($r('app.string.contacts_A_two'), $r('sys.media.clone_app_badge_2')) ], @@ -50,6 +50,7 @@ export let contactsGroups: object[] = [ { title: 'B', contacts: [ + // $r('app.string.xxx')需要替换为开发者所需的资源文件 new Contact($r('app.string.contacts_B_one'), $r('sys.media.clone_app_badge_3')), new Contact($r('app.string.contacts_B_two'), $r('sys.media.clone_app_badge_4')), new Contact($r('app.string.contacts_B_three'), $r('sys.media.clone_app_badge_5')) @@ -59,6 +60,7 @@ export let contactsGroups: object[] = [ { title: 'D', contacts: [ + // $r('app.string.xxx')需要替换为开发者所需的资源文件 new Contact($r('app.string.contacts_D_one'), $r('sys.media.clone_app_badge_3')), new Contact($r('app.string.contacts_D_two'), $r('sys.media.clone_app_badge_4')), new Contact($r('app.string.contacts_D_three'), $r('sys.media.clone_app_badge_5')) @@ -68,6 +70,7 @@ export let contactsGroups: object[] = [ { title: 'F', contacts: [ + // $r('app.string.xxx')需要替换为开发者所需的资源文件 new Contact($r('app.string.contacts_F_one'), $r('sys.media.clone_app_badge_3')), new Contact($r('app.string.contacts_F_two'), $r('sys.media.clone_app_badge_4')) ], @@ -76,6 +79,7 @@ export let contactsGroups: object[] = [ { title: 'G', contacts: [ + // $r('app.string.xxx')需要替换为开发者所需的资源文件 new Contact($r('app.string.contacts_G_one'), $r('sys.media.clone_app_badge_3')), new Contact($r('app.string.contacts_G_two'), $r('sys.media.clone_app_badge_4')) ], @@ -84,6 +88,7 @@ export let contactsGroups: object[] = [ { title: 'H', contacts: [ + // $r('app.string.xxx')需要替换为开发者所需的资源文件 new Contact($r('app.string.contacts_H_one'), $r('sys.media.clone_app_badge_3')), new Contact($r('app.string.contacts_H_two'), $r('sys.media.clone_app_badge_4')), new Contact($r('app.string.contacts_H_three'), $r('sys.media.clone_app_badge_5')) @@ -93,6 +98,7 @@ export let contactsGroups: object[] = [ { title: 'X', contacts: [ + // $r('app.string.xxx')需要替换为开发者所需的资源文件 new Contact($r('app.string.contacts_X_one'), $r('sys.media.clone_app_badge_3')), new Contact($r('app.string.contacts_X_two'), $r('sys.media.clone_app_badge_4')), new Contact($r('app.string.contacts_X_three'), $r('sys.media.clone_app_badge_5')) @@ -100,6 +106,7 @@ export let contactsGroups: object[] = [ key: util.generateRandomUUID(true) } as ContactsGroup ]; + // [EndExclude respond_to_scroll_position] @Entry @@ -119,18 +126,22 @@ export struct ResponsiveScrollPositionList { .width('100%') .padding(5) } + // [EndExclude respond_to_scroll_position] build() { // [StartExclude respond_to_scroll_position] NavDestination() { Column({ space: 12 }) { + // $r('app.string.ResponsiveScrollPositionList_titleExample')需要替换为开发者所需的资源文件 ComponentCard({ title: $r('app.string.ResponsiveScrollPositionList_titleExample') }) { // [EndExclude use_stack] Stack({ alignContent: Alignment.End }) { // 此为响应滚动位置示例List容器 + // [Start respond_tolistScroller] List({ scroller: this.listScroller }) { // [StartExclude use_foreach] + // [StartExclude respond_tolistScroller] ForEach(contactsGroups, (itemGroup: ContactsGroup) => { ListItemGroup({ header: this.itemHead(itemGroup.title) }) { // 循环渲染ListItem @@ -141,14 +152,18 @@ export struct ResponsiveScrollPositionList { Image(item.icon).width(40).height(40).margin(10) Text(item.name).fontSize(20) }.width('100%').justifyContent(FlexAlign.Start) + // [EndExclude respond_to_scroll_position] } + // [StartExclude respond_to_scroll_position] }, (item: Contact) => JSON.stringify(item)) } } }, (itemGroup: ContactsGroup) => JSON.stringify(itemGroup)) + // [EndExclude respond_tolistScroller] } + // [End respond_tolistScroller] // [EndExclude respond_to_scroll_position] .onScrollIndex((firstIndex: number) => { // [StartExclude respond_to_scroll_position] @@ -162,6 +177,9 @@ export struct ResponsiveScrollPositionList { // 字母表索引组件 AlphabetIndexer({ arrayValue: alphabets, selected: 0 }) .selected(this.selectedIndex) + .onSelect((index: number) => { + this.listScroller.scrollToIndex(index); + }) // [End respond_to_scroll_position] }.height('90%') } diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/SupportSlidingHand.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/SupportSlidingHand.ets new file mode 100644 index 0000000000000000000000000000000000000000..6bfc67f2c75b7ba727c652fdc6272c6262904a13 --- /dev/null +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/list/SupportSlidingHand.ets @@ -0,0 +1,171 @@ +/* +* Copyright (c) 2025 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. +*/ +// [Start class_News] +import { LengthMetrics } from '@kit.ArkUI'; +import { ComponentCard } from '../../common/Card'; +// [Start class_News_content] +class News { + public id: string; + public title: string; + public content: string; + public type: string; + + constructor(id: string, title: string, content: string, type: string) { + this.id = id; + this.title = title; + this.content = content; + this.type = type; + } +} +// [End class_News_content] +const FRICTION_SCALE: number = 4.2; +const DEFAULT_FRICTION: number = 1; + +// [End class_News] +@Entry +@Component +export struct SupportSlidingHand { + // [Start NewsData] + @State newsData: Array = [ + new News('1', 'News Title', 'This is a short news with limited content, quickly swipe to switch between them', + 'short'), + new News('2', 'News Title', 'This is a short news with limited content, quickly swipe to switch between them', + 'short'), + new News('3', 'News Title', 'This is a short news with limited content, quickly swipe to switch between them', + 'long'), + new News('4', 'News Title', 'This is a short news with limited content, quickly swipe to switch between them', + 'short'), + new News('5', 'News Title', 'This is a short news with limited content, quickly swipe to switch between them', + 'long'), + ]; + // [End NewsData] + // 当前显示的新闻的索引 + @State currentIndex: number = 0; + private scrollerForList: Scroller = new Scroller(); + @State listHeight: number = 500; + + // 判断当前是否为短新闻 + IsShortNews(currentIndex: number): boolean { + return this.newsData[currentIndex].type === 'short' + } + + build() { + NavDestination() { + Column({ space: 10 }) { + // 顶部导航栏 + this.topBar() + // 新闻列表 + List({ scroller: this.scrollerForList, space: 10 }) { + ForEach(this.newsData, (item: News, index) => { + ListItem() { + Column({ space: 10 }) { + Text(item.title) + .fontSize(18) + .fontColor(Color.Black) + .fontWeight(index === this.currentIndex ? 700 : 400) + .backgroundColor(index === this.currentIndex ? '#FF9800' : '#FFFFFF') + .padding({ top: 10, bottom: 5 }) + + Text(item.content) + .fontSize(14) + .fontColor('#666666') + } + .width('100%') + .height(item.type === 'short' ? '70%' : '200%') + .backgroundColor(index === this.currentIndex ? '#FFFFFF' : '#F5F5F5') + .borderRadius(8) + .shadow(index === this.currentIndex ? { fill: true, color: '#9E9E9E', radius: 5 } : + { radius: 5, fill: false }) + } + }, (item: News) => item.id) + } + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true }) + .width('100%') + .height('80%') + .onScrollIndex((startIndex: number) => { + this.currentIndex = startIndex + }) + .id('scrollToIndex') + // 实现参考 + // [Start scrollToIndex_scrollerForList] + .onWillStopDragging((velocity: number) => { + // 短新闻处理 + if (this.IsShortNews(this.currentIndex)) { + // [Start scrollToIndex] + if (velocity > 30) { + this.scrollerForList.scrollToIndex(this.currentIndex, true, ScrollAlign.START) + } else if (velocity < -30) { + this.scrollerForList.scrollToIndex(this.currentIndex + 1, true, ScrollAlign.START) + } + // [End scrollToIndex] + return; + } + // [Start scrollerForList] + // 长新闻处理 + // [Start scrollerForList_rect] + let rect = this.scrollerForList.getItemRect(this.currentIndex); + // [End scrollerForList_rect] + if (velocity < -1000) { + if (rect) { + // 当前节点在页面内的剩余显示范围 + let leftRect = rect.y + rect.height; + // 终点位置 + let mainPosition = -velocity * DEFAULT_FRICTION / FRICTION_SCALE; + if (leftRect + mainPosition > 0.75 * this.listHeight) { + this.scrollerForList.scrollToIndex(this.currentIndex + 1, true, ScrollAlign.START); + return; + } else if (leftRect + mainPosition < 0.25 * this.listHeight) { + this.scrollerForList.scrollToIndex(this.currentIndex, true, ScrollAlign.END, + { extraOffset: LengthMetrics.vp(this.listHeight * 0.3) }) + return; + } + } + } else if (velocity > 1000) { + let leftRect = rect?.y + rect?.height; + let mainPosition = velocity * DEFAULT_FRICTION / FRICTION_SCALE; + if (leftRect + mainPosition > 0.75 * this.listHeight) { + this.scrollerForList.scrollToIndex(this.currentIndex, true, ScrollAlign.START); + return; + } + } + // [End scrollerForList] + }) + // [End scrollToIndex_scrollerForList] + } + .width('100%') + .height('100%') + .padding({ left: 12, right: 12 }) + .height(this.listHeight) + .backgroundColor(Color.White) + .padding({ top: 20 }) + }.backgroundColor('#f1f2f3') + .title($r('app.string.Support_Sliding_Hand_Event')) + + } + + @Builder + topBar() { + Column() { + Column() { + // $r('app.string.Today_Hot_News')需要替换为开发者所需的资源文件 + Text($r('app.string.Today_Hot_News')) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(700) + .margin({ bottom: 10 }) + } + } + } +} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperAndTabsLinkage.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperAndTabsLinkage.ets index 4b6320ccd976e470890217dae13cd3d61caa0ce2..114da8cf7e7d6aca0401a55b12be26e92a635750 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperAndTabsLinkage.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperAndTabsLinkage.ets @@ -15,6 +15,7 @@ import { ComponentCard } from "../../common/Card"; +// [Start swiper_tabs_linkage] // xxx.ets class MyDataSource implements IDataSource { private list: number[] = []; @@ -72,9 +73,11 @@ export struct SwiperAndTabsLinkage { } build() { + // [StartExclude swiper_tabs_linkage] NavDestination() { Column({ space: 12 }) { ComponentCard({ title: $r('app.string.SwiperAndTabsLinkage_title') }) { + // [EndExclude swiper_tabs_linkage] Column() { Tabs({ barPosition: BarPosition.Start, controller: this.tabsController }) { ForEach(this.list, (index: number) =>{ @@ -113,6 +116,7 @@ export struct SwiperAndTabsLinkage { this.tabsController.changeIndex(index); }) } + // [StartExclude swiper_tabs_linkage] } } .width('100%') @@ -121,5 +125,7 @@ export struct SwiperAndTabsLinkage { } .backgroundColor('#f1f2f3') .title($r('app.string.SwiperAndTabsLinkage_title')) + // [EndExclude swiper_tabs_linkage] } -} \ No newline at end of file +} +// [End swiper_tabs_linkage] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperDigitIndicatorIgnoreComponentSize.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperDigitIndicatorIgnoreComponentSize.ets new file mode 100644 index 0000000000000000000000000000000000000000..39d248a7c5586541a5066c89c8222cb3b001439e --- /dev/null +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperDigitIndicatorIgnoreComponentSize.ets @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2025 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 { LengthMetrics } from '@kit.ArkUI'; +import { ComponentCard } from '../../common/Card'; + +class MyDataSource implements IDataSource { + private list: number[] = []; + + constructor(list: number[]) { + this.list = list; + } + + totalCount(): number { + return this.list.length; + } + + getData(index: number): number { + return this.list[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +export struct SwiperDigitIndicatorIgnoreComponentSize { + private swiperController1: SwiperController = new SwiperController(); + private data1: MyDataSource = new MyDataSource([]); + + aboutToAppear(): void { + let list1: number[] = []; + for (let i = 1; i <= 10; i++) { + list1.push(i); + } + this.data1 = new MyDataSource(list1); + } + + build() { + NavDestination() { + Column({ space: 12 }) { + // $r('app.string.SwiperDigitIndicatorIgnoreComponentSize_title')需要替换为开发者所需的字符串资源文件 + ComponentCard({ title: $r('app.string.SwiperDigitIndicatorIgnoreComponentSize_title') }) { + Scroll() { + Column({ space: 20 }) { + // [Start digit_indicator] + Swiper(this.swiperController1) { + // [StartExclude digit_indicator] + LazyForEach(this.data1, (item: string) => { + Text(item.toString()) + .width('90%') + .height(120) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }, (item: string) => item) + // [EndExclude digit_indicator] + } + .indicator(new DigitIndicator() + .bottom(LengthMetrics.vp(0), true) + ) + + // [End digit_indicator] + }.width('100%') + } + } + } + .width('100%') + .height('100%') + .padding({ left: 12, right: 12 }) + } + .backgroundColor('#f1f2f3') + // $r('app.string.SwiperDigitIndicatorIgnoreComponentSize_title')需要替换为开发者所需的字符串资源文件 + .title($r('app.string.SwiperDigitIndicatorIgnoreComponentSize_title')) + } +} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperIgnoreComponentSize.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperIgnoreComponentSize.ets index 420343eb510941dde4c0e9565b2d06c0df0124ef..a914b045784ec495276eaffb001efbb70bab434a 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperIgnoreComponentSize.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperIgnoreComponentSize.ets @@ -13,8 +13,11 @@ * limitations under the License. */ +// [Start dot_indicator] import { LengthMetrics } from '@kit.ArkUI'; +// [StartExclude dot_indicator] import { ComponentCard } from '../../common/Card'; +// [EndExclude dot_indicator] class MyDataSource implements IDataSource { @@ -63,12 +66,18 @@ export struct SwiperIgnoreComponentSize { } build() { + // [StartExclude dot_indicator] NavDestination() { Column({ space: 12 }) { ComponentCard({ title: $r('app.string.SwiperIgnoreComponentSize_title') }) { + // [EndExclude dot_indicator] Scroll() { Column({ space: 20 }) { + // [Start dot_indicator_space] + // [Start dot_indicator_bottom] Swiper(this.swiperController1) { + // [StartExclude dot_indicator_space] + // [StartExclude dot_indicator_bottom] LazyForEach(this.data1, (item: string) => { Text(item.toString()) .width('90%') @@ -77,16 +86,27 @@ export struct SwiperIgnoreComponentSize { .textAlign(TextAlign.Center) .fontSize(30) }, (item: string) => item) + // [EndExclude dot_indicator_bottom] + // [EndExclude dot_indicator_space] } .indicator(new DotIndicator() + // [StartExclude dot_indicator_bottom] .space(this.space) - .bottom(LengthMetrics.vp(0), this.ignoreSize) + // [EndExclude dot_indicator_bottom] + // [StartExclude dot_indicator_space] + .bottom(LengthMetrics.vp(0), this.ignoreSize) // true + // [StartExclude dot_indicator_bottom] .itemWidth(15) .itemHeight(15) .selectedItemWidth(15) .selectedItemHeight(15) .color(Color.Gray) - .selectedColor(Color.Blue)) + .selectedColor(Color.Blue) + // [EndExclude dot_indicator_space] + // [EndExclude dot_indicator_bottom] + ) + // [End dot_indicator_bottom] + // [End dot_indicator_space] .displayArrow({ showBackground: true, isSidebarMiddle: true, @@ -109,6 +129,7 @@ export struct SwiperIgnoreComponentSize { }.margin(2) }.width('100%') } + // [StartExclude dot_indicator] } } .width('100%') @@ -117,5 +138,7 @@ export struct SwiperIgnoreComponentSize { } .backgroundColor('#f1f2f3') .title($r('app.string.SwiperIgnoreComponentSize_title')) + // [EndExclude dot_indicator] } -} \ No newline at end of file +} +// [End dot_indicator] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperPageSwitchMethod.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperPageSwitchMethod.ets index 64ae9a299941977d3e3bdf1ffbff1f994838cfde..9705d57f50bfdf6e31b156053c0a81539afaf0c5 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperPageSwitchMethod.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperPageSwitchMethod.ets @@ -19,7 +19,19 @@ import { ComponentCard } from '../../common/Card'; @Entry @Component export struct SwiperPageSwitchMethod { + private swiperBackgroundColors: Color[] = [Color.Blue, Color.Brown, Color.Gray, Color.Green, Color.Orange, + Color.Pink, Color.Red, Color.Yellow]; + private swiperAnimationMode: (SwiperAnimationMode | boolean | undefined)[] = [undefined, true, false, + SwiperAnimationMode.NO_ANIMATION, SwiperAnimationMode.DEFAULT_ANIMATION, SwiperAnimationMode.FAST_ANIMATION]; private swiperController: SwiperController = new SwiperController(); + private animationModeIndex: number = 0; + private animationMode: (SwiperAnimationMode | boolean | undefined) = undefined; + @State animationModeStr: string = 'undefined'; + @State targetIndex: number = 0; + + aboutToAppear(): void { + this.toSwiperAnimationModeStr(); + } build() { // [StartExclude switch_pages] @@ -27,26 +39,16 @@ export struct SwiperPageSwitchMethod { Column({ space: 12 }) { ComponentCard({ title: $r('app.string.SwiperPageSwitchMethod_title') }) { // [EndExclude switch_pages] - Column({ space: 8 }) { + Column({ space: 5 }) { Swiper(this.swiperController) { - Text('0') - .width('90%') - .height('100%') - .backgroundColor(Color.Gray) - .textAlign(TextAlign.Center) - .fontSize(30) - Text('1') - .width('90%') - .height('100%') - .backgroundColor(Color.Green) - .textAlign(TextAlign.Center) - .fontSize(30) - Text('2') - .width('90%') - .height('100%') - .backgroundColor(Color.Pink) - .textAlign(TextAlign.Center) - .fontSize(30) + ForEach(this.swiperBackgroundColors, (backgroundColor: Color, index: number) => { + Text(index.toString()) + .width(250) + .height(250) + .backgroundColor(backgroundColor) + .textAlign(TextAlign.Center) + .fontSize(30) + }) } // [StartExclude switch_pages] .height(200) @@ -63,15 +65,53 @@ export struct SwiperPageSwitchMethod { this.swiperController.showPrevious(); // 通过controller切换到前一页 }) }.margin(5) + + Row({ space: 12 }) { + Text('Index:') + Button(this.targetIndex.toString()) + .onClick(() => { + this.targetIndex = (this.targetIndex + 1) % this.swiperBackgroundColors.length; + }) + }.margin(5) + Row({ space: 12 }) { + Text('AnimationMode:') + Button(this.animationModeStr) + .onClick(() => { + this.animationModeIndex = (this.animationModeIndex + 1) % this.swiperAnimationMode.length; + this.toSwiperAnimationModeStr(); + }) + }.margin(5) + + Row({ space: 12 }) { + Button('changeIndex(' + this.targetIndex + ', ' + this.animationModeStr + ')') + .onClick(() => { + this.swiperController.changeIndex(this.targetIndex, this.animationMode); // 通过controller切换到指定页 + }) + }.margin(5) } + // [StartExclude switch_pages] } } - // [End switch_pages] .width('100%') .height('100%') .padding({ left: 12, right: 12 }) } .backgroundColor('#f1f2f3') .title($r('app.string.SwiperPageSwitchMethod_title')) + // [EndExclude switch_pages] + } + + private toSwiperAnimationModeStr() { + this.animationMode = this.swiperAnimationMode[this.animationModeIndex]; + if ((this.animationMode === true) || (this.animationMode === false)) { + this.animationModeStr = '' + this.animationMode; + } else if ((this.animationMode === SwiperAnimationMode.NO_ANIMATION) || + (this.animationMode === SwiperAnimationMode.DEFAULT_ANIMATION) || + (this.animationMode === SwiperAnimationMode.FAST_ANIMATION)) { + this.animationModeStr = SwiperAnimationMode[this.animationMode]; + } else { + this.animationModeStr = 'undefined'; + } } -} \ No newline at end of file +} +// [End switch_pages] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperVisibleContentPosition.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperVisibleContentPosition.ets new file mode 100644 index 0000000000000000000000000000000000000000..8c8e783483615fc11778fe27d93aa19d8220a7bb --- /dev/null +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/SwiperVisibleContentPosition.ets @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const DOMAIN = 0x0000; + +// [Start visible_content_position] +// xxx.ets +class MyDataSource implements IDataSource { + private listeners: DataChangeListener[] = []; + private dataArray: string[] = ['0', '1', '2', '3', '4', '5', '6']; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string | undefined { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + hilog.info(DOMAIN, 'testTag', 'add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + hilog.info(DOMAIN, 'testTag', 'remove listener'); + this.listeners.splice(pos, 1); + } + } +} + +@Entry +@Component +export struct SwiperVisibleContentPosition { + private data: MyDataSource = new MyDataSource(); + @State index: number = 3; + + build() { + // [StartExclude visible_content_position] + NavDestination() { + // [EndExclude visible_content_position] + Column({ space: 12 }) { + // [StartExclude visible_content_position] + // $r('app.string.SwiperVisibleContentPosition_title')需要替换为开发者所需的字符串资源文件 + ComponentCard({ title: $r('app.string.SwiperVisibleContentPosition_title') }) { + Column({ space: 20 }) { + // [EndExclude visible_content_position] + Swiper() { + LazyForEach(this.data, (item: string) => { + Text(item.toString()) + .width('90%') + .height(160) + .backgroundColor(0xAFEEEE) + .textAlign(TextAlign.Center) + .fontSize(30) + }) + } + .onChange((index) => { + this.index = index; + }) + .index(3) + .maintainVisibleContentPosition(true) + .displayArrow({ + showBackground: true, + isSidebarMiddle: true, + backgroundSize: 24, + backgroundColor: Color.White, + arrowSize: 18, + arrowColor: Color.Blue + }, false) + + Column({ space: 12 }) { + Text('index:' + this.index).fontSize(20) + Row() { + // 在LazyForEach索引为0的位置添加数据 + Button('header data add').height(30).onClick(() => { + this.data.addData(0, 'header Data'); + }) + // 删除LazyForEach索引为0的位置数据 + Button('header data delete').height(30).onClick(() => { + this.data.deleteData(0); + }) + } + }.margin(5) + // [StartExclude visible_content_position] + }.width('100%') + } + // [EndExclude visible_content_position] + }.width('100%') + .margin({ top: 5 }) + // [StartExclude visible_content_position] + } + .backgroundColor('#f1f2f3') + // $r('app.string.SwiperVisibleContentPosition_title')需要替换为开发者所需的字符串资源文件 + .title($r('app.string.SwiperVisibleContentPosition_title')) + // [EndExclude visible_content_position] + } +} +// [End visible_content_position] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/index.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/index.ets index 37aa2ea07443fc9bb7f149c03d90906f217a4379..8ab8d2fbe51284e8e92a7938ba7407f03db0ee7e 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/index.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/swiper/index.ets @@ -23,6 +23,9 @@ import { SwiperLoop } from './SwiperLoop'; import { SwiperMultiPage } from './SwiperMultiPage'; import { SwiperPageSwitchMethod } from './SwiperPageSwitchMethod'; import { SwiperAndTabsLinkage } from './SwiperAndTabsLinkage'; +import { SwiperIgnoreComponentSize } from './SwiperIgnoreComponentSize'; +import { SwiperDigitIndicatorIgnoreComponentSize } from './SwiperDigitIndicatorIgnoreComponentSize'; +import { SwiperVisibleContentPosition } from './SwiperVisibleContentPosition'; import resource from '../../common/resource'; export const SWIPER_ROUTE_PREFIX: string = 'swiper'; @@ -67,6 +70,21 @@ const routes: Route[] = [ name: `${SWIPER_ROUTE_PREFIX}/SwiperAndTabsLinkage`, title: resource.resourceToString($r('app.string.SwiperAndTabsLinkage_title')), description: $r('app.string.SwiperAndTabsLinkage_description') + }, + { + name: `${SWIPER_ROUTE_PREFIX}/SwiperIgnoreComponentSize`, + title: resource.resourceToString($r('app.string.SwiperIgnoreComponentSize_title')), + description: $r('app.string.SwiperIgnoreComponentSize_description') + }, + { + name: `${SWIPER_ROUTE_PREFIX}/SwiperDigitIndicatorIgnoreComponentSize`, + title: resource.resourceToString($r('app.string.SwiperDigitIndicatorIgnoreComponentSize_title')), + description: $r('app.string.SwiperDigitIndicatorIgnoreComponentSize_description') + }, + { + name: `${SWIPER_ROUTE_PREFIX}/SwiperVisibleContentPosition`, + title: resource.resourceToString($r('app.string.SwiperVisibleContentPosition_title')), + description: $r('app.string.SwiperVisibleContentPosition_description') } ]; @@ -90,6 +108,12 @@ export function swiperDestination(name: string) { SwiperCustomAnimation(); } else if (name === routes[7].name) { SwiperAndTabsLinkage(); + } else if (name === routes[8].name) { + SwiperIgnoreComponentSize(); + } else if (name === routes[9].name) { + SwiperDigitIndicatorIgnoreComponentSize(); + } else if (name === routes[10].name) { + SwiperVisibleContentPosition(); } } @@ -113,6 +137,7 @@ struct SwiperExample { } .contentStartOffset(56) .padding({ left: 16, right: 16 }) + .id('list_') } .backgroundColor('#f1f3f5') .title('Swiper', { diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/ContentPageNoAndTabLinkage.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/ContentPageNoAndTabLinkage.ets new file mode 100644 index 0000000000000000000000000000000000000000..d4cc3b06ae642bdf2dcc5492afd85e2aa0d2f1d0 --- /dev/null +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/ContentPageNoAndTabLinkage.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start ContentPageNoAndTabLinkage] +import { ComponentCard } from '../../common/Card'; +@Entry +@Component +export struct ContentPageNoAndTabLinkage { + + @State selectIndex: number = 0; + @Builder tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + .fontColor(this.selectIndex === targetIndex ? '#1698CE' : '#6B6B6B') + } + } + build() { + NavDestination() { + Column({ space: 12 }) { + // $r('app.string.ContentWillChange_titleContentOnAndTabSync')需要替换为开发者所需的字符串(图像、数字等)资源文件 + ComponentCard({ title: $r('app.string.ContentWillChange_titleContentOnAndTabSync') }) { + // [Start bottom_navigation] + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Text($r('app.string.homepage_content')).width('100%').height('100%').backgroundColor('rgb(213,213,213)') + .fontSize(40).fontColor(Color.Black).textAlign(TextAlign.Center) + }.tabBar(this.tabBuilder($r('app.string.homepage'), 0)) + + TabContent() { + Text($r('app.string.discover_content')).width('100%').height('100%').backgroundColor('rgb(112,112,112)') + .fontSize(40).fontColor(Color.Black).textAlign(TextAlign.Center) + }.tabBar(this.tabBuilder($r('app.string.discover'), 1)) + + TabContent() { + Text($r('app.string.recommend')).width('100%').height('100%').backgroundColor('rgb(39,135,217)') + .fontSize(40).fontColor(Color.Black).textAlign(TextAlign.Center) + }.tabBar(this.tabBuilder($r('app.string.recommend_content'), 2)) + + TabContent() { + Text($r('app.string.mine_content')).width('100%').height('100%').backgroundColor('rgb(0,74,175)') + .fontSize(40).fontColor(Color.Black).textAlign(TextAlign.Center) + }.tabBar(this.tabBuilder($r('app.string.mine'), 3)) + } + .animationDuration(0) + .backgroundColor('#F1F3F5') + .onSelected((index: number) => { + this.selectIndex = index; + }) + } + } + .width('100%') + .height('100%') + .padding({ left: 12, right: 12 }) + } + .backgroundColor('#f1f2f3') + .title($r('app.string.ContentWillChange_titleContentOnAndTabSync')) + } +} +// [End ContentPageNoAndTabLinkage] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/NumberOfCachesTabBar.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/NumberOfCachesTabBar.ets new file mode 100644 index 0000000000000000000000000000000000000000..5a50072449edc96ebf995df77afc4918d63576dd --- /dev/null +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/NumberOfCachesTabBar.ets @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start NumberOfCachesTabBar] +import { ComponentCard } from '../../common/Card'; +@Entry +@Component +export struct NumberOfCachesTabBar { + build() { + NavDestination() { + Column({ space: 12 }) { + ComponentCard({ title: $r('app.string.Cache_count') }) { + // [Start top_navigation] + Tabs({ barPosition: BarPosition.Start }) { + // [StartExclude top_navigation] + TabContent() { + MyComponent({ color: '#00CB87' }) + }.tabBar(SubTabBarStyle.of('green')) + + TabContent() { + MyComponent({ color: '#007DFF' }) + }.tabBar(SubTabBarStyle.of('blue')) + + TabContent() { + MyComponent({ color: '#FFBF00' }) + }.tabBar(SubTabBarStyle.of('yellow')) + + TabContent() { + MyComponent({ color: '#E67C92' }) + }.tabBar(SubTabBarStyle.of('pink')) + + TabContent() { + MyComponent({ color: '#FF0000' }) + }.tabBar(SubTabBarStyle.of('red')) + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .cachedMaxCount(1, TabsCacheMode.CACHE_BOTH_SIDE) + // [EndExclude top_navigation] + } + // [End top_navigation] + } + .width('100%') + .height('100%') + .padding({ left: 12, right: 12 }) + } + .backgroundColor('#f1f2f3') + .title($r('app.string.Cache_count')) + } +} + +@Component +struct MyComponent { + private color: string = ''; + + aboutToAppear(): void { + console.info('aboutToAppear backgroundColor:' + this.color); + } + + aboutToDisappear(): void { + console.info('aboutToDisappear backgroundColor:' + this.color); + } + + build() { + Column() + .width('100%') + .height('100%') + .backgroundColor(this.color) + } +} +// [End NumberOfCachesTabBar] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/index.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/index.ets index b601f6080cca995f0b2a9c9f1acdb62245de2a22..2540b4e86eb4eea926bafcca28b63b8c47581ede 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/index.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/tabs/index.ets @@ -12,8 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -import { AgeFriendlyTabs } from './AgeFriendlyTabs'; import { BottomTabBar } from './BottomTabBar'; import { CompletedRoutableCard } from '../../common/Card'; import { ContentWillChange } from './ContentWillChange'; @@ -26,6 +24,8 @@ import { SwipeLockedTabBar } from './SwipeLockedTabBar'; import { TabsLayout } from './TabsLayout'; import { TopTabBar } from './TopTabBar'; import resource from '../../common/resource'; +import { NumberOfCachesTabBar } from './NumberOfCachesTabBar'; +import { ContentPageNoAndTabLinkage } from './ContentPageNoAndTabLinkage'; export const TABS_ROUTE_PREFIX: string = 'tabs'; @@ -76,9 +76,14 @@ const routes: Route[] = [ description: $r('app.string.ContentWillChange_description') }, { - name: `${TABS_ROUTE_PREFIX}/AgeFriendlyTabs`, - title: resource.resourceToString($r('app.string.AgeFriendlyTabs_title')), - description: $r('app.string.AgeFriendlyTabs_description') + name: `${TABS_ROUTE_PREFIX}/NumberOfCachesTabBar`, + title: resource.resourceToString($r('app.string.Cache_count')), + description: $r('app.string.ContentWillChange_description') + }, + { + name: `${TABS_ROUTE_PREFIX}/ContentPageAndTabLinkage`, + title: resource.resourceToString($r('app.string.ContentWillChange_titleContentOnAndTabSync')), + description: $r('app.string.Content_titleContentOnAndTabSync') } ]; @@ -104,8 +109,10 @@ export function tabsDestination(name: string) { CustomTabBar(); } else if (name === routes[8].name) { ContentWillChange(); - } else if (name === routes[9].name) { - AgeFriendlyTabs(); + }else if (name === routes[9].name) { + NumberOfCachesTabBar(); + }else if (name === routes[10].name) { + ContentPageNoAndTabLinkage(); } } diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets index 3dfc468dab8a710c503ab4537d43e56fb5ce2bd0..d89c169b401ac5f0b11b0a88d593d79da8d86411 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets @@ -95,13 +95,14 @@ export class WaterFlowDataSource implements IDataSource { this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length); this.notifyDataAdd(this.dataArray.length - 1); } - + // [Start addNewItems_start] public addNewItems(count: number): void { for (let i = 0; i < count; i++) { this.dataArray.push(this.dataArray.length); this.notifyDataAdd(this.dataArray.length - 1); } } + // [End addNewItems_start] // 在指定索引位置增加一个元素 public addItem(index: number): void { diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDynamicSwitchover.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDynamicSwitchover.ets index 6c7ccb83c5a000e1af44dc02091fbe3b1475b9ce..9c17fa72ce202a440b24722d21615f6deabc6217 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDynamicSwitchover.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDynamicSwitchover.ets @@ -37,7 +37,7 @@ struct ReusableFlowItem { } } } - +// [Start waterFlowDynamicSwitchover_start] @Reusable @Component struct ReusableListItem { @@ -61,13 +61,16 @@ struct ReusableListItem { @Entry @Component export struct WaterFlowDynamicSwitchover { + // 通过状态变量设置列数,可以按需修改触发布局更新 + @State columns: number = 2; + + // [StartExclude waterFlowDynamicSwitchover_start] minSize: number = 80; maxSize: number = 180; colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; dataSource: WaterFlowDataSource = new WaterFlowDataSource(100); private itemWidthArray: number[] = []; private itemHeightArray: number[] = []; - @State columns: number = 2; @State waterflowScale: number = 1; @State imageScale: number = 1; @State waterFlowOpacity: number = 1; @@ -127,7 +130,7 @@ export struct WaterFlowDynamicSwitchover { .margin({ top: 2 }) }.width('100%').justifyContent(FlexAlign.Center) } - + // [EndExclude waterFlowDynamicSwitchover_start] build() { NavDestination() { Column({ space: 12 }) { @@ -167,6 +170,9 @@ export struct WaterFlowDynamicSwitchover { }, 1000); } }) + // [StartExclude waterFlowDynamicSwitchover_start] + .id('test') + // [EndExclude waterFlowDynamicSwitchover_start] } } } @@ -177,3 +183,4 @@ export struct WaterFlowDynamicSwitchover { .title($r('app.string.WaterFlowDynamicSwitchover_title')) } } +// [End waterFlowDynamicSwitchover_start] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowGroupingMixing.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowGroupingMixing.ets index 0f5fcc388c75a2ff187f8ffa7f5d49b1fd8b1488..b7bc28e7e9e62bfd0f7703c7b4161e420cda2569 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowGroupingMixing.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowGroupingMixing.ets @@ -37,7 +37,7 @@ struct ReusableFlowItem { } } } - +// [Start waterFlowGroupingMixing_start] @Entry @Component export struct WaterFlowGroupingMixing { @@ -47,15 +47,30 @@ export struct WaterFlowGroupingMixing { dataSource: WaterFlowDataSource = new WaterFlowDataSource(100); private itemWidthArray: number[] = []; private itemHeightArray: number[] = []; - @State columns: number = 2; - @State waterflowScale: number = 1; - @State imageScale: number = 1; - @State waterFlowOpacity: number = 1; - @State waterflowSnapshot: image.PixelMap | undefined = undefined; - private columnChanged: boolean = false; - private oldColumn: number = this.columns; - private pinchTime: number = 0; private gridItems: number[] = []; + @State sections: WaterFlowSections = new WaterFlowSections(); + sectionMargin: Margin = { + top: 10, + left: 5, + bottom: 10, + right: 5 + }; + oneColumnSection: SectionOptions = { + itemsCount: 1, + crossCount: 1, + columnsGap: 5, + rowsGap: 10, + margin: this.sectionMargin, + }; + twoColumnSection: SectionOptions = { + itemsCount: 98, + crossCount: 2, + }; + // 使用分组瀑布流时无法通过footer设置尾部组件,可以保留一个固定的分组作为footer + lastSection: SectionOptions = { + itemsCount: 1, + crossCount: 1, + }; // 计算FlowItem宽/高 getSize() { @@ -72,59 +87,26 @@ export struct WaterFlowGroupingMixing { } aboutToAppear() { - // 读取上次最后切换到到列数 - let lastCount = AppStorage.get('columnsCount'); - if (typeof lastCount != 'undefined') { - this.columns = lastCount; - } this.setItemSizeArray(); for (let i = 0; i < 15; ++i) { this.gridItems.push(i); } - } - - // 根据缩放阈值改变列数,触发WaterFlow重新布局 - changeColumns(scale: number) { - if (scale > (this.columns / (this.columns - 0.5)) && this.columns > 1) { - this.columns--; - this.columnChanged = true; - } else if (scale < 1 && this.columns < 4) { - this.columns++; - this.columnChanged = true; - } - } - - @Builder - itemFoot() { - Row() { - LoadingProgress() - .color(Color.Blue).height(50).aspectRatio(1).width('20%') - Text(`正在加载`) - .fontSize(20) - .width('30%') - .height(50) - .align(Alignment.Center) - .margin({ top: 2 }) - }.width('100%').justifyContent(FlexAlign.Center) + // 所有分组的itemCount之和需要和WaterFlow下数据源的子节点总数相等,否则无法正常布局 + let sectionOptions: SectionOptions[] = [this.oneColumnSection, this.twoColumnSection, this.lastSection]; + this.sections.splice(0, 0, sectionOptions); } build() { NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.WaterFlowGroupingMixing_title') }) { - List({ space: 10 }) { - ListItem() { - Text('List').fontSize(14).height(16).margin(3) - } - - ListItem() { - Column() { - Text('Grid in ListItem').fontSize(12).height(16).margin(3) - + ComponentCard({ title: $r('app.string.WaterFlowGroupingMixing_title') }) { + WaterFlow({ layoutMode: WaterFlowLayoutMode.SLIDING_WINDOW, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + if (item === 0) { Grid() { ForEach(this.gridItems, (day: number) => { GridItem() { - Text('GridItem').fontSize(10).height(16) + Text('GridItem').fontSize(14).height(16) }.backgroundColor(0xFFC0CB) }, (day: number) => day.toString()) } @@ -133,48 +115,32 @@ export struct WaterFlowGroupingMixing { .columnsGap(5) .columnsTemplate('1fr '.repeat(5)) .rowsTemplate('1fr '.repeat(3)) - .width('95%') - }.borderWidth(3) + } else { + ReusableFlowItem({ item: item }) + } } - - ListItem() { - Column() { - Text('WaterFlow in ListItem').fontSize(14).height(16).margin(3) - WaterFlow({ layoutMode: WaterFlowLayoutMode.SLIDING_WINDOW }) { - LazyForEach(this.dataSource, (item: number) => { - FlowItem() { - ReusableFlowItem({ item: item }) - } - .width('100%') - .aspectRatio(this.columns === 2 ? this.itemHeightArray[item % 100] / this.itemWidthArray[item % 100] : 0) - .backgroundColor(this.colors[item % 5]) - }, (item: string) => item) - } - .columnsTemplate('1fr '.repeat(this.columns)) - .backgroundColor(0xFAEEE0) - .height('100%') - .layoutWeight(1) - // 即将触底时提前增加数据 - .onScrollIndex((first: number, last: number) => { - if (last + 20 >= this.dataSource.totalCount()) { - setTimeout(() => { - this.dataSource.addNewItems(100); - }, 1000) - } - }) - .width('95%') - }.borderWidth(3) - } - }.borderWidth(3) - .width('98%') - .alignListItem(ListItemAlign.Center).scrollBar(BarState.Off) + .width('100%') + .aspectRatio(item != 0 ? this.itemHeightArray[item % 100] / this.itemWidthArray[item % 100] : 0) + .backgroundColor(item != 0 ? this.colors[item % 5] : Color.White) + }, (item: string) => item) } + .backgroundColor(0xFAEEE0) + .height('100%') + // 即将触底时提前增加数据 + .onScrollIndex((first: number, last: number) => { + if (last + 20 >= this.dataSource.totalCount()) { + setTimeout(() => { + this.dataSource.addNewItems(100); + // 增加数据后同步调整对应分组的itemCount + this.twoColumnSection.itemsCount += 100; + this.sections.update(1, this.twoColumnSection); + }, 1000); + } + }) + .margin(10) } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) - } - .backgroundColor('#f1f2f3') + }.backgroundColor('#f1f2f3') .title($r('app.string.WaterFlowGroupingMixing_title')) } } +// [End waterFlowGroupingMixing_start] \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowInfiniteScrolling.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowInfiniteScrolling.ets index 090bdf39b81bc3ba995ca1617cc95492d8cdcb44..36b1f523b9afa476260ab3c82c9ad0f1ccca6559 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowInfiniteScrolling.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowInfiniteScrolling.ets @@ -93,7 +93,7 @@ export struct WaterFlowInfiniteScrolling { this.columnChanged = true; } } - + // [Start WaterFlowInfiniteScrolling_start] @Builder itemFoot() { Row() { @@ -130,9 +130,7 @@ export struct WaterFlowInfiniteScrolling { // 触底加载数据 .onReachEnd(() => { setTimeout(() => { - for (let i = 0; i < 100; i++) { - this.dataSource.addLastItem(); - } + this.dataSource.addNewItems(100); }, 1000) }) } @@ -144,4 +142,5 @@ export struct WaterFlowInfiniteScrolling { .backgroundColor('#f1f2f3') .title($r('app.string.WaterFlowInfiniteScrolling_title')) } + // [End WaterFlowInfiniteScrolling_start] } diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowInfiniteScrollingEarly.ets b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowInfiniteScrollingEarly.ets index 162cb8e756fd1ce79512599c73e712d7ab1f0d1c..cea2bfa447ed350ab2ded22ee344432c3b15a49f 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowInfiniteScrollingEarly.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowInfiniteScrollingEarly.ets @@ -107,7 +107,7 @@ export struct WaterFlowInfiniteScrollingEarly { .margin({ top: 2 }) }.width('100%').justifyContent(FlexAlign.Center) } - + // [Start waterFlowInfiniteScrollingEarly_start] build() { NavDestination() { Column({ space: 12 }) { @@ -144,4 +144,5 @@ export struct WaterFlowInfiniteScrollingEarly { .backgroundColor('#f1f2f3') .title($r('app.string.WaterFlowInfiniteScrollingEarly_title')) } + // [End waterFlowInfiniteScrollingEarly_start] } \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/element/string.json b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/element/string.json index f5f2e04b93c4c18a04876f8e02668d82e6862464..e2573740b14a75993b0b79186ed1bc4b07d12d7e 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/element/string.json +++ b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/element/string.json @@ -308,6 +308,10 @@ "name": "ScrollableTabBar_titleExample", "value": "滚动导航栏示例" }, + { + "name": "Cache_count", + "value": "缓存数" + }, { "name": "FocusOn_content", "value": "关注的内容" @@ -336,6 +340,18 @@ "name": "humanities_content", "value": "人文的内容" }, + { + "name": "art_content", + "value": "艺术的内容" + }, + { + "name": "nature_content", + "value": "自然的内容" + }, + { + "name": "military_content", + "value": "军事的内容" + }, { "name": "FocusOn", "value": "关注" @@ -364,6 +380,18 @@ "name": "humanities", "value": "人文" }, + { + "name": "art", + "value": "艺术" + }, + { + "name": "nature", + "value": "自然" + }, + { + "name": "military", + "value": "军事" + }, { "name": "ScrollableTabBar_description", "value": "示例展示内容分类较多,屏幕宽度无法容纳所有分类页签的情况下,需要使用可滚动的导航栏的情景。" @@ -420,6 +448,10 @@ "name": "ContentWillChange_titleContentAndTabSync", "value": "内容页和页签联动示例" }, + { + "name": "ContentWillChange_titleContentOnAndTabSync", + "value": "内容页和页签不联动示例" + }, { "name": "ContentWillChange_titleSpecifiedTab", "value": "切换指定页签示例" @@ -436,6 +468,10 @@ "name": "ContentWillChange_description", "value": "示例展示使用了自定义导航栏后,自行实现页签切换逻辑。" }, + { + "name": "Content_titleContentOnAndTabSync", + "value": "示例展示使用了自定义导航栏后,内容和标签联动" + }, { "name": "AgeFriendlyTabs_title", "value": "支持适老化" @@ -576,6 +612,18 @@ "name": "ResponsiveScrollPositionList_title", "value": "响应滚动位置" }, + { + "name": "Sliding_Hand_Event", + "value": "滑动离手事件" + }, + { + "name": "Support_Sliding_Hand_Event", + "value": "支持滑动离手事件" + }, + { + "name": "Today_Hot_News", + "value": "今日热点新闻" + }, { "name": "ResponsiveScrollPositionList_titleExample", "value": "响应滚动位置示例" @@ -856,6 +904,14 @@ "name": "ArcListCrown_description", "value": "手表设备上弧形列表在获焦的情况下可对旋转表冠做出响应,用户可通过旋转表冠的操作滑动列表,浏览列表项数据。" }, + { + "name": "ArcListCreate_title", + "value": "创建弧形列表" + }, + { + "name": "ArcListCreate_description", + "value": "ArcList可通过调用以下接口来创建。" + }, { "name": "ArcListShow_title", "value": "在弧形列表中显示数据" @@ -940,6 +996,10 @@ "name": "ListChatRoom_description", "value": "部分业务场景需要列表底部插入数据时,自动向上滚动,把新插入的节点展示出来。" }, + { + "name": "SupportSlidingHand_title", + "value": "支持滑动离手事件" + }, { "name": "LongGrid_title", "value": "性能优化" @@ -983,6 +1043,114 @@ { "name": "ArcListStyles_light", "value": "显示和亮度" + }, + { + "name": "Reading", + "value": "读书" + }, + { + "name": "Exercise", + "value": "旅游" + }, + { + "name": "Travel", + "value": "旅游" + }, + { + "name": "Listening_Music", + "value": "听音乐" + }, + { + "name": "Watching_Films", + "value": "看电影" + }, + { + "name": "Singing", + "value": "唱歌" + }, + { + "name": "Meeting", + "value": "会议" + }, + { + "name": "Voting", + "value": "投票" + }, + { + "name": "Check_in", + "value": "签到" + }, + { + "name": "Printing", + "value": "打印" + }, + { + "name": "Live_Streaming", + "value": "直播" + }, + { + "name": "Imported", + "value": "进口" + }, + { + "name": "Categories", + "value": "分类" + }, + { + "name": "Recharge", + "value": "充值" + }, + { + "name": "Membership", + "value": "领卷" + }, + { + "name": "Claim_Coupon", + "value": "抽奖" + }, + { + "name": "Lottery", + "value": "会员" + }, + { + "name": "Favorites", + "value": "收藏" + }, + { + "name": "Points", + "value": "积分" + }, + { + "name": "More", + "value": "更多" + }, + { + "name": "Previous_Page", + "value": "上一页" + }, + { + "name": "Next_page", + "value": "下一页" + }, + { + "name": "message", + "value": "发送" + }, + { + "name": "contacts", + "value": "联系人" + }, + { + "name": "First_subassembly", + "value": "第一个子组件" + }, + { + "name": "Second_subassembly", + "value": "第二个子组件" + }, + { + "name": "Third_subassembly", + "value": "第三个子组件" } ] } \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_public_delete_filled.svg b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_public_delete_filled.svg new file mode 100644 index 0000000000000000000000000000000000000000..8f8348613dafc3fb1a1adbaa0f978bd3e9398fd7 --- /dev/null +++ b/ArkUIKit/ScrollableComponent/entry/src/main/resources/base/media/ic_public_delete_filled.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/main/syscap.json b/ArkUIKit/ScrollableComponent/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..f6d8139cd95cc7832f9bb6c50cff85200da2fcfb --- /dev/null +++ b/ArkUIKit/ScrollableComponent/entry/src/main/syscap.json @@ -0,0 +1,18 @@ +{ + "devices": { + "general": [ + "default", + "tablet" + ], + "custom": [ + { + "xts": [ + "SystemCapability.ArkUI.ArkUI.Full", + "SystemCapability.ArkUI.ArkUI.Circle", + "SystemCapability.Security.DeviceSecurityLevel", + "SystemCapability.UserIAM.UserAuth.PinAuth" + ] + } + ] + } +} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/List.test.ets index 7c16bc08c6fb53175fcdc9d628a4d6a9b34bef4c..a0c9dd74f6cb4c62d739de07bd60e08716b3d5b6 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/List.test.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/List.test.ets @@ -15,8 +15,9 @@ import abilityTest from './Ability.test'; import IndexTest from './index.test'; - +import indexAdd from './indexAdd.test'; export default function testsuite() { abilityTest(); IndexTest(); + indexAdd() } \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/index.test.ets b/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/index.test.ets index 30b111830deafd1cbbb852db21fa483d02371daa..b1f5dfd85f2e38088e5e895bd00cc7686037823f 100644 --- a/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/index.test.ets +++ b/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/index.test.ets @@ -14,12 +14,14 @@ */ import { describe, it, expect, beforeAll } from '@ohos/hypium'; + // 导入测试依赖kit -import { abilityDelegatorRegistry, Driver, ON, MouseButton,MatchPattern, UiDirection } from '@kit.TestKit'; +import { abilityDelegatorRegistry, Driver, ON, MouseButton, MatchPattern, UiDirection, Component } from '@kit.TestKit'; import { UIAbility, Want } from '@kit.AbilityKit'; import { Point } from '@ohos.UiTest'; +import { hilog } from '@kit.PerformanceAnalysisKit'; - +const DOMAIN = 0x0000; const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); const bundleName = abilityDelegatorRegistry.getArguments().bundleName; let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); @@ -47,1242 +49,1304 @@ export default function IndexTest() { }) /** - * @tc.number UiTest_001 - * @tc.name testControlledScrollPositionList - * @tc.desc 测试控制滚动位置示例 + * @tc.number UiTest_041 + * @tc.name testArcListArcIndexerBar + * @tc.desc 测试弧形列表联动indexer示例 */ - it('testControlledScrollPositionList', 0, async (done: Function) => { - console.info('uitest: testControlledScrollPositionList begin'); + it('ArcListArcIndexerBar', 0, async (done: Function) => { + console.info('uitest: testArcListArcIndexerBar begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ControlledScrollPositionList_title')); + let str = await getResourceString($r('app.string.ArcListArcIndexerBar_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let stackList = await driver.findComponent(ON.type('Stack')); - expect(stackList === null).assertFalse(); let button = await driver.findComponent(ON.type('Button')); expect(button === null).assertFalse(); - await stackList.scrollToBottom(2400); await button.click(); + let testText = await driver.findComponent(ON.text('F', MatchPattern.CONTAINS)); + expect(testText === null).assertFalse(); + let arclist = await driver.findComponent(ON.type('ArcList')); + expect(arclist === null).assertFalse(); + await arclist.scrollToBottom(5000); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testControlledScrollPositionList end'); + console.info('uitest: testArcListArcIndexerBar end'); done(); }) /** - * @tc.number UiTest_002 - * @tc.name testResponsiveScrollPositionList - * @tc.desc 测试响应滚动位置示例 + * @tc.number UiTest_035 + * @tc.name testArcLongList + * @tc.desc 测试弧形长列表示例 */ - it('testResponsiveScrollPositionList', 0, async (done: Function) => { - console.info('uitest: testResponsiveScrollPositionList begin'); + it('ArcLongList', 0, async (done: Function) => { + console.info('uitest: testArcLongList begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ResponsiveScrollPositionList_title')); + let list = await driver.findComponent(ON.type('List')); + expect(list === null).assertFalse(); + await list.scrollToBottom(2400); + let str = await getResourceString($r('app.string.ArcLongList_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - - let stackList = await driver.findComponent(ON.type('Stack')); - expect(stackList === null).assertFalse(); - await stackList.scrollToBottom(2400); + let arclist = await driver.findComponent(ON.type('ArcList')); + expect(arclist === null).assertFalse(); + await arclist.scrollToBottom(30000); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testResponsiveScrollPositionList end'); + console.info('uitest: testArcLongList end'); done(); }) /** - * @tc.number UiTest_003 - * @tc.name testDataInList - * @tc.desc 测试列表显示数据示例 + * @tc.number UiTest_036 + * @tc.name testArcListAcrScrollBar + * @tc.desc 测试弧形列表外置滚动条示例 */ - it('testDataInList', 0, async (done: Function) => { - console.info('uitest: testDataInList begin'); + it('ArcListAcrScrollBar', 0, async (done: Function) => { + console.info('uitest: testArcListAcrScrollBar begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.DataInList_title')); + let str = await getResourceString($r('app.string.ArcListAcrScrollBar_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - str = await getResourceString($r('app.string.peopleOne')); - let dataListText = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(dataListText === null).assertFalse(); + let arclist = await driver.findComponent(ON.type('ArcList')); + expect(arclist === null).assertFalse(); + await arclist.scrollToBottom(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testDataInList end'); + console.info('uitest: testArcListAcrScrollBar end'); done(); }) /** - * @tc.number UiTest_004 - * @tc.name testStickyHeaderList - * @tc.desc 测试添加粘性标题示例 + * @tc.number UiTest_037 + * @tc.name testArcListBuiltInScrollerBar + * @tc.desc 测试弧形列表内置滚动条示例 */ - it('testStickyHeaderList', 0, async (done: Function) => { - console.info('uitest: testStickyHeaderList begin'); + it('arcListBuiltInScrollerBar', 0, async (done: Function) => { + console.info('uitest: testArcListBuiltInScrollerBar begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.StickyHeaderList_title')); + let str = await getResourceString($r('app.string.arcListBuiltInScrollerBar_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let stickyList = await driver.findComponent(ON.type('List')); - expect(stickyList === null).assertFalse(); - await stickyList.scrollToBottom(); + let arclist = await driver.findComponent(ON.type('ArcList')); + expect(arclist === null).assertFalse(); + await arclist.scrollToBottom(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testStickyHeaderList end'); + console.info('uitest: testArcListBuiltInScrollerBar end'); done(); }) /** - * @tc.number UiTest_005 - * @tc.name testAddListItem - * @tc.desc 测试新增列表项示例 + * @tc.number UiTest_038 + * @tc.name testArcListContents + * @tc.desc 测试弧形列表迭代弧形列表内容示例 */ - it('testAddListItem', 0, async (done: Function) => { - console.info('uitest: testAddListItem begin'); + it('ArcListContents', 0, async (done: Function) => { + console.info('uitest: testArcListContents begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,17); - let str = await getResourceString($r('app.string.AddListItem_title')); + let str = await getResourceString($r('app.string.ArcListContents_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let addButton = await driver.findComponent(ON.text('+', MatchPattern.CONTAINS)); - expect(addButton === null).assertFalse(); - await addButton.click(); - await driver.mouseClick({x: 580, y: 770}, MouseButton.MOUSE_BUTTON_LEFT, 0, 0); + let arclist = await driver.findComponent(ON.type('ArcList')); + expect(arclist === null).assertFalse(); + await arclist.scrollToBottom(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testAddListItem end'); + console.info('uitest: testArcListContents end'); done(); }) /** - * @tc.number UiTest_006 - * @tc.name testDeleteListItem - * @tc.desc 测试删除列表项示例 + * @tc.number UiTest_039 + * @tc.name testArcListShow + * @tc.desc 测试弧形列表展示数据示例 */ - it('testDeleteListItem', 0, async (done: Function) => { - console.info('uitest: testDeleteListItem begin'); + it('ArcListShow', 0, async (done: Function) => { + console.info('uitest: testArcListShow begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,17); - let str = await getResourceString($r('app.string.DeleteListItem_title')); + let str = await getResourceString($r('app.string.ArcListShow_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let addButton = await driver.findComponent(ON.text('+', MatchPattern.CONTAINS)); - expect(addButton === null).assertFalse(); - await addButton.click(); - await driver.mouseClick({x: 580, y: 770}, MouseButton.MOUSE_BUTTON_LEFT, 0, 0); - let listContent = await driver.findComponent(ON.text('Reading', MatchPattern.CONTAINS)); - expect(listContent === null).assertFalse(); - await listContent.longClick(); - let deleteButton = await driver.findComponent(ON.text('delete', MatchPattern.CONTAINS)); - expect(deleteButton === null).assertFalse(); - await deleteButton.click(); + let arclist = await driver.findComponent(ON.type('ArcList')); + expect(arclist === null).assertFalse(); + await arclist.scrollToBottom(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testDeleteListItem end'); + console.info('uitest: testArcListShow end'); done(); }) /** - * @tc.number UiTest_007 - * @tc.name testListLayout - * @tc.desc 测试列表开发布局示例 + * @tc.number UiTest_040 + * @tc.name testArcListStyles + * @tc.desc 测试弧形列表设置样式示例 */ - it('testListLayout', 0, async (done: Function) => { - console.info('uitest: testListLayout begin'); + it('ArcListStyles', 0, async (done: Function) => { + console.info('uitest: testArcListStyles begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ListLayout_title')); + let str = await getResourceString($r('app.string.ArcListStyles_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let dataListText = await driver.findComponent(ON.text('ListItem one', MatchPattern.CONTAINS)); - expect(dataListText === null).assertFalse(); + let arclist = await driver.findComponent(ON.type('List')); + expect(arclist === null).assertFalse(); + await arclist.scrollToBottom(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testListLayout end'); + console.info('uitest: testArcListStyles end'); done(); }) /** - * @tc.number UiTest_008 - * @tc.name testGridScrollPosition - * @tc.desc 测试控制滚动位置的网格布局示例 + * @tc.number UiTest_042 + * @tc.name testArcListSideSlip + * @tc.desc 测试弧形列表侧滑示例 */ - it('testGridScrollPosition', 0, async (done: Function) => { - console.info('uitest: testGridScrollPosition begin'); + it('ArcListSideSlip', 0, async (done: Function) => { + console.info('uitest: testArcListSideSlip begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ScrollPosition_title')); + let str = await getResourceString($r('app.string.ArcListSideSlip_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let buttonPrevious = await driver.findComponent(ON.text('Previous', MatchPattern.CONTAINS)); - let buttonNext = await driver.findComponent(ON.text('Next', MatchPattern.CONTAINS)); - expect(buttonPrevious === null).assertFalse(); - expect(buttonNext === null).assertFalse(); - await buttonNext.click(); - await buttonPrevious.click(); + let testText = await driver.findComponent(ON.text('Alice', MatchPattern.CONTAINS)); + expect(testText === null).assertFalse(); + let arclist = await driver.findComponent(ON.type('ArcList')); + expect(arclist === null).assertFalse(); + await arclist.scrollToBottom(5000); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testGridScrollPosition end'); + console.info('uitest: testArcListSideSlip end'); done(); }) /** - * @tc.number UiTest_009 - * @tc.name testGridScrollableGrid - * @tc.desc 测试可滚动的网格布局示例 + * @tc.number UiTest_047 + * @tc.name testArcListCrown + * @tc.desc 测试弧形列表响应旋转表冠示例 */ - it('testGridScrollableGrid', 0, async (done: Function) => { - console.info('uitest: testGridScrollableGrid begin'); + it('ArcListCrown', 0, async (done: Function) => { + console.info('=====>uitest: testArcListCrown begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ScrollableGrid_title')); + let list = await driver.findComponent(ON.type('List')); + expect(list === null).assertFalse(); + await list.scrollToBottom(1000); + let str = await getResourceString($r('app.string.ArcListCrown_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - - let scrollableGrid = await driver.findComponent(ON.type('Grid')); - expect(scrollableGrid === null).assertFalse(); - await scrollableGrid.scrollToBottom(); + let arclist = await driver.findComponent(ON.type('ArcList')); + expect(arclist === null).assertFalse(); + await arclist.scrollToBottom(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testGridScrollableGrid end'); + console.info('=====>uitest: testArcListCrown end'); done(); }) /** - * @tc.number UiTest_010 - * @tc.name testSwiperAutoPlay - * @tc.desc 测试自动轮播示例 + * @tc.number UiTest_048 + * @tc.name testArcListCreate + * @tc.desc 测试弧形列表创建弧形列表示例 */ - it('testSwiperAutoPlay', 0, async (done: Function) => { - console.info('uitest: testSwiperAutoPlay begin'); + it('ArcListCreate', 0, async (done: Function) => { + console.info('=====>uitest: testArcListCreate begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.SwiperAutoPlay_title')); + let list = await driver.findComponent(ON.type('List')); + expect(list === null).assertFalse(); + await list.scrollToBottom(1000); + let str = await getResourceString($r('app.string.ArcListCreate_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,2); + let arclist = await driver.findComponent(ON.type('ArcList')); + expect(arclist === null).assertFalse(); + await arclist.scrollToBottom(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testSwiperAutoPlay end'); + console.info('=====>uitest: testArcListCreate end'); done(); }) /** - * @tc.number UiTest_011 - * @tc.name testSwiperDirection - * @tc.desc 测试轮播方向示例 + * @tc.number UiTest_043 + * @tc.name testWaterFlowDynamicSwitchover + * @tc.desc 测试瀑布流动态切换列数示例 */ - it('testSwiperDirection', 0, async (done: Function) => { - console.info('uitest: testSwiperCustomAnimation begin'); + it('WaterFlowDynamicSwitchover', 0, async (done: Function) => { + console.info('uitest: testWaterFlowDynamicSwitchover begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('WaterFlow', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.SwiperDirection_title')); + let str = await getResourceString($r('app.string.WaterFlowDynamicSwitchover_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - let scrollPoint2:Point = {x:400,y:800}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.mouseScroll(scrollPoint2,true,2); + let arclist = await driver.findComponent(ON.type('WaterFlow')); + if (arclist === null) { + console.log("=====> arclist is null"); + } + expect(arclist === null).assertFalse(); + let flowItemText = await driver.findComponent(ON.text('FlowItem0', MatchPattern.CONTAINS)); + if (flowItemText === null) { + console.log("=====> flowItemText is null"); + } + expect(flowItemText === null).assertFalse(); + let scrollPoint: Point = { x: 350, y: 1100 }; + let scrollPoint2: Point = { x: 350, y: 550 }; + await driver.fling(scrollPoint, scrollPoint2, 1, 2000); + let button = await driver.findComponent(ON.type('Button')); + if (button === null) { + console.log("=====> button is null"); + } + expect(button === null).assertFalse(); + await button.click(); + + let testText = await driver.findComponent(ON.text('N9', MatchPattern.CONTAINS)); + if (testText === null) { + console.log("=====> testText is null"); + } + expect(testText === null).assertFalse(); + await driver.fling(scrollPoint, scrollPoint2, 1, 1200); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testSwiperCustomAnimation end'); + console.info('uitest: testWaterFlowDynamicSwitchover end'); done(); }) /** - * @tc.number UiTest_012 - * @tc.name testSwiperMultiPage - * @tc.desc 测试每页显示多个子页面示例 + * @tc.number UiTest_044 + * @tc.name testWaterFlowGroupingMixing + * @tc.desc 测试瀑布流混合布局示例 */ - it('testSwiperMultiPage', 0, async (done: Function) => { - console.info('uitest: testSwiperMultiPage begin'); + it('WaterFlowGroupingMixing', 0, async (done: Function) => { + console.info('uitest: testWaterFlowGroupingMixing begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('WaterFlow', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.SwiperMultiPage_title')); + let str = await getResourceString($r('app.string.WaterFlowGroupingMixing_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,2); + let arclist = await driver.findComponent(ON.type('WaterFlow')); + expect(arclist === null).assertFalse(); + let scrollPoint: Point = { x: 350, y: 1100 }; + let scrollPoint2: Point = { x: 350, y: 550 }; + await driver.fling(scrollPoint, scrollPoint2, 1, 1200); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testSwiperMultiPage end'); + console.info('uitest: testWaterFlowGroupingMixing end'); done(); }) /** - * @tc.number UiTest_013 - * @tc.name testSwiperCustomAnimation - * @tc.desc 测试自定义切换动画示例 + * @tc.number UiTest_045 + * @tc.name testWaterFlowInfiniteScrolling + * @tc.desc 测试瀑布流无限滑动触底增加示例 */ - it('testSwiperCustomAnimation', 0, async (done: Function) => { - console.info('uitest: testSwiperCustomAnimation begin'); + it('WaterFlowInfiniteScrolling', 0, async (done: Function) => { + console.info('uitest: testWaterFlowInfiniteScrolling begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('WaterFlow', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.SwiperCustomAnimation_title')); + let str = await getResourceString($r('app.string.WaterFlowInfiniteScrolling_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,2); + let arclist = await driver.findComponent(ON.type('WaterFlow')); + expect(arclist === null).assertFalse(); + let scrollPoint: Point = { x: 350, y: 1100 }; + let scrollPoint2: Point = { x: 350, y: 550 }; + await driver.fling(scrollPoint, scrollPoint2, 1, 1200); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testSwiperCustomAnimation end'); + console.info('uitest: testWaterFlowInfiniteScrolling end'); done(); }) /** - * @tc.number UiTest_014 - * @tc.name testSwiperPageSwitchMethod - * @tc.desc 测试页面切换方式示例 + * @tc.number UiTest_046 + * @tc.name testWaterFlowInfiniteScrollingEarly + * @tc.desc 测试瀑布流无限滑动提前增加示例 */ - it('testSwiperPageSwitchMethod', 0, async (done: Function) => { - console.info('uitest: testSwiperPageSwitchMethod begin'); + it('WaterFlowInfiniteScrollingEarly', 0, async (done: Function) => { + console.info('uitest: testWaterFlowInfiniteScrollingEarly begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('WaterFlow', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.SwiperPageSwitchMethod_title')); + let str = await getResourceString($r('app.string.WaterFlowInfiniteScrollingEarly_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let buttonPrevious = await driver.findComponent(ON.text('showPrevious', MatchPattern.CONTAINS)); - let buttonNext = await driver.findComponent(ON.text('showNext', MatchPattern.CONTAINS)); - expect(buttonPrevious === null).assertFalse(); - expect(buttonNext === null).assertFalse(); - await buttonNext.click(); - await buttonPrevious.click(); + let arclist = await driver.findComponent(ON.type('WaterFlow')); + expect(arclist === null).assertFalse(); + let scrollPoint: Point = { x: 350, y: 1100 }; + let scrollPoint2: Point = { x: 350, y: 550 }; + await driver.fling(scrollPoint, scrollPoint2, 1, 1200); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testSwiperPageSwitchMethod end'); + console.info('uitest: testWaterFlowInfiniteScrollingEarly end'); done(); }) /** - * @tc.number UiTest_015 - * @tc.name testTabsLayout - * @tc.desc 测试基本布局示例 + * @tc.number UiTest_001 + * @tc.name testControlledScrollPositionList + * @tc.desc 测试控制滚动位置示例 */ - it('testTabsLayout', 0, async (done: Function) => { - console.info('uitest: testTabsLayout begin'); + it('testControlledScrollPositionList', 0, async (done: Function) => { + console.info('uitest: testControlledScrollPositionList begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.TabsLayout_title')); + let str = await getResourceString($r('app.string.ControlledScrollPositionList_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,2); + let stackList = await driver.findComponent(ON.type('Stack')); + expect(stackList === null).assertFalse(); + let button = await driver.findComponent(ON.type('Button')); + expect(button === null).assertFalse(); + await stackList.scrollToBottom(2400); + await button.click(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testTabsLayout end'); + console.info('uitest: testControlledScrollPositionList end'); done(); }) /** - * @tc.number UiTest_016 - * @tc.name testBottomTabBar - * @tc.desc 测试底部导航示例 + * @tc.number UiTest_002 + * @tc.name testResponsiveScrollPositionList + * @tc.desc 测试响应滚动位置示例 */ - it('testBottomTabBar', 0, async (done: Function) => { - console.info('uitest: testBottomTabBar begin'); + it('testResponsiveScrollPositionList', 0, async (done: Function) => { + console.info('uitest: testResponsiveScrollPositionList begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.BottomTabBar_title')); + let str = await getResourceString($r('app.string.ResponsiveScrollPositionList_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,2); + let stackList = await driver.findComponent(ON.type('Stack')); + expect(stackList === null).assertFalse(); + await stackList.scrollToBottom(2400); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testBottomTabBar end'); + console.info('uitest: testResponsiveScrollPositionList end'); done(); }) /** - * @tc.number UiTest_017 - * @tc.name testTopTabBar - * @tc.desc 测试顶部导航示例 + * @tc.number UiTest_003 + * @tc.name testDataInList + * @tc.desc 测试列表显示数据示例 */ - it('testTopTabBar', 0, async (done: Function) => { - console.info('uitest: testBottomTabBar begin'); + it('testDataInList', 0, async (done: Function) => { + console.info('uitest: testDataInList begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.TopTabBar_title')); + let str = await getResourceString($r('app.string.DataInList_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,2); + str = await getResourceString($r('app.string.peopleOne')); + let dataListText = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(dataListText === null).assertFalse(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testBottomTabBar end'); + console.info('uitest: testDataInList end'); done(); }) /** - * @tc.number UiTest_018 - * @tc.name testSideTabBar - * @tc.desc 测试侧边导航示例 + * @tc.number UiTest_004 + * @tc.name testStickyHeaderList + * @tc.desc 测试添加粘性标题示例 */ - it('testSideTabBar', 0, async (done: Function) => { - console.info('uitest: tesSideTabBar begin'); + it('testStickyHeaderList', 0, async (done: Function) => { + console.info('uitest: testStickyHeaderList begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.SideTabBar_title')); + let str = await getResourceString($r('app.string.StickyHeaderList_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,4); + let stickyList = await driver.findComponent(ON.type('List')); + expect(stickyList === null).assertFalse(); + await stickyList.scrollToBottom(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: tesSideTabBar end'); + console.info('uitest: testStickyHeaderList end'); done(); }) /** - * @tc.number UiTest_019 - * @tc.name testSwipeLockedTabBar - * @tc.desc 测试限制导航栏的滑动切换示例 + * @tc.number UiTest_005 + * @tc.name testAddListItem + * @tc.desc 测试新增列表项示例 */ - it('testSwipeLockedTabBar', 0, async (done: Function) => { - console.info('uitest: testSwipeLockedTabBar begin'); + it('testAddListItem', 0, async (done: Function) => { + console.info('uitest: testAddListItem begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.SwipeLockedTabBar_title')); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 17); + let str = await getResourceString($r('app.string.AddListItem_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,4); + let addButton = await driver.findComponent(ON.text('+', MatchPattern.CONTAINS)); + expect(addButton === null).assertFalse(); + await addButton.click(); + await driver.mouseClick({ x: 580, y: 770 }, MouseButton.MOUSE_BUTTON_LEFT, 0, 0); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testSwipeLockedTabBar end'); + console.info('uitest: testAddListItem end'); done(); }) /** - * @tc.number UiTest_020 - * @tc.name testFixedTabBar - * @tc.desc 测试固定导航栏示例 + * @tc.number UiTest_006 + * @tc.name testDeleteListItem + * @tc.desc 测试删除列表项示例 */ - it('testFixedTabBar', 0, async (done: Function) => { - console.info('uitest: testFixedTabBar begin'); + it('testDeleteListItem', 0, async (done: Function) => { + console.info('uitest: testDeleteListItem begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.FixedTabBar_title')); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 17); + let str = await getResourceString($r('app.string.DeleteListItem_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,4); + let addButton = await driver.findComponent(ON.text('+', MatchPattern.CONTAINS)); + expect(addButton === null).assertFalse(); + await addButton.click(); + await driver.mouseClick({ x: 580, y: 770 }, MouseButton.MOUSE_BUTTON_LEFT, 0, 0); + let listContent = await driver.findComponent(ON.text('Reading', MatchPattern.CONTAINS)); + expect(listContent === null).assertFalse(); + await listContent.longClick(); + let deleteButton = await driver.findComponent(ON.text('delete', MatchPattern.CONTAINS)); + expect(deleteButton === null).assertFalse(); + await deleteButton.click(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testFixedTabBar end'); + console.info('uitest: testDeleteListItem end'); done(); }) /** - * @tc.number UiTest_021 - * @tc.name testScrollableTabBar - * @tc.desc 测试滚动导航栏示例 + * @tc.number UiTest_007 + * @tc.name testListLayout + * @tc.desc 测试列表开发布局示例 */ - it('testScrollableTabBar', 0, async (done: Function) => { - console.info('uitest: testScrollableTabBar begin'); + it('testListLayout', 0, async (done: Function) => { + console.info('uitest: testListLayout begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ScrollableTabBar_title')); + let str = await getResourceString($r('app.string.ListLayout_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,12); + let dataListText = await driver.findComponent(ON.text('ListItem one', MatchPattern.CONTAINS)); + expect(dataListText === null).assertFalse(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testScrollableTabBar end'); + console.info('uitest: testListLayout end'); done(); }) /** - * @tc.number UiTest_022 - * @tc.name testCustomTabBar - * @tc.desc 测试自定义导航栏示例 + * @tc.number UiTest_008 + * @tc.name testGridScrollPosition + * @tc.desc 测试控制滚动位置的网格布局示例 */ - it('testCustomTabBar', 0, async (done: Function) => { - console.info('uitest: testCustomTabBar begin'); + it('testGridScrollPosition', 0, async (done: Function) => { + console.info('uitest: testGridScrollPosition begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.CustomTabBar_title')); + let str = await getResourceString($r('app.string.ScrollPosition_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let tabs = await driver.findComponent(ON.type('Tabs')); - expect(tabs === null).assertFalse(); - let scrollPoint:Point = {x:400,y:400}; - await driver.mouseScroll(scrollPoint,true,4); + let buttonPrevious = await driver.findComponent(ON.text('Previous', MatchPattern.CONTAINS)); + let buttonNext = await driver.findComponent(ON.text('Next', MatchPattern.CONTAINS)); + expect(buttonPrevious === null).assertFalse(); + expect(buttonNext === null).assertFalse(); + await buttonNext.click(); + await buttonPrevious.click(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testCustomTabBar end'); + console.info('uitest: testGridScrollPosition end'); done(); }) /** - * @tc.number UiTest_023 - * @tc.name testArcSwiperAction - * @tc.desc 测试弧形轮播动画示例 + * @tc.number UiTest_009 + * @tc.name testGridScrollableGrid + * @tc.desc 测试可滚动的网格布局示例 */ - it('ArcSwiperAction', 0, async (done: Function) => { - console.info('uitest: testSwiperCustomAnimation begin'); + it('testGridScrollableGrid', 0, async (done: Function) => { + console.info('uitest: testGridScrollableGrid begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ArcSwiperAction_title')); + let str = await getResourceString($r('app.string.ScrollableGrid_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:300,y:300}; - await driver.mouseScroll(scrollPoint,true,2); + let scrollableGrid = await driver.findComponent(ON.type('Grid')); + expect(scrollableGrid === null).assertFalse(); + await scrollableGrid.scrollToBottom(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testArcSwiperAction end'); + console.info('uitest: testGridScrollableGrid end'); done(); }) /** - * @tc.number UiTest_024 - * @tc.name testArcSwiperVertical - * @tc.desc 测试弧形轮播垂直方向示例 + * @tc.number UiTest_010 + * @tc.name testSwiperAutoPlay + * @tc.desc 测试自动轮播示例 */ - it('ArcSwiperVertical ', 0, async (done: Function) => { - console.info('uitest: testArcSwiperVertical begin'); + it('testSwiperAutoPlay', 0, async (done: Function) => { + console.info('uitest: testSwiperAutoPlay begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ArcSwiperVertical_title')); + let str = await getResourceString($r('app.string.SwiperAutoPlay_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); let swiper = await driver.findComponent(ON.type('Swiper')); expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:300,y:300}; - await driver.mouseScroll(scrollPoint,true,2); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 2); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testArcSwiperVertical end'); + console.info('uitest: testSwiperAutoPlay end'); done(); }) /** - * @tc.number UiTest_025 - * @tc.name testArcSwiperHorizontal - * @tc.desc 测试弧形轮播水平方向示例 + * @tc.number UiTest_011 + * @tc.name testSwiperDirection + * @tc.desc 测试轮播方向示例 */ - it('ArcSwiperHorizontal', 0, async (done: Function) => { - console.info('uitest: testArcSwiperHorizontal begin'); + it('testSwiperDirection', 0, async (done: Function) => { + console.info('uitest: testSwiperCustomAnimation begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ArcSwiperHorizontal_title')); + let str = await getResourceString($r('app.string.SwiperDirection_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); let swiper = await driver.findComponent(ON.type('Swiper')); expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:300,y:300}; - await driver.mouseScroll(scrollPoint,true,2); + let scrollPoint: Point = { x: 400, y: 400 }; + let scrollPoint2: Point = { x: 400, y: 800 }; + await driver.mouseScroll(scrollPoint, true, 2); + await driver.mouseScroll(scrollPoint2, true, 2); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testArcSwiperHorizontal end'); + console.info('uitest: testSwiperCustomAnimation end'); done(); }) /** - * @tc.number UiTest_026 - * @tc.name testArcSwiperSideSlip - * @tc.desc 测试弧形轮播侧滑返回示例 + * @tc.number UiTest_012 + * @tc.name testSwiperMultiPage + * @tc.desc 测试每页显示多个子页面示例 */ - it('ArcSwiperSideSlip', 0, async (done: Function) => { - console.info('uitest: testArcSwiperSideSlip begin'); + it('testSwiperMultiPage', 0, async (done: Function) => { + console.info('uitest: testSwiperMultiPage begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ArcSwiperSideSlip_title')); + let str = await getResourceString($r('app.string.SwiperMultiPage_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); let swiper = await driver.findComponent(ON.type('Swiper')); expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:300,y:300}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.mouseScroll(scrollPoint,false,2); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 2); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testArcSwiperSideSlip end'); + console.info('uitest: testSwiperMultiPage end'); done(); }) /** - * @tc.number UiTest_027 - * @tc.name testArcSwiperToggle - * @tc.desc 测试弧形轮播页面切换方式示例 + * @tc.number UiTest_013 + * @tc.name testSwiperCustomAnimation + * @tc.desc 测试自定义切换动画示例 */ - it('ArcSwiperToggle', 0, async (done: Function) => { - console.info('uitest: testArcSwiperToggle begin'); + it('testSwiperCustomAnimation', 0, async (done: Function) => { + console.info('uitest: testSwiperCustomAnimation begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ArcSwiperToggle_title')); + let str = await getResourceString($r('app.string.SwiperCustomAnimation_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let preArcButton = await driver.findComponent(ON.text('previous', MatchPattern.CONTAINS)); - let nextArcButton = await driver.findComponent(ON.text('next', MatchPattern.CONTAINS)); - expect(preArcButton === null).assertFalse(); - expect(nextArcButton === null).assertFalse(); - await nextArcButton.click(); - await preArcButton.click(); + let swiper = await driver.findComponent(ON.type('Swiper')); + expect(swiper === null).assertFalse(); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 2); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testArcSwiperToggle end'); + console.info('uitest: testSwiperCustomAnimation end'); done(); }) /** - * @tc.number UiTest_028 - * @tc.name testArcSwiperStyles - * @tc.desc 测试弧形轮播设置导航点样式示例 + * @tc.number UiTest_014 + * @tc.name testSwiperPageSwitchMethod + * @tc.desc 测试页面切换方式示例 */ - it('ArcSwiperStyles', 0, async (done: Function) => { - console.info('uitest: testArcSwiperToggle begin'); + it('testSwiperPageSwitchMethod', 0, async (done: Function) => { + console.info('uitest: testSwiperPageSwitchMethod begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ArcSwiperStyles_title')); + let str = await getResourceString($r('app.string.SwiperPageSwitchMethod_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:300,y:300}; - let scrollPoint2:Point = {x:300,y:600}; - await driver.mouseScroll(scrollPoint,true,2); - await driver.mouseScroll(scrollPoint2,true,2); + let buttonPrevious = await driver.findComponent(ON.text('showPrevious', MatchPattern.CONTAINS)); + let buttonNext = await driver.findComponent(ON.text('showNext', MatchPattern.CONTAINS)); + expect(buttonPrevious === null).assertFalse(); + expect(buttonNext === null).assertFalse(); + await buttonNext.click(); + await buttonPrevious.click(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testArcSwiperStyles end'); + console.info('uitest: testSwiperPageSwitchMethod end'); done(); }) /** - * @tc.number UiTest_029 - * @tc.name testSwiperAndTabsLinkage - * @tc.desc 测试轮播与选项卡联动示例 + * @tc.number UiTest_015 + * @tc.name testTabsLayout + * @tc.desc 测试基本布局示例 */ - it('SwiperAndTabsLinkage', 0, async (done: Function) => { - console.info('uitest: testSwiperAndTabsLinkage begin'); + it('testTabsLayout', 0, async (done: Function) => { + console.info('uitest: testTabsLayout begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.SwiperAndTabsLinkage_title')); + let str = await getResourceString($r('app.string.TabsLayout_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let swiper = await driver.findComponent(ON.type('Swiper')); - expect(swiper === null).assertFalse(); - let scrollPoint:Point = {x:400,y:500}; - await driver.mouseScroll(scrollPoint,true,2); + let tabs = await driver.findComponent(ON.type('Tabs')); + expect(tabs === null).assertFalse(); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 2); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testSwiperAndTabsLinkage end'); + console.info('uitest: testTabsLayout end'); done(); }) /** - * @tc.number UiTest_030 - * @tc.name testLongGrid - * @tc.desc 测试网格性能优化示例 + * @tc.number UiTest_016 + * @tc.name testBottomTabBar + * @tc.desc 测试底部导航示例 */ - it('LongGrid', 0, async (done: Function) => { - console.info('uitest: testLongGrid begin'); + it('testBottomTabBar', 0, async (done: Function) => { + console.info('uitest: testBottomTabBar begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.LongGrid_title')); + let str = await getResourceString($r('app.string.BottomTabBar_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let scrollableGrid = await driver.findComponent(ON.type('Grid')); - expect(scrollableGrid === null).assertFalse(); - await scrollableGrid.scrollToBottom(); + let tabs = await driver.findComponent(ON.type('Tabs')); + expect(tabs === null).assertFalse(); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 2); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testLongGrid end'); + console.info('uitest: testBottomTabBar end'); done(); }) /** - * @tc.number UiTest_031 - * @tc.name testGridScrollbar - * @tc.desc 测试网格添加外置滚动条示例 + * @tc.number UiTest_017 + * @tc.name testTopTabBar + * @tc.desc 测试顶部导航示例 */ - it('GridScrollbar', 0, async (done: Function) => { - console.info('uitest: testGridScrollbar begin'); + it('testTopTabBar', 0, async (done: Function) => { + console.info('uitest: testBottomTabBar begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.GridScrollbar_title')); + let str = await getResourceString($r('app.string.TopTabBar_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let scrollableGrid = await driver.findComponent(ON.type('Grid')); - expect(scrollableGrid === null).assertFalse(); - await scrollableGrid.scrollToBottom(); + let tabs = await driver.findComponent(ON.type('Tabs')); + expect(tabs === null).assertFalse(); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 2); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testGridScrollbar end'); + console.info('uitest: testBottomTabBar end'); done(); }) /** - * @tc.number UiTest_032 - * @tc.name testGridSideToSide - * @tc.desc 测试网格控制滚动位置示例 + * @tc.number UiTest_018 + * @tc.name testSideTabBar + * @tc.desc 测试侧边导航示例 */ - it('GridSideToSide', 0, async (done: Function) => { - console.info('uitest: testGridSideToSide begin'); + it('testSideTabBar', 0, async (done: Function) => { + console.info('uitest: tesSideTabBar begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.GridSideToSide_description')); + let str = await getResourceString($r('app.string.SideTabBar_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let preArcButton = await driver.findComponent(ON.text('上一页', MatchPattern.CONTAINS)); - let nextArcButton = await driver.findComponent(ON.text('下一页', MatchPattern.CONTAINS)); - expect(preArcButton === null).assertFalse(); - expect(nextArcButton === null).assertFalse(); - await nextArcButton.click(); - await preArcButton.click(); + let tabs = await driver.findComponent(ON.type('Tabs')); + expect(tabs === null).assertFalse(); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 4); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testGridSideToSide end'); + console.info('uitest: tesSideTabBar end'); done(); }) /** - * @tc.number UiTest_033 - * @tc.name testLongList - * @tc.desc 测试长列表示例 + * @tc.number UiTest_019 + * @tc.name testSwipeLockedTabBar + * @tc.desc 测试限制导航栏的滑动切换示例 */ - it('LongList', 0, async (done: Function) => { - console.info('uitest: testLongList begin'); + it('testSwipeLockedTabBar', 0, async (done: Function) => { + console.info('uitest: testSwipeLockedTabBar begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let list = await driver.findComponent(ON.type('List')); - expect(list === null).assertFalse(); - await list.scrollToBottom(1000); - let str = await getResourceString($r('app.string.LongList_title')); + let str = await getResourceString($r('app.string.SwipeLockedTabBar_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let scrollableList = await driver.findComponent(ON.type('List')); - expect(scrollableList === null).assertFalse(); - await scrollableList.scrollToBottom(); + let tabs = await driver.findComponent(ON.type('Tabs')); + expect(tabs === null).assertFalse(); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 4); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testLongList end'); + console.info('uitest: testSwipeLockedTabBar end'); done(); }) /** - * @tc.number UiTest_033 - * @tc.name testCollapseAndExpand - * @tc.desc 测试列表折叠与展开示例 + * @tc.number UiTest_020 + * @tc.name testFixedTabBar + * @tc.desc 测试固定导航栏示例 */ - it('CollapseAndExpand', 0, async (done: Function) => { - console.info('uitest: testCollapseAndExpand begin'); + it('testFixedTabBar', 0, async (done: Function) => { + console.info('uitest: testFixedTabBar begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let list = await driver.findComponent(ON.type('List')); - expect(list === null).assertFalse(); - await list.scrollToBottom(1000); - let str = await getResourceString($r('app.string.CollapseAndExpand_title')); + let str = await getResourceString($r('app.string.FixedTabBar_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let text = await driver.findComponent(ON.text('个人基本资料', MatchPattern.CONTAINS)); - expect(text === null).assertFalse(); - await text.click(); - let nameText = await driver.findComponent(ON.text('昵称', MatchPattern.CONTAINS)); - expect(nameText === null).assertFalse(); - await text.click(); - nameText = await driver.findComponent(ON.text('昵称', MatchPattern.CONTAINS)); - expect(nameText === null).assertTrue(); + let tabs = await driver.findComponent(ON.type('Tabs')); + expect(tabs === null).assertFalse(); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 4); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testCollapseAndExpand end'); + console.info('uitest: testFixedTabBar end'); done(); }) /** - * @tc.number UiTest_035 - * @tc.name testArcLongList - * @tc.desc 测试弧形长列表示例 + * @tc.number UiTest_021 + * @tc.name testScrollableTabBar + * @tc.desc 测试滚动导航栏示例 */ - it('ArcLongList', 0, async (done: Function) => { - console.info('uitest: testArcLongList begin'); + it('testScrollableTabBar', 0, async (done: Function) => { + console.info('uitest: testScrollableTabBar begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ArcLongList_title')); + let str = await getResourceString($r('app.string.ScrollableTabBar_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let arclist = await driver.findComponent(ON.type('ArcList')); - expect(arclist === null).assertFalse(); - await arclist.scrollToBottom(15000); + let tabs = await driver.findComponent(ON.type('Tabs')); + expect(tabs === null).assertFalse(); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 12); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testArcLongList end'); + console.info('uitest: testScrollableTabBar end'); done(); }) /** - * @tc.number UiTest_036 - * @tc.name testArcListAcrScrollBar - * @tc.desc 测试弧形列表外置滚动条示例 + * @tc.number UiTest_022 + * @tc.name testCustomTabBar + * @tc.desc 测试自定义导航栏示例 */ - it('ArcListAcrScrollBar', 0, async (done: Function) => { - console.info('uitest: testArcListAcrScrollBar begin'); + it('testCustomTabBar', 0, async (done: Function) => { + console.info('uitest: testCustomTabBar begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ArcListAcrScrollBar_title')); + let str = await getResourceString($r('app.string.CustomTabBar_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let arclist = await driver.findComponent(ON.type('ArcList')); - expect(arclist === null).assertFalse(); - await arclist.scrollToBottom(); + let tabs = await driver.findComponent(ON.type('Tabs')); + expect(tabs === null).assertFalse(); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 4); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testArcListAcrScrollBar end'); + console.info('uitest: testCustomTabBar end'); done(); }) /** - * @tc.number UiTest_037 - * @tc.name testArcListBuiltInScrollerBar - * @tc.desc 测试弧形列表内置滚动条示例 + * @tc.number UiTest_023 + * @tc.name testArcSwiperAction + * @tc.desc 测试弧形轮播动画示例 */ - it('arcListBuiltInScrollerBar', 0, async (done: Function) => { - console.info('uitest: testArcListBuiltInScrollerBar begin'); + it('ArcSwiperAction', 0, async (done: Function) => { + console.info('uitest: testSwiperCustomAnimation begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.arcListBuiltInScrollerBar_title')); + let str = await getResourceString($r('app.string.ArcSwiperAction_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let arclist = await driver.findComponent(ON.type('ArcList')); - expect(arclist === null).assertFalse(); - await arclist.scrollToBottom(); + let swiper = await driver.findComponent(ON.type('Swiper')); + expect(swiper === null).assertFalse(); + let scrollPoint: Point = { x: 300, y: 300 }; + await driver.mouseScroll(scrollPoint, true, 2); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testArcListBuiltInScrollerBar end'); + console.info('uitest: testArcSwiperAction end'); done(); }) /** - * @tc.number UiTest_038 - * @tc.name testArcListContents - * @tc.desc 测试弧形列表内置滚动条示例 + * @tc.number UiTest_024 + * @tc.name testArcSwiperVertical + * @tc.desc 测试弧形轮播垂直方向示例 */ - it('ArcListContents', 0, async (done: Function) => { - console.info('uitest: testArcListContents begin'); + it('ArcSwiperVertical ', 0, async (done: Function) => { + console.info('uitest: testArcSwiperVertical begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ArcListContents_title')); + let str = await getResourceString($r('app.string.ArcSwiperVertical_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let arclist = await driver.findComponent(ON.type('ArcList')); - expect(arclist === null).assertFalse(); - await arclist.scrollToBottom(); + let swiper = await driver.findComponent(ON.type('Swiper')); + expect(swiper === null).assertFalse(); + let scrollPoint: Point = { x: 300, y: 300 }; + await driver.mouseScroll(scrollPoint, true, 2); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testArcListContents end'); + console.info('uitest: testArcSwiperVertical end'); done(); }) /** - * @tc.number UiTest_039 - * @tc.name testArcListShow - * @tc.desc 测试弧形列表展示数据示例 + * @tc.number UiTest_025 + * @tc.name testArcSwiperHorizontal + * @tc.desc 测试弧形轮播水平方向示例 */ - it('ArcListShow', 0, async (done: Function) => { - console.info('uitest: testArcListShow begin'); + it('ArcSwiperHorizontal', 0, async (done: Function) => { + console.info('uitest: testArcSwiperHorizontal begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ArcListShow_title')); + let str = await getResourceString($r('app.string.ArcSwiperHorizontal_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let arclist = await driver.findComponent(ON.type('ArcList')); - expect(arclist === null).assertFalse(); - await arclist.scrollToBottom(); + let swiper = await driver.findComponent(ON.type('Swiper')); + expect(swiper === null).assertFalse(); + let scrollPoint: Point = { x: 300, y: 300 }; + await driver.mouseScroll(scrollPoint, true, 2); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testArcListShow end'); + console.info('uitest: testArcSwiperHorizontal end'); done(); }) /** - * @tc.number UiTest_040 - * @tc.name testArcListStyles - * @tc.desc 测试弧形列表设置样式示例 + * @tc.number UiTest_026 + * @tc.name testArcSwiperSideSlip + * @tc.desc 测试弧形轮播侧滑返回示例 */ - it('ArcListStyles', 0, async (done: Function) => { - console.info('uitest: testArcListStyles begin'); + it('ArcSwiperSideSlip', 0, async (done: Function) => { + console.info('uitest: testArcSwiperSideSlip begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ArcListStyles_title')); + let str = await getResourceString($r('app.string.ArcSwiperSideSlip_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let arclist = await driver.findComponent(ON.type('List')); - expect(arclist === null).assertFalse(); - await arclist.scrollToBottom(); + let swiper = await driver.findComponent(ON.type('Swiper')); + expect(swiper === null).assertFalse(); + let scrollPoint: Point = { x: 300, y: 300 }; + await driver.mouseScroll(scrollPoint, true, 2); + await driver.mouseScroll(scrollPoint, false, 2); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testArcListStyles end'); + console.info('uitest: testArcSwiperSideSlip end'); done(); }) /** - * @tc.number UiTest_041 - * @tc.name testArcListArcIndexerBar - * @tc.desc 测试弧形列表联动indexer示例 + * @tc.number UiTest_027 + * @tc.name testArcSwiperToggle + * @tc.desc 测试弧形轮播页面切换方式示例 */ - it('ArcListArcIndexerBar', 0, async (done: Function) => { - console.info('uitest: testArcListArcIndexerBar begin'); + it('ArcSwiperToggle', 0, async (done: Function) => { + console.info('uitest: testArcSwiperToggle begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ArcListArcIndexerBar_title')); + let str = await getResourceString($r('app.string.ArcSwiperToggle_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let button = await driver.findComponent(ON.type('Button')); - expect(button === null).assertFalse(); - await button.click(); - let testText = await driver.findComponent(ON.text('F', MatchPattern.CONTAINS)); - expect(testText === null).assertFalse(); - let arclist = await driver.findComponent(ON.type('ArcList')); - expect(arclist === null).assertFalse(); - await arclist.scrollToBottom(5000); + let preArcButton = await driver.findComponent(ON.text('previous', MatchPattern.CONTAINS)); + let nextArcButton = await driver.findComponent(ON.text('next', MatchPattern.CONTAINS)); + expect(preArcButton === null).assertFalse(); + expect(nextArcButton === null).assertFalse(); + await nextArcButton.click(); + await preArcButton.click(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testArcListArcIndexerBar end'); + console.info('uitest: testArcSwiperToggle end'); done(); }) /** - * @tc.number UiTest_042 - * @tc.name testArcListSideSlip - * @tc.desc 测试弧形列表侧滑示例 + * @tc.number UiTest_028 + * @tc.name testArcSwiperStyles + * @tc.desc 测试弧形轮播设置导航点样式示例 */ - it('ArcListSideSlip', 0, async (done: Function) => { - console.info('uitest: testArcListSideSlip begin'); + it('ArcSwiperStyles', 0, async (done: Function) => { + console.info('uitest: testArcSwiperToggle begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('ArcList', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('ArcSwiper', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.ArcListSideSlip_title')); + let str = await getResourceString($r('app.string.ArcSwiperStyles_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let arclist = await driver.findComponent(ON.type('ArcList')); - expect(arclist === null).assertFalse(); - let scrollPoint:Point = {x:200,y:500}; - let scrollPoint2:Point = {x:500,y:500}; + let swiper = await driver.findComponent(ON.type('Swiper')); + expect(swiper === null).assertFalse(); + let scrollPoint: Point = { x: 300, y: 300 }; + let scrollPoint2: Point = { x: 300, y: 600 }; + await driver.mouseScroll(scrollPoint, true, 2); + await driver.mouseScroll(scrollPoint2, true, 2); + await driver.pressBack(); + await driver.pressBack(); + console.info('uitest: testArcSwiperStyles end'); + done(); + }) - await driver.fling(scrollPoint2,scrollPoint,1,600); - let button = await driver.findComponent(ON.type('Button')); - expect(button === null).assertFalse(); - await button.click(); - let testText = await driver.findComponent(ON.text('Alice', MatchPattern.CONTAINS)); - expect(testText === null).assertTrue(); - await arclist.scrollToBottom(5000); + /** + * @tc.number UiTest_029 + * @tc.name testSwiperAndTabsLinkage + * @tc.desc 测试轮播与选项卡联动示例 + */ + it('SwiperAndTabsLinkage', 0, async (done: Function) => { + console.info('uitest: testSwiperAndTabsLinkage begin'); + let driver = Driver.create(); + let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); + expect(componentButton === null).assertFalse(); + await componentButton.click(); + let str = await getResourceString($r('app.string.SwiperAndTabsLinkage_title')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + + let swiper = await driver.findComponent(ON.type('Swiper')); + expect(swiper === null).assertFalse(); + let scrollPoint: Point = { x: 400, y: 500 }; + await driver.mouseScroll(scrollPoint, true, 2); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testArcListSideSlip end'); + console.info('uitest: testSwiperAndTabsLinkage end'); done(); }) /** - * @tc.number UiTest_043 - * @tc.name testWaterFlowDynamicSwitchover - * @tc.desc 测试瀑布流动态切换列数示例 + * @tc.number UiTest_030 + * @tc.name testLongGrid + * @tc.desc 测试网格性能优化示例 */ - it('WaterFlowDynamicSwitchover', 0, async (done: Function) => { - console.info('uitest: testWaterFlowDynamicSwitchover begin'); + it('LongGrid', 0, async (done: Function) => { + console.info('uitest: testLongGrid begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('WaterFlow', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.WaterFlowDynamicSwitchover_title')); + let str = await getResourceString($r('app.string.LongGrid_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let arclist = await driver.findComponent(ON.type('WaterFlow')); - expect(arclist === null).assertFalse(); - let flowItemText = await driver.findComponent(ON.text('FlowItem0', MatchPattern.CONTAINS)); - expect(flowItemText === null).assertFalse(); - let scrollPoint:Point = {x:350,y:1100}; - let scrollPoint2:Point = {x:350,y:550}; - await driver.fling(scrollPoint,scrollPoint2,1,1200); - let button = await driver.findComponent(ON.type('Button')); - expect(button === null).assertFalse(); - await button.click(); - let testText = await driver.findComponent(ON.text('N9', MatchPattern.CONTAINS)); - expect(testText === null).assertFalse(); - await driver.fling(scrollPoint,scrollPoint2,1,1200); + let scrollableGrid = await driver.findComponent(ON.type('Grid')); + expect(scrollableGrid === null).assertFalse(); + await scrollableGrid.scrollToBottom(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testWaterFlowDynamicSwitchover end'); + console.info('uitest: testLongGrid end'); done(); }) /** - * @tc.number UiTest_044 - * @tc.name testWaterFlowGroupingMixing - * @tc.desc 测试瀑布流混合布局示例 + * @tc.number UiTest_031 + * @tc.name testGridScrollbar + * @tc.desc 测试网格添加外置滚动条示例 */ - it('WaterFlowGroupingMixing', 0, async (done: Function) => { - console.info('uitest: testWaterFlowGroupingMixing begin'); + it('GridScrollbar', 0, async (done: Function) => { + console.info('uitest: testGridScrollbar begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('WaterFlow', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.WaterFlowGroupingMixing_title')); + let str = await getResourceString($r('app.string.GridScrollbar_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let arclist = await driver.findComponent(ON.type('WaterFlow')); - expect(arclist === null).assertFalse(); - let scrollPoint:Point = {x:350,y:1100}; - let scrollPoint2:Point = {x:350,y:550}; - await driver.fling(scrollPoint,scrollPoint2,1,1200); + let scrollableGrid = await driver.findComponent(ON.type('Grid')); + expect(scrollableGrid === null).assertFalse(); + await scrollableGrid.scrollToBottom(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testWaterFlowGroupingMixing end'); + console.info('uitest: testGridScrollbar end'); done(); }) /** - * @tc.number UiTest_045 - * @tc.name testWaterFlowInfiniteScrolling - * @tc.desc 测试瀑布流无限滑动触底增加示例 + * @tc.number UiTest_032 + * @tc.name testGridSideToSide + * @tc.desc 测试网格控制滚动位置示例 */ - it('WaterFlowInfiniteScrolling', 0, async (done: Function) => { - console.info('uitest: testWaterFlowInfiniteScrolling begin'); + it('GridSideToSide', 0, async (done: Function) => { + console.info('uitest: testGridSideToSide begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('WaterFlow', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('Grid', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.WaterFlowInfiniteScrolling_title')); + let str = await getResourceString($r('app.string.GridSideToSide_description')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let arclist = await driver.findComponent(ON.type('WaterFlow')); - expect(arclist === null).assertFalse(); - let scrollPoint:Point = {x:350,y:1100}; - let scrollPoint2:Point = {x:350,y:550}; - await driver.fling(scrollPoint,scrollPoint2,1,1200); + let preArcButton = await driver.findComponent(ON.text('上一页', MatchPattern.CONTAINS)); + let nextArcButton = await driver.findComponent(ON.text('下一页', MatchPattern.CONTAINS)); + expect(preArcButton === null).assertFalse(); + expect(nextArcButton === null).assertFalse(); + await nextArcButton.click(); + await preArcButton.click(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testWaterFlowInfiniteScrolling end'); + console.info('uitest: testGridSideToSide end'); done(); }) /** - * @tc.number UiTest_046 - * @tc.name testWaterFlowInfiniteScrollingEarly - * @tc.desc 测试瀑布流无限滑动提前增加示例 + * @tc.number UiTest_033 + * @tc.name testLongList + * @tc.desc 测试长列表示例 */ - it('WaterFlowInfiniteScrollingEarly', 0, async (done: Function) => { - console.info('uitest: testWaterFlowInfiniteScrollingEarly begin'); + it('LongList', 0, async (done: Function) => { + console.info('uitest: testLongList begin'); let driver = Driver.create(); - let componentButton = await driver.findComponent(ON.text('WaterFlow', MatchPattern.CONTAINS)); + let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); expect(componentButton === null).assertFalse(); await componentButton.click(); - let str = await getResourceString($r('app.string.WaterFlowInfiniteScrollingEarly_title')); + let list = await driver.findComponent(ON.type('List')); + expect(list === null).assertFalse(); + await list.scrollToBottom(1000); + let str = await getResourceString($r('app.string.LongList_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let arclist = await driver.findComponent(ON.type('WaterFlow')); - expect(arclist === null).assertFalse(); - let scrollPoint:Point = {x:350,y:1100}; - let scrollPoint2:Point = {x:350,y:550}; - await driver.fling(scrollPoint,scrollPoint2,1,1200); + let scrollableList = await driver.findComponent(ON.type('List')); + expect(scrollableList === null).assertFalse(); + await scrollableList.scrollToBottom(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testWaterFlowInfiniteScrollingEarly end'); + console.info('uitest: testLongList end'); + done(); + }) + + /** + * @tc.number UiTest_033 + * @tc.name testCollapseAndExpand + * @tc.desc 测试列表折叠与展开示例 + */ + it('CollapseAndExpand', 0, async (done: Function) => { + console.info('uitest: testCollapseAndExpand begin'); + let driver = Driver.create(); + let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); + expect(componentButton === null).assertFalse(); + await componentButton.click(); + let list = await driver.findComponent(ON.type('List')); + expect(list === null).assertFalse(); + await list.scrollToBottom(1000); + let str = await getResourceString($r('app.string.CollapseAndExpand_title')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + + let text = await driver.findComponent(ON.text('个人基本资料', MatchPattern.CONTAINS)); + expect(text === null).assertFalse(); + await text.click(); + let nameText = await driver.findComponent(ON.text('昵称', MatchPattern.CONTAINS)); + expect(nameText === null).assertFalse(); + await text.click(); + nameText = await driver.findComponent(ON.text('昵称', MatchPattern.CONTAINS)); + expect(nameText === null).assertTrue(); + await driver.pressBack(); + await driver.pressBack(); + console.info('uitest: testCollapseAndExpand end'); done(); }) @@ -1311,7 +1375,7 @@ export default function IndexTest() { let testButton = await driver.findComponent(ON.text('发送', MatchPattern.CONTAINS)); expect(testButton === null).assertFalse(); await testButton.click(); - await driver.mouseClick({x: 670, y: 700}, MouseButton.MOUSE_BUTTON_LEFT, 0, 0); + await driver.mouseClick({ x: 670, y: 700 }, MouseButton.MOUSE_BUTTON_LEFT, 0, 0); let nameText = await driver.findComponent(ON.text('message test', MatchPattern.CONTAINS)); expect(nameText === null).assertFalse(); await driver.pressBack(); @@ -1320,5 +1384,206 @@ export default function IndexTest() { done(); }) + /** + * @tc.number UiTest_047 + * @tc.name testSwiperIgnoreComponentSize + * @tc.desc 测试设置圆点导航点间距和忽略导航点组件大小 + */ + it('SwiperIgnoreComponentSize', 0, async (done: Function) => { + hilog.info(DOMAIN, 'testTag', 'uitest: testSwiperIgnoreComponentSize begin'); + let driver = Driver.create(); + let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); + expect(componentButton === null).assertFalse(); + await componentButton.click(); + let str = await getResourceString($r('app.string.SwiperIgnoreComponentSize_title')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + + let spaceIndexButton = await driver.findComponent(ON.text('spaceIndex:', MatchPattern.CONTAINS)); + expect(spaceIndexButton === null).assertFalse(); + await spaceIndexButton.click(); + await spaceIndexButton.click(); + await spaceIndexButton.click(); + + let ignoreSizeIndexButton = await driver.findComponent(ON.text('ignoreSizeIndex:', MatchPattern.CONTAINS)); + expect(ignoreSizeIndexButton === null).assertFalse(); + await ignoreSizeIndexButton.click(); + await ignoreSizeIndexButton.click(); + + let swiper = await driver.findComponent(ON.type('Swiper')); + expect(swiper === null).assertFalse(); + let scrollPoint:Point = {x:400,y:500}; + await driver.mouseScroll(scrollPoint,true,2); + await driver.pressBack(); + await driver.pressBack(); + hilog.info(DOMAIN, 'testTag', 'uitest: testSwiperIgnoreComponentSize end'); + done(); + }) + + /** + * @tc.number UiTest_048 + * @tc.name testSwiperDigitIndicatorIgnoreComponentSize + * @tc.desc 测试设置数字导航点忽略导航点组件大小 + */ + it('SwiperDigitIndicatorIgnoreComponentSize', 0, async (done: Function) => { + hilog.info(DOMAIN, 'testTag', 'uitest: testSwiperDigitIndicatorIgnoreComponentSize begin'); + let driver = Driver.create(); + let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); + expect(componentButton === null).assertFalse(); + await componentButton.click(); + + let listComponent: Component = await driver.waitForComponent(ON.id('list_'), 1000); + let listCenter = await listComponent.getBoundsCenter(); + await driver.swipe(listCenter.x, listCenter.y + 400, listCenter.x, listCenter.y - 400, 3000); + await driver.waitForIdle(500, 500); + + let str = await getResourceString($r('app.string.SwiperDigitIndicatorIgnoreComponentSize_title')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + + let swiper = await driver.findComponent(ON.type('Swiper')); + expect(swiper === null).assertFalse(); + let scrollPoint:Point = {x:400,y:500}; + await driver.mouseScroll(scrollPoint,true,2); + await driver.pressBack(); + await driver.pressBack(); + hilog.info(DOMAIN, 'testTag', 'uitest: testSwiperDigitIndicatorIgnoreComponentSize end'); + done(); + }) + + /** + * @tc.number UiTest_049 + * @tc.name testSwiperPageSwitchMethod + * @tc.desc 测试页面的切换方式。 + */ + it('SwiperPageSwitchMethod', 0, async (done: Function) => { + hilog.info(DOMAIN, 'testTag', 'uitest: testSwiperPageSwitchMethod begin'); + let driver = Driver.create(); + let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); + expect(componentButton === null).assertFalse(); + await componentButton.click(); + let str = await getResourceString($r('app.string.SwiperPageSwitchMethod_title')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + + let showNextButton = await driver.findComponent(ON.text('showNext', MatchPattern.CONTAINS)); + expect(showNextButton === null).assertFalse(); + await showNextButton.click(); + + let showPreviousButton = await driver.findComponent(ON.text('showPrevious', MatchPattern.CONTAINS)); + expect(showPreviousButton === null).assertFalse(); + await showPreviousButton.click(); + await showPreviousButton.click(); + + let undefinedButton = await driver.findComponent(ON.text('undefined', MatchPattern.CONTAINS)); + expect(undefinedButton === null).assertFalse(); + await undefinedButton.click(); + + let changeButton = await driver.findComponent(ON.text('changeIndex(', MatchPattern.CONTAINS)); + expect(changeButton === null).assertFalse(); + await changeButton.click(); + + let swiper = await driver.findComponent(ON.type('Swiper')); + expect(swiper === null).assertFalse(); + let scrollPoint:Point = {x:400,y:500}; + await driver.mouseScroll(scrollPoint,true,2); + await driver.pressBack(); + await driver.pressBack(); + hilog.info(DOMAIN, 'testTag', 'uitest: testSwiperPageSwitchMethod end'); + done(); + }) + + /** + * @tc.number UiTest_050 + * @tc.name testSwiperVisibleContentPosition + * @tc.desc 测试保存可见位置不变。 + */ + it('SwiperVisibleContentPosition', 0, async (done: Function) => { + hilog.info(DOMAIN, 'testTag', 'uitest: testSwiperVisibleContentPosition begin'); + let driver = Driver.create(); + let componentButton = await driver.findComponent(ON.text('Swiper', MatchPattern.CONTAINS)); + expect(componentButton === null).assertFalse(); + await componentButton.click(); + + let listComponent: Component = await driver.waitForComponent(ON.id('list_'), 1000); + let listCenter = await listComponent.getBoundsCenter(); + await driver.swipe(listCenter.x, listCenter.y + 400, listCenter.x, listCenter.y - 400, 3000); + await driver.waitForIdle(500, 500); + + let str = await getResourceString($r('app.string.SwiperVisibleContentPosition_title')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + + let addButton = await driver.findComponent(ON.text('header data add', MatchPattern.CONTAINS)); + expect(addButton === null).assertFalse(); + await addButton.click(); + + let deleteButton = await driver.findComponent(ON.text('header data delete', MatchPattern.CONTAINS)); + expect(deleteButton === null).assertFalse(); + await deleteButton.click(); + + let swiper = await driver.findComponent(ON.type('Swiper')); + expect(swiper === null).assertFalse(); + let scrollPoint:Point = {x:400,y:500}; + await driver.mouseScroll(scrollPoint,true,2); + await driver.pressBack(); + await driver.pressBack(); + hilog.info(DOMAIN, 'testTag', 'uitest: testSwiperVisibleContentPosition end'); + done(); + }) + + /** + * @tc.number UiTest_51 + * @tc.name testBottomTabBar + * @tc.desc 内容标签不同步 + */ + it('testBottomTabBar', 0, async (done: Function) => { + let driver = Driver.create(); + let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); + expect(componentButton === null).assertFalse(); + await componentButton.click(); + let str = await getResourceString($r('app.string.ContentWillChange_titleContentOnAndTabSync')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + + let tabs = await driver.findComponent(ON.type('Tabs')); + expect(tabs === null).assertFalse(); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 2); + await driver.pressBack(); + await driver.pressBack(); + done(); + }) + + /** + * @tc.number UiTest_51 + * @tc.name testBottomTabBar + * @tc.desc 缓存数 + */ + it('testBottomTabBar', 0, async (done: Function) => { + let driver = Driver.create(); + let componentButton = await driver.findComponent(ON.text('Tabs', MatchPattern.CONTAINS)); + expect(componentButton === null).assertFalse(); + await componentButton.click(); + let str = await getResourceString($r('app.string.Cache_count')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + + let tabs = await driver.findComponent(ON.type('Tabs')); + expect(tabs === null).assertFalse(); + let scrollPoint: Point = { x: 400, y: 400 }; + await driver.mouseScroll(scrollPoint, true, 2); + await driver.pressBack(); + await driver.pressBack(); + done(); + }) + + }) } \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/indexAdd.test.ets b/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/indexAdd.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..bc67e3e88de4d863e940343fc4cfc57c2b55f54e --- /dev/null +++ b/ArkUIKit/ScrollableComponent/entry/src/ohosTest/ets/test/indexAdd.test.ets @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2025 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 { describe, it, expect, beforeAll, Level } from '@ohos/hypium'; +// 导入测试依赖kit +import { abilityDelegatorRegistry, Driver, ON, MouseButton,MatchPattern, UiDirection } from '@kit.TestKit'; +import { UIAbility, Want } from '@kit.AbilityKit'; +import { Point } from '@ohos.UiTest'; + + +const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); +const bundleName = abilityDelegatorRegistry.getArguments().bundleName; +let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); +let want: Want; + +async function getResourceString(resource: Resource): Promise { + let manage = abilityDelegator.getAppContext().resourceManager; + let textString: string = await manage.getStringValue(resource); + return textString; +} + +export default function IndexTest() { + describe('IndexTestAdd', () => { + beforeAll(async () => { + want = { + bundleName: bundleName, + abilityName: 'EntryAbility' + }; + await delegator.startAbility(want); + let driver = Driver.create(); + await driver.delayMs(1000); + const ability: UIAbility = await delegator.getCurrentTopAbility(); + expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); + }) + /**要 + * @tc.number UiTest_001 + * @tc.name SlidingHandEvent + * @tc.desc 支持滑动离手事件 + */ + it('SlidingHandEvent', Level.LEVEL1, async (done: Function) => { + let driver = Driver.create(); + let componentButton = await driver.findComponent(ON.text('List', MatchPattern.CONTAINS)); + expect(componentButton === null).assertFalse(); + await componentButton.click(); + let list = await driver.findComponent(ON.type('List')); + expect(list === null).assertFalse(); + await list.scrollToBottom(1000); + let str = await getResourceString($r('app.string.Sliding_Hand_Event')); + let openModel = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + await openModel.click() + await driver.delayMs(1000) + await driver.pressBack(); + await driver.pressBack(); + done(); + }) + }) +} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/entry/src/ohosTest/syscap.json b/ArkUIKit/ScrollableComponent/entry/src/ohosTest/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..f6d8139cd95cc7832f9bb6c50cff85200da2fcfb --- /dev/null +++ b/ArkUIKit/ScrollableComponent/entry/src/ohosTest/syscap.json @@ -0,0 +1,18 @@ +{ + "devices": { + "general": [ + "default", + "tablet" + ], + "custom": [ + { + "xts": [ + "SystemCapability.ArkUI.ArkUI.Full", + "SystemCapability.ArkUI.ArkUI.Circle", + "SystemCapability.Security.DeviceSecurityLevel", + "SystemCapability.UserIAM.UserAuth.PinAuth" + ] + } + ] + } +} \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/ohosTest.md b/ArkUIKit/ScrollableComponent/ohosTest.md new file mode 100644 index 0000000000000000000000000000000000000000..a63c23f43244fd90f12785ba592f0c91f9e8e63b --- /dev/null +++ b/ArkUIKit/ScrollableComponent/ohosTest.md @@ -0,0 +1,26 @@ +# Navigation 测试用例归档 + +## 用例表 + +| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | +|-----------------------| -------------- |-------------------------------------------|-----------------------| :------- | -------- | +| 测试弧形列表联动indexer示例 | 设备正常运行 | 进入各个示例页面,push页面,下拉到页面底部,然后返回 | 页面跳转,滑动页面正常 | 是 | Pass | +| 测试弧形长列表示例 | 设备正常运行 | 进入各个示例页面,push页面,下拉到页面底部,然后返回 | 页面跳转,滑动页面正常 | 是 | Pass | +| 测试弧形列表外置滚动条示例 | 设备正常运行 | 进入各个示例页面,push页面,下拉到页面底部,然后返回 | 页面跳转,滑动页面正常 | 是 | Pass | +| 测试弧形列表内置滚动条示例 | 设备正常运行 | 进入各个示例页面,push页面,下拉到页面底部,然后返回 | 页面跳转,滑动页面正常 | 是 | Pass | +| 测试弧形列表迭代弧形列表内容示例 | 设备正常运行 | 进入各个示例页面,push页面,下拉到页面底部,然后返回 | 页面跳转,滑动页面正常 | 是 | Pass | +| 测试弧形列表展示数据示例 | 设备正常运行 | 进入各个示例页面,push页面,下拉到页面底部,然后返回 | 页面跳转,滑动页面正常 | 是 | Pass | +| 测试弧形列表设置样式示例 | 设备正常运行 | 进入各个示例页面,push页面,下拉到页面底部,然后返回 | 页面跳转,滑动页面正常 | 是 | Pass | +| 测试弧形列表侧滑示例 | 设备正常运行 | 进入各个示例页面,push页面,下拉到页面底部,然后返回 | 页面跳转,滑动页面正常 | 是 | Pass | +| 测试弧形列表响应旋转表冠示例 | 设备正常运行 | 进入各个示例页面,push页面,下拉到页面底部,然后返回 | 页面跳转,滑动页面正常 | 是 | Pass | +| 测试弧形列表创建弧形列表示例 | 设备正常运行 | 进入各个示例页面,push页面,下拉到页面底部,然后返回 | 页面跳转,滑动页面正常 | 是 | Pass | +| 测试瀑布流动态切换列数示例 | 设备正常运行 | 进入各个示例页面,push页面,点击切换列数按钮,下拉到页面底部,然后返回 | 页面跳转,滑动页面正常 | 是 | Pass | +| 测试瀑布流混合布局示例 | 设备正常运行 | 进入各个示例页面,push页面,下拉到页面底部,然后返回 | 页面跳转,滑动页面正常 | 是 | Pass | +| 测试瀑布流无限滑动触底增加示例 | 设备正常运行 | 进入各个示例页面,push页面,下拉页面,然后返回 | 页面跳转,滑动页面正常 | 是 | Pass | +| 测试瀑布流无限滑动提前增加示例 | 设备正常运行 | 进入各个示例页面,push页面,下拉页面,然后返回 | 页面跳转,滑动页面正常 | 是 | Pass | +| 测试设置圆点导航点间距和忽略导航点组件大小 | 设备正常运行 | 进入swiper页面,再进入 设置圆点导航点间距,点击按钮设置不同的间距,然后返回 | 页面上swiper组件的导航点间距发生变化 | 是 | Pass | +| 测试设置数字导航点忽略导航点组件大小 | 设备正常运行 | 进入swiper页面,再进入 设置数字导航点忽略导航点组件大小,然后返回 | 页面上swiper组件的数字导航显示正常 | 是 | Pass | +| 测试页面的切换方式 | 设备正常运行 | 进入swiper页面,再进入 页面切换方式,点击不同的按钮,然后返回 | 页面上swiper组件的页面切换正常 | 是 | Pass | +| 测试保存可见位置不变 | 设备正常运行 | 进入swiper页面,再进入 保持可见位置不变 点击添加和删除页面的按钮,然后返回 | 页面上swiper组件的页面显示不变,正常 | 是 | Pass | +| 测试打开缓存数页面 | 设备正常运行 | 进入示例页面,点击各个tab,然后返回 | 页面上tab标签切换正常 | 是 | Pass | +| 测试打开标签与内容不联动页面 | 设备正常运行 | 进入示例页面,点击各个tab,然后返回 | 页面上tab标签切换正常 | 是 | Pass | \ No newline at end of file diff --git a/ArkUIKit/ScrollableComponent/screenshots/device/image4.jpeg b/ArkUIKit/ScrollableComponent/screenshots/device/image4.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..dcbf54041e1e36458bc42990c428724fdbc77d02 Binary files /dev/null and b/ArkUIKit/ScrollableComponent/screenshots/device/image4.jpeg differ diff --git a/ArkUIKit/ScrollableComponent/screenshots/device/image5.jpeg b/ArkUIKit/ScrollableComponent/screenshots/device/image5.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..6ff28be287aeed036425811bb627b49a09d3ed22 Binary files /dev/null and b/ArkUIKit/ScrollableComponent/screenshots/device/image5.jpeg differ diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/.gitignore b/ArkUIKit/StateMgmtV2MVVM/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..c7f0089d9094a93c6ee907340b8c6ad2ecf9b287 --- /dev/null +++ b/ArkUIKit/StateMgmtV2MVVM/entry/.gitignore @@ -0,0 +1,7 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test +/obfuscation-rules.txt \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/model/TaskListModel.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/model/TaskListModel.ets index 9167605416e7308fb01ad9048d8632ea999b1075..bbd988ba9c7b7556c6dc86da6b62371c82b3d206 100644 --- a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/model/TaskListModel.ets +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/model/TaskListModel.ets @@ -15,7 +15,7 @@ */ // src/main/ets/model/TaskListModel.ets - +// [Start Model_TaskListModel] import { common } from '@kit.AbilityKit'; import util from '@ohos.util'; import TaskModel from'./TaskModel'; @@ -39,4 +39,5 @@ export default class TaskListModel { return newTask; }); } -} \ No newline at end of file +} +// [End Model_TaskListModel] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/model/TaskModel.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/model/TaskModel.ets index 4fda48d268eed03fa5f89784626fb046e134073f..71f9435e5f83c3020a149610db0832479715f086 100644 --- a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/model/TaskModel.ets +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/model/TaskModel.ets @@ -15,8 +15,9 @@ */ // src/main/ets/model/TaskModel.ets - +// [Start Model_TaskModel] export default class TaskModel { public taskName: string = 'Todo'; public isFinish: boolean = false; -} \ No newline at end of file +} +// [End Model_TaskModel] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/AppStorageV2Page.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/AppStorageV2Page.ets new file mode 100644 index 0000000000000000000000000000000000000000..bc219ca3f6f15cd9e8e13576d8bd9ce68d345043 --- /dev/null +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/AppStorageV2Page.ets @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2025 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. + * +*/ + +// src/main/ets/pages/8-AppStorageV2.ets +// [Start Main_AppStorageV2] +import { AppStorageV2 } from '@kit.ArkUI'; +import { common, Want } from '@kit.AbilityKit'; +import { Setting } from './SettingPage'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +@ObservedV2 +class Task { + public taskName: string = ''; + @Trace public isFinish: boolean = false; + + constructor (taskName: string, isFinish: boolean) { + this.taskName = taskName; + this.isFinish = isFinish; + } +} + +@ComponentV2 +struct TaskItem { + @Param task: Task = new Task('', false); + @Event deleteTask: () => void = () => {}; + @Monitor('task.isFinish') + onTaskFinished(mon: IMonitor) { + hilog.debug(0x0000, 'testTag', '%{public}s', '任务' + this.task.taskName + '的完成状态从' + mon.value()?.before + '变为了' + mon.value()?.now); + } + + build() { + Row() { + Image(this.task.isFinish ? $r('app.media.finished') : $r('app.media.unfinished')) + .width(28) + .height(28) + Text(this.task.taskName) + .decoration({ type: this.task.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None }) + Button($r('app.string.Delete_task')) + .onClick(() => this.deleteTask()) + } + .onClick(() => this.task.isFinish = !this.task.isFinish) + } +} + +@Entry +@ComponentV2 +struct TodoList { + @Local tasks: Task[] = [ + new Task('task1', false), + new Task('task2', false), + new Task('task3', false), + ]; + @Local newTaskName: string = ''; + @Local setting: Setting = AppStorageV2.connect(Setting, 'Setting', () => new Setting())!; + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + + finishAll(ifFinish: boolean) { + for (let task of this.tasks) { + task.isFinish = ifFinish; + } + } + + @Computed + get tasksUnfinished(): number { + return this.tasks.filter(task => !task.isFinish).length; + } + + build() { + Column() { + Text($r('app.string.TodoList_title')) + .fontSize(40) + .margin({ bottom: 10 }) + Text(`${this.context.resourceManager.getStringSync($r('app.string.Unfinish_count').id)}:${this.tasksUnfinished}`) + Repeat(this.tasks.filter(task => this.setting.showCompletedTask || !task.isFinish)) + .each((obj: RepeatItem) => { + TaskItem({ + task: obj.item, + deleteTask: () => this.tasks.splice(this.tasks.indexOf(obj.item), 1) + }) + }) + Row() { + Button($r('app.string.Finish_all_tasks')) + .onClick(() => this.finishAll(true)) + Button($r('app.string.Unfinish_all_tasks')) + .onClick(() => this.finishAll(false)) + Button($r('app.string.Setting')) + .onClick(() => { + let wantInfo: Want = { + deviceId: '', // deviceId为空表示本设备 + bundleName: 'com.samples.statemgmtv2mvvm', // 替换成AppScope/app.json5里的bundleName + abilityName: 'SettingAbility', + }; + this.context.startAbility(wantInfo); + }) + } + Row() { + TextInput({ placeholder: $r('app.string.Add_new_task'), text: this.newTaskName }) + .onChange((value) => this.newTaskName = value) + .width('70%') + Button('+') + .onClick(() => { + this.tasks.push(new Task(this.newTaskName, false)); + this.newTaskName = ''; + }) + } + } + } +} +// [End Main_AppStorageV2] \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/oh-package.json5 b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/BasicPage.ets similarity index 60% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/oh-package.json5 rename to ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/BasicPage.ets index 0ef4eeed251a93463c2abf85b262c3e1fb6733bc..49dca48b25ff4d24822ee4bee171413f6a92a7aa 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/oh-package.json5 +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/BasicPage.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -11,18 +11,23 @@ * 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. - */ + * +*/ -{ - name: '@ohos/hamock', - version: '1.0.0', - description: 'A mock framework for OpenHarmony application.', - main: 'index.ets', - author: 'huawei', - license: 'Apache-2.0', - dependencies: {}, - ohos: { - org: 'ohos', - }, - types: 'index.d.ts' +// src/main/ets/pages/1-Basic.ets +// [Start Main_Basic] +@Entry +@ComponentV2 +struct TodoList { + build() { + Column() { + Text($r('app.string.TodoList_title')) + .fontSize(40) + .margin({ bottom: 10 }) + Text('task1') + Text('task2') + Text('task3') + } + } } +// [End Main_Basic] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/BuilderPage.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/BuilderPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..64edf68a99ff775d72a63e6dc0c0b379bc219a7e --- /dev/null +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/BuilderPage.ets @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2025 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. + * +*/ + +// src/main/ets/pages/10-Builder.ets +// [Start Main_Builder] +import { AppStorageV2, PersistenceV2, Type } from '@kit.ArkUI'; +import { common, Want } from '@kit.AbilityKit'; +import { Setting } from './SettingPage'; +import util from '@ohos.util'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +@ObservedV2 +class Task { + // 未实现构造函数,因为@Type当前不支持带参数的构造函数 + @Trace public taskName: string = 'Todo'; + @Trace public isFinish: boolean = false; +} + +@Builder function actionButton(text: string|Resource, onClick:() => void) { + Button(text, { buttonStyle: ButtonStyleMode.NORMAL }) + .onClick(onClick) + .margin({ left: 10, right: 10, top: 5, bottom: 5 }) +} + +@ObservedV2 +class TaskList { + // 对于复杂对象需要@Type修饰,确保序列化成功 + @Type(Task) + @Trace public tasks: Task[] = []; + + constructor(tasks: Task[]) { + this.tasks = tasks; + } + + async loadTasks(context: common.UIAbilityContext) { + let getJson = await context.resourceManager.getRawFileContent('defaultTasks.json'); + let textDecoderOptions: util.TextDecoderOptions = { ignoreBOM : true }; + let textDecoder = util.TextDecoder.create('utf-8',textDecoderOptions); + let result = textDecoder.decodeToString(getJson); + this.tasks =JSON.parse(result).map((task: Task)=>{ + let newTask = new Task(); + newTask.taskName = task.taskName; + newTask.isFinish = task.isFinish; + return newTask; + }); + } +} + +@ComponentV2 +struct TaskItem { + @Param task: Task = new Task(); + @Event deleteTask: () => void = () => {}; + @Monitor('task.isFinish') + onTaskFinished(mon: IMonitor) { + hilog.debug(0x0000, 'testTag', '%{public}s', '任务' + this.task.taskName + '的完成状态从' + mon.value()?.before + '变为了' + mon.value()?.now); + } + + build() { + Row() { + Image(this.task.isFinish ? $r('app.media.finished') : $r('app.media.unfinished')) + .width(28) + .height(28) + .margin({ left : 15, right : 10 }) + Text(this.task.taskName) + .decoration({ type: this.task.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None }) + .fontSize(18) + actionButton($r('app.string.Delete_task'), () => this.deleteTask()) + } + .height('7%') + .width('90%') + .backgroundColor('#90f1f3f5') + .borderRadius(25) + .onClick(() => this.task.isFinish = !this.task.isFinish) + } +} + +@Entry +@ComponentV2 +struct TodoList { + @Local taskList: TaskList = PersistenceV2.connect(TaskList, 'TaskList', () => new TaskList([]))!; + @Local newTaskName: string = ''; + @Local setting: Setting = AppStorageV2.connect(Setting, 'Setting', () => new Setting())!; + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + + async aboutToAppear() { + this.taskList = PersistenceV2.connect(TaskList, 'TaskList', () => new TaskList([]))!; + if (this.taskList.tasks.length === 0) { + await this.taskList.loadTasks(this.context); + } + } + + finishAll(ifFinish: boolean) { + for (let task of this.taskList.tasks) { + task.isFinish = ifFinish; + } + } + + @Computed + get tasksUnfinished(): number { + return this.taskList.tasks.filter(task => !task.isFinish).length; + } + + build() { + Column() { + Text($r('app.string.TodoList_title')) + .fontSize(40) + .margin(10) + Text(`${this.context.resourceManager.getStringSync($r('app.string.Unfinish_count').id)}:${this.tasksUnfinished}`) + .margin({ left: 10, bottom: 10 }) + Repeat(this.taskList.tasks.filter(task => this.setting.showCompletedTask || !task.isFinish)) + .each((obj: RepeatItem) => { + TaskItem({ + task: obj.item, + deleteTask: () => this.taskList.tasks.splice(this.taskList.tasks.indexOf(obj.item), 1) + }).margin(5) + }) + Row() { + actionButton($r('app.string.Finish_all_tasks'), (): void => this.finishAll(true)) + actionButton($r('app.string.Unfinish_all_tasks'), (): void => this.finishAll(false)) + actionButton($r('app.string.Setting'), (): void => { + let wantInfo: Want = { + deviceId: '', // deviceId为空表示本设备 + bundleName: 'com.samples.statemgmtv2mvvm', // 替换成AppScope/app.json5里的bundleName + abilityName: 'SettingAbility', + }; + this.context.startAbility(wantInfo); + }) + } + .margin({ top: 10, bottom: 5 }) + Row() { + TextInput({ placeholder: $r('app.string.Add_new_task'), text: this.newTaskName }) + .onChange((value) => this.newTaskName = value) + .width('70%') + actionButton('+', (): void => { + let newTask = new Task(); + newTask.taskName = this.newTaskName; + this.taskList.tasks.push(newTask); + this.newTaskName = ''; + }) + } + } + .height('100%') + .width('100%') + .alignItems(HorizontalAlign.Start) + .margin({ left: 15 }) + } +} +// [End Main_Builder] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/EventPage.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/EventPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..393a639270c30f4aa8a4f9850a6622d6dd722b6f --- /dev/null +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/EventPage.ets @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2025 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. + * +*/ + +// src/main/ets/pages/4-Event.ets +// [Start Main_Event] +@ComponentV2 +struct TaskItem { + @Param taskName: string = ''; + @Param @Once isFinish: boolean = false; + @Event deleteTask: () => void = () => {}; + + build() { + Row() { + Image(this.isFinish ? $r('app.media.finished') : $r('app.media.unfinished')) + .width(28) + .height(28) + Text(this.taskName) + .decoration({ type: this.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None }) + Button($r('app.string.Delete_task')) + .onClick(() => this.deleteTask()) + } + .onClick(() => this.isFinish = !this.isFinish) + } +} + +@Entry +@ComponentV2 +struct TodoList { + @Local tasks: string[] = ['task1','task2','task3']; + @Local newTaskName: string = ''; + build() { + Column() { + Text($r('app.string.TodoList_title')) + .fontSize(40) + .margin({ bottom: 10 }) + ForEach(this.tasks, (task: string) => { + TaskItem({ + taskName: task, + isFinish: false, + deleteTask: () => this.tasks.splice(this.tasks.indexOf(task), 1) + }) + }) + Row() { + TextInput({ placeholder: $r('app.string.Add_new_task'), text: this.newTaskName }) + .onChange((value) => this.newTaskName = value) + .width('70%') + Button('+') + .onClick(() => { + this.tasks.push(this.newTaskName); + this.newTaskName = ''; + }) + } + } + } +} +// [End Main_Event] \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertContain.js b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/LocalPage.ets similarity index 46% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertContain.js rename to ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/LocalPage.ets index 7fba0d9755503e5e926f6c1a4e425e0d1cf47570..8c804fbde99a04e2c52375e5943976125fec2cdb 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertContain.js +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/LocalPage.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -11,25 +11,30 @@ * 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. - */ + * +*/ -function assertContain(actualValue, expect) { - let result = false; - if (Object.prototype.toString.call(actualValue).indexOf('Array')) { - for (let i in actualValue) { - if (actualValue[i] == expect[0]) { - result = true; - } - } - } - let type = Object.prototype.toString.call(actualValue); - if (type === '[object String]') { - result = actualValue.indexOf(expect[0]) >= 0; +// src/main/ets/pages/2-Local.ets +// [Start Main_Local] +@Entry +@ComponentV2 +struct TodoList { + @Local isFinish: boolean = false; + + build() { + Column() { + Text($r('app.string.TodoList_title')) + .fontSize(40) + .margin({ bottom: 10 }) + Row() { + Image(this.isFinish ? $r('app.media.finished') : $r('app.media.unfinished')) + .width(28) + .height(28) + Text('task1') + .decoration({ type: this.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None }) + } + .onClick(() => this.isFinish = !this.isFinish) } - return { - pass: result, - message: 'expect false, ' + actualValue + ' do not have ' + expect[0] - }; + } } - -export default assertContain; +// [End Main_Local] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/MonitorComputedPage.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/MonitorComputedPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..38bfc9c7e2969aa4ca561ed03cc4b5bbc1060ae9 --- /dev/null +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/MonitorComputedPage.ets @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2025 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 { hilog } from '@kit.PerformanceAnalysisKit'; + +// src/main/ets/pages/7-MonitorComputed.ets +// [Start Main_MonitorComputed] +@ObservedV2 +class Task { + public taskName: string = ''; + @Trace public isFinish: boolean = false; + + constructor (taskName: string, isFinish: boolean) { + this.taskName = taskName; + this.isFinish = isFinish; + } +} + +@ComponentV2 +struct TaskItem { + @Param task: Task = new Task('', false); + @Event deleteTask: () => void = () => {}; + @Monitor('task.isFinish') + onTaskFinished(mon: IMonitor) { + hilog.debug(0x0000, 'testTag', '%{public}s', '任务' + this.task.taskName + '的完成状态从' + mon.value()?.before + '变为了' + mon.value()?.now); + } + + build() { + Row() { + Image(this.task.isFinish ? $r('app.media.finished') : $r('app.media.unfinished')) + .width(28) + .height(28) + Text(this.task.taskName) + .decoration({ type: this.task.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None }) + Button($r('app.string.Delete_task')) + .onClick(() => this.deleteTask()) + } + .onClick(() => this.task.isFinish = !this.task.isFinish) + } +} + +@Entry +@ComponentV2 +struct TodoList { + @Local tasks: Task[] = [ + new Task('task1', false), + new Task('task2', false), + new Task('task3', false), + ]; + @Local newTaskName: string = ''; + + finishAll(ifFinish: boolean) { + for (let task of this.tasks) { + task.isFinish = ifFinish; + } + } + + @Computed + get tasksUnfinished(): number { + return this.tasks.filter(task => !task.isFinish).length; + } + + build() { + Column() { + Text($r('app.string.TodoList_title')) + .fontSize(40) + .margin({ bottom: 10 }) + Text(`${this.getUIContext().getHostContext()?.resourceManager.getStringSync($r('app.string.Unfinish_count').id)}:${this.tasksUnfinished}`) + Repeat(this.tasks) + .each((obj: RepeatItem) => { + TaskItem({ + task: obj.item, + deleteTask: () => this.tasks.splice(this.tasks.indexOf(obj.item), 1) + }) + }) + Row() { + Button($r('app.string.Finish_all_tasks')) + .onClick(() => this.finishAll(true)) + Button($r('app.string.Unfinish_all_tasks')) + .onClick(() => this.finishAll(false)) + } + Row() { + TextInput({ placeholder: $r('app.string.Add_new_task'), text: this.newTaskName }) + .onChange((value) => this.newTaskName = value) + .width('70%') + Button('+') + .onClick(() => { + this.tasks.push(new Task(this.newTaskName, false)); + this.newTaskName = ''; + }) + } + } + } +} +// [End Main_MonitorComputed] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/ObservedV2TracePage.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/ObservedV2TracePage.ets new file mode 100644 index 0000000000000000000000000000000000000000..a9cb3576fdf067236188a05ab1466a7ed7c9a703 --- /dev/null +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/ObservedV2TracePage.ets @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2025 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. + * +*/ + +// src/main/ets/pages/6-ObservedV2Trace.ets +// [Start Main_ObservedV2Trace] +@ObservedV2 +class Task { + public taskName: string = ''; + @Trace public isFinish: boolean = false; + + constructor (taskName: string, isFinish: boolean) { + this.taskName = taskName; + this.isFinish = isFinish; + } +} + +@ComponentV2 +struct TaskItem { + @Param task: Task = new Task('', false); + @Event deleteTask: () => void = () => {}; + + build() { + Row() { + Image(this.task.isFinish ? $r('app.media.finished') : $r('app.media.unfinished')) + .width(28) + .height(28) + Text(this.task.taskName) + .decoration({ type: this.task.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None }) + Button($r('app.string.Delete_task')) + .onClick(() => this.deleteTask()) + } + .onClick(() => this.task.isFinish = !this.task.isFinish) + } +} + +@Entry +@ComponentV2 +struct TodoList { + @Local tasks: Task[] = [ + new Task('task1', false), + new Task('task2', false), + new Task('task3', false), + ]; + @Local newTaskName: string = ''; + + finishAll(ifFinish: boolean) { + for (let task of this.tasks) { + task.isFinish = ifFinish; + } + } + + build() { + Column() { + Text($r('app.string.TodoList_title')) + .fontSize(40) + .margin({ bottom: 10 }) + Repeat(this.tasks) + .each((obj: RepeatItem) => { + TaskItem({ + task: obj.item, + deleteTask: () => this.tasks.splice(this.tasks.indexOf(obj.item), 1) + }) + }) + Row() { + Button($r('app.string.Finish_all_tasks')) + .onClick(() => this.finishAll(true)) + Button($r('app.string.Unfinish_all_tasks')) + .onClick(() => this.finishAll(false)) + } + Row() { + TextInput({ placeholder: $r('app.string.Add_new_task'), text: this.newTaskName }) + .onChange((value) => this.newTaskName = value) + .width('70%') + Button('+') + .onClick(() => { + this.tasks.push(new Task(this.newTaskName, false)); + this.newTaskName = ''; + }) + } + } + } +} +// [End Main_ObservedV2Trace] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/ParamPage.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/ParamPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..ad34ebdd012767fa4a6401152c9b6f658515cffd --- /dev/null +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/ParamPage.ets @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2025 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. + * +*/ + +// src/main/ets/pages/3-Param.ets +// [Start Main_Param] +@ComponentV2 +struct TaskItem { + @Param taskName: string = ''; + @Param @Once isFinish: boolean = false; + + build() { + Row() { + Image(this.isFinish ? $r('app.media.finished') : $r('app.media.unfinished')) + .width(28) + .height(28) + Text(this.taskName) + .decoration({ type: this.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None }) + } + .onClick(() => this.isFinish = !this.isFinish) + } +} + +@Entry +@ComponentV2 +struct TodoList { + build() { + Column() { + Text($r('app.string.TodoList_title')) + .fontSize(40) + .margin({ bottom: 10 }) + TaskItem({ taskName: 'Task 1', isFinish: false }) + TaskItem({ taskName: 'Task 2', isFinish: false }) + TaskItem({ taskName: 'Task 3', isFinish: false }) + } + } +} +// [End Main_Param] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/PersistenceV2Page.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/PersistenceV2Page.ets new file mode 100644 index 0000000000000000000000000000000000000000..928cba6e61f3bfa3a6b95019ea12dd75b27ec957 --- /dev/null +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/PersistenceV2Page.ets @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2025 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. + * +*/ + +// src/main/ets/pages/9-PersistenceV2.ets +// [Start Main_PersistenceV2] +import { AppStorageV2, PersistenceV2, Type } from '@kit.ArkUI'; +import { common, Want } from '@kit.AbilityKit'; +import { Setting } from './SettingPage'; +import util from '@ohos.util'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +@ObservedV2 +class Task { + // 未实现构造函数,因为@Type当前不支持带参数的构造函数 + @Trace public taskName: string = 'Todo'; + @Trace public isFinish: boolean = false; +} + +@ObservedV2 +class TaskList { + // 对于复杂对象需要@Type修饰,确保序列化成功 + @Type(Task) + @Trace public tasks: Task[] = []; + + constructor(tasks: Task[]) { + this.tasks = tasks; + } + + async loadTasks(context: common.UIAbilityContext) { + let getJson = await context.resourceManager.getRawFileContent('defaultTasks.json'); + let textDecoderOptions: util.TextDecoderOptions = { ignoreBOM : true }; + let textDecoder = util.TextDecoder.create('utf-8',textDecoderOptions); + let result = textDecoder.decodeToString(getJson); + this.tasks =JSON.parse(result).map((task: Task)=>{ + let newTask = new Task(); + newTask.taskName = task.taskName; + newTask.isFinish = task.isFinish; + return newTask; + }); + } +} + +@ComponentV2 +struct TaskItem { + @Param task: Task = new Task(); + @Event deleteTask: () => void = () => {}; + @Monitor('task.isFinish') + onTaskFinished(mon: IMonitor) { + hilog.debug(0x0000, 'testTag', '%{public}s', '任务' + this.task.taskName + '的完成状态从' + mon.value()?.before + '变为了' + mon.value()?.now); + } + + build() { + Row() { + Image(this.task.isFinish ? $r('app.media.finished') : $r('app.media.unfinished')) + .width(28) + .height(28) + Text(this.task.taskName) + .decoration({ type: this.task.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None }) + Button($r('app.string.Delete_task')) + .onClick(() => this.deleteTask()) + } + .onClick(() => this.task.isFinish = !this.task.isFinish) + } +} + +@Entry +@ComponentV2 +struct TodoList { + @Local taskList: TaskList = PersistenceV2.connect(TaskList, 'TaskList', () => new TaskList([]))!; + @Local newTaskName: string = ''; + @Local setting: Setting = AppStorageV2.connect(Setting, 'Setting', () => new Setting())!; + private context = this.getUIContext().getHostContext() as common.UIAbilityContext; + + async aboutToAppear() { + this.taskList = PersistenceV2.connect(TaskList, 'TaskList', () => new TaskList([]))!; + if (this.taskList.tasks.length === 0) { + await this.taskList.loadTasks(this.context); + } + } + + finishAll(ifFinish: boolean) { + for (let task of this.taskList.tasks) { + task.isFinish = ifFinish; + } + } + + @Computed + get tasksUnfinished(): number { + return this.taskList.tasks.filter(task => !task.isFinish).length; + } + + build() { + Column() { + Text($r('app.string.TodoList_title')) + .fontSize(40) + .margin({ bottom: 10 }) + Text(`${this.context.resourceManager.getStringSync($r('app.string.Unfinish_count').id)}:${this.tasksUnfinished}`) + Repeat(this.taskList.tasks.filter(task => this.setting.showCompletedTask || !task.isFinish)) + .each((obj: RepeatItem) => { + TaskItem({ + task: obj.item, + deleteTask: () => this.taskList.tasks.splice(this.taskList.tasks.indexOf(obj.item), 1) + }) + }) + Row() { + Button($r('app.string.Finish_all_tasks')) + .onClick(() => this.finishAll(true)) + Button($r('app.string.Unfinish_all_tasks')) + .onClick(() => this.finishAll(false)) + Button($r('app.string.Setting')) + .onClick(() => { + let wantInfo: Want = { + deviceId: '', // deviceId为空表示本设备 + bundleName: 'com.samples.statemgmtv2mvvm', // 替换成AppScope/app.json5里的bundleName + abilityName: 'SettingAbility', + }; + this.context.startAbility(wantInfo); + }) + } + Row() { + TextInput({ placeholder: $r('app.string.Add_new_task'), text: this.newTaskName }) + .onChange((value) => this.newTaskName = value) + .width('70%') + Button('+') + .onClick(() => { + let newTask = new Task(); + newTask.taskName = this.newTaskName; + this.taskList.tasks.push(newTask); + this.newTaskName = ''; + }) + } + } + } +} +// [End Main_PersistenceV2] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/RepeatPage.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/RepeatPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..0d1356e7d5613d43245566ec9c06427f70466ef2 --- /dev/null +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/RepeatPage.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2025 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. + * +*/ + +// src/main/ets/pages/5-Repeat.ets +// [Start Main_Repeat] +@ComponentV2 +struct TaskItem { + @Param taskName: string = ''; + @Param @Once isFinish: boolean = false; + @Event deleteTask: () => void = () => {}; + + build() { + Row() { + Image(this.isFinish ? $r('app.media.finished') : $r('app.media.unfinished')) + .width(28) + .height(28) + Text(this.taskName) + .decoration({ type: this.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None }) + Button($r('app.string.Delete_task')) + .onClick(() => this.deleteTask()) + } + .onClick(() => this.isFinish = !this.isFinish) + } +} + +@Entry +@ComponentV2 +struct TodoList { + @Local tasks: string[] = ['task1','task2','task3']; + @Local newTaskName: string = ''; + build() { + Column() { + Text($r('app.string.TodoList_title')) + .fontSize(40) + .margin({ bottom: 10 }) + Repeat(this.tasks) + .each((obj: RepeatItem) => { + TaskItem({ + taskName: obj.item, + isFinish: false, + deleteTask: () => this.tasks.splice(this.tasks.indexOf(obj.item), 1) + }) + }) + Row() { + TextInput({ placeholder: $r('app.string.Add_new_task'), text: this.newTaskName }) + .onChange((value) => this.newTaskName = value) + .width('70%') + Button('+') + .onClick(() => { + this.tasks.push(this.newTaskName); + this.newTaskName = ''; + }) + } + } + } +} +// [End Main_Repeat] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/SettingPage.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/SettingPage.ets index 2420dc984bf12feab4b2ff14e7e16b0442703248..c27b9c8a4f94a37dd4b602de86ccba154e6f259e 100644 --- a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/SettingPage.ets +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/SettingPage.ets @@ -15,7 +15,7 @@ */ // src/main/ets/pages/SettingPage.ets - +// [Start Main_SettingPage] import { AppStorageV2 } from '@kit.ArkUI'; import { common } from '@kit.AbilityKit'; @@ -48,4 +48,5 @@ struct SettingPage { } .alignItems(HorizontalAlign.Start) } -} \ No newline at end of file +} +// [End Main_SettingPage] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/TodoListPage.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/TodoListPage.ets index b86f8a4ae09b4966a18f477073102f85a0907edd..b5e92ff285551e5fd39f8348e348cc3a4539f79e 100644 --- a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/TodoListPage.ets +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/pages/TodoListPage.ets @@ -15,7 +15,7 @@ */ // src/main/ets/pages/TodoListPage.ets - +// [Start Main_TodoListPage] import TaskListViewModel from '../viewmodel/TaskListViewModel'; import { common } from '@kit.AbilityKit'; import { AppStorageV2, PersistenceV2, router } from '@kit.ArkUI'; @@ -70,4 +70,5 @@ struct TodoList { .alignItems(HorizontalAlign.Start) .margin({ left: 15 }) } -} \ No newline at end of file +} +// [End Main_TodoListPage] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/view/BottomView.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/view/BottomView.ets index fd3159613d84f5e0bafd83b4066ede53144dc33c..e32df50fdbace6a9cf32789d8a3582f0e397274f 100644 --- a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/view/BottomView.ets +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/view/BottomView.ets @@ -15,7 +15,7 @@ */ // src/main/ets/view/BottomView.ets - +// [Start View_BottomView] import { common, Want } from '@kit.AbilityKit'; import TaskViewModel from '../viewmodel/TaskViewModel'; import TaskListViewModel from '../viewmodel/TaskListViewModel'; @@ -60,4 +60,5 @@ export default struct BottomView { } } } -} \ No newline at end of file +} +// [End View_BottomView] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/view/ListView.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/view/ListView.ets index 2807f2af8ffbb89c3cf31bf2f24f37e27a9d9786..2c0f894bc435d15dc19d02062b2cb41d8dcd6a0c 100644 --- a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/view/ListView.ets +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/view/ListView.ets @@ -15,7 +15,7 @@ */ // src/main/ets/view/ListView.ets - +// [Start View_ListView] import TaskViewModel from '../viewmodel/TaskViewModel'; import TaskListViewModel from '../viewmodel/TaskListViewModel'; import { Setting } from '../pages/SettingPage'; @@ -64,4 +64,5 @@ export default struct ListView { }).margin(5) }) } -} \ No newline at end of file +} +// [End View_ListView] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/view/TitleView.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/view/TitleView.ets index 1b0e3e0663bdb89ee1d1b5832956e96e93bd22eb..e1cddb7361b37d6924ef33dfef86a7d57829c1ec 100644 --- a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/view/TitleView.ets +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/view/TitleView.ets @@ -15,7 +15,7 @@ */ // src/main/ets/view/TitleView.ets - +// [Start View_TitleView] @ComponentV2 export default struct TitleView { @Param tasksUnfinished: number = 0; @@ -29,4 +29,5 @@ export default struct TitleView { .margin({ left: 10, bottom: 10 }) } } -} \ No newline at end of file +} +// [End View_TitleView] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/viewmodel/TaskListViewModel.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/viewmodel/TaskListViewModel.ets index f0fe8481cabd36a8e0e54e3d74bde500d8476b0c..3070bd277c70cae2ea09a88380526aca959a7131 100644 --- a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/viewmodel/TaskListViewModel.ets +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/viewmodel/TaskListViewModel.ets @@ -15,7 +15,7 @@ */ // src/main/ets/viewmodel/TaskListViewModel.ets - +// [Start ViewModel_TaskListViewModel] import { common } from '@kit.AbilityKit'; import { Type } from '@kit.ArkUI'; import TaskListModel from '../model/TaskListModel'; @@ -49,4 +49,5 @@ export default class TaskListViewModel { removeTask(removedTask: TaskViewModel): void { this.tasks.splice(this.tasks.indexOf(removedTask), 1); } -} \ No newline at end of file +} +// [End ViewModel_TaskListViewModel] \ No newline at end of file diff --git a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/viewmodel/TaskViewModel.ets b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/viewmodel/TaskViewModel.ets index b412dcc9c11f62c73dee3d588c13b8b1f0ff5c73..6aa8d4acfe214417291eb50d9b992117f73797a8 100644 --- a/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/viewmodel/TaskViewModel.ets +++ b/ArkUIKit/StateMgmtV2MVVM/entry/src/main/ets/viewmodel/TaskViewModel.ets @@ -15,7 +15,7 @@ */ // src/main/ets/viewmodel/TaskViewModel.ets - +// [Start ViewModel_TaskViewModel] import TaskModel from '../model/TaskModel'; @ObservedV2 @@ -31,4 +31,5 @@ export default class TaskViewModel { updateIsFinish(): void { this.isFinish = !this.isFinish; } -} \ No newline at end of file +} +// [End ViewModel_TaskViewModel] \ No newline at end of file diff --git a/ArkUIKit/StateStyle/entry/src/main/ets/pages/Index.ets b/ArkUIKit/StateStyle/entry/src/main/ets/pages/Index.ets index bf5b7cdb6aaceed711c2986615213428f97aa21d..3d1b74273445805f712413dde21ab509e724480a 100644 --- a/ArkUIKit/StateStyle/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/StateStyle/entry/src/main/ets/pages/Index.ets @@ -148,7 +148,7 @@ struct ComponentExtension { .width('100%') .onClick(() => { const name = `pages/${routeGroup.name}/${route.name}`; - router.pushUrl({url: name}); + this.getUIContext().getRouter().pushUrl({url: name}); }) } .width('100%') diff --git a/ArkUIKit/StateStyle/entry/src/main/syscap.json b/ArkUIKit/StateStyle/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..d14edde4277db282075a6639d65e40ddbbf0f2a2 --- /dev/null +++ b/ArkUIKit/StateStyle/entry/src/main/syscap.json @@ -0,0 +1,20 @@ +{ + "devices": { + "general": [ + "default" + ], + "custom": [ + { + "xts": [ + "SystemCapability.ArkUI.ArkUI.Full", + "SystemCapability.ArkUI.ArkUI.Circle", + "SystemCapability.Test.UiTest", + "SystemCapability.Ability.AbilityRuntime.Core", + "SystemCapability.Notification.Emitter", + "SystemCapability.MiscServices.Time", + "SystemCapability.FileManagement.File.FileIO" + ] + } + ] + } +} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/config/buildConfig.json b/ArkUIKit/StateTrack/entry/build/config/buildConfig.json deleted file mode 100644 index 4712acc4d94df2bcfaeb472144e8104546ac27d7..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/config/buildConfig.json +++ /dev/null @@ -1 +0,0 @@ -{"compileConfig":{"deviceType":"default","buildMode":"debug","compilerType":"ark","note":"false","logLevel":"3","hapMode":"false","img2bin":"true","Path":"D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\tools\\node\\","projectProfilePath":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\build-profile.json5","localPropertiesPath":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\local.properties","appResource":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\res\\default\\ResourceTable.txt","cachePath":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\cache\\default\\default@CompileArkTS\\esmodule\\debug","aceBuildJson":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\loader\\default\\loader.json","aceModuleJsonPath":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\res\\default\\module.json","aceSoPath":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\loader_out\\default\\nativeDependencies.txt","aceModuleRoot":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets","aceModuleBuild":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\loader_out\\default\\ets","aceProfilePath":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\res\\default\\resources\\base\\profile","aceSuperVisualPath":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\supervisual","watchMode":"false"},"patchConfig":{"changedFileList":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\patch\\default\\changedFileList.json"}} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/.ts_checker_cache b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/.ts_checker_cache deleted file mode 100644 index 0d8599507bc1e024574f67a1c9fbfcf1467e5820..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/.ts_checker_cache +++ /dev/null @@ -1,1969 +0,0 @@ -{ - "runtimeOS": "HarmonyOS", - "sdkInfo": "false:20:6.0.0.47:Release", - "fileList": { - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AbilityConstant.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.appManager.d.ts" - ], - "parent": [ - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\entryability\\EntryAbility.ets", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.UIAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Ability.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.EnvironmentCallback.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.ConfigurationConstant.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\entryability\\EntryAbility.ets", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Configuration.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIExtensionContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.UIAbility.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Ability.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AbilityConstant.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.rpc.d.ts" - ], - "parent": [ - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\entryability\\EntryAbility.ets", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AbilityLifecycleCallback.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\entryability\\EntryAbility.ets", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.UIAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.dialogRequest.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\abilityResult.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.unifiedDataChannel.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.ability.featureAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\startAbilityParameter.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AppServiceExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\embedded_component.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.hilog.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\entryability\\EntryAbility.ets", - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\entrybackupability\\EntryBackupAbility.ets", - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\pages\\stateTrack\\StateTrackClass.ets", - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\pages\\stateTrack\\StateTrackClass2.ets", - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\pages\\stateTrack\\StateTrackClass3.ets" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\BaseContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.node.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.ConfigurationConstant.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts" - ], - "parent": [ - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\entryability\\EntryAbility.ets", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.UIAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.StartOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AbilityLifecycleCallback.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\component\\navigation.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.ability.featureAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\folder_stack.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\nav_destination.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\navigation.d.ts" - ], - "error": false - }, - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\entryability\\EntryAbility.ets": { - "mtimeMs": 1761551441298.3037, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AbilityConstant.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.ConfigurationConstant.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.UIAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.hilog.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.appManager.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ProcessInformation.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationStateObserver.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AbilityStateData.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AppStateData.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ProcessData.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AbilityConstant.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ProcessInformation.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.appManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.resourceManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.rpc.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.mediaquery.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.inspector.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.promptAction.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.router.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.observer.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\component\\navigation.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.componentSnapshot.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.dragController.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.unifiedDataChannel.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityHelper.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.ability.featureAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.rdb.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimodalInput.pointer.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneResources.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\embedded_component.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\nav_destination.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\navigation.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\pattern_lock.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\video.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.web.webview.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.security.cert.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.security.cryptoFramework.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.print.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ProcessInformation.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.appManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.appManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationStateObserver.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AppStateData.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AbilityStateData.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ProcessData.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.appManager.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AbilityStateData.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.appManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationStateObserver.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AppStateData.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.appManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationStateObserver.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ProcessData.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.appManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationStateObserver.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\Metadata.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ElementName.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ApplicationInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\AbilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\BundleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\HapModuleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ExtensionAbilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\Skill.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ProcessInformation.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ApplicationInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\AbilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\BundleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\HapModuleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ExtensionAbilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.StartOptions.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\Metadata.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ApplicationInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\AbilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\HapModuleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ExtensionAbilityInfo.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ElementName.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\connectOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.CompletionHandler.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ApplicationInfo.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\Metadata.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\global\\resource.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\AbilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\BundleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ExtensionAbilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\AbilityInfo.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ApplicationInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\Metadata.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\Skill.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\HapModuleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\BundleInfo.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ApplicationInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\HapModuleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\HapModuleInfo.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\AbilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ExtensionAbilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\Metadata.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\BundleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AbilityStageContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ExtensionAbilityInfo.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ApplicationInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\Metadata.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\Skill.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\HapModuleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ExtensionContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\Skill.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\AbilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ExtensionAbilityInfo.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\global\\resource.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ApplicationInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.resourceManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.drawing.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\units.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Ability.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AbilityConstant.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Configuration.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.UIAbility.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\connectOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.UIAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.dialogRequest.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AbilityConstant.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AtomicServiceOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.ConfigurationConstant.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIServiceProxy.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIServiceExtensionConnectCallback.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AbilityStartCallback.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\AbilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\abilityResult.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\HapModuleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.OpenLinkOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.StartOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Configuration.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.UIAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.observer.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\EmbeddableUIAbilityContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.rpc.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.UIAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\connectOptions.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Configuration.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.ConfigurationConstant.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Ability.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.EnvironmentCallback.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AbilityStageContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\BaseContext.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.rdb.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.colorSpaceManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.resourceManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.rpc.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.drawableDescriptor.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.drawing.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.StartOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.componentSnapshot.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.unifiedDataChannel.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\PhotoEditorExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimodalInput.pointer.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.web.webview.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.font.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.mediaquery.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.inspector.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.promptAction.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.router.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.componentUtils.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.node.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.animator.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.observer.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.animator.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.measure.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.componentSnapshot.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.dragController.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimodalInput.pointer.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\BuilderNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\FrameNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\ComponentContent.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\NodeController.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\XComponentNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.node.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\BuilderNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\BuilderNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\BuilderNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\NodeController.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\FrameNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\FrameNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\RenderNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\XComponentNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Content.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\ComponentContent.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\NodeContent.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\content_slot.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\node_container.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.colorSpaceManager.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.drawing.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.resourceManager.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\global\\rawFileDescriptor.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\global\\resource.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.drawableDescriptor.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\global\\rawFileDescriptor.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.resourceManager.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.drawableDescriptor.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.resourceManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\image.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.font.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.mediaquery.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.inspector.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.promptAction.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\action_sheet.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\alert_dialog.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\custom_dialog_controller.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.router.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts", - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\pages\\Index.ets" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.componentUtils.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.animator.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.observer.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\component\\navigation.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.measure.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.componentSnapshot.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.dragController.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.unifiedDataChannel.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AbilityStageContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\BaseContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\FormExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\EventHub.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityHelper.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AbilityStartCallback.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\connectOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\VpnExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\EmbeddableUIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\PhotoEditorExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIServiceProxy.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIServiceExtensionConnectCallback.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AppServiceExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\abilityResult.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimodalInput.pointer.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\BuilderNode.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\FrameNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.node.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\ComponentContent.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\XComponentNode.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\NodeController.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\FrameNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.node.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\FrameNode.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\RenderNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\ComponentContent.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.node.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\BuilderNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\NodeController.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\XComponentNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\NodeContent.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\canvas.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.drawing.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.common2D.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\global\\resource.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.node.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\BuilderNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\FrameNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\RenderNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\NodeController.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\particle.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\units.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\RenderNode.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.node.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\FrameNode.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\XComponentNode.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\BuilderNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\FrameNode.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.node.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Content.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.node.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\ComponentContent.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\NodeContent.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\ComponentContent.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\BuilderNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Content.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.node.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\FrameNode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\NodeContent.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Content.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\FrameNode.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.node.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.drawing.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.common2D.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.colorSpaceManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\global\\resource.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\canvas.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.text.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.common2D.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.drawing.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.text.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\component\\navigation.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.observer.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\connectOptions.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ElementName.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.rpc.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.ability.featureAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AppServiceExtensionContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.dialogRequest.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AtomicServiceOptions.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.CompletionHandlerForAtomicService.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.StartOptions.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIExtensionContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIServiceProxy.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIExtensionContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIServiceExtensionConnectCallback.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIExtensionContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AbilityStartCallback.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\abilityResult.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\abilityResult.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AbilityStartCallback.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.ability.featureAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\PhotoEditorExtensionContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\EventHub.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ApplicationInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\BaseContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.resourceManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.contextConstant.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AbilityStageContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.print.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.OpenLinkOptions.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIExtensionContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.StartOptions.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.contextConstant.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.bundleManager.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.CompletionHandler.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AtomicServiceOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AppServiceExtensionContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.CompletionHandlerForAtomicService.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AtomicServiceOptions.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.contextConstant.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.StartOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.CompletionHandler.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ElementName.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.StartOptions.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\EventHub.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationContext.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ProcessInformation.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.ConfigurationConstant.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AbilityLifecycleCallback.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.EnvironmentCallback.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.ApplicationStateChangeCallback.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AbilityLifecycleCallback.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.UIAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.EnvironmentCallback.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AbilityConstant.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Configuration.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.ApplicationStateChangeCallback.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ApplicationContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.unifiedDataChannel.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.dragController.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIExtensionContext.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.StartOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\abilityResult.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\connectOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.AtomicServiceOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.OpenLinkOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.ConfigurationConstant.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIServiceProxy.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIServiceExtensionConnectCallback.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AbilityStageContext.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\HapModuleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Configuration.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ExtensionContext.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\HapModuleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Configuration.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundleManager\\ExtensionAbilityInfo.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\FormExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\VpnExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\PhotoEditorExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AppServiceExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.file.BackupExtensionContext.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\FormExtensionContext.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ExtensionContext.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityHelper.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\data\\rdb\\resultSet.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityOperation.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityResult.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.dataAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.rdb.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.ability.featureAbility.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\VpnExtensionContext.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ExtensionContext.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\EmbeddableUIAbilityContext.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\UIAbilityContext.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\PhotoEditorExtensionContext.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\abilityResult.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\AppServiceExtensionContext.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ExtensionContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\connectOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.StartOptions.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\data\\rdb\\resultSet.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityHelper.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.rdb.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityOperation.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.ability.featureAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.dataAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.rdb.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityHelper.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityResult.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityHelper.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.dataAbility.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.rdb.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityHelper.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityOperation.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.rdb.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\data\\rdb\\resultSet.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\BaseContext.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityHelper.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityOperation.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.dataAbility.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.ability.featureAbility.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\startAbilityParameter.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\abilityResult.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\appVersionInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityHelper.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\connectOptions.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\processInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\dataAbilityOperation.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\ability\\startAbilityParameter.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.ability.featureAbility.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\appVersionInfo.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.ability.featureAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\context.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\context.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\applicationInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\processInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\elementName.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\BaseContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\hapModuleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\appVersionInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\abilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.ability.featureAbility.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\processInfo.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.ability.featureAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\context.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\applicationInfo.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\moduleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\customizeData.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\abilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\bundleInfo.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\elementName.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\context.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\hapModuleInfo.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\abilityInfo.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\bundleInfo.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\abilityInfo.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\applicationInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\customizeData.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\hapModuleInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\bundleInfo.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\applicationInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\abilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\bundleInfo.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\app\\context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\abilityInfo.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\moduleInfo.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\applicationInfo.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\customizeData.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\applicationInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\abilityInfo.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\bundleInfo.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\abilityInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\applicationInfo.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\bundle\\hapModuleInfo.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.bundle.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.application.BackupExtensionAbility.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.file.BackupExtensionContext.d.ts" - ], - "parent": [ - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\entrybackupability\\EntryBackupAbility.ets" - ], - "error": false - }, - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\entrybackupability\\EntryBackupAbility.ets": { - "mtimeMs": 1761551441298.3037, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.hilog.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.application.BackupExtensionAbility.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.application.BackupExtensionAbility.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.file.BackupExtensionContext.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\ExtensionContext.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.application.BackupExtensionAbility.d.ts" - ], - "error": false - }, - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\pages\\Index.ets": { - "mtimeMs": 1761551441299.306, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.router.d.ts" - ], - "parent": [], - "error": false - }, - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\pages\\stateTrack\\StateTrackClass.ets": { - "mtimeMs": 1761551441299.306, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.hilog.d.ts" - ], - "parent": [], - "error": false - }, - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\pages\\stateTrack\\StateTrackClass2.ets": { - "mtimeMs": 1761551441300.305, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.hilog.d.ts" - ], - "parent": [], - "error": false - }, - "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\ets\\pages\\stateTrack\\StateTrackClass3.ets": { - "mtimeMs": 1761551441300.305, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.hilog.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\action_sheet.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.promptAction.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.promptAction.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\alert_dialog.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.promptAction.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\canvas.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.drawing.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\FrameNode.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.uniformTypeDescriptor.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimodalInput.intentionCode.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\ImageModifier.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\SymbolGlyphModifier.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.shape.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.matrix4.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\image.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.uiEffect.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.theme.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\with_theme.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\common.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.dragController.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.dragController.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimodalInput.pointer.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.unifiedDataChannel.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.unifiedDataChannel.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.uniformTypeDescriptor.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.unifiedDataChannel.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.data.unifiedDataChannel.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimodalInput.intentionCode.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\ImageModifier.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\SymbolGlyphModifier.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.shape.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.shape.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.shape.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.shape.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.matrix4.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.observer.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.observer.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.observer.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.UIContext.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.uiEffect.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.uiEffect.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\ComponentContent.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.theme.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.promptAction.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.scene.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\ScenePostProcessSettings.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneTypes.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneResources.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneNodes.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\Scene.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\component3d.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\component3d.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.scene.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\ScenePostProcessSettings.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.scene.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneNodes.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneTypes.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.scene.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneResources.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneNodes.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\Scene.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneResources.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneTypes.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.scene.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneNodes.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\Scene.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneNodes.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneResources.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneTypes.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\ScenePostProcessSettings.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\Scene.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.scene.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\Scene.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\Scene.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneResources.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneNodes.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneTypes.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.scene.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\graphics3d\\SceneNodes.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\content_slot.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.node.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\custom_dialog_controller.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.promptAction.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\embedded_component.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.app.ability.Want.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\folder_stack.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\image.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.drawableDescriptor.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.drawing.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.drawing.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.matrix4.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\nav_destination.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\navigation.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.window.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\node_container.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.node.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\particle.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\pattern_lock.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\CommonModifier.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\tabs.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\tabs.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\CommonModifier.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.text.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.drawing.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.common2D.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\text_common.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\text_common.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.text.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.text.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.text.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.text.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.text.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.graphics.text.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.intl.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\time_picker.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\time_picker.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.intl.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\with_theme.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.arkui.theme.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\units.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\global\\resource.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\arkui\\Graphics.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\video.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.web.webview.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.security.cert.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.multimedia.image.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.print.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.web.netErrorList.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\web.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\build-tools\\ets-loader\\declarations\\web.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.web.webview.d.ts" - ], - "parent": [], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.security.cert.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.security.cryptoFramework.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.web.webview.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.print.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts", - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\application\\Context.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.web.webview.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.web.netErrorList.d.ts": { - "mtimeMs": 1758690718000, - "children": [], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.web.webview.d.ts" - ], - "error": false - }, - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.security.cryptoFramework.d.ts": { - "mtimeMs": 1758690718000, - "children": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.base.d.ts" - ], - "parent": [ - "D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\openharmony\\ets\\api\\@ohos.security.cert.d.ts" - ], - "error": false - } - } -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/.tsbuildinfo b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/.tsbuildinfo deleted file mode 100644 index 693cdf301725ddfeb1ff15da5bc3f18ab0896090..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es5.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2016.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2017.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2018.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2019.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2021.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.core.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.collection.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.generator.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.iterable.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.promise.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.proxy.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.reflect.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.symbol.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2016.array.include.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2017.object.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2017.string.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2017.intl.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2018.intl.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2018.promise.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2018.regexp.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2019.array.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2019.object.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2019.string.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2019.symbol.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2019.intl.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.bigint.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.date.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.promise.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.string.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.intl.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.number.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2021.promise.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2021.string.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2021.weakref.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2021.intl.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.base.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/metadata.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/elementname.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.want.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/global/resource.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/applicationinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/skill.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/abilityinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/extensionabilityinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/hapmoduleinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/bundleinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.bundle.bundlemanager.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/processinformation.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/appstatedata.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/abilitystatedata.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/processdata.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/applicationstateobserver.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.appmanager.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.abilityconstant.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.configurationconstant.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.configuration.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.ability.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/basecontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.graphics.colorspacemanager.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/global/rawfiledescriptor.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.drawabledescriptor.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.resourcemanager.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.rpc.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.multimedia.image.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.font.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.mediaquery.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.inspector.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.promptaction.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.router.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.componentutils.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.graphics.common2d.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.graphics.drawing.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/graphics.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/rendernode.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/content.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/componentcontent.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/framenode.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/buildernode.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/nodecontroller.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/xcomponentnode.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/nodecontent.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.node.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.animator.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/ability/connectoptions.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.dialogrequest.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.completionhandlerforatomicservice.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.contextconstant.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.completionhandler.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.startoptions.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.atomicserviceoptions.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/uiserviceproxy.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/uiserviceextensionconnectcallback.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/ability/abilityresult.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/abilitystartcallback.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/eventhub.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.abilitylifecyclecallback.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.environmentcallback.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.applicationstatechangecallback.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/applicationcontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/context.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.openlinkoptions.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/uiabilitycontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/component/navigation.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.observer.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.measure.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.componentsnapshot.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.data.unifieddatachannel.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.dragcontroller.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/extensioncontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/uiextensioncontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/abilitystagecontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/formextensioncontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/data/rdb/resultset.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/ability/startabilityparameter.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/app/appversioninfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundle/moduleinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundle/customizedata.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundle/applicationinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/app/processinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundle/elementname.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundle/bundleinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.bundle.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundle/abilityinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundle/hapmoduleinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/app/context.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.ability.featureability.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.data.rdb.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.data.dataability.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/ability/dataabilityoperation.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/ability/dataabilityresult.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/ability/dataabilityhelper.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/vpnextensioncontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/embeddableuiabilitycontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/photoeditorextensioncontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/appserviceextensioncontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.common.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.multimodalinput.pointer.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.uicontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.window.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.uiability.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.hilog.d.ts","../../../../../../src/main/ets/entryability/entryability.ets","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.file.backupextensioncontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.application.backupextensionability.d.ts","../../../../../../src/main/ets/entrybackupability/entrybackupability.ets","../../../../../../src/main/ets/pages/index.ets","../../../../../../src/main/ets/pages/statetrack/statetrackclass.ets","../../../../../../src/main/ets/pages/statetrack/statetrackclass2.ets","../../../../../../src/main/ets/pages/statetrack/statetrackclass3.ets","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/action_sheet.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/alert_dialog.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/alphabet_indexer.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/badge.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/blank.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/button.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/calendar_picker.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/canvas.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/checkbox.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/checkboxgroup.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/circle.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/column.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/column_split.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.data.uniformtypedescriptor.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.multimodalinput.intentioncode.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/imagemodifier.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/symbolglyphmodifier.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.shape.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.matrix4.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.graphics.uieffect.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.theme.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/common.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/common_ts_ets_api.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/graphics3d/scenepostprocesssettings.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/graphics3d/scenetypes.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/graphics3d/sceneresources.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/graphics3d/scene.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/graphics3d/scenenodes.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.graphics.scene.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/component3d.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/container_span.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/content_slot.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/context_menu.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/counter.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/custom_dialog_controller.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/data_panel.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/date_picker.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/divider.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/ellipse.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/embedded_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/enums.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/featureability.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/flex.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/flow_item.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/focus.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/folder_stack.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/form_link.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/for_each.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/gauge.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/gesture.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/global.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/grid.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/griditem.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/grid_col.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/grid_container.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/grid_row.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/hyperlink.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/image.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/image_animator.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/image_common.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/image_span.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/lazy_for_each.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/lazy_grid_layout.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/line.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/list.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/list_item.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/list_item_group.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/loading_progress.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/matrix2d.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/marquee.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/menu.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/menu_item.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/menu_item_group.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/nav_destination.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/nav_router.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/navigation.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/navigator.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/node_container.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/page_transition.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/panel.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/particle.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/paste_button.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/path.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/pattern_lock.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/polygon.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/polyline.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/progress.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/qrcode.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/radio.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/rating.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/rect.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/refresh.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/relative_container.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/repeat.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/rich_editor.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/rich_text.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/row.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/row_split.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/save_button.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/scroll.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/scroll_bar.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/search.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/security_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/select.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/shape.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/slider.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/span.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/stack.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/state_management.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/stepper.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/stepper_item.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/swiper.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/indicatorcomponent.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/symbolglyph.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/symbol_span.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/commonmodifier.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/tabs.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/tab_content.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/text.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/text_area.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/text_clock.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.graphics.text.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/text_common.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/text_input.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/text_picker.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/text_timer.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.intl.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/time_picker.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/toggle.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/toolbar.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/with_theme.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/units.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/video.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.security.cryptoframework.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.security.cert.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.print.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.web.neterrorlist.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.web.webview.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/web.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/xcomponent.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/sidebar.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/water_flow.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/styled_string.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/index-full.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/animator.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/calendar.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/form_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/media_cached_image.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/plugin_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/root_scene.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/screen.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/window_scene.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/ability_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/remote_window.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/effect_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/ui_extension_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/isolated_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/linearindicator.d.ts"],"fileInfos":[{"version":"be8b901880718680b6c067fd8083bd5b04cde401c1e1123823e3068bb2e0d282","affectsGlobalScope":true},"e8d2e50f9e8fdd312d31f97571b4c7295b8f29f7f8363498edae2a9eb113ee36","4b1854aec637e8e041eff02899e16fd3c0c78685c622336aadfd67e6604bbe1b","d6f7d47355a0167969e9a8eedfb0994f21e038d360965ec06c30f6871038900b","4735756aff7c5857de387f321633f272e2daba4950c427ab200de954340c7c13","13dfb22c1b46f9858b19fc7df54674146f3d174ccd35f0e02e8d05a3026b9ba8","33d21bcca0f7b054d0d0d402125f547c9ac77782c2df301de314143f08e81406","80510205fb587019e1ad42bfbc046d4f55f3c5a1c8b3debca7d6fe0adc93959f",{"version":"276144a8254bed55adae6f0646c37a2cd11575ac2cbc679bf7ac0419c443fd58","affectsGlobalScope":true},{"version":"3523038578cadf637fdce58f06018e144fd5b26c12e3f9c1cef14cdf92ca3d20","affectsGlobalScope":true},{"version":"28065193ddf88bf697915b9236d2d00a27e85726563e88474f166790376e10d8","affectsGlobalScope":true},{"version":"511c964513d7c2f72556554cdeb960b4f0445990d11080297a97cc7b5fa1bb68","affectsGlobalScope":true},{"version":"725daac09ec6eb9086c2bea6bbdf6d6ab2a6f49d686656c6021a4da0415fe31f","affectsGlobalScope":true},{"version":"21574b67bbedcb39a6efa00ca47e5b9402946a4d4e890abd5b51d3fd371819ba","affectsGlobalScope":true},{"version":"2415a2b1a4a521594b9837316ae3950b0c0c2f8b689defd358986bf3e263e904","affectsGlobalScope":true},{"version":"e5d8d715990d96a37f3521a3f1460679507b261eec1b42dc84d4de835997b794","affectsGlobalScope":true},{"version":"93fa2a84417c65ab8ed121a0b84536312e00a11cbf45b0006a75324d00b176d2","affectsGlobalScope":true},{"version":"a003a6051b48dc64eaa8ad83789e4c2a540f3482bed821053b6770969bd598fb","affectsGlobalScope":true},{"version":"e90857fa86cecc3bc964a2d7db9d95a0c406bebfadeb4853a01a0079936f12f7","affectsGlobalScope":true},{"version":"8bbb03589e48f10b49996064f35256e858d205dcb364428fb4cc045061b1d786","affectsGlobalScope":true},{"version":"5044747370afee4b4c247e8a14c2969d245bbcf8396295dc5a60c659d796a71f","affectsGlobalScope":true},{"version":"8e4921934f4bec04df1bee5762a8f4ad9213f0dab33ea10c5bb1ba1201070c6a","affectsGlobalScope":true},{"version":"a894424c7058bcc77c1a3c92fe289c0ff93792e583e064c683d021879479f7b8","affectsGlobalScope":true},{"version":"8f03386d697248c5d356fd53f2729b920ea124cd1414a6c22de03c5d24729277","affectsGlobalScope":true},{"version":"21ac76354ecc1324ee2e31ac5fcebfa91b1b6beb3e8c3fe6f3988538e9629c73","affectsGlobalScope":true},{"version":"ecc058373716a6bb19a4492ac553b61e3ebc0eb657407b6ea62337316885b64b","affectsGlobalScope":true},{"version":"fe7acdc1039eca904399190766d1c8766b7d2621413f972c8542dddd69612097","affectsGlobalScope":true},{"version":"c25aa843b930662d62f0e853dd1f347d08b66cdec09bd760151d4ba6ce220fe6","affectsGlobalScope":true},{"version":"3e47477f297e4fa0d556c40a872c2c45bddefa487fd054bf1f80bceb527a682b","affectsGlobalScope":true},{"version":"a902be9f4116b449dbac07ffe3f4d69abb664f8eddfaeb892225612469213788","affectsGlobalScope":true},{"version":"155d8d1e367e05af5e5708a860825785f00eabae01744cf7bc569664301415a4","affectsGlobalScope":true},{"version":"5b30b81cdeb239772daf44e6c0d5bf6adec9dbf8d534ed25c9a0e8a43b9abfff","affectsGlobalScope":true},{"version":"cdb77abf1220d79a20508bbcfddf21f0437ea8ef5939ba46f999c4987061baab","affectsGlobalScope":true},{"version":"62e02a2f5889850ed658dfde861b2ba84fb22f3663ea3b2e2f7fb3dcd1813431","affectsGlobalScope":true},{"version":"357921f26d612a4c5ac9896340e6a2beffcaf889ff5cdfcc742e9af804d1a448","affectsGlobalScope":true},{"version":"d836a4258d6b5ee12054b802002d7c9c5eb6a1adb6a654f0ee9429cbda03e1a0","affectsGlobalScope":true},{"version":"c021bff90eb33d29edfde16c9b861097bbf99aa290726d0d0ac65330aa7be85a","affectsGlobalScope":true},{"version":"1c4e64dc374ea5922d7632a52b167187ba7c7e35b34d3c1e22625be66ca1576d","affectsGlobalScope":true},{"version":"cd1bebc4db8fb52c5618ecad3f511f62c78921451c198220c5b2ee5610b4d7b9","affectsGlobalScope":true},{"version":"fb60e7c9de1306648f865b4c8ef76b7376731af3955b69551004ad3848fb8f4c","affectsGlobalScope":true},{"version":"18d23591bba5678cf57ef139e1a3daad8017b26ad6612c8c34d6fa39044b245f","affectsGlobalScope":true},{"version":"868df11ccdabb6de564f70b68aa6b379a243ef32c8f6ee6dc71056a3dd54578a","affectsGlobalScope":true},{"version":"cebef4c7f9b6afb02cd08e7288fab05d0be3e3c898c720775b8aa286e9f7cfed","affectsGlobalScope":true},{"version":"7e3c49afe9bf537f68ce2487d7996c6e5c2350c0f250939726add1efcb1bcf01","affectsGlobalScope":true},{"version":"c7673e88666f933b0d007e82e42b60e85cf606ec247033e8ee5ab5940e4be206","affectsGlobalScope":true},"18c90c5c0cc77bce15249c3b628f54126680dca8e8f800ae13c6827577d8d7ff","0885aa6e52133b13da14bd23c6e2923eb41f6587004d566b7fdcd643003f85dd","41c21e94cc18d83501abacdaf56f29ffa89e64a6dd5449580a53f7c834d487fc","734f6e14694c64bd97f1043a47397565d098937d35301b18c8670612a4e159cf","ff3b80b87f5c428ff03782f0036d2056e1f371b828f5fd1397064730c35c1c2a","76d8f54d8fa8b072116d014f52f4461a30652dc66260903f4897cbe7838ce373","5c5627008db0c037c148380ab9ed21004ad2e33df3c693a5f750a84fdb182c34","b2b5603060e1d6b2982cb5670e4c9f2864b185276e63bbc903d3a9c17ecdbfb0","90e2871e53f616739841e476f3054c5ae40255095aa2e7459222c4dc15e838b0","783616dbe6f5eb8691d1c390e7b089cbadafa32bd00b0c70c04d41407a761d69","1e597215fe046a63746dba7c4858158640e2604eedf9846eae6b349124ee29b9","ae2e5abe87b1a08b722b2eb1480ed06320c3f3f4d0d6dc44e66d08ec329d66ef","21930bd35ce5693ef61bd468014596dfaa5bd6b6c2d4f59f60844fac0eee384d","84912c4054b88f51a421edac0e72c3afffa6e13234d81b9a1aab9c9336830ce4","d6b557c3349079a11c7699cc680f0a9c9f709a09019d45e5e065985ea3919e9b","d720df61b68e1ac759fb8ee19a85b2d64d5fadc4f0f4a8c8e7b55df67a3f1775","acba4d1a0998ac6561b9a1aa15c6b1125f769f046cb38d325856a40b768cdaca","f3aeea828c0af07cee7cfacc5f7f5dd5c7f3e67d8bb63ab279c61c0642194d7c","620b7c31b289e834d976fa4c5dfd04ed9f0923ee5f7641b86fcd532baf2565b6","59076a01123585639ac35ad1ba8fd1acceee2335fe1ffcbf032d38925e47bce1","16820b43a1c139ef435c5dad03ec2a7f91c6e0fed732691ecba152ed1b44cd52","2478abad18abd3df6315d031c62f01f83a91caa634f35b17465df224608a8ac0","a8e07c1a2f8475fbab17dda22a5f51e2d26fbc39603cf3b18f9c0ae2b519e55e","9e35cb3a784322d79f1fc3e5f1f838baccf6e4897b1ba7ca58a0e85f5c62d392","2900121efc03a6a977643fe47b1f57f5d23e2ab7b4cac525ff41f6bd481ca52f","c855e91f562922633a8cbb28b6bf142242a831d861ba23475744253f5e37b95b","024f0f2569c643dc83c8e4ef7432a00186d101e7424132f88fb452f311b5d884","7b5f82b0e0cdc724a3b14a9c8bfce48ca8a5e70fa25f3f55503c4aeb84d0815e","fe89cfcf174d05ce0e14b241b1f456e98100506442bc434c254b457175043d64","a0577605aac5da0b747b491593a469584f0005416e52dce21fbb970abcd115e2","be201049e4d4638501f377c34d5318a68b41548a1a2ee577a306aabfedb05c93","95fdeb811613fe4b7db3766ace5232f7b0830a84bc4eeb5db6fa7c327d1fbbfe","9f17874d37b0bb6bc111469635ff0abddaa39c615d5459354044e5b920d8c095","ae6fbbd727e947b2214d28fb53875d98fee0cc796ece51d34f42475c0b5dfe69","7b071796c9afe1026dbc08854bd73d7f7085f97885a2699b45852808f9d3ce82","f83ee958f4e51ff58ec869784ca5403f66e111488d80ad8ed55e43fe96e79546","44f591ebb300365d6ebcda253431a049d45aa74c5717e58055d8b804bd2a8718","c59d5014d6310118454fe99540005aa81f41a72326eefd3d13ae3cb0a648b008","04d7628b1479c95bb2385477c283fdbf51afe60db51acf2449293c9303374cd8","16d269cca8715b0ca8b907859f6cce45f230f1b55a6429f267e4c5a8aa7f9d17","69634b06c488b31c03055d4544fddea21f84c1b0d052784ccd33ed6527b08131","b840440738eb0014fa755aecb6c49f70c907cca21c78a247b058156ae4bca715","329edb7e5e887dee7d365a60f139fc36de2f9a441abdd690c93bc5a45e467163","3f9b161e68bb7a52a3171cd1144254a968c8d2bb5b6b41ae30d93d5131aa5980","53a5c6a0ecdf633bea0a5ffdaeb9425b01c350ece3ef11b53301eb08bd9dbbf8","dc132b2bfd37756d5385b19a8972614ca9de8bf8264435096283230ce0d1fb2e","a480bb40ed9139c1886999772d83f2d46d4cbf86449af3c606dcca1dbc38d087","be0c35d4b8a3e29f1a98636e00b25ff9fde28e7b2a9eb7cda2c646f13751f1dc","5d1e8f9c86780f23962980d995e80f70cb90173100c4f3f1280c651c6dc22094","2238892eef3efdeaa60f96d62943897ca8c945dd6fb230ce71d2d9ce1989c30d","b77055b21a6390a1053cf3fd95a830c51b0a0b317e1639d0d029bfc637fc9984","0c98893d17a23b9b9a68328528d408ac9141b4d4e3fb5b2b38e6895c4f98aaed","a06221608f5d45845214ee4991743c1e7a6c91fa2addd3665d618abd1f940be1","5bf7782d5dc0ffb156bdb4b981e56c066247c252e7538a32efcf97ab6a65e5d4","45752fba2bcc8f837ba1eb959da11f22584ae2288b3cd0c8a0522c3aacbbd928","ee67d9b87041e39ed225a1c5e815d839985dfc9b6e12af1c96adef07b37251c7","c585cd71cd521f4373ff211223d2487faf3a467037b8e6ab0fa112551492b4c8","0cc5c94908b284934cc25e6bd28a612650b9644d64ce21248732f8ad95625cd5","105a88bf7880674f76b13a3100c47f22f72b2cbe30f42115bac1d45a772bd4a4","e6d653e5102c35235bf08d13b93ab1e229fe3fb4f734a06bf3e268f6be7fa0cd","500cd84a36eec70cf12d75d8db0482692947137231e5b56d729ee01d5799687e","486609fe99f6a3f875a7ec02440f1442f9f70d1b960b25e487d7172fff2145e0","7067a4950c4dfa1282ac4b2af9ea9d6f654ab9ca4874030b0ce08eba113bb788","5ba940e673cb292665db309eaf3cf3b6cd562c69c7d8343e92d351cafdda5de0","1415aaa37727b9d971f5d90855be88e9d6d0f91dedb5f448bac516232c0ec53e","1ee4140494ebdaa4971b592cb59603953c4f613a6707069292e04006a41eb4dd","bdc21c1c6547a171df6e036e256ea2a08ec3fff1259cef232f34b796e27cbdfa",{"version":"a1b442ee2c5708d05fa6267dafcfaaf9052aa5b1f2b96afd87d8bc768d5ffc2d","affectsGlobalScope":true},"6e44d700d4da368e0baa78517d2fd699302b6ef24908c9bfcb329e1a1ec4dae7","2fd4536b789dffa504fa1060d29618e0898f63635fc5b6ac8f8eaacc0e01a435","d73b0df62037fa7d8e447785395076fc48a7529a86d21951bba43b7c2c7e221b","ae34c262f096b945f4104faf1358983ee865fd67a31df058229ac2fc43cdc60e","18ae3d0c60ca49a89e37b243d5692b946f3863e6c6b2a5e2f806cd9fed499e81","ef2a7b4201827194eb706b950ef40889d0870f402e610cb096d86f0bb2d3bfda","33d2db33dbe83d05305a585bf6c0c083e825270b53c56ecc69584b3a6343903c","e15a16903c5239648c795bc68acdc833f6ae58daf7cbabad085e372ad2396a45","062845bbf8e7d38e456b9ad7d53248ba7e1c5b3f061edafddf0d3820488e6648","eb334428756c8c94fcf87fb74ff084f243de6595d19d5875a2e83cfdf645fd67","8e0622fd44e6fc146b3b431cd5433449bcc7660b555e6e6175926a5665353ad4","0fe10efa53a287daaccba7fa70bbf20820ead1cd0c011ad59248f04cea5f3534","6534aeb84fdb78bdf07dd551c70e5f859c28a08b00507446b1043c20526feb9d","59528c8bb0cd15a4e2b544547cd324bb3a1153ebd52beb99c1f36f5437bca908","7542f446bc5bc9148a8443618064cdd94ba23293716dc839ea17e79dee318b45","3a5f3b923aa0dbf9d743ee99961763d38576b11ba81dbcd1b90c046f52d6071e","53b8801feda0f792b5959291f0e760ed1e013a78fb4e22072b663a76eb47a368","e440c7066c19e60990f65eee96ecd5fe22cebf754376c0732a29ee4a11cfd2a4","7d81efdbf839fe9fd65d580a89b98cbde2d89a822d22e2e8e060921ddc93cc9f","f5c03ad15eee48dedd7bdef771d50369c70fa70b10523ab777e925a4c90dbbeb","e79dae84c8e3d36f8f47f2da99a824ebee5674af266cbf274355e1b058fb219b","8c804ac09102ae81cb3a5bd3698b0bbea4ee98bcf1c67ea28daf963e01743cc1","96c6b16e1aa7514e7df94ee86e534b8c06301470960072fac70099e93cf53efc","6c4a9afb20d47e984c4bf2e586b9652073cdf9f850cccee67a3eb4144ebdf147","2644ca9cd4f4d4f4192686f8df72f9e414341fcc40bf10383fe94d3ee7a148ac","383f35282369bbe076f1203bb8db614279bcdf69d3997a7ed8cd02b885aabcc9","64322c0908a6e5cce21f118b77e1bfa46ea39abb05fea77bb9369705e3b8cf47","97e9592d53be761c186124ada0363ffcf29efd028772f317e252e31edee3f84d","6e9801e6ddf7c3eeeda628c984737cadcfa7d075866ec59d0a66d0443aa3fd58","25d084c26f6956c51674a81f67ec88a0d6393e2582199243f06435ee0c2a88bb","bc6faa40ca044b14b715e85fef1ae84e35bd773a5aaad6b78f48d73da135e7b3","67819e5de1ef35de58abe6fcd4b48d4a9cbc9e7d3d72bdbef84366e06f8eacbd","4b6adcdca1b49c4a8dac544448a554be3dab44777a9e71dbcb616f5ae2a88cf3","eb5f405d8ca352dea6f605738c0ad6cced8837be60e64853ee067922d1bd0251","9037ebc6080ee87baf79279684015f7ebaa2a71c2b410707f0c7a5968e331ed3","0673364463a46eaccc54cada61bd168b63db49b4eafe73ef44bd3763dbfef653","0f5d7b3c98e25df635a065681dbbaf399e55459367ffb3c19169141a4704ead3","18d9c779b4f7ed8c70e708f992dfc5b0aa914460a83a1152d6456e1274fc6b11","3cadb4e33737fe417d3857edf0a8bf27029969ff3874532f22acf769943c229f","a98e4114fa6839755dce055ca4b9913ab27b0605a964ebdba14571d261fc57b9","c0dc66ec8a658536f71f7e5bf86971c960a7c8f886e76a9571ce66e950421493","cacebb42b85d8cfbf4517b65b10a68721082b4c52c1a5b5c5cb0c55074fc0060","6a5952343434321c6a4d45c219a9cfce6fb8800791e99e2b92d5e17aaa87df28","eba8c739fee9d23bf70fbccdbfc8085b96d296005128933fceed283f43cf2feb","5d875cd9f4a1f30c1311368dc34cb56ac7e2931c9bbd54cbdedb2c861c955e3e","2773252e129393cd103c62fa93b2437fc0e60783cb37f3ffb6c8e09ae15949c2",{"version":"96e15690cc2379a8b1b4d891b9714785764daf37d5af0996f9261f698b90c1b5","affectsGlobalScope":true},{"version":"3f80769e98e3c0415ebb402dfdf74d97d0d1ee6e4f3b97e6ee3bfbd3109c48e7","affectsGlobalScope":true},{"version":"be6e8ce9d89e6ae797bc5fec1dd2bf1a3e5096819a740e5f7d990ad052953f04","affectsGlobalScope":true},{"version":"6b6cfa0fa9528f829fa03a2cbcb1a9a325800daed455ef111ff15d8d6be8f39f","affectsGlobalScope":true},{"version":"2dae1085d34be82cceaa9da090d387d6a0ac7587ce93d63aa5e3ae5577338bc3","affectsGlobalScope":true},{"version":"ffae7fd73a4a74451be1de4ac54f9686aa321d0b5c633014ab336cc0b437b80a","affectsGlobalScope":true},{"version":"d1c9e5f0ccf6c9dec445e23f6c7806b2ec253fbf40975eda3851093cb7b5cace","affectsGlobalScope":true},{"version":"705d4d41c465b766928595f27e0d6e2cdbbc9b9874492052e171c92424bb7b8d","affectsGlobalScope":true},{"version":"353273db48805fa739de275b52173cb3edf2e553ef86e7813a3f6e4a1d4bddb7","affectsGlobalScope":true},{"version":"f6f74d538cfe5a140e54b23bb409c2225d0412636b8767cd6f8e91267f5b2895","affectsGlobalScope":true},{"version":"1b818842e3d38878689b2c2f3ef055ced422697dc9979976c489a06ff06a65b9","affectsGlobalScope":true},{"version":"7c0ae2a94e7a1a4571cd5dfdc4debd3833c4494ac90e008f6186b86ab61ece10","affectsGlobalScope":true},{"version":"26b491ab4cd40c8a4a797912bb77cf6656f6836d7d7dd83d110c44d3be50c7e4","affectsGlobalScope":true},"748d89f0afe6bab24b161aa0c139a2b91ba7ae37219b842ff6441fc965181713","aabcc875047a9ce097df133c01ccba6e6d1a70f9b3ebe16edfbce541b711d278","d2f0b25716bcf18895c71306abda91b5c9e5720077522060c5fec9bd1d755c03","8c107d9768a16d54f16190b0d6f33957d4bd41eef4fb7ef6b10fca0e5a39a587","cd487422606842bb084a6645f4353a8ee1de9714959c7d8cba214a460cb7f493","77bc4c8fb72b564df020bc3e2b49978f113e0388883e48d5149c4599d422529c","838fd41bfdaab921a26d32d8730b71101fd06e651d7e206324302246a9886243","f3fa1713741b3f7d07ed6bf57134fcbb6729e78f789a910b7e969403b9840a0f",{"version":"024e075321a9059640058c8b61bcf80f241318d686f5f870c33bdc769a53e559","affectsGlobalScope":true},{"version":"dfa1413db6ee4885b5fd49a8edbcd1ee08d8a983dd6b2399992da08cfc455556","affectsGlobalScope":true},"32dd1f6fa95589df742f0e5dc59a39617b85691b3d485a55d05949e6a277c341","61d73ba02b770f68da0d5df5abe6c4b892a94ecd791118d4c5eada5689127505","fe64e214cf336c5f3f188328c53bc015bfb5cd8b9a08855e8eba6154bf514dba","a6f44c7a5b4fc2e6aa37f4aff3944ca4b875e9f46f5196f93830fb88eb04e890","c3310cd0ff3c44be30be014909a718286897be09a3e4919512fb32d91e0de558","9febc93b9612a5081040535a0cc788716ec7ffc0e182517ad1057647704bc96d",{"version":"cd734a3ceb5b1343e1d92f40813437e25530eb5b7ef5154c90b46dec68e4caeb","affectsGlobalScope":true},{"version":"1d26e6d3045e6aa4c43b1b3058fc150ea0a3a05b82f832ce143cfd0d83713758","affectsGlobalScope":true},{"version":"328c9a08cfd0be25d4b3f33f60b21ffe469885f6b4d868e704fa45b4a355b7ca","affectsGlobalScope":true},{"version":"eecedc013fd6e67e7b2727cdf98fefd8dbfd833686a458157cdb305c576f2ee4","affectsGlobalScope":true},{"version":"009f50b2f451600f3b511c7532555ed02a44b93853325b72dd3b979e8ce6e58c","affectsGlobalScope":true},{"version":"2e11c2fbb7a11c2bbaf75a03876f6d0142cf5987e1deea4b1db88d175e84a8e8","affectsGlobalScope":true},{"version":"f2bf83fd6f73d59d35c157612efcf5636a02bea68dddd457edfe396241506b94","affectsGlobalScope":true},{"version":"e6c1aa24b636629fb3a8d69bf78a7d93d7f7095eb96e55cf6b30f45d3b48c2a1","affectsGlobalScope":true},{"version":"491ac07cb7139d2c9dd1fb834df8a71a34b3afd1fe7ca2abab060df7b025b974","affectsGlobalScope":true},{"version":"809d9fbd0d3d0f09074389672b7fee279bc5bbba8b4058b9fbcac91eeb904e9b","affectsGlobalScope":true},{"version":"d84104ff83394662482270c22f3db767397ead8f356c835215ef209f61331000","affectsGlobalScope":true},{"version":"9cb312e2f01112b3826155fb56d56e3e4d7ddd4ede6d0c2f87d655a39bc826ec","affectsGlobalScope":true},{"version":"8b0e1e59695dd28adf930fa4f82ee7f34789fa179837f52fcaa4e56478080974","affectsGlobalScope":true},{"version":"6ea823d5666499a02a3803899588d5337ecf7fababfc27ef1eff214526429f5b","affectsGlobalScope":true},{"version":"34e04261f8d46785867afa92ce6ce81f656228b9983927b9106605ea80399f04","affectsGlobalScope":true},{"version":"8be0e01065b88a7ae97de8138d5561ee34b4dd52dd261253652af6e2999d6220","affectsGlobalScope":true},{"version":"79560e3396417129db53868db639d5b55ec5d33253ad6ae074e94d901599bd7b","affectsGlobalScope":true},{"version":"7a1fdf8e667f526c7a0f3ad9fd8c11ddb3203837294ed277089f7bd2b82753e7","affectsGlobalScope":true},{"version":"399edc722872d367cddd6cd495369534cdbd2d30583889e83d3ab183f3446467","affectsGlobalScope":true},{"version":"953e4e86ef7d072197a5c535a547e7be231b4ab34ebba8d8fff9b752dc63c416","affectsGlobalScope":true},{"version":"90763cb92024b4f3a71ce52e121a06eb37875a7103952acf4bd34f821bc38799","affectsGlobalScope":true},{"version":"27849691ad382edde70c536ebc0a8eb8a45d69360d4b78eb49be2aeb8f0f9ed5","affectsGlobalScope":true},{"version":"1e65a598e37ecb4fa64c85f7cd420fd322612f10458dedc195a55ed7856e3ea4","affectsGlobalScope":true},{"version":"f07f6f392d85adc461612b9fc0114b19e19b03f4e0cf2b86bb17a2660aaad8b6","affectsGlobalScope":true},{"version":"e3444fd440d71f349fd854b42b955316d02249dcb5c5fd3da770388fb93a5011","affectsGlobalScope":true},{"version":"58c153487cdb0395e0602770d51dcb9b49f123e9e361dac849000ea98bac381e","affectsGlobalScope":true},{"version":"556469c9300b8bdf20ca790bccbbd6fc6697bb5d70cb5e921314fa89f2a21834","affectsGlobalScope":true},{"version":"0f7f6bb0ad58920c9f3fb76920826678bb5b7c71ea665b8653479139282039a8","affectsGlobalScope":true},{"version":"d16a8d241066333f1cce03ca06881e042a212b483b8254cc96c9596d9eb8a08c","affectsGlobalScope":true},{"version":"ba8a5a9383147b5ee09db9f7a44d99e9b2721dde4140755eed385386b724a06a","affectsGlobalScope":true},{"version":"a82fab989da9ffdf06c4cb390184f59f40a88e0f0b773fd9d30f1030a4bdd133","affectsGlobalScope":true},{"version":"3babd328660263e70db849a19469ee97eb26fdfea5159739c6ae63f11ae3a296","affectsGlobalScope":true},{"version":"d839874dd15f6ed348bace3842d483b53fb2933a67fc7e15414a6fb8513f9830","affectsGlobalScope":true},{"version":"b0bc815e0adc758ea47d6d3d0197b08f8d20edf56a8f7dda51db6576aa492ef0","affectsGlobalScope":true},{"version":"4e49bff690806c16ba10951046d8752d729031c190479e7b8d3f7ffb929add5b","affectsGlobalScope":true},{"version":"b8da7b98a977d6ccc5cd01ae6f3ac805a01390a78995be8126ee2b7ee4d8fe2c","affectsGlobalScope":true},{"version":"d90ad509192026b7ca61fbe15bb1b509c8c4377d4d184eb0f2c2f5fa6e55e207","affectsGlobalScope":true},{"version":"8e094675134039e83ea5c0e237a7f1389f6c65f66a453329c615ff2be711d4f1","affectsGlobalScope":true},{"version":"265e798c386cb4d68884c27cd3fe18b18531fdcf8b06a6f5f0457d5708409313","affectsGlobalScope":true},{"version":"1111132f62a1fa6ae7d0f4d8270351f96f4ecd605089e4e05062cc345f0ab8ba","affectsGlobalScope":true},{"version":"8ad20d4d07985a03b06755c578f8c5e61959b70c08aa6adf6834dceaa45038cc","affectsGlobalScope":true},{"version":"164cbee53b866ab7bcc1e27be9ca9425ad6ae546d428053c1390f39247ae8124","affectsGlobalScope":true},{"version":"4f4b54dad289cc7da8173f85edf66bcf34b5117d55f4f069154519cfea3ec864","affectsGlobalScope":true},{"version":"8833f137d183571bcfb39b82446abb9d1be5587de2db3e67e69e879e3c36440a","affectsGlobalScope":true},{"version":"2e543a7bcebb6b524651629de4ed05a093f30a979531c1900c7f95c3321b5a53","affectsGlobalScope":true},{"version":"110d2fbadd2fd7713a988779de06f5981e89202f470b1c6f03bcc4676e031942","affectsGlobalScope":true},{"version":"c4dea040deb2f44da458e0db699d8cc07f7a3a8273fb289c26c931cc69c34a1c","affectsGlobalScope":true},{"version":"ed0d1670088a608eaae7baebf7c3b0ad740df1f6a3fbf2e9918b4d2184b10418","affectsGlobalScope":true},{"version":"3b6e856ed84b49d4d2da000fd7c968cbb2f2f3bcb45aa5c516905bb25297a04f","affectsGlobalScope":true},{"version":"a8a6f58d770f1070c632933a238e5c2a3f9b93ee3748fca778741105ca51b42a","affectsGlobalScope":true},{"version":"9737e958668cf4d3877bde85c838d74a6f2399c55aea728330d6757f886fbd47","affectsGlobalScope":true},{"version":"a7c2fa80d163ae228a5f81cb93a1ec3f5ec18448c16ae6fa2fc0af8ff8202142","affectsGlobalScope":true},{"version":"ed92cc55553d5625fb29aa7a56ef7dafef214ba67569a5ad2090ff1210b7a7ee","affectsGlobalScope":true},{"version":"7d39efcf0a7e218d29702ad1ecfc1a819b5d19ead4e297edc51e1e4f48b01f70","affectsGlobalScope":true},{"version":"aa2a62fc51ebae2f2a69d0eeb18b7c9772b088c4bbf3d9e54455a02f98250aaa","affectsGlobalScope":true},{"version":"701ba90d14b2e21192f6184eae5927c5361449a52f7a97d24760f40de985e6a0","affectsGlobalScope":true},{"version":"7c56364ef045ad4a2a9093201e7015cb6dbd33c1789f375ae45ab745171dcd10","affectsGlobalScope":true},{"version":"ba14e8fd121b7b8ca07806f8902dedb6a78aa304cf3f29fb4d550c5174cabad8","affectsGlobalScope":true},{"version":"44ce2c9c3eab14339cf368213acd36f968652894a9c1a1db8f7980c5dfe0b062","affectsGlobalScope":true},{"version":"641703298fafc5cac58bfc067880d3a7d15dfa63014eff307fc40606d99f7695","affectsGlobalScope":true},{"version":"0258b20790ed0fd4fb112e5340d489f70f5ff353020926b395dc32e09f22a422","affectsGlobalScope":true},{"version":"fae2d8d01d5662e8c4602ffbb5c69388cc8a517c38a0d22f17c5975a008d8cfc","affectsGlobalScope":true},{"version":"8743407239e7e664b367343052be4a208d2bae2dbf09de62602c7045b642608f","affectsGlobalScope":true},{"version":"1a3d3001d09a11acca5dd4692dfbbbd526265e5bfb923f127eade807e96194a4","affectsGlobalScope":true},{"version":"bc343f02b56a1d98c7a6af5fc7518d79da9fd1f49cae4b1b97bf68de638d92e7","affectsGlobalScope":true},{"version":"2d8146043e62b7dcac961550e314acbba75fc14a78ccbebdedbdf3d29ee12bca","affectsGlobalScope":true},{"version":"c85bfc4b4d31ced03d7d3b36fd0d5c687c2fdc79810c4747087bf563b73fbec0","affectsGlobalScope":true},{"version":"6be5c828035b956f4136ccc865ecf914d1d966ecc89069e436997a595e0d47df","affectsGlobalScope":true},{"version":"e597e2399a2f5c999202e1bdfa1b0f5900f151b36b76f2d908ab74f2b4953dd4","affectsGlobalScope":true},{"version":"c7d982a2208e45043ebfd7891656f2ea115d4d119f2fc588355f7497b474b0e7","affectsGlobalScope":true},{"version":"5f1b7ef960cfed544094539c33810e5c3356bbb4901a857f240ff3bdd48d1d21","affectsGlobalScope":true},{"version":"f6a38297cf4932bad57637935c7567e5ebaba358d9d1ba05e93f09532b6e3038","affectsGlobalScope":true},{"version":"b7943bedfeb28fe2faa5e470425dd53efb5f8f7f36b2cfa8c40101490b892a95","affectsGlobalScope":true},{"version":"71b0196e3afeb2dd6864b864ea674d488de715f404b58e23e31dc05785ab8aa1","affectsGlobalScope":true},{"version":"6e4143a7da65fb171693aaeabdce2ab45918b64f4376ffec7be9bcec3d98bfaa","affectsGlobalScope":true},{"version":"fd6be01b565fca71bd6fd1f0f908c55ee0ff3ebbd1c3164226d1658da31ca662","affectsGlobalScope":true},{"version":"778132080567d22448de92f3d521fa5ee80cba17c4b402a5eee82cfd0da119cb","affectsGlobalScope":true},{"version":"5a895045b978fa050cd0ba6329ce97c435da2746a1871eb627ccce3f1667437f","affectsGlobalScope":true},{"version":"62d46230b41ce40023bd02ab1ba87f67a4a2596a3d6c62a66847ae86c4aed56f","affectsGlobalScope":true},{"version":"1667c3cea4df08f3ca882c5aa89d1d30828c5f7fbad5d7b99078cd02883c0e38","affectsGlobalScope":true},{"version":"9275648e986dd11e14b0b34d99aeebf0b632f3437fc636fe748582c3ea1f938a","affectsGlobalScope":true},{"version":"0050c919a6db04eb1161549c0b9883f07e341465f979db510381010884820c69","affectsGlobalScope":true},{"version":"8f3491349ef151050e0d8627ca0df34022a514df6552525a727fce0bd63d4d13","affectsGlobalScope":true},{"version":"dfe39326c357ad5c2793071529c2fa17016b1f33aaf2ff68f145f2bf547ba1a7","affectsGlobalScope":true},{"version":"7027679520d93e6d578e95ea194e421e709fbd20ab5a638084306cfed0c4c2f8","affectsGlobalScope":true},{"version":"5268624b0726192556c5c0be40a7a2479c40ec3b0a7732b7644ba6e079f20bf2","affectsGlobalScope":true},"5f2812985cf17f59db22b3f65ec76e1e7065d0e0d6d7f9a557e84f8a2c29e9f3",{"version":"d93627a771eb3089eb4a10d4687fda916dc9d73b02b01c3d87f6519482078863","affectsGlobalScope":true},{"version":"d084060ff7327f0c485b6efb3f1e6da0c1f7b3994b172dbb4ee49bc1993e0380","affectsGlobalScope":true},{"version":"b52776b968af86d593bbabbde7bbaf679cd482a38b0d6abe47e0510fcd135fdc","affectsGlobalScope":true},{"version":"6c61ca33af2fc0ccadf75a54f703a9ef0b9fbb4f69194ffef84e38343627012f","affectsGlobalScope":true},{"version":"3e8a96f68d24b318bc30a63344f7d4bd0d4558df1f5d2d569ab8e7b58f8d8466","affectsGlobalScope":true},"bcaa31b0ab53f1bb0ab217932b46ef1be570c5e0b71cac149d21a284b468080b",{"version":"aefc67cc89b17e4b36069d1c82be8d3b67fffb2dcf09d3469b62ddbbafd56cc9","affectsGlobalScope":true},{"version":"f7fd1042a37dbc4b80765ff070f433fc2d04194463d6f40ee4bab32c90e292ab","affectsGlobalScope":true},{"version":"0d3fe42231316be682277aa0c3e9937ed60610caec5f2d2669d30fb4846cb9be","affectsGlobalScope":true},{"version":"ccd4c143316d8784615624fb86c7fc5866321f26c64597a6b8762b46a4c6ae54","affectsGlobalScope":true},"614a2d35bf66a5f56b643ddffe9f779279eaff318a219a02d1c0fc1c4474cccd",{"version":"384d5da6f57c903720df0491e985c70ddd2591b861b268b2e694bfe3478047d2","affectsGlobalScope":true},{"version":"4b9290a110a4332145785b310afcceb4e31d0a32cfc2f686446c25bacc121f56","affectsGlobalScope":true},{"version":"5686baf6e3c4c244f2e2daaa306986619ce967cf7cf58a80e87f6b8fe4351388","affectsGlobalScope":true},{"version":"4bcfbab841de41b0a983a2312e684c0dfbeaa1e61fa801c56c85bb6c0b14b1e6","affectsGlobalScope":true},{"version":"07d4c4ef938690b1d85ab124138c8737b09b65108858b9213a1a2bc1cefa2b1f","affectsGlobalScope":true},{"version":"2fe137a03095209fe470abd521675f1729c95b416c92c6f1da15c042a7478fcb","affectsGlobalScope":true},"c92b1bbab6cd6ea02ba24a0b92f4d27779ee4b31ea12344d9d1c07ef57e1ad09","486b34258d280c4f09e089e496dbdb2ec7672010c3768492a40f86b8eafac0aa","00a046cedae69af18df1bfad757969fd5e851c6713458face8ae4ba7e1f3ae0c","f11046b75914ea9f73d1a89098b55639f253a7cda2924e16fe671cab923a347f","ead3d3722080de185007770883a2666d443e48e8cc5504ee93f0f06bd1948944",{"version":"1b69207048179b5b43ee0911a968a208b08dc2028b18bebc088575a82f7bbe68","affectsGlobalScope":true},{"version":"dd71ba6be8c2f31da0891252f3063e6f0a27a10e1b57ed7d38cc6edd10a59283","affectsGlobalScope":true},{"version":"44509a4b8ddf0b4b68698646598f5a8ec6ca919b58fc505cf1baf1fa911a68bf","affectsGlobalScope":true},{"version":"effb99c487277fc32e167f6e77bfcf84013ea2d3b56ef6424b77b36188b20ed9","affectsGlobalScope":true},{"version":"cef933f61c21263c027e234452d5fb5f87c424ba6b0920c48a2084af5fc187d4","affectsGlobalScope":true},"bd6709b0a41eb03998f47986b49dbd87c38d41923d32d16ab94335eb5b1343be"],"options":{"allowSyntheticDefaultImports":true,"alwaysStrict":true,"esModuleInterop":true,"etsAnnotationsEnable":true,"experimentalDecorators":true,"importsNotUsedAsValues":0,"module":6,"noImplicitAny":false,"noUnusedLocals":false,"noUnusedParameters":false,"skipLibCheck":false,"sourceMap":true,"target":8,"tsBuildInfoFile":"./.tsbuildinfo"},"fileIdsList":[[46,49,94,103,124,125,129,135,141,149],[64,66],[63],[149,150],[46,58,59,60,61,62],[96,99],[68,94,101,102,103,104,105,109,110,112,119,120,121,122,141,142,143,144,145],[48],[65],[49],[57,74,97,98,149],[49,64,67,73,112,149],[153],[46,74],[46,117],[74],[46],[83,84,85,86,87,88,89,90,91],[46,112],[46,74,75,76,77,78,79,80,92,93,114,115,116,118,146,147],[46,47,48,49,51,52,53,54,55,56],[46,49,74,128,131,133],[137],[46,68,123],[46,49,74],[119],[50,69,74,81],[183,184,185,186,187],[81,82],[46,69,72,73],[46,110],[46,50,70,71],[46,293],[46,74,294,295,296],[46,57,65,68,74,92,148],[48,73],[46,123,137,138,139,140],[136,137,138],[46,68,125,128,129,130,132,133,134],[55,66,110],[103],[46,49,58,65,106,107,108,110],[59,60,61],[49,94,99,119],[46,51,68,72,97,105,109],[112],[54,55,66,110],[74,103,119],[57,63],[46,49,53,55,64,65,66,74,94,95,99,100,101,102,103,104,110,111,149,150],[46,49,65,94,99,100,101,102,103,111,119],[83,87,148],[85,88,148],[83,84,86,148],[50,81,82],[85,87],[83],[87,88,148],[127,128,132],[126,127],[128,133,134],[133],[47,51,52,57],[47,50,57],[51,55,57],[47,53,54,57],[184,185,187],[183,184,185,186],[46,184],[78],[82,87],[74,78,83,86,110,114,117,118,147,148,173,174,175,176,177,178,179,180],[188],[92],[46,49],[149],[46,71,82,178],[160,161,162,163,164,165,166,167,168,169,170,171,172,181,182,189,190,191,192,193,194,195,196,197,198,199,200,202,203,204,205,206,207,208,209,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,276,277,278,279,280,282,283,284,285,287,288,289,290,291,292,298,299,300,301,302,304,305,306,307,308,309,310,311,312,313,314,315,316,317],[46,149],[275],[281],[286],[50,83],[297],[180],[49,64,65,149,150,151],[151,154],[79],[151]],"referencedMap":[[136,1],[67,2],[64,3],[106,4],[63,5],[100,6],[146,7],[98,8],[66,9],[95,10],[107,2],[99,11],[150,12],[154,13],[116,14],[118,15],[71,16],[77,17],[92,18],[114,19],[148,20],[57,21],[132,22],[138,23],[137,24],[117,25],[153,26],[82,27],[188,28],[281,29],[76,17],[74,30],[147,14],[295,31],[78,17],[72,32],[79,17],[73,17],[294,33],[293,17],[297,34],[149,35],[103,10],[94,36],[141,37],[139,38],[124,10],[135,39],[121,40],[104,41],[109,42],[62,43],[145,44],[110,45],[143,46],[119,47],[122,26],[144,48],[58,49],[112,50],[120,51],[142,26],[88,52],[86,53],[87,54],[83,55],[91,56],[89,52],[84,57],[90,58],[133,59],[128,60],[131,61],[134,62],[53,63],[51,64],[56,65],[54,63],[55,66],[186,67],[187,68],[185,69],[160,70],[161,70],[167,71],[181,72],[189,73],[191,74],[194,70],[199,75],[205,76],[217,77],[303,78],[233,79],[235,79],[237,74],[240,57],[243,17],[276,80],[282,81],[287,82],[291,83],[292,17],[298,84],[290,85],[113,79],[152,86],[155,87],[156,88],[157,89],[158,89],[159,89]],"exportedModulesMap":[[136,1],[67,2],[64,3],[106,4],[63,5],[100,6],[146,7],[98,8],[66,9],[95,10],[107,2],[99,11],[150,12],[154,13],[116,14],[118,15],[71,16],[77,17],[92,18],[114,19],[148,20],[57,21],[132,22],[138,23],[137,24],[117,25],[153,26],[82,27],[188,28],[281,29],[76,17],[74,30],[147,14],[295,31],[78,17],[72,32],[79,17],[73,17],[294,33],[293,17],[297,34],[149,35],[103,10],[94,36],[141,37],[139,38],[124,10],[135,39],[121,40],[104,41],[109,42],[62,43],[145,44],[110,45],[143,46],[119,47],[122,26],[144,48],[58,49],[112,50],[120,51],[142,26],[88,52],[86,53],[87,54],[83,55],[91,56],[89,52],[84,57],[90,58],[133,59],[128,60],[131,61],[134,62],[53,63],[51,64],[56,65],[54,63],[55,66],[186,67],[187,68],[185,69],[160,70],[161,70],[167,71],[181,72],[189,73],[191,74],[194,70],[199,75],[205,76],[217,77],[303,78],[233,79],[235,79],[237,74],[240,57],[243,17],[276,80],[282,81],[287,82],[291,83],[292,17],[298,84],[290,85],[113,79],[152,86],[155,87],[156,88],[157,89],[158,89],[159,89]],"semanticDiagnosticsPerFile":[136,93,67,64,106,108,63,100,146,98,96,66,65,97,95,107,111,99,150,49,154,116,80,118,71,77,92,114,177,180,148,46,57,132,138,137,117,173,153,75,69,81,82,188,281,179,151,286,178,115,76,74,174,147,295,78,72,79,73,294,293,296,297,149,103,94,141,139,140,124,125,135,129,121,104,60,109,62,145,59,68,110,143,105,119,122,144,61,58,112,120,102,101,142,88,275,86,85,87,83,175,91,89,84,176,90,133,128,131,127,130,134,126,53,51,56,48,54,55,47,52,123,70,50,186,187,183,185,184,160,161,162,163,164,165,166,167,168,169,170,171,172,181,182,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,207,206,208,209,210,211,213,214,215,212,216,217,218,219,220,303,272,221,222,223,224,225,226,227,229,228,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,300,265,266,267,268,269,270,302,271,274,273,277,276,278,279,280,282,283,284,285,287,288,289,291,292,301,298,290,299,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,8,45,42,43,44,1,113,152,155,156,157,158,159],"arktsLinterDiagnosticsPerFile":[136,93,67,64,106,108,63,100,146,98,96,66,65,97,95,107,111,99,150,49,154,116,80,118,71,77,92,114,177,180,148,46,57,132,138,137,117,173,153,75,69,81,82,188,281,179,151,286,178,115,76,74,174,147,295,78,72,79,73,294,293,296,297,149,103,94,141,139,140,124,125,135,129,121,104,60,109,62,145,59,68,110,143,105,119,122,144,61,58,112,120,102,101,142,88,275,86,85,87,83,175,91,89,84,176,90,133,128,131,127,130,134,126,53,51,56,48,54,55,47,52,123,70,50,186,187,183,185,184,160,161,162,163,164,165,166,167,168,169,170,171,172,181,182,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,207,206,208,209,210,211,213,214,215,212,216,217,218,219,220,303,272,221,222,223,224,225,226,227,229,228,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,300,265,266,267,268,269,270,302,271,274,273,277,276,278,279,280,282,283,284,285,287,288,289,291,292,301,298,290,299,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,8,45,42,43,44,1,113,152,155,156,157,158,159],"affectedFilesPendingEmit":[[136,1],[93,1],[67,1],[64,1],[106,1],[108,1],[63,1],[100,1],[146,1],[98,1],[96,1],[66,1],[65,1],[97,1],[95,1],[107,1],[111,1],[99,1],[150,1],[49,1],[154,1],[116,1],[80,1],[118,1],[71,1],[77,1],[92,1],[114,1],[177,1],[180,1],[148,1],[46,1],[57,1],[132,1],[138,1],[137,1],[117,1],[173,1],[153,1],[75,1],[69,1],[81,1],[82,1],[188,1],[281,1],[179,1],[151,1],[286,1],[178,1],[115,1],[76,1],[74,1],[174,1],[147,1],[295,1],[78,1],[72,1],[79,1],[73,1],[294,1],[293,1],[296,1],[297,1],[149,1],[103,1],[94,1],[141,1],[139,1],[140,1],[124,1],[125,1],[135,1],[129,1],[121,1],[104,1],[60,1],[109,1],[62,1],[145,1],[59,1],[68,1],[110,1],[143,1],[105,1],[119,1],[122,1],[144,1],[61,1],[58,1],[112,1],[120,1],[102,1],[101,1],[142,1],[88,1],[275,1],[86,1],[85,1],[87,1],[83,1],[175,1],[91,1],[89,1],[84,1],[176,1],[90,1],[133,1],[128,1],[131,1],[127,1],[130,1],[134,1],[126,1],[53,1],[51,1],[56,1],[48,1],[54,1],[55,1],[47,1],[52,1],[123,1],[70,1],[50,1],[186,1],[187,1],[183,1],[185,1],[184,1],[160,1],[161,1],[162,1],[163,1],[164,1],[165,1],[166,1],[167,1],[168,1],[169,1],[170,1],[171,1],[172,1],[181,1],[182,1],[189,1],[190,1],[191,1],[192,1],[193,1],[194,1],[195,1],[196,1],[197,1],[198,1],[199,1],[200,1],[201,1],[202,1],[203,1],[204,1],[205,1],[207,1],[206,1],[208,1],[209,1],[210,1],[211,1],[213,1],[214,1],[215,1],[212,1],[216,1],[217,1],[218,1],[219,1],[220,1],[303,1],[272,1],[221,1],[222,1],[223,1],[224,1],[225,1],[226,1],[227,1],[229,1],[228,1],[230,1],[231,1],[232,1],[233,1],[234,1],[235,1],[236,1],[237,1],[238,1],[239,1],[240,1],[241,1],[242,1],[243,1],[244,1],[245,1],[246,1],[247,1],[248,1],[249,1],[250,1],[251,1],[252,1],[253,1],[254,1],[255,1],[256,1],[257,1],[258,1],[259,1],[260,1],[261,1],[262,1],[263,1],[264,1],[300,1],[265,1],[266,1],[267,1],[268,1],[269,1],[270,1],[302,1],[271,1],[274,1],[273,1],[277,1],[276,1],[278,1],[279,1],[280,1],[282,1],[283,1],[284,1],[285,1],[287,1],[288,1],[289,1],[291,1],[292,1],[301,1],[298,1],[290,1],[299,1],[2,1],[3,1],[4,1],[5,1],[6,1],[7,1],[8,1],[113,1],[152,1],[155,1],[156,1],[157,1],[158,1],[159,1]],"arkTSVersion":"ArkTS_1_1","compatibleSdkVersion":20},"version":"4.9.5"} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/.tsbuildinfo.linter b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/.tsbuildinfo.linter deleted file mode 100644 index 7c8d8a8d6ed52c552d55b2f0c36fd05008096851..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/.tsbuildinfo.linter +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es5.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2016.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2017.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2018.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2019.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2021.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.core.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.collection.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.generator.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.iterable.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.promise.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.proxy.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.reflect.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.symbol.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2016.array.include.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2017.object.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2017.string.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2017.intl.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2018.intl.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2018.promise.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2018.regexp.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2019.array.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2019.object.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2019.string.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2019.symbol.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2019.intl.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.bigint.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.date.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.promise.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.string.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.intl.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2020.number.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2021.promise.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2021.string.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2021.weakref.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/node_modules/typescript/lib/lib.es2021.intl.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.base.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/metadata.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/elementname.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.want.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/global/resource.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/applicationinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/skill.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/abilityinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/extensionabilityinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/hapmoduleinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundlemanager/bundleinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.bundle.bundlemanager.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/processinformation.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/appstatedata.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/abilitystatedata.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/processdata.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/applicationstateobserver.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.appmanager.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.abilityconstant.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.configurationconstant.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.configuration.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.ability.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/basecontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.graphics.colorspacemanager.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/global/rawfiledescriptor.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.drawabledescriptor.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.resourcemanager.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.rpc.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.multimedia.image.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.font.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.mediaquery.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.inspector.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.promptaction.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.router.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.componentutils.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.graphics.common2d.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.graphics.drawing.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/graphics.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/rendernode.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/content.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/componentcontent.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/framenode.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/buildernode.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/nodecontroller.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/xcomponentnode.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/nodecontent.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.node.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.animator.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/ability/connectoptions.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.dialogrequest.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.completionhandlerforatomicservice.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.contextconstant.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.completionhandler.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.startoptions.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.atomicserviceoptions.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/uiserviceproxy.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/uiserviceextensionconnectcallback.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/ability/abilityresult.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/abilitystartcallback.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/eventhub.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.abilitylifecyclecallback.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.environmentcallback.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.applicationstatechangecallback.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/applicationcontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/context.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.openlinkoptions.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/uiabilitycontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/component/navigation.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.observer.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.measure.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.componentsnapshot.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.data.unifieddatachannel.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.dragcontroller.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/extensioncontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/uiextensioncontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/abilitystagecontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/formextensioncontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/data/rdb/resultset.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/ability/startabilityparameter.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/app/appversioninfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundle/moduleinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundle/customizedata.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundle/applicationinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/app/processinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundle/elementname.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundle/bundleinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.bundle.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundle/abilityinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/bundle/hapmoduleinfo.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/app/context.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.ability.featureability.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.data.rdb.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.data.dataability.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/ability/dataabilityoperation.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/ability/dataabilityresult.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/ability/dataabilityhelper.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/vpnextensioncontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/embeddableuiabilitycontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/photoeditorextensioncontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/application/appserviceextensioncontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.common.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.multimodalinput.pointer.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.uicontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.window.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.app.ability.uiability.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.hilog.d.ts","../../../../../../src/main/ets/entryability/entryability.ets","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.file.backupextensioncontext.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.application.backupextensionability.d.ts","../../../../../../src/main/ets/entrybackupability/entrybackupability.ets","../../../../../../src/main/ets/pages/index.ets","../../../../../../src/main/ets/pages/statetrack/statetrackclass.ets","../../../../../../src/main/ets/pages/statetrack/statetrackclass2.ets","../../../../../../src/main/ets/pages/statetrack/statetrackclass3.ets","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/action_sheet.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/alert_dialog.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/alphabet_indexer.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/badge.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/blank.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/button.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/calendar_picker.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/canvas.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/checkbox.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/checkboxgroup.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/circle.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/column.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/column_split.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.data.uniformtypedescriptor.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.multimodalinput.intentioncode.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/imagemodifier.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/symbolglyphmodifier.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.shape.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.matrix4.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.graphics.uieffect.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.arkui.theme.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/common.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/common_ts_ets_api.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/graphics3d/scenepostprocesssettings.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/graphics3d/scenetypes.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/graphics3d/sceneresources.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/graphics3d/scene.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/graphics3d/scenenodes.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.graphics.scene.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/component3d.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/container_span.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/content_slot.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/context_menu.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/counter.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/custom_dialog_controller.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/data_panel.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/date_picker.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/divider.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/ellipse.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/embedded_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/enums.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/featureability.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/flex.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/flow_item.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/focus.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/folder_stack.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/form_link.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/for_each.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/gauge.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/gesture.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/global.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/grid.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/griditem.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/grid_col.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/grid_container.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/grid_row.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/hyperlink.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/image.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/image_animator.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/image_common.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/image_span.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/lazy_for_each.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/lazy_grid_layout.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/line.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/list.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/list_item.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/list_item_group.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/loading_progress.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/matrix2d.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/marquee.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/menu.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/menu_item.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/menu_item_group.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/nav_destination.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/nav_router.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/navigation.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/navigator.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/node_container.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/page_transition.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/panel.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/particle.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/paste_button.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/path.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/pattern_lock.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/polygon.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/polyline.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/progress.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/qrcode.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/radio.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/rating.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/rect.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/refresh.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/relative_container.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/repeat.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/rich_editor.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/rich_text.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/row.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/row_split.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/save_button.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/scroll.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/scroll_bar.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/search.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/security_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/select.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/shape.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/slider.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/span.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/stack.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/state_management.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/stepper.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/stepper_item.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/swiper.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/indicatorcomponent.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/symbolglyph.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/symbol_span.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/arkui/commonmodifier.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/tabs.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/tab_content.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/text.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/text_area.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/text_clock.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.graphics.text.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/text_common.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/text_input.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/text_picker.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/text_timer.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.intl.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/time_picker.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/toggle.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/toolbar.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/with_theme.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/units.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/video.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.security.cryptoframework.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.security.cert.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.print.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.web.neterrorlist.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/api/@ohos.web.webview.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/web.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/xcomponent.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/sidebar.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/water_flow.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/styled_string.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/index-full.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/animator.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/calendar.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/form_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/media_cached_image.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/plugin_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/root_scene.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/screen.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/window_scene.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/ability_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/remote_window.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/effect_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/ui_extension_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/isolated_component.d.ts","d:/devecostudio-windows-6.0.0.858/deveco studio/sdk/default/openharmony/ets/build-tools/ets-loader/declarations/linearindicator.d.ts"],"fileInfos":[{"version":"be8b901880718680b6c067fd8083bd5b04cde401c1e1123823e3068bb2e0d282","affectsGlobalScope":true},"e8d2e50f9e8fdd312d31f97571b4c7295b8f29f7f8363498edae2a9eb113ee36","4b1854aec637e8e041eff02899e16fd3c0c78685c622336aadfd67e6604bbe1b","d6f7d47355a0167969e9a8eedfb0994f21e038d360965ec06c30f6871038900b","4735756aff7c5857de387f321633f272e2daba4950c427ab200de954340c7c13","13dfb22c1b46f9858b19fc7df54674146f3d174ccd35f0e02e8d05a3026b9ba8","33d21bcca0f7b054d0d0d402125f547c9ac77782c2df301de314143f08e81406","80510205fb587019e1ad42bfbc046d4f55f3c5a1c8b3debca7d6fe0adc93959f",{"version":"276144a8254bed55adae6f0646c37a2cd11575ac2cbc679bf7ac0419c443fd58","affectsGlobalScope":true},{"version":"3523038578cadf637fdce58f06018e144fd5b26c12e3f9c1cef14cdf92ca3d20","affectsGlobalScope":true},{"version":"28065193ddf88bf697915b9236d2d00a27e85726563e88474f166790376e10d8","affectsGlobalScope":true},{"version":"511c964513d7c2f72556554cdeb960b4f0445990d11080297a97cc7b5fa1bb68","affectsGlobalScope":true},{"version":"725daac09ec6eb9086c2bea6bbdf6d6ab2a6f49d686656c6021a4da0415fe31f","affectsGlobalScope":true},{"version":"21574b67bbedcb39a6efa00ca47e5b9402946a4d4e890abd5b51d3fd371819ba","affectsGlobalScope":true},{"version":"2415a2b1a4a521594b9837316ae3950b0c0c2f8b689defd358986bf3e263e904","affectsGlobalScope":true},{"version":"e5d8d715990d96a37f3521a3f1460679507b261eec1b42dc84d4de835997b794","affectsGlobalScope":true},{"version":"93fa2a84417c65ab8ed121a0b84536312e00a11cbf45b0006a75324d00b176d2","affectsGlobalScope":true},{"version":"a003a6051b48dc64eaa8ad83789e4c2a540f3482bed821053b6770969bd598fb","affectsGlobalScope":true},{"version":"e90857fa86cecc3bc964a2d7db9d95a0c406bebfadeb4853a01a0079936f12f7","affectsGlobalScope":true},{"version":"8bbb03589e48f10b49996064f35256e858d205dcb364428fb4cc045061b1d786","affectsGlobalScope":true},{"version":"5044747370afee4b4c247e8a14c2969d245bbcf8396295dc5a60c659d796a71f","affectsGlobalScope":true},{"version":"8e4921934f4bec04df1bee5762a8f4ad9213f0dab33ea10c5bb1ba1201070c6a","affectsGlobalScope":true},{"version":"a894424c7058bcc77c1a3c92fe289c0ff93792e583e064c683d021879479f7b8","affectsGlobalScope":true},{"version":"8f03386d697248c5d356fd53f2729b920ea124cd1414a6c22de03c5d24729277","affectsGlobalScope":true},{"version":"21ac76354ecc1324ee2e31ac5fcebfa91b1b6beb3e8c3fe6f3988538e9629c73","affectsGlobalScope":true},{"version":"ecc058373716a6bb19a4492ac553b61e3ebc0eb657407b6ea62337316885b64b","affectsGlobalScope":true},{"version":"fe7acdc1039eca904399190766d1c8766b7d2621413f972c8542dddd69612097","affectsGlobalScope":true},{"version":"c25aa843b930662d62f0e853dd1f347d08b66cdec09bd760151d4ba6ce220fe6","affectsGlobalScope":true},{"version":"3e47477f297e4fa0d556c40a872c2c45bddefa487fd054bf1f80bceb527a682b","affectsGlobalScope":true},{"version":"a902be9f4116b449dbac07ffe3f4d69abb664f8eddfaeb892225612469213788","affectsGlobalScope":true},{"version":"155d8d1e367e05af5e5708a860825785f00eabae01744cf7bc569664301415a4","affectsGlobalScope":true},{"version":"5b30b81cdeb239772daf44e6c0d5bf6adec9dbf8d534ed25c9a0e8a43b9abfff","affectsGlobalScope":true},{"version":"cdb77abf1220d79a20508bbcfddf21f0437ea8ef5939ba46f999c4987061baab","affectsGlobalScope":true},{"version":"62e02a2f5889850ed658dfde861b2ba84fb22f3663ea3b2e2f7fb3dcd1813431","affectsGlobalScope":true},{"version":"357921f26d612a4c5ac9896340e6a2beffcaf889ff5cdfcc742e9af804d1a448","affectsGlobalScope":true},{"version":"d836a4258d6b5ee12054b802002d7c9c5eb6a1adb6a654f0ee9429cbda03e1a0","affectsGlobalScope":true},{"version":"c021bff90eb33d29edfde16c9b861097bbf99aa290726d0d0ac65330aa7be85a","affectsGlobalScope":true},{"version":"1c4e64dc374ea5922d7632a52b167187ba7c7e35b34d3c1e22625be66ca1576d","affectsGlobalScope":true},{"version":"cd1bebc4db8fb52c5618ecad3f511f62c78921451c198220c5b2ee5610b4d7b9","affectsGlobalScope":true},{"version":"fb60e7c9de1306648f865b4c8ef76b7376731af3955b69551004ad3848fb8f4c","affectsGlobalScope":true},{"version":"18d23591bba5678cf57ef139e1a3daad8017b26ad6612c8c34d6fa39044b245f","affectsGlobalScope":true},{"version":"868df11ccdabb6de564f70b68aa6b379a243ef32c8f6ee6dc71056a3dd54578a","affectsGlobalScope":true},{"version":"cebef4c7f9b6afb02cd08e7288fab05d0be3e3c898c720775b8aa286e9f7cfed","affectsGlobalScope":true},{"version":"7e3c49afe9bf537f68ce2487d7996c6e5c2350c0f250939726add1efcb1bcf01","affectsGlobalScope":true},{"version":"c7673e88666f933b0d007e82e42b60e85cf606ec247033e8ee5ab5940e4be206","affectsGlobalScope":true},"18c90c5c0cc77bce15249c3b628f54126680dca8e8f800ae13c6827577d8d7ff","0885aa6e52133b13da14bd23c6e2923eb41f6587004d566b7fdcd643003f85dd","41c21e94cc18d83501abacdaf56f29ffa89e64a6dd5449580a53f7c834d487fc","734f6e14694c64bd97f1043a47397565d098937d35301b18c8670612a4e159cf","ff3b80b87f5c428ff03782f0036d2056e1f371b828f5fd1397064730c35c1c2a","76d8f54d8fa8b072116d014f52f4461a30652dc66260903f4897cbe7838ce373","5c5627008db0c037c148380ab9ed21004ad2e33df3c693a5f750a84fdb182c34","b2b5603060e1d6b2982cb5670e4c9f2864b185276e63bbc903d3a9c17ecdbfb0","90e2871e53f616739841e476f3054c5ae40255095aa2e7459222c4dc15e838b0","783616dbe6f5eb8691d1c390e7b089cbadafa32bd00b0c70c04d41407a761d69","1e597215fe046a63746dba7c4858158640e2604eedf9846eae6b349124ee29b9","ae2e5abe87b1a08b722b2eb1480ed06320c3f3f4d0d6dc44e66d08ec329d66ef","21930bd35ce5693ef61bd468014596dfaa5bd6b6c2d4f59f60844fac0eee384d","84912c4054b88f51a421edac0e72c3afffa6e13234d81b9a1aab9c9336830ce4","d6b557c3349079a11c7699cc680f0a9c9f709a09019d45e5e065985ea3919e9b","d720df61b68e1ac759fb8ee19a85b2d64d5fadc4f0f4a8c8e7b55df67a3f1775","acba4d1a0998ac6561b9a1aa15c6b1125f769f046cb38d325856a40b768cdaca","f3aeea828c0af07cee7cfacc5f7f5dd5c7f3e67d8bb63ab279c61c0642194d7c","620b7c31b289e834d976fa4c5dfd04ed9f0923ee5f7641b86fcd532baf2565b6","59076a01123585639ac35ad1ba8fd1acceee2335fe1ffcbf032d38925e47bce1","16820b43a1c139ef435c5dad03ec2a7f91c6e0fed732691ecba152ed1b44cd52","2478abad18abd3df6315d031c62f01f83a91caa634f35b17465df224608a8ac0","a8e07c1a2f8475fbab17dda22a5f51e2d26fbc39603cf3b18f9c0ae2b519e55e","9e35cb3a784322d79f1fc3e5f1f838baccf6e4897b1ba7ca58a0e85f5c62d392","2900121efc03a6a977643fe47b1f57f5d23e2ab7b4cac525ff41f6bd481ca52f","c855e91f562922633a8cbb28b6bf142242a831d861ba23475744253f5e37b95b","024f0f2569c643dc83c8e4ef7432a00186d101e7424132f88fb452f311b5d884","7b5f82b0e0cdc724a3b14a9c8bfce48ca8a5e70fa25f3f55503c4aeb84d0815e","fe89cfcf174d05ce0e14b241b1f456e98100506442bc434c254b457175043d64","a0577605aac5da0b747b491593a469584f0005416e52dce21fbb970abcd115e2","be201049e4d4638501f377c34d5318a68b41548a1a2ee577a306aabfedb05c93","95fdeb811613fe4b7db3766ace5232f7b0830a84bc4eeb5db6fa7c327d1fbbfe","9f17874d37b0bb6bc111469635ff0abddaa39c615d5459354044e5b920d8c095","ae6fbbd727e947b2214d28fb53875d98fee0cc796ece51d34f42475c0b5dfe69","7b071796c9afe1026dbc08854bd73d7f7085f97885a2699b45852808f9d3ce82","f83ee958f4e51ff58ec869784ca5403f66e111488d80ad8ed55e43fe96e79546","44f591ebb300365d6ebcda253431a049d45aa74c5717e58055d8b804bd2a8718","c59d5014d6310118454fe99540005aa81f41a72326eefd3d13ae3cb0a648b008","04d7628b1479c95bb2385477c283fdbf51afe60db51acf2449293c9303374cd8","16d269cca8715b0ca8b907859f6cce45f230f1b55a6429f267e4c5a8aa7f9d17","69634b06c488b31c03055d4544fddea21f84c1b0d052784ccd33ed6527b08131","b840440738eb0014fa755aecb6c49f70c907cca21c78a247b058156ae4bca715","329edb7e5e887dee7d365a60f139fc36de2f9a441abdd690c93bc5a45e467163","3f9b161e68bb7a52a3171cd1144254a968c8d2bb5b6b41ae30d93d5131aa5980","53a5c6a0ecdf633bea0a5ffdaeb9425b01c350ece3ef11b53301eb08bd9dbbf8","dc132b2bfd37756d5385b19a8972614ca9de8bf8264435096283230ce0d1fb2e","a480bb40ed9139c1886999772d83f2d46d4cbf86449af3c606dcca1dbc38d087","be0c35d4b8a3e29f1a98636e00b25ff9fde28e7b2a9eb7cda2c646f13751f1dc","5d1e8f9c86780f23962980d995e80f70cb90173100c4f3f1280c651c6dc22094","2238892eef3efdeaa60f96d62943897ca8c945dd6fb230ce71d2d9ce1989c30d","b77055b21a6390a1053cf3fd95a830c51b0a0b317e1639d0d029bfc637fc9984","0c98893d17a23b9b9a68328528d408ac9141b4d4e3fb5b2b38e6895c4f98aaed","a06221608f5d45845214ee4991743c1e7a6c91fa2addd3665d618abd1f940be1","5bf7782d5dc0ffb156bdb4b981e56c066247c252e7538a32efcf97ab6a65e5d4","45752fba2bcc8f837ba1eb959da11f22584ae2288b3cd0c8a0522c3aacbbd928","ee67d9b87041e39ed225a1c5e815d839985dfc9b6e12af1c96adef07b37251c7","c585cd71cd521f4373ff211223d2487faf3a467037b8e6ab0fa112551492b4c8","0cc5c94908b284934cc25e6bd28a612650b9644d64ce21248732f8ad95625cd5","105a88bf7880674f76b13a3100c47f22f72b2cbe30f42115bac1d45a772bd4a4","e6d653e5102c35235bf08d13b93ab1e229fe3fb4f734a06bf3e268f6be7fa0cd","500cd84a36eec70cf12d75d8db0482692947137231e5b56d729ee01d5799687e","486609fe99f6a3f875a7ec02440f1442f9f70d1b960b25e487d7172fff2145e0","7067a4950c4dfa1282ac4b2af9ea9d6f654ab9ca4874030b0ce08eba113bb788","5ba940e673cb292665db309eaf3cf3b6cd562c69c7d8343e92d351cafdda5de0","1415aaa37727b9d971f5d90855be88e9d6d0f91dedb5f448bac516232c0ec53e","1ee4140494ebdaa4971b592cb59603953c4f613a6707069292e04006a41eb4dd","bdc21c1c6547a171df6e036e256ea2a08ec3fff1259cef232f34b796e27cbdfa",{"version":"a1b442ee2c5708d05fa6267dafcfaaf9052aa5b1f2b96afd87d8bc768d5ffc2d","affectsGlobalScope":true},"6e44d700d4da368e0baa78517d2fd699302b6ef24908c9bfcb329e1a1ec4dae7","2fd4536b789dffa504fa1060d29618e0898f63635fc5b6ac8f8eaacc0e01a435","d73b0df62037fa7d8e447785395076fc48a7529a86d21951bba43b7c2c7e221b","ae34c262f096b945f4104faf1358983ee865fd67a31df058229ac2fc43cdc60e","18ae3d0c60ca49a89e37b243d5692b946f3863e6c6b2a5e2f806cd9fed499e81","ef2a7b4201827194eb706b950ef40889d0870f402e610cb096d86f0bb2d3bfda","33d2db33dbe83d05305a585bf6c0c083e825270b53c56ecc69584b3a6343903c","e15a16903c5239648c795bc68acdc833f6ae58daf7cbabad085e372ad2396a45","062845bbf8e7d38e456b9ad7d53248ba7e1c5b3f061edafddf0d3820488e6648","eb334428756c8c94fcf87fb74ff084f243de6595d19d5875a2e83cfdf645fd67","8e0622fd44e6fc146b3b431cd5433449bcc7660b555e6e6175926a5665353ad4","0fe10efa53a287daaccba7fa70bbf20820ead1cd0c011ad59248f04cea5f3534","6534aeb84fdb78bdf07dd551c70e5f859c28a08b00507446b1043c20526feb9d","59528c8bb0cd15a4e2b544547cd324bb3a1153ebd52beb99c1f36f5437bca908","7542f446bc5bc9148a8443618064cdd94ba23293716dc839ea17e79dee318b45","3a5f3b923aa0dbf9d743ee99961763d38576b11ba81dbcd1b90c046f52d6071e","53b8801feda0f792b5959291f0e760ed1e013a78fb4e22072b663a76eb47a368","e440c7066c19e60990f65eee96ecd5fe22cebf754376c0732a29ee4a11cfd2a4","7d81efdbf839fe9fd65d580a89b98cbde2d89a822d22e2e8e060921ddc93cc9f","f5c03ad15eee48dedd7bdef771d50369c70fa70b10523ab777e925a4c90dbbeb","e79dae84c8e3d36f8f47f2da99a824ebee5674af266cbf274355e1b058fb219b","8c804ac09102ae81cb3a5bd3698b0bbea4ee98bcf1c67ea28daf963e01743cc1","96c6b16e1aa7514e7df94ee86e534b8c06301470960072fac70099e93cf53efc","6c4a9afb20d47e984c4bf2e586b9652073cdf9f850cccee67a3eb4144ebdf147","2644ca9cd4f4d4f4192686f8df72f9e414341fcc40bf10383fe94d3ee7a148ac","383f35282369bbe076f1203bb8db614279bcdf69d3997a7ed8cd02b885aabcc9","64322c0908a6e5cce21f118b77e1bfa46ea39abb05fea77bb9369705e3b8cf47","97e9592d53be761c186124ada0363ffcf29efd028772f317e252e31edee3f84d","6e9801e6ddf7c3eeeda628c984737cadcfa7d075866ec59d0a66d0443aa3fd58","25d084c26f6956c51674a81f67ec88a0d6393e2582199243f06435ee0c2a88bb","bc6faa40ca044b14b715e85fef1ae84e35bd773a5aaad6b78f48d73da135e7b3","67819e5de1ef35de58abe6fcd4b48d4a9cbc9e7d3d72bdbef84366e06f8eacbd","4b6adcdca1b49c4a8dac544448a554be3dab44777a9e71dbcb616f5ae2a88cf3","eb5f405d8ca352dea6f605738c0ad6cced8837be60e64853ee067922d1bd0251","9037ebc6080ee87baf79279684015f7ebaa2a71c2b410707f0c7a5968e331ed3","0673364463a46eaccc54cada61bd168b63db49b4eafe73ef44bd3763dbfef653","0f5d7b3c98e25df635a065681dbbaf399e55459367ffb3c19169141a4704ead3","18d9c779b4f7ed8c70e708f992dfc5b0aa914460a83a1152d6456e1274fc6b11","3cadb4e33737fe417d3857edf0a8bf27029969ff3874532f22acf769943c229f","a98e4114fa6839755dce055ca4b9913ab27b0605a964ebdba14571d261fc57b9","c0dc66ec8a658536f71f7e5bf86971c960a7c8f886e76a9571ce66e950421493","cacebb42b85d8cfbf4517b65b10a68721082b4c52c1a5b5c5cb0c55074fc0060","6a5952343434321c6a4d45c219a9cfce6fb8800791e99e2b92d5e17aaa87df28","eba8c739fee9d23bf70fbccdbfc8085b96d296005128933fceed283f43cf2feb","5d875cd9f4a1f30c1311368dc34cb56ac7e2931c9bbd54cbdedb2c861c955e3e","2773252e129393cd103c62fa93b2437fc0e60783cb37f3ffb6c8e09ae15949c2",{"version":"96e15690cc2379a8b1b4d891b9714785764daf37d5af0996f9261f698b90c1b5","affectsGlobalScope":true},{"version":"3f80769e98e3c0415ebb402dfdf74d97d0d1ee6e4f3b97e6ee3bfbd3109c48e7","affectsGlobalScope":true},{"version":"be6e8ce9d89e6ae797bc5fec1dd2bf1a3e5096819a740e5f7d990ad052953f04","affectsGlobalScope":true},{"version":"6b6cfa0fa9528f829fa03a2cbcb1a9a325800daed455ef111ff15d8d6be8f39f","affectsGlobalScope":true},{"version":"2dae1085d34be82cceaa9da090d387d6a0ac7587ce93d63aa5e3ae5577338bc3","affectsGlobalScope":true},{"version":"ffae7fd73a4a74451be1de4ac54f9686aa321d0b5c633014ab336cc0b437b80a","affectsGlobalScope":true},{"version":"d1c9e5f0ccf6c9dec445e23f6c7806b2ec253fbf40975eda3851093cb7b5cace","affectsGlobalScope":true},{"version":"705d4d41c465b766928595f27e0d6e2cdbbc9b9874492052e171c92424bb7b8d","affectsGlobalScope":true},{"version":"353273db48805fa739de275b52173cb3edf2e553ef86e7813a3f6e4a1d4bddb7","affectsGlobalScope":true},{"version":"f6f74d538cfe5a140e54b23bb409c2225d0412636b8767cd6f8e91267f5b2895","affectsGlobalScope":true},{"version":"1b818842e3d38878689b2c2f3ef055ced422697dc9979976c489a06ff06a65b9","affectsGlobalScope":true},{"version":"7c0ae2a94e7a1a4571cd5dfdc4debd3833c4494ac90e008f6186b86ab61ece10","affectsGlobalScope":true},{"version":"26b491ab4cd40c8a4a797912bb77cf6656f6836d7d7dd83d110c44d3be50c7e4","affectsGlobalScope":true},"748d89f0afe6bab24b161aa0c139a2b91ba7ae37219b842ff6441fc965181713","aabcc875047a9ce097df133c01ccba6e6d1a70f9b3ebe16edfbce541b711d278","d2f0b25716bcf18895c71306abda91b5c9e5720077522060c5fec9bd1d755c03","8c107d9768a16d54f16190b0d6f33957d4bd41eef4fb7ef6b10fca0e5a39a587","cd487422606842bb084a6645f4353a8ee1de9714959c7d8cba214a460cb7f493","77bc4c8fb72b564df020bc3e2b49978f113e0388883e48d5149c4599d422529c","838fd41bfdaab921a26d32d8730b71101fd06e651d7e206324302246a9886243","f3fa1713741b3f7d07ed6bf57134fcbb6729e78f789a910b7e969403b9840a0f",{"version":"024e075321a9059640058c8b61bcf80f241318d686f5f870c33bdc769a53e559","affectsGlobalScope":true},{"version":"dfa1413db6ee4885b5fd49a8edbcd1ee08d8a983dd6b2399992da08cfc455556","affectsGlobalScope":true},"32dd1f6fa95589df742f0e5dc59a39617b85691b3d485a55d05949e6a277c341","61d73ba02b770f68da0d5df5abe6c4b892a94ecd791118d4c5eada5689127505","fe64e214cf336c5f3f188328c53bc015bfb5cd8b9a08855e8eba6154bf514dba","a6f44c7a5b4fc2e6aa37f4aff3944ca4b875e9f46f5196f93830fb88eb04e890","c3310cd0ff3c44be30be014909a718286897be09a3e4919512fb32d91e0de558","9febc93b9612a5081040535a0cc788716ec7ffc0e182517ad1057647704bc96d",{"version":"cd734a3ceb5b1343e1d92f40813437e25530eb5b7ef5154c90b46dec68e4caeb","affectsGlobalScope":true},{"version":"1d26e6d3045e6aa4c43b1b3058fc150ea0a3a05b82f832ce143cfd0d83713758","affectsGlobalScope":true},{"version":"328c9a08cfd0be25d4b3f33f60b21ffe469885f6b4d868e704fa45b4a355b7ca","affectsGlobalScope":true},{"version":"eecedc013fd6e67e7b2727cdf98fefd8dbfd833686a458157cdb305c576f2ee4","affectsGlobalScope":true},{"version":"009f50b2f451600f3b511c7532555ed02a44b93853325b72dd3b979e8ce6e58c","affectsGlobalScope":true},{"version":"2e11c2fbb7a11c2bbaf75a03876f6d0142cf5987e1deea4b1db88d175e84a8e8","affectsGlobalScope":true},{"version":"f2bf83fd6f73d59d35c157612efcf5636a02bea68dddd457edfe396241506b94","affectsGlobalScope":true},{"version":"e6c1aa24b636629fb3a8d69bf78a7d93d7f7095eb96e55cf6b30f45d3b48c2a1","affectsGlobalScope":true},{"version":"491ac07cb7139d2c9dd1fb834df8a71a34b3afd1fe7ca2abab060df7b025b974","affectsGlobalScope":true},{"version":"809d9fbd0d3d0f09074389672b7fee279bc5bbba8b4058b9fbcac91eeb904e9b","affectsGlobalScope":true},{"version":"d84104ff83394662482270c22f3db767397ead8f356c835215ef209f61331000","affectsGlobalScope":true},{"version":"9cb312e2f01112b3826155fb56d56e3e4d7ddd4ede6d0c2f87d655a39bc826ec","affectsGlobalScope":true},{"version":"8b0e1e59695dd28adf930fa4f82ee7f34789fa179837f52fcaa4e56478080974","affectsGlobalScope":true},{"version":"6ea823d5666499a02a3803899588d5337ecf7fababfc27ef1eff214526429f5b","affectsGlobalScope":true},{"version":"34e04261f8d46785867afa92ce6ce81f656228b9983927b9106605ea80399f04","affectsGlobalScope":true},{"version":"8be0e01065b88a7ae97de8138d5561ee34b4dd52dd261253652af6e2999d6220","affectsGlobalScope":true},{"version":"79560e3396417129db53868db639d5b55ec5d33253ad6ae074e94d901599bd7b","affectsGlobalScope":true},{"version":"7a1fdf8e667f526c7a0f3ad9fd8c11ddb3203837294ed277089f7bd2b82753e7","affectsGlobalScope":true},{"version":"399edc722872d367cddd6cd495369534cdbd2d30583889e83d3ab183f3446467","affectsGlobalScope":true},{"version":"953e4e86ef7d072197a5c535a547e7be231b4ab34ebba8d8fff9b752dc63c416","affectsGlobalScope":true},{"version":"90763cb92024b4f3a71ce52e121a06eb37875a7103952acf4bd34f821bc38799","affectsGlobalScope":true},{"version":"27849691ad382edde70c536ebc0a8eb8a45d69360d4b78eb49be2aeb8f0f9ed5","affectsGlobalScope":true},{"version":"1e65a598e37ecb4fa64c85f7cd420fd322612f10458dedc195a55ed7856e3ea4","affectsGlobalScope":true},{"version":"f07f6f392d85adc461612b9fc0114b19e19b03f4e0cf2b86bb17a2660aaad8b6","affectsGlobalScope":true},{"version":"e3444fd440d71f349fd854b42b955316d02249dcb5c5fd3da770388fb93a5011","affectsGlobalScope":true},{"version":"58c153487cdb0395e0602770d51dcb9b49f123e9e361dac849000ea98bac381e","affectsGlobalScope":true},{"version":"556469c9300b8bdf20ca790bccbbd6fc6697bb5d70cb5e921314fa89f2a21834","affectsGlobalScope":true},{"version":"0f7f6bb0ad58920c9f3fb76920826678bb5b7c71ea665b8653479139282039a8","affectsGlobalScope":true},{"version":"d16a8d241066333f1cce03ca06881e042a212b483b8254cc96c9596d9eb8a08c","affectsGlobalScope":true},{"version":"ba8a5a9383147b5ee09db9f7a44d99e9b2721dde4140755eed385386b724a06a","affectsGlobalScope":true},{"version":"a82fab989da9ffdf06c4cb390184f59f40a88e0f0b773fd9d30f1030a4bdd133","affectsGlobalScope":true},{"version":"3babd328660263e70db849a19469ee97eb26fdfea5159739c6ae63f11ae3a296","affectsGlobalScope":true},{"version":"d839874dd15f6ed348bace3842d483b53fb2933a67fc7e15414a6fb8513f9830","affectsGlobalScope":true},{"version":"b0bc815e0adc758ea47d6d3d0197b08f8d20edf56a8f7dda51db6576aa492ef0","affectsGlobalScope":true},{"version":"4e49bff690806c16ba10951046d8752d729031c190479e7b8d3f7ffb929add5b","affectsGlobalScope":true},{"version":"b8da7b98a977d6ccc5cd01ae6f3ac805a01390a78995be8126ee2b7ee4d8fe2c","affectsGlobalScope":true},{"version":"d90ad509192026b7ca61fbe15bb1b509c8c4377d4d184eb0f2c2f5fa6e55e207","affectsGlobalScope":true},{"version":"8e094675134039e83ea5c0e237a7f1389f6c65f66a453329c615ff2be711d4f1","affectsGlobalScope":true},{"version":"265e798c386cb4d68884c27cd3fe18b18531fdcf8b06a6f5f0457d5708409313","affectsGlobalScope":true},{"version":"1111132f62a1fa6ae7d0f4d8270351f96f4ecd605089e4e05062cc345f0ab8ba","affectsGlobalScope":true},{"version":"8ad20d4d07985a03b06755c578f8c5e61959b70c08aa6adf6834dceaa45038cc","affectsGlobalScope":true},{"version":"164cbee53b866ab7bcc1e27be9ca9425ad6ae546d428053c1390f39247ae8124","affectsGlobalScope":true},{"version":"4f4b54dad289cc7da8173f85edf66bcf34b5117d55f4f069154519cfea3ec864","affectsGlobalScope":true},{"version":"8833f137d183571bcfb39b82446abb9d1be5587de2db3e67e69e879e3c36440a","affectsGlobalScope":true},{"version":"2e543a7bcebb6b524651629de4ed05a093f30a979531c1900c7f95c3321b5a53","affectsGlobalScope":true},{"version":"110d2fbadd2fd7713a988779de06f5981e89202f470b1c6f03bcc4676e031942","affectsGlobalScope":true},{"version":"c4dea040deb2f44da458e0db699d8cc07f7a3a8273fb289c26c931cc69c34a1c","affectsGlobalScope":true},{"version":"ed0d1670088a608eaae7baebf7c3b0ad740df1f6a3fbf2e9918b4d2184b10418","affectsGlobalScope":true},{"version":"3b6e856ed84b49d4d2da000fd7c968cbb2f2f3bcb45aa5c516905bb25297a04f","affectsGlobalScope":true},{"version":"a8a6f58d770f1070c632933a238e5c2a3f9b93ee3748fca778741105ca51b42a","affectsGlobalScope":true},{"version":"9737e958668cf4d3877bde85c838d74a6f2399c55aea728330d6757f886fbd47","affectsGlobalScope":true},{"version":"a7c2fa80d163ae228a5f81cb93a1ec3f5ec18448c16ae6fa2fc0af8ff8202142","affectsGlobalScope":true},{"version":"ed92cc55553d5625fb29aa7a56ef7dafef214ba67569a5ad2090ff1210b7a7ee","affectsGlobalScope":true},{"version":"7d39efcf0a7e218d29702ad1ecfc1a819b5d19ead4e297edc51e1e4f48b01f70","affectsGlobalScope":true},{"version":"aa2a62fc51ebae2f2a69d0eeb18b7c9772b088c4bbf3d9e54455a02f98250aaa","affectsGlobalScope":true},{"version":"701ba90d14b2e21192f6184eae5927c5361449a52f7a97d24760f40de985e6a0","affectsGlobalScope":true},{"version":"7c56364ef045ad4a2a9093201e7015cb6dbd33c1789f375ae45ab745171dcd10","affectsGlobalScope":true},{"version":"ba14e8fd121b7b8ca07806f8902dedb6a78aa304cf3f29fb4d550c5174cabad8","affectsGlobalScope":true},{"version":"44ce2c9c3eab14339cf368213acd36f968652894a9c1a1db8f7980c5dfe0b062","affectsGlobalScope":true},{"version":"641703298fafc5cac58bfc067880d3a7d15dfa63014eff307fc40606d99f7695","affectsGlobalScope":true},{"version":"0258b20790ed0fd4fb112e5340d489f70f5ff353020926b395dc32e09f22a422","affectsGlobalScope":true},{"version":"fae2d8d01d5662e8c4602ffbb5c69388cc8a517c38a0d22f17c5975a008d8cfc","affectsGlobalScope":true},{"version":"8743407239e7e664b367343052be4a208d2bae2dbf09de62602c7045b642608f","affectsGlobalScope":true},{"version":"1a3d3001d09a11acca5dd4692dfbbbd526265e5bfb923f127eade807e96194a4","affectsGlobalScope":true},{"version":"bc343f02b56a1d98c7a6af5fc7518d79da9fd1f49cae4b1b97bf68de638d92e7","affectsGlobalScope":true},{"version":"2d8146043e62b7dcac961550e314acbba75fc14a78ccbebdedbdf3d29ee12bca","affectsGlobalScope":true},{"version":"c85bfc4b4d31ced03d7d3b36fd0d5c687c2fdc79810c4747087bf563b73fbec0","affectsGlobalScope":true},{"version":"6be5c828035b956f4136ccc865ecf914d1d966ecc89069e436997a595e0d47df","affectsGlobalScope":true},{"version":"e597e2399a2f5c999202e1bdfa1b0f5900f151b36b76f2d908ab74f2b4953dd4","affectsGlobalScope":true},{"version":"c7d982a2208e45043ebfd7891656f2ea115d4d119f2fc588355f7497b474b0e7","affectsGlobalScope":true},{"version":"5f1b7ef960cfed544094539c33810e5c3356bbb4901a857f240ff3bdd48d1d21","affectsGlobalScope":true},{"version":"f6a38297cf4932bad57637935c7567e5ebaba358d9d1ba05e93f09532b6e3038","affectsGlobalScope":true},{"version":"b7943bedfeb28fe2faa5e470425dd53efb5f8f7f36b2cfa8c40101490b892a95","affectsGlobalScope":true},{"version":"71b0196e3afeb2dd6864b864ea674d488de715f404b58e23e31dc05785ab8aa1","affectsGlobalScope":true},{"version":"6e4143a7da65fb171693aaeabdce2ab45918b64f4376ffec7be9bcec3d98bfaa","affectsGlobalScope":true},{"version":"fd6be01b565fca71bd6fd1f0f908c55ee0ff3ebbd1c3164226d1658da31ca662","affectsGlobalScope":true},{"version":"778132080567d22448de92f3d521fa5ee80cba17c4b402a5eee82cfd0da119cb","affectsGlobalScope":true},{"version":"5a895045b978fa050cd0ba6329ce97c435da2746a1871eb627ccce3f1667437f","affectsGlobalScope":true},{"version":"62d46230b41ce40023bd02ab1ba87f67a4a2596a3d6c62a66847ae86c4aed56f","affectsGlobalScope":true},{"version":"1667c3cea4df08f3ca882c5aa89d1d30828c5f7fbad5d7b99078cd02883c0e38","affectsGlobalScope":true},{"version":"9275648e986dd11e14b0b34d99aeebf0b632f3437fc636fe748582c3ea1f938a","affectsGlobalScope":true},{"version":"0050c919a6db04eb1161549c0b9883f07e341465f979db510381010884820c69","affectsGlobalScope":true},{"version":"8f3491349ef151050e0d8627ca0df34022a514df6552525a727fce0bd63d4d13","affectsGlobalScope":true},{"version":"dfe39326c357ad5c2793071529c2fa17016b1f33aaf2ff68f145f2bf547ba1a7","affectsGlobalScope":true},{"version":"7027679520d93e6d578e95ea194e421e709fbd20ab5a638084306cfed0c4c2f8","affectsGlobalScope":true},{"version":"5268624b0726192556c5c0be40a7a2479c40ec3b0a7732b7644ba6e079f20bf2","affectsGlobalScope":true},"5f2812985cf17f59db22b3f65ec76e1e7065d0e0d6d7f9a557e84f8a2c29e9f3",{"version":"d93627a771eb3089eb4a10d4687fda916dc9d73b02b01c3d87f6519482078863","affectsGlobalScope":true},{"version":"d084060ff7327f0c485b6efb3f1e6da0c1f7b3994b172dbb4ee49bc1993e0380","affectsGlobalScope":true},{"version":"b52776b968af86d593bbabbde7bbaf679cd482a38b0d6abe47e0510fcd135fdc","affectsGlobalScope":true},{"version":"6c61ca33af2fc0ccadf75a54f703a9ef0b9fbb4f69194ffef84e38343627012f","affectsGlobalScope":true},{"version":"3e8a96f68d24b318bc30a63344f7d4bd0d4558df1f5d2d569ab8e7b58f8d8466","affectsGlobalScope":true},"bcaa31b0ab53f1bb0ab217932b46ef1be570c5e0b71cac149d21a284b468080b",{"version":"aefc67cc89b17e4b36069d1c82be8d3b67fffb2dcf09d3469b62ddbbafd56cc9","affectsGlobalScope":true},{"version":"f7fd1042a37dbc4b80765ff070f433fc2d04194463d6f40ee4bab32c90e292ab","affectsGlobalScope":true},{"version":"0d3fe42231316be682277aa0c3e9937ed60610caec5f2d2669d30fb4846cb9be","affectsGlobalScope":true},{"version":"ccd4c143316d8784615624fb86c7fc5866321f26c64597a6b8762b46a4c6ae54","affectsGlobalScope":true},"614a2d35bf66a5f56b643ddffe9f779279eaff318a219a02d1c0fc1c4474cccd",{"version":"384d5da6f57c903720df0491e985c70ddd2591b861b268b2e694bfe3478047d2","affectsGlobalScope":true},{"version":"4b9290a110a4332145785b310afcceb4e31d0a32cfc2f686446c25bacc121f56","affectsGlobalScope":true},{"version":"5686baf6e3c4c244f2e2daaa306986619ce967cf7cf58a80e87f6b8fe4351388","affectsGlobalScope":true},{"version":"4bcfbab841de41b0a983a2312e684c0dfbeaa1e61fa801c56c85bb6c0b14b1e6","affectsGlobalScope":true},{"version":"07d4c4ef938690b1d85ab124138c8737b09b65108858b9213a1a2bc1cefa2b1f","affectsGlobalScope":true},{"version":"2fe137a03095209fe470abd521675f1729c95b416c92c6f1da15c042a7478fcb","affectsGlobalScope":true},"c92b1bbab6cd6ea02ba24a0b92f4d27779ee4b31ea12344d9d1c07ef57e1ad09","486b34258d280c4f09e089e496dbdb2ec7672010c3768492a40f86b8eafac0aa","00a046cedae69af18df1bfad757969fd5e851c6713458face8ae4ba7e1f3ae0c","f11046b75914ea9f73d1a89098b55639f253a7cda2924e16fe671cab923a347f","ead3d3722080de185007770883a2666d443e48e8cc5504ee93f0f06bd1948944",{"version":"1b69207048179b5b43ee0911a968a208b08dc2028b18bebc088575a82f7bbe68","affectsGlobalScope":true},{"version":"dd71ba6be8c2f31da0891252f3063e6f0a27a10e1b57ed7d38cc6edd10a59283","affectsGlobalScope":true},{"version":"44509a4b8ddf0b4b68698646598f5a8ec6ca919b58fc505cf1baf1fa911a68bf","affectsGlobalScope":true},{"version":"effb99c487277fc32e167f6e77bfcf84013ea2d3b56ef6424b77b36188b20ed9","affectsGlobalScope":true},{"version":"cef933f61c21263c027e234452d5fb5f87c424ba6b0920c48a2084af5fc187d4","affectsGlobalScope":true},"bd6709b0a41eb03998f47986b49dbd87c38d41923d32d16ab94335eb5b1343be"],"options":{"allowSyntheticDefaultImports":true,"alwaysStrict":true,"esModuleInterop":true,"etsAnnotationsEnable":true,"experimentalDecorators":true,"importsNotUsedAsValues":0,"module":6,"noImplicitAny":false,"noUnusedLocals":false,"noUnusedParameters":false,"skipLibCheck":false,"sourceMap":true,"target":8,"tsBuildInfoFile":"./.tsbuildinfo"},"fileIdsList":[[46,49,94,103,124,125,129,135,141,149],[64,66],[63],[149,150],[46,58,59,60,61,62],[96,99],[68,94,101,102,103,104,105,109,110,112,119,120,121,122,141,142,143,144,145],[48],[65],[49],[57,74,97,98,149],[49,64,67,73,112,149],[153],[46,74],[46,117],[74],[46],[83,84,85,86,87,88,89,90,91],[46,112],[46,74,75,76,77,78,79,80,92,93,114,115,116,118,146,147],[46,47,48,49,51,52,53,54,55,56],[46,49,74,128,131,133],[137],[46,68,123],[46,49,74],[119],[50,69,74,81],[183,184,185,186,187],[81,82],[46,69,72,73],[46,110],[46,50,70,71],[46,293],[46,74,294,295,296],[46,57,65,68,74,92,148],[48,73],[46,123,137,138,139,140],[136,137,138],[46,68,125,128,129,130,132,133,134],[55,66,110],[103],[46,49,58,65,106,107,108,110],[59,60,61],[49,94,99,119],[46,51,68,72,97,105,109],[112],[54,55,66,110],[74,103,119],[57,63],[46,49,53,55,64,65,66,74,94,95,99,100,101,102,103,104,110,111,149,150],[46,49,65,94,99,100,101,102,103,111,119],[83,87,148],[85,88,148],[83,84,86,148],[50,81,82],[85,87],[83],[87,88,148],[127,128,132],[126,127],[128,133,134],[133],[47,51,52,57],[47,50,57],[51,55,57],[47,53,54,57],[184,185,187],[183,184,185,186],[46,184],[78],[82,87],[74,78,83,86,110,114,117,118,147,148,173,174,175,176,177,178,179,180],[188],[92],[46,49],[149],[46,71,82,178],[160,161,162,163,164,165,166,167,168,169,170,171,172,181,182,189,190,191,192,193,194,195,196,197,198,199,200,202,203,204,205,206,207,208,209,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,276,277,278,279,280,282,283,284,285,287,288,289,290,291,292,298,299,300,301,302,304,305,306,307,308,309,310,311,312,313,314,315,316,317],[46,149],[275],[281],[286],[50,83],[297],[180],[49,64,65,149,150,151],[151,154],[79],[151]],"referencedMap":[[136,1],[67,2],[64,3],[106,4],[63,5],[100,6],[146,7],[98,8],[66,9],[95,10],[107,2],[99,11],[150,12],[154,13],[116,14],[118,15],[71,16],[77,17],[92,18],[114,19],[148,20],[57,21],[132,22],[138,23],[137,24],[117,25],[153,26],[82,27],[188,28],[281,29],[76,17],[74,30],[147,14],[295,31],[78,17],[72,32],[79,17],[73,17],[294,33],[293,17],[297,34],[149,35],[103,10],[94,36],[141,37],[139,38],[124,10],[135,39],[121,40],[104,41],[109,42],[62,43],[145,44],[110,45],[143,46],[119,47],[122,26],[144,48],[58,49],[112,50],[120,51],[142,26],[88,52],[86,53],[87,54],[83,55],[91,56],[89,52],[84,57],[90,58],[133,59],[128,60],[131,61],[134,62],[53,63],[51,64],[56,65],[54,63],[55,66],[186,67],[187,68],[185,69],[160,70],[161,70],[167,71],[181,72],[189,73],[191,74],[194,70],[199,75],[205,76],[217,77],[303,78],[233,79],[235,79],[237,74],[240,57],[243,17],[276,80],[282,81],[287,82],[291,83],[292,17],[298,84],[290,85],[113,79],[152,86],[155,87],[156,88],[157,89],[158,89],[159,89]],"exportedModulesMap":[[136,1],[67,2],[64,3],[106,4],[63,5],[100,6],[146,7],[98,8],[66,9],[95,10],[107,2],[99,11],[150,12],[154,13],[116,14],[118,15],[71,16],[77,17],[92,18],[114,19],[148,20],[57,21],[132,22],[138,23],[137,24],[117,25],[153,26],[82,27],[188,28],[281,29],[76,17],[74,30],[147,14],[295,31],[78,17],[72,32],[79,17],[73,17],[294,33],[293,17],[297,34],[149,35],[103,10],[94,36],[141,37],[139,38],[124,10],[135,39],[121,40],[104,41],[109,42],[62,43],[145,44],[110,45],[143,46],[119,47],[122,26],[144,48],[58,49],[112,50],[120,51],[142,26],[88,52],[86,53],[87,54],[83,55],[91,56],[89,52],[84,57],[90,58],[133,59],[128,60],[131,61],[134,62],[53,63],[51,64],[56,65],[54,63],[55,66],[186,67],[187,68],[185,69],[160,70],[161,70],[167,71],[181,72],[189,73],[191,74],[194,70],[199,75],[205,76],[217,77],[303,78],[233,79],[235,79],[237,74],[240,57],[243,17],[276,80],[282,81],[287,82],[291,83],[292,17],[298,84],[290,85],[113,79],[152,86],[155,87],[156,88],[157,89],[158,89],[159,89]],"semanticDiagnosticsPerFile":[136,93,67,64,106,108,63,100,146,98,96,66,65,97,95,107,111,99,150,49,154,116,80,118,71,77,92,114,177,180,148,46,57,132,138,137,117,173,153,75,69,81,82,188,281,179,151,286,178,115,76,74,174,147,295,78,72,79,73,294,293,296,297,149,103,94,141,139,140,124,125,135,129,121,104,60,109,62,145,59,68,110,143,105,119,122,144,61,58,112,120,102,101,142,88,275,86,85,87,83,175,91,89,84,176,90,133,128,131,127,130,134,126,53,51,56,48,54,55,47,52,123,70,50,186,187,183,185,184,160,161,162,163,164,165,166,167,168,169,170,171,172,181,182,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,207,206,208,209,210,211,213,214,215,212,216,217,218,219,220,303,272,221,222,223,224,225,226,227,229,228,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,300,265,266,267,268,269,270,302,271,274,273,277,276,278,279,280,282,283,284,285,287,288,289,291,292,301,298,290,299,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,8,45,42,43,44,1,113,152,155,156,157,158,159],"affectedFilesPendingEmit":[[136,1],[93,1],[67,1],[64,1],[106,1],[108,1],[63,1],[100,1],[146,1],[98,1],[96,1],[66,1],[65,1],[97,1],[95,1],[107,1],[111,1],[99,1],[150,1],[49,1],[154,1],[116,1],[80,1],[118,1],[71,1],[77,1],[92,1],[114,1],[177,1],[180,1],[148,1],[46,1],[57,1],[132,1],[138,1],[137,1],[117,1],[173,1],[153,1],[75,1],[69,1],[81,1],[82,1],[188,1],[281,1],[179,1],[151,1],[286,1],[178,1],[115,1],[76,1],[74,1],[174,1],[147,1],[295,1],[78,1],[72,1],[79,1],[73,1],[294,1],[293,1],[296,1],[297,1],[149,1],[103,1],[94,1],[141,1],[139,1],[140,1],[124,1],[125,1],[135,1],[129,1],[121,1],[104,1],[60,1],[109,1],[62,1],[145,1],[59,1],[68,1],[110,1],[143,1],[105,1],[119,1],[122,1],[144,1],[61,1],[58,1],[112,1],[120,1],[102,1],[101,1],[142,1],[88,1],[275,1],[86,1],[85,1],[87,1],[83,1],[175,1],[91,1],[89,1],[84,1],[176,1],[90,1],[133,1],[128,1],[131,1],[127,1],[130,1],[134,1],[126,1],[53,1],[51,1],[56,1],[48,1],[54,1],[55,1],[47,1],[52,1],[123,1],[70,1],[50,1],[186,1],[187,1],[183,1],[185,1],[184,1],[160,1],[161,1],[162,1],[163,1],[164,1],[165,1],[166,1],[167,1],[168,1],[169,1],[170,1],[171,1],[172,1],[181,1],[182,1],[189,1],[190,1],[191,1],[192,1],[193,1],[194,1],[195,1],[196,1],[197,1],[198,1],[199,1],[200,1],[201,1],[202,1],[203,1],[204,1],[205,1],[207,1],[206,1],[208,1],[209,1],[210,1],[211,1],[213,1],[214,1],[215,1],[212,1],[216,1],[217,1],[218,1],[219,1],[220,1],[303,1],[272,1],[221,1],[222,1],[223,1],[224,1],[225,1],[226,1],[227,1],[229,1],[228,1],[230,1],[231,1],[232,1],[233,1],[234,1],[235,1],[236,1],[237,1],[238,1],[239,1],[240,1],[241,1],[242,1],[243,1],[244,1],[245,1],[246,1],[247,1],[248,1],[249,1],[250,1],[251,1],[252,1],[253,1],[254,1],[255,1],[256,1],[257,1],[258,1],[259,1],[260,1],[261,1],[262,1],[263,1],[264,1],[300,1],[265,1],[266,1],[267,1],[268,1],[269,1],[270,1],[302,1],[271,1],[274,1],[273,1],[277,1],[276,1],[278,1],[279,1],[280,1],[282,1],[283,1],[284,1],[285,1],[287,1],[288,1],[289,1],[291,1],[292,1],[301,1],[298,1],[290,1],[299,1],[2,1],[3,1],[4,1],[5,1],[6,1],[7,1],[8,1],[113,1],[152,1],[155,1],[156,1],[157,1],[158,1],[159,1]]},"version":"4.9.5"} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/compileInfo.json b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/compileInfo.json deleted file mode 100644 index b28e1248f0f28395ac2cdb6901cb518cc89c08c1..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/compileInfo.json +++ /dev/null @@ -1 +0,0 @@ -{"buildMode":"Debug"} diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compileContextInfo.json b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compileContextInfo.json deleted file mode 100644 index 0d8d5624e62bd50d065f550968badd4d4fa70f56..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compileContextInfo.json +++ /dev/null @@ -1 +0,0 @@ -{"hspPkgNames":[],"compileEntries":["&entry/src/main/ets/entryability/EntryAbility&","&entry/src/main/ets/entrybackupability/EntryBackupAbility&","&entry/src/main/ets/pages/Index&","&entry/src/main/ets/pages/stateTrack/StateTrackClass&","&entry/src/main/ets/pages/stateTrack/StateTrackClass2&","&entry/src/main/ets/pages/stateTrack/StateTrackClass3&"],"updateVersionInfo":{}} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/EntryAbility.ets-f6598f93c1eebc0308326d60265fecbf.msgpack b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/EntryAbility.ets-f6598f93c1eebc0308326d60265fecbf.msgpack deleted file mode 100644 index 3c207e233fa3b2dc4531e2fd6f4d02e03b8f027b..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/EntryAbility.ets-f6598f93c1eebc0308326d60265fecbf.msgpack and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/EntryBackupAbility.ets-8fb6d10e24d06ab44004f738efc10e2e.msgpack b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/EntryBackupAbility.ets-8fb6d10e24d06ab44004f738efc10e2e.msgpack deleted file mode 100644 index 25b226d339f78f838c7503f7fd908cb8e8b13f17..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/EntryBackupAbility.ets-8fb6d10e24d06ab44004f738efc10e2e.msgpack and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/Index.ets-f7115e7e2e9adf05ea6e4d43448265d3.msgpack b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/Index.ets-f7115e7e2e9adf05ea6e4d43448265d3.msgpack deleted file mode 100644 index 595447e12a9116afd5f2ac85474e29e5d15b582c..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/Index.ets-f7115e7e2e9adf05ea6e4d43448265d3.msgpack and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/StateTrackClass.ets-a76e444ecb4729cdca7078404f28ee6d.msgpack b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/StateTrackClass.ets-a76e444ecb4729cdca7078404f28ee6d.msgpack deleted file mode 100644 index 1f9e5f245b372ea4441804c4e08f5cea32eacb8e..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/StateTrackClass.ets-a76e444ecb4729cdca7078404f28ee6d.msgpack and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/StateTrackClass2.ets-426162a728aaa5c0aa22aca37882af9c.msgpack b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/StateTrackClass2.ets-426162a728aaa5c0aa22aca37882af9c.msgpack deleted file mode 100644 index 2113e1d290cddda0533733b149108f664315f566..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/StateTrackClass2.ets-426162a728aaa5c0aa22aca37882af9c.msgpack and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/StateTrackClass3.ets-84f64ce016c7750122f1bb266334545c.msgpack b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/StateTrackClass3.ets-84f64ce016c7750122f1bb266334545c.msgpack deleted file mode 100644 index d8ef09e9a7857bed38b2b13ebd3bce6a59b7e3a3..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/modules/StateTrackClass3.ets-84f64ce016c7750122f1bb266334545c.msgpack and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/other/pkgName2SourceRoots.msgpack b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/other/pkgName2SourceRoots.msgpack deleted file mode 100644 index e0bdb76fe6759066b2a5f39fe5f21272c3ed36c2..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/other/pkgName2SourceRoots.msgpack +++ /dev/null @@ -1 +0,0 @@ -r@ \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/plugins/plugins.msgpack b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/plugins/plugins.msgpack deleted file mode 100644 index a4dc48aced2e4adcf1f8f755ca2f7fce524644f0..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/compiler.cache/plugins/plugins.msgpack and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/dep_info.json b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/dep_info.json deleted file mode 100644 index 54aef53cba9fdcd7c45962b531723e9f1c36e512..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/dep_info.json +++ /dev/null @@ -1 +0,0 @@ -{"resolveConflictMode":true,"depName2RootPath":{"@ohos/lottie":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\oh_modules\\.ohpm\\@ohos+lottie@2.0.24\\oh_modules\\@ohos\\lottie","@ohos/hypium":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\oh_modules\\.ohpm\\@ohos+hypium@1.0.24\\oh_modules\\@ohos\\hypium","@ohos/hamock":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\oh_modules\\.ohpm\\@ohos+hamock@1.0.0\\oh_modules\\@ohos\\hamock"},"depName2DepInfo":{"@ohos/lottie":{"dependencyType":"har","isByteCodeHar":false,"pkgRootPath":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\oh_modules\\.ohpm\\@ohos+lottie@2.0.24\\oh_modules\\@ohos\\lottie","pkgName":"@ohos/lottie","pkgVersion":"2.0.24"},"@ohos/hypium":{"dependencyType":"har","isByteCodeHar":false,"pkgRootPath":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\oh_modules\\.ohpm\\@ohos+hypium@1.0.24\\oh_modules\\@ohos\\hypium","pkgName":"@ohos/hypium","pkgVersion":"1.0.24"},"@ohos/hamock":{"dependencyType":"har","isByteCodeHar":false,"pkgRootPath":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\oh_modules\\.ohpm\\@ohos+hamock@1.0.0\\oh_modules\\@ohos\\hamock","pkgName":"@ohos/hamock","pkgVersion":"1.0.0"}}} diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entryability/EntryAbility.protoBin b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entryability/EntryAbility.protoBin deleted file mode 100644 index c4c6ce5885530baa8198444bfd92707d82407641..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entryability/EntryAbility.protoBin and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entryability/EntryAbility.ts b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entryability/EntryAbility.ts deleted file mode 100644 index 5bcadbf771a3c193901246508e307afd2401b0bf..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entryability/EntryAbility.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type AbilityConstant from "@ohos:app.ability.AbilityConstant"; -import ConfigurationConstant from "@ohos:app.ability.ConfigurationConstant"; -import UIAbility from "@ohos:app.ability.UIAbility"; -import type Want from "@ohos:app.ability.Want"; -import hilog from "@ohos:hilog"; -import type window from "@ohos:window"; -const DOMAIN = 0x0000; -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } - catch (err) { - hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err)); - } - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); - } - onDestroy(): void { - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); - } - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); - }); - } - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - onForeground(): void { - // Ability has brought to foreground - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); - } - onBackground(): void { - // Ability has back to background - hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entrybackupability/EntryBackupAbility.protoBin b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entrybackupability/EntryBackupAbility.protoBin deleted file mode 100644 index d8b47a2d6a6bbe397b00c3156f8da811e9a3053d..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entrybackupability/EntryBackupAbility.protoBin and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entrybackupability/EntryBackupAbility.ts b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entrybackupability/EntryBackupAbility.ts deleted file mode 100644 index 7a794ad4d2525b290012c0fb01421ac1f1ccb857..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entrybackupability/EntryBackupAbility.ts +++ /dev/null @@ -1,14 +0,0 @@ -import hilog from "@ohos:hilog"; -import BackupExtensionAbility from "@ohos:application.BackupExtensionAbility"; -import type { BundleVersion as BundleVersion } from "@ohos:application.BackupExtensionAbility"; -const DOMAIN = 0x0000; -export default class EntryBackupAbility extends BackupExtensionAbility { - async onBackup() { - hilog.info(DOMAIN, 'testTag', 'onBackup ok'); - await Promise.resolve(); - } - async onRestore(bundleVersion: BundleVersion) { - hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); - await Promise.resolve(); - } -} diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/Index.protoBin b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/Index.protoBin deleted file mode 100644 index 9c245cf2226475036eddc46971b3c5385fbe9d8c..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/Index.protoBin and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/Index.ts b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/Index.ts deleted file mode 100644 index cf8a553f5f1952cef8520073bc0413560edc003c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/Index.ts +++ /dev/null @@ -1,148 +0,0 @@ -if (!("finalizeConstruction" in ViewPU.prototype)) { - Reflect.set(ViewPU.prototype, "finalizeConstruction", () => { }); -} -interface Index_Params { - bgColor?: ResourceColor; -} -interface listItem { - router?: string; - name: string; - description?: string; -} -let demandList: listItem[] = [ - { - name: 'class1', - router: 'pages/stateTrack/StateTrackClass', - }, - { - name: 'class2', - router: 'pages/stateTrack/StateTrackClass2', - }, - { - name: 'class3', - router: 'pages/stateTrack/StateTrackClass3', - }, -]; -class Index extends ViewPU { - constructor(parent, params, __localStorage, elmtId = -1, paramsLambda = undefined, extraInfo) { - super(parent, __localStorage, elmtId, extraInfo); - if (typeof paramsLambda === "function") { - this.paramsGenerator_ = paramsLambda; - } - this.__bgColor = new ObservedPropertyObjectPU('#39b5fa', this, "bgColor"); - this.setInitiallyProvidedValue(params); - this.finalizeConstruction(); - } - setInitiallyProvidedValue(params: Index_Params) { - if (params.bgColor !== undefined) { - this.bgColor = params.bgColor; - } - } - updateStateVars(params: Index_Params) { - } - purgeVariableDependenciesOnElmtId(rmElmtId) { - this.__bgColor.purgeDependencyOnElmtId(rmElmtId); - } - aboutToBeDeleted() { - this.__bgColor.aboutToBeDeleted(); - SubscriberManager.Get().delete(this.id__()); - this.aboutToBeDeletedInternal(); - } - private __bgColor: ObservedPropertyObjectPU; - get bgColor() { - return this.__bgColor.get(); - } - set bgColor(newValue: ResourceColor) { - this.__bgColor.set(newValue); - } - initialRender() { - this.observeComponentCreation2((elmtId, isInitialRender) => { - Column.create(); - }, Column); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Text.create({ "id": 16777224, "type": 10003, params: [], "bundleName": "com.samples.statemanagementproject", "moduleName": "entry" }); - Text.height('5%'); - Text.width('100%'); - Text.textAlign(TextAlign.Center); - Text.fontSize(15); - Text.fontWeight(FontWeight.Bold); - Text.backgroundColor(ObservedObject.GetRawObject(this.bgColor)); - Text.fontColor(Color.White); - }, Text); - Text.pop(); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Column.create(); - Column.width('100%'); - Column.backgroundColor('#fff4f3f3'); - Column.padding({ top: 5 }); - }, Column); - this.observeComponentCreation2((elmtId, isInitialRender) => { - List.create({ space: 20, initialIndex: 0 }); - List.listDirection(Axis.Vertical); - List.scrollBar(BarState.Off); - List.friction(0.6); - List.divider({ - strokeWidth: 2, - color: 0xFFFFFF, - startMargin: 20, - endMargin: 20 - }); - List.edgeEffect(EdgeEffect.Spring); - List.contentEndOffset(50); - List.width('90%'); - }, List); - this.observeComponentCreation2((elmtId, isInitialRender) => { - ForEach.create(); - const forEachItemGenFunction = (_item, index: number) => { - const listitem = _item; - { - const itemCreation = (elmtId, isInitialRender) => { - ViewStackProcessor.StartGetAccessRecordingFor(elmtId); - ListItem.create(deepRenderFunction, true); - if (!isInitialRender) { - ListItem.pop(); - } - ViewStackProcessor.StopGetAccessRecording(); - }; - const itemCreation2 = (elmtId, isInitialRender) => { - ListItem.create(deepRenderFunction, true); - }; - const deepRenderFunction = (elmtId, isInitialRender) => { - itemCreation(elmtId, isInitialRender); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Column.create(); - Column.onClick(() => { - if (!!listitem.router) { - this.getUIContext().getRouter().pushUrl({ url: listitem.router }); - } - }); - }, Column); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Text.create(listitem.name); - Text.fontSize(15); - Text.fontColor(ObservedObject.GetRawObject(this.bgColor)); - Text.maxLines(1); - }, Text); - Text.pop(); - Column.pop(); - ListItem.pop(); - }; - this.observeComponentCreation2(itemCreation2, ListItem); - ListItem.pop(); - } - }; - this.forEachUpdateFunction(elmtId, demandList, forEachItemGenFunction, undefined, true, false); - }, ForEach); - ForEach.pop(); - List.pop(); - Column.pop(); - Column.pop(); - } - rerender() { - this.updateDirtyElements(); - } - static getEntryName(): string { - return "Index"; - } -} -registerNamedRoute(() => new Index(undefined, {}), "", { bundleName: "com.samples.statemanagementproject", moduleName: "entry", pagePath: "pages/Index", pageFullPath: "entry/src/main/ets/pages/Index", integratedHsp: "false", moduleType: "followWithHap" }); diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass.protoBin b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass.protoBin deleted file mode 100644 index ce8be6eb08c6d5b4e4ef51f941bda1308055e3d0..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass.protoBin and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass.ts b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass.ts deleted file mode 100644 index eb8b17bbd3e41799f4784a0fcdb8355598a39df3..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass.ts +++ /dev/null @@ -1,108 +0,0 @@ -if (!("finalizeConstruction" in ViewPU.prototype)) { - Reflect.set(ViewPU.prototype, "finalizeConstruction", () => { }); -} -interface Index_Params { - info?: Info; -} -import hilog from "@ohos:hilog"; -const DOMAIN_NUMBER: number = 0XFF00; -const TAG: string = '[EvtryAblity]'; -class Info { - public name: string = 'Jack'; - public age: number = 12; -} -class Index extends ViewPU { - constructor(parent, params, __localStorage, elmtId = -1, paramsLambda = undefined, extraInfo) { - super(parent, __localStorage, elmtId, extraInfo); - if (typeof paramsLambda === "function") { - this.paramsGenerator_ = paramsLambda; - } - this.__info = new ObservedPropertyObjectPU(new Info(), this, "info"); - this.setInitiallyProvidedValue(params); - this.finalizeConstruction(); - } - setInitiallyProvidedValue(params: Index_Params) { - if (params.info !== undefined) { - this.info = params.info; - } - } - updateStateVars(params: Index_Params) { - } - purgeVariableDependenciesOnElmtId(rmElmtId) { - this.__info.purgeDependencyOnElmtId(rmElmtId); - } - aboutToBeDeleted() { - this.__info.aboutToBeDeleted(); - SubscriberManager.Get().delete(this.id__()); - this.aboutToBeDeletedInternal(); - } - private __info: ObservedPropertyObjectPU; - get info() { - return this.__info.get(); - } - set info(newValue: Info) { - this.__info.set(newValue); - } - // 借助getFontSize的日志打印,可以分辨哪个组件触发了渲染 - getFontSize(id: number): number { - hilog.info(DOMAIN_NUMBER, TAG, `Component ${id} render`); - return 30; - } - initialRender() { - this.observeComponentCreation2((elmtId, isInitialRender) => { - Column.create(); - Column.height('100%'); - Column.width('100%'); - }, Column); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Text.create(`name: ${this.info.name}`); - Text.fontSize(this.getFontSize(1)); - }, Text); - Text.pop(); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Text.create(`age: ${this.info.age}`); - Text.fontSize(this.getFontSize(2)); - }, Text); - Text.pop(); - this.observeComponentCreation2((elmtId, isInitialRender) => { - // 点击当前Button,可以发现当前虽然仅改变了name属性 - // 但是依旧会触发两个Text的刷新 - // Text(`age: ${this.info.age}`)是冗余刷新 - Button.createWithLabel('change name'); - // 点击当前Button,可以发现当前虽然仅改变了name属性 - // 但是依旧会触发两个Text的刷新 - // Text(`age: ${this.info.age}`)是冗余刷新 - Button.onClick(() => { - this.info.name = 'Jane'; - }); - }, Button); - // 点击当前Button,可以发现当前虽然仅改变了name属性 - // 但是依旧会触发两个Text的刷新 - // Text(`age: ${this.info.age}`)是冗余刷新 - Button.pop(); - this.observeComponentCreation2((elmtId, isInitialRender) => { - // 点击当前Button,可以发现当前虽然仅改变了age属性 - // 但是依旧会触发两个Text的刷新 - // Text(`name: ${this.info.name}`)是冗余刷新 - Button.createWithLabel('change age'); - // 点击当前Button,可以发现当前虽然仅改变了age属性 - // 但是依旧会触发两个Text的刷新 - // Text(`name: ${this.info.name}`)是冗余刷新 - Button.onClick(() => { - this.info.age++; - }); - }, Button); - // 点击当前Button,可以发现当前虽然仅改变了age属性 - // 但是依旧会触发两个Text的刷新 - // Text(`name: ${this.info.name}`)是冗余刷新 - Button.pop(); - Column.pop(); - } - rerender() { - this.updateDirtyElements(); - } - static getEntryName(): string { - return "Index"; - } -} -registerNamedRoute(() => new Index(undefined, {}), "", { bundleName: "com.samples.statemanagementproject", moduleName: "entry", pagePath: "pages/stateTrack/StateTrackClass", pageFullPath: "entry/src/main/ets/pages/stateTrack/StateTrackClass", integratedHsp: "false", moduleType: "followWithHap" }); diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass2.protoBin b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass2.protoBin deleted file mode 100644 index af1fa36d10f69d08ba75f674338326cf72422068..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass2.protoBin and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass2.ts b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass2.ts deleted file mode 100644 index 56ddd56a874d086b7caac30de5151fc383277d10..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass2.ts +++ /dev/null @@ -1,137 +0,0 @@ -if (!("finalizeConstruction" in ViewPU.prototype)) { - Reflect.set(ViewPU.prototype, "finalizeConstruction", () => { }); -} -interface AddLog_Params { - logTrack?: LogTrack; - logNotTrack?: LogNotTrack; -} -import hilog from "@ohos:hilog"; -const DOMAIN_NUMBER: number = 0XFF00; -const TAG: string = '[EvtryAblity]'; -class LogTrack { - @Track - public str1: string; - @Track - public str2: string; - constructor(str1: string) { - this.str1 = str1; - this.str2 = 'World'; - } -} -class LogNotTrack { - public str1: string; - public str2: string; - constructor(str1: string) { - this.str1 = str1; - this.str2 = '世界'; - } -} -class AddLog extends ViewPU { - constructor(parent, params, __localStorage, elmtId = -1, paramsLambda = undefined, extraInfo) { - super(parent, __localStorage, elmtId, extraInfo); - if (typeof paramsLambda === "function") { - this.paramsGenerator_ = paramsLambda; - } - this.__logTrack = new ObservedPropertyObjectPU(new LogTrack('Hello'), this, "logTrack"); - this.__logNotTrack = new ObservedPropertyObjectPU(new LogNotTrack('你好'), this, "logNotTrack"); - this.setInitiallyProvidedValue(params); - this.finalizeConstruction(); - } - setInitiallyProvidedValue(params: AddLog_Params) { - if (params.logTrack !== undefined) { - this.logTrack = params.logTrack; - } - if (params.logNotTrack !== undefined) { - this.logNotTrack = params.logNotTrack; - } - } - updateStateVars(params: AddLog_Params) { - } - purgeVariableDependenciesOnElmtId(rmElmtId) { - this.__logTrack.purgeDependencyOnElmtId(rmElmtId); - this.__logNotTrack.purgeDependencyOnElmtId(rmElmtId); - } - aboutToBeDeleted() { - this.__logTrack.aboutToBeDeleted(); - this.__logNotTrack.aboutToBeDeleted(); - SubscriberManager.Get().delete(this.id__()); - this.aboutToBeDeletedInternal(); - } - private __logTrack: ObservedPropertyObjectPU; - get logTrack() { - return this.__logTrack.get(); - } - set logTrack(newValue: LogTrack) { - this.__logTrack.set(newValue); - } - private __logNotTrack: ObservedPropertyObjectPU; - get logNotTrack() { - return this.__logNotTrack.get(); - } - set logNotTrack(newValue: LogNotTrack) { - this.__logNotTrack.set(newValue); - } - isRender(index: number) { - hilog.info(DOMAIN_NUMBER, TAG, `Text ${index} is rendered`); - return 50; - } - initialRender() { - this.observeComponentCreation2((elmtId, isInitialRender) => { - Row.create(); - Row.height('100%'); - }, Row); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Column.create(); - Column.width('100%'); - }, Column); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Text.create(this.logTrack.str1); - Text.id('str1'); - Text.fontSize(this.isRender(1)); - Text.fontWeight(FontWeight.Bold); - }, Text); - Text.pop(); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Text.create(this.logTrack.str2); - Text.fontSize(this.isRender(2)); - Text.fontWeight(FontWeight.Bold); - }, Text); - Text.pop(); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Button.createWithLabel('change logTrack.str1'); - Button.id('str2'); - Button.onClick(() => { - this.logTrack.str1 = 'Bye'; - }); - }, Button); - Button.pop(); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Text.create(this.logNotTrack.str1); - Text.fontSize(this.isRender(3)); - Text.fontWeight(FontWeight.Bold); - }, Text); - Text.pop(); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Text.create(this.logNotTrack.str2); - Text.fontSize(this.isRender(4)); - Text.fontWeight(FontWeight.Bold); - }, Text); - Text.pop(); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Button.createWithLabel('change logNotTrack.str1'); - Button.onClick(() => { - this.logNotTrack.str1 = '再见'; - }); - }, Button); - Button.pop(); - Column.pop(); - Row.pop(); - } - rerender() { - this.updateDirtyElements(); - } - static getEntryName(): string { - return "AddLog"; - } -} -registerNamedRoute(() => new AddLog(undefined, {}), "", { bundleName: "com.samples.statemanagementproject", moduleName: "entry", pagePath: "pages/stateTrack/StateTrackClass2", pageFullPath: "entry/src/main/ets/pages/stateTrack/StateTrackClass2", integratedHsp: "false", moduleType: "followWithHap" }); diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass3.protoBin b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass3.protoBin deleted file mode 100644 index 22ab5af2e89476e295b0e6a54e0411db90d75a82..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass3.protoBin and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass3.ts b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass3.ts deleted file mode 100644 index bc1e3c5ca7f65161c5218d11d13778da1b1c73e5..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass3.ts +++ /dev/null @@ -1,95 +0,0 @@ -if (!("finalizeConstruction" in ViewPU.prototype)) { - Reflect.set(ViewPU.prototype, "finalizeConstruction", () => { }); -} -interface AddLog3_Params { - log?: Log; -} -import hilog from "@ohos:hilog"; -const DOMAIN_NUMBER: number = 0XFF00; -const TAG: string = '[EvtryAblity]'; -class Log { - @Track - public logInfo: string; - public owner: string; - public id: number; - public time: Date; - public location: string; - public reason: string; - constructor(logInfo: string) { - this.logInfo = logInfo; - this.owner = 'OH'; - this.id = 0; - this.time = new Date(); - this.location = 'CN'; - this.reason = 'NULL'; - } -} -class AddLog3 extends ViewPU { - constructor(parent, params, __localStorage, elmtId = -1, paramsLambda = undefined, extraInfo) { - super(parent, __localStorage, elmtId, extraInfo); - if (typeof paramsLambda === "function") { - this.paramsGenerator_ = paramsLambda; - } - this.__log = new ObservedPropertyObjectPU(new Log('origin info.'), this, "log"); - this.setInitiallyProvidedValue(params); - this.finalizeConstruction(); - } - setInitiallyProvidedValue(params: AddLog3_Params) { - if (params.log !== undefined) { - this.log = params.log; - } - } - updateStateVars(params: AddLog3_Params) { - } - purgeVariableDependenciesOnElmtId(rmElmtId) { - this.__log.purgeDependencyOnElmtId(rmElmtId); - } - aboutToBeDeleted() { - this.__log.aboutToBeDeleted(); - SubscriberManager.Get().delete(this.id__()); - this.aboutToBeDeletedInternal(); - } - private __log: ObservedPropertyObjectPU; - get log() { - return this.__log.get(); - } - set log(newValue: Log) { - this.__log.set(newValue); - } - initialRender() { - this.observeComponentCreation2((elmtId, isInitialRender) => { - Row.create(); - Row.height('100%'); - }, Row); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Column.create(); - Column.width('100%'); - }, Column); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Text.create(this.log.logInfo); - Text.fontSize(50); - Text.fontWeight(FontWeight.Bold); - Text.onClick(() => { - // 没有被@Track装饰的属性可以在点击事件中使用。 - hilog.info(DOMAIN_NUMBER, TAG, 'owner: ' + this.log.owner + - ' id: ' + this.log.id + - ' time: ' + this.log.time + - ' location: ' + this.log.location + - ' reason: ' + this.log.reason); - this.log.time = new Date(); - this.log.id++; - this.log.logInfo += ' info.'; - }); - }, Text); - Text.pop(); - Column.pop(); - Row.pop(); - } - rerender() { - this.updateDirtyElements(); - } - static getEntryName(): string { - return "AddLog3"; - } -} -registerNamedRoute(() => new AddLog3(undefined, {}), "", { bundleName: "com.samples.statemanagementproject", moduleName: "entry", pagePath: "pages/stateTrack/StateTrackClass3", pageFullPath: "entry/src/main/ets/pages/stateTrack/StateTrackClass3", integratedHsp: "false", moduleType: "followWithHap" }); diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/filesInfo.txt b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/filesInfo.txt deleted file mode 100644 index 57c5ea2fb8efa8b34350bede94db57d32474baf5..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/filesInfo.txt +++ /dev/null @@ -1,6 +0,0 @@ -E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entryability/EntryAbility.ts;&entry/src/main/ets/entryability/EntryAbility&;esm;entry|entry|1.0.0|src/main/ets/entryability/EntryAbility.ts;entry;false;ets -E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/Index.ts;&entry/src/main/ets/pages/Index&;esm;entry|entry|1.0.0|src/main/ets/pages/Index.ts;entry;false;ets -E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entrybackupability/EntryBackupAbility.ts;&entry/src/main/ets/entrybackupability/EntryBackupAbility&;esm;entry|entry|1.0.0|src/main/ets/entrybackupability/EntryBackupAbility.ts;entry;false;ets -E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass.ts;&entry/src/main/ets/pages/stateTrack/StateTrackClass&;esm;entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass.ts;entry;false;ets -E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass2.ts;&entry/src/main/ets/pages/stateTrack/StateTrackClass2&;esm;entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass2.ts;entry;false;ets -E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass3.ts;&entry/src/main/ets/pages/stateTrack/StateTrackClass3&;esm;entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass3.ts;entry;false;ets diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/modules.cache b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/modules.cache deleted file mode 100644 index 31b537362a03f0568525a76e2b86b390140482b9..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/modules.cache +++ /dev/null @@ -1,7 +0,0 @@ -E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entryability/EntryAbility.ts;E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entryability/EntryAbility.protoBin -E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/Index.ts;E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/Index.protoBin -E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entrybackupability/EntryBackupAbility.ts;E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/entrybackupability/EntryBackupAbility.protoBin -E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass.ts;E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass.protoBin -E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass2.ts;E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass2.protoBin -E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass3.ts;E:/applications_app_samples/code/DocsSample/ArkUISample/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/stateTrack/StateTrackClass3.protoBin -E:\applications_app_samples\code\DocsSample\ArkUISample\StateTrack\entry\build\default\cache\default\default@CompileArkTS\esmodule\debug\npmEntries.txt;E:\applications_app_samples\code\DocsSample\ArkUISample\StateTrack\entry\build\default\cache\default\default@CompileArkTS\esmodule\debug\npmEntries.protoBin diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/npmEntries.protoBin b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/npmEntries.protoBin deleted file mode 100644 index 799cf238c6029a20f1f8326e7cf8309d0a48d7df..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/npmEntries.protoBin and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/npmEntries.txt b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/npmEntries.txt deleted file mode 100644 index 5c9e7b7c87dc3f4cb7f203ad5143af2c090ecc5f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/npmEntries.txt +++ /dev/null @@ -1,7 +0,0 @@ -@system.app:@native.system.app -@ohos.app:@native.ohos.app -@system.router:@native.system.router -@system.curves:@native.system.curves -@ohos.curves:@native.ohos.curves -@system.matrix4:@native.system.matrix4 -@ohos.matrix4:@native.ohos.matrix4 diff --git a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/sourceMaps.json b/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/sourceMaps.json deleted file mode 100644 index 7a44b2cc0a2b38de4ac86dd76bc80b181627a1c0..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/sourceMaps.json +++ /dev/null @@ -1,6 +0,0 @@ -{"key": "entry|entry|1.0.0|src/main/ets/entryability/EntryAbility.ts", "val": {"version":3,"file":"EntryAbility.ets","sourceRoot":"","sources":["entry/src/main/ets/entryability/EntryAbility.ets"],"names":[],"mappings":"YAcS,eAAe;OAAE,qBAAqB;OAAE,SAAS;YAAE,IAAI;OACvD,KAAK;YACL,MAAM;AAEf,MAAM,MAAM,GAAG,MAAM,CAAC;AAEtB,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,SAAS;IACjD,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,CAAC,WAAW,GAAG,IAAI;QAClE,IAAI;YACF,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;SACvG;QAAC,OAAO,GAAG,EAAE;YACZ,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,4CAA4C,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;SACnG;QACD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,kBAAkB,CAAC,CAAC;IAClE,CAAC;IAED,SAAS,IAAI,IAAI;QACf,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC;IACnE,CAAC;IAED,mBAAmB,CAAC,WAAW,EAAE,MAAM,CAAC,WAAW,GAAG,IAAI;QACxD,yDAAyD;QACzD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,6BAA6B,CAAC,CAAC;QAE3E,WAAW,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE;YAC7C,IAAI,GAAG,CAAC,IAAI,EAAE;gBACZ,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,+CAA+C,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;gBACrG,OAAO;aACR;YACD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,mCAAmC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,oBAAoB,IAAI,IAAI;QAC1B,yDAAyD;QACzD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,8BAA8B,CAAC,CAAC;IAC9E,CAAC;IAED,YAAY,IAAI,IAAI;QAClB,oCAAoC;QACpC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC;IACtE,CAAC;IAED,YAAY,IAAI,IAAI;QAClB,iCAAiC;QACjC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC;IACtE,CAAC;CACF","entry-package-info":"entry|1.0.0"}} -{"key": "entry|entry|1.0.0|src/main/ets/entrybackupability/EntryBackupAbility.ts", "val": {"version":3,"file":"EntryBackupAbility.ets","sourceRoot":"","sources":["entry/src/main/ets/entrybackupability/EntryBackupAbility.ets"],"names":[],"mappings":"OAcS,KAAK;OACL,sBAAsB;cAAE,aAAa,IAAb,aAAa;AAE9C,MAAM,MAAM,GAAG,MAAM,CAAC;AAEtB,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,sBAAsB;IACpE,KAAK,CAAC,QAAQ;QACZ,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QAC7C,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,aAAa,EAAE,aAAa;QAC1C,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,yBAAyB,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;QACxF,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;CACF","entry-package-info":"entry|1.0.0"}} -{"key": "entry|entry|1.0.0|src/main/ets/pages/Index.ts", "val": {"version":3,"file":"Index.ets","sourceRoot":"","sources":["entry/src/main/ets/pages/Index.ets"],"names":[],"mappings":";;;;IAwCS,OAAO,GAAE,aAAa;;AAzB/B,UAAU,QAAQ;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,IAAI,UAAU,EAAE,QAAQ,EAAE,GAAG;IAC3B;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,kCAAkC;KAC3C;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,mCAAmC;KAC5C;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,mCAAmC;KAC5C;CAEF,CAAA;MAIM,KAAK;IAFZ;;;;;sDAGkC,SAAS;;;KAL1C;;;;;;;;;;;;;;;;IAKC,4CAAgB,aAAa,EAAa;QAAnC,OAAO;;;QAAP,OAAO,WAAE,aAAa;;;IAE7B;;YACE,MAAM;;;YACJ,IAAI;YAAJ,IAAI,CACD,MAAM,CAAC,IAAI;YADd,IAAI,CAED,KAAK,CAAC,MAAM;YAFf,IAAI,CAGD,SAAS,CAAC,SAAS,CAAC,MAAM;YAH7B,IAAI,CAID,QAAQ,CAAC,EAAE;YAJd,IAAI,CAKD,UAAU,CAAC,UAAU,CAAC,IAAI;YAL7B,IAAI,CAMD,eAAe,6BAAC,IAAI,CAAC,OAAO;YAN/B,IAAI,CAOD,SAAS,CAAC,KAAK,CAAC,KAAK;;QAPxB,IAAI;;YASJ,MAAM;YAAN,MAAM,CA+BL,KAAK,CAAC,MAAM;YA/Bb,MAAM,CAiCL,eAAe,CAAC,WAAW;YAjC5B,MAAM,CAkCL,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;;;YAjCjB,IAAI,QAAC,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE;YAAnC,IAAI,CAiBH,aAAa,CAAC,IAAI,CAAC,QAAQ;YAjB5B,IAAI,CAkBH,SAAS,CAAC,QAAQ,CAAC,GAAG;YAlBvB,IAAI,CAmBH,QAAQ,CAAC,GAAG;YAnBb,IAAI,CAoBH,OAAO,CAAC;gBACP,WAAW,EAAE,CAAC;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,EAAE;gBACf,SAAS,EAAE,EAAE;aACd;YAzBD,IAAI,CA0BH,UAAU,CAAC,UAAU,CAAC,MAAM;YA1B7B,IAAI,CA2BH,gBAAgB,CAAC,EAAE;YA3BpB,IAAI,CA4BH,KAAK,CAAC,KAAK;;;YA3BV,OAAO;mDAAkC,KAAK,EAAE,MAAM;;;;;;;4BACpD,QAAQ;;;;;;;;;;4BACN,MAAM;4BAAN,MAAM,CAML,OAAO,CAAC,GAAG,EAAE;gCACZ,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE;oCACrB,IAAI,CAAC,YAAY,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;iCAClE;4BACH,CAAC;;;4BATC,IAAI,QAAC,QAAQ,CAAC,IAAI;4BAAlB,IAAI,CACD,QAAQ,CAAC,EAAE;4BADd,IAAI,CAED,SAAS,6BAAC,IAAI,CAAC,OAAO;4BAFzB,IAAI,CAGD,QAAQ,CAAC,CAAC;;wBAHb,IAAI;wBADN,MAAM;wBADR,QAAQ;;;oBAAR,QAAQ;;;+CADF,UAAU;;QAAlB,OAAO;QADT,IAAI;QADN,MAAM;QAVR,MAAM;KA8CP","entry-package-info":"entry|1.0.0"}} -{"key": "entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass.ts", "val": {"version":3,"file":"StateTrackClass.ets","sourceRoot":"","sources":["entry/src/main/ets/pages/stateTrack/StateTrackClass.ets"],"names":[],"mappings":";;;;IA0BS,IAAI,GAAE,IAAI;;OAXV,KAAK;AACd,MAAM,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;AACrC,MAAM,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;AACpC,MAAM,IAAI;IACR,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,CAAC;CACzB;MAIM,KAAK;IAFZ;;;;;mDAGsB,IAAI,IAAI,EAAE;;;KAL/B;;;;;;;;;;;;;;;;IAKC,yCAAa,IAAI,EAAc;QAAxB,IAAI;;;QAAJ,IAAI,WAAE,IAAI;;;IAEjB,mCAAmC;IACnC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;QAC7B,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;QACzD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;YACE,MAAM;YAAN,MAAM,CAoBL,MAAM,CAAC,MAAM;YApBd,MAAM,CAqBL,KAAK,CAAC,MAAM;;;YApBX,IAAI,QAAC,SAAS,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAA9B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;;QAD/B,IAAI;;YAEJ,IAAI,QAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAA5B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;;QAD/B,IAAI;;YAGJ,gCAAgC;YAChC,mBAAmB;YACnB,qCAAqC;YACrC,MAAM,iBAAC,aAAa;YAHpB,gCAAgC;YAChC,mBAAmB;YACnB,qCAAqC;YACrC,MAAM,CAAgB,OAAO,CAAC,GAAG,EAAE;gBACjC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;YAC1B,CAAC;;QALD,gCAAgC;QAChC,mBAAmB;QACnB,qCAAqC;QACrC,MAAM;;YAIN,+BAA+B;YAC/B,mBAAmB;YACnB,uCAAuC;YACvC,MAAM,iBAAC,YAAY;YAHnB,+BAA+B;YAC/B,mBAAmB;YACnB,uCAAuC;YACvC,MAAM,CAAe,OAAO,CAAC,GAAG,EAAE;gBAChC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YAClB,CAAC;;QALD,+BAA+B;QAC/B,mBAAmB;QACnB,uCAAuC;QACvC,MAAM;QAhBR,MAAM;KAsBP","entry-package-info":"entry|1.0.0"}} -{"key": "entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass2.ts", "val": {"version":3,"file":"StateTrackClass2.ets","sourceRoot":"","sources":["entry/src/main/ets/pages/stateTrack/StateTrackClass2.ets"],"names":[],"mappings":";;;;IA0CS,QAAQ,GAAE,QAAQ;IAClB,WAAW,GAAE,WAAW;;OA5BxB,KAAK;AACd,MAAM,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;AACrC,MAAM,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;AAEpC,MAAM,QAAQ;IACZ,CAAC,KAAK;IAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAC3B,CAAC,KAAK;IAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAE3B,YAAY,IAAI,EAAE,MAAM;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;IACtB,CAAC;CACF;AAED,MAAM,WAAW;IACf,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAEpB,YAAY,IAAI,EAAE,MAAM;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;MAIM,MAAM;IAFb;;;;;uDAG8B,IAAI,QAAQ,CAAC,OAAO,CAAC;0DACf,IAAI,WAAW,CAAC,IAAI,CAAC;;;KANxD;;;;;;;;;;;;;;;;;;;;;IAKC,6CAAiB,QAAQ,EAAyB;QAA3C,QAAQ;;;QAAR,QAAQ,WAAE,QAAQ;;;IACzB,gDAAoB,WAAW,EAAyB;QAAjD,WAAW;;;QAAX,WAAW,WAAE,WAAW;;;IAE/B,QAAQ,CAAC,KAAK,EAAE,MAAM;QACpB,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,QAAQ,KAAK,cAAc,CAAC,CAAC;QAC5D,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;YACE,GAAG;YAAH,GAAG,CA2BF,MAAM,CAAC,MAAM;;;YA1BZ,MAAM;YAAN,MAAM,CAwBL,KAAK,CAAC,MAAM;;;YAvBX,IAAI,QAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;YAAvB,IAAI,CACD,EAAE,CAAC,MAAM;YADZ,IAAI,CAED,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAF5B,IAAI,CAGD,UAAU,CAAC,UAAU,CAAC,IAAI;;QAH7B,IAAI;;YAIJ,IAAI,QAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;YAAvB,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAD5B,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;;QAF7B,IAAI;;YAGJ,MAAM,iBAAC,sBAAsB;YAA7B,MAAM,CACH,EAAE,CAAC,MAAM;YADZ,MAAM,CAEH,OAAO,CAAC,GAAG,EAAE;gBACZ,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;YAC7B,CAAC;;QAJH,MAAM;;YAKN,IAAI,QAAC,IAAI,CAAC,WAAW,CAAC,IAAI;YAA1B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAD5B,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;;QAF7B,IAAI;;YAGJ,IAAI,QAAC,IAAI,CAAC,WAAW,CAAC,IAAI;YAA1B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAD5B,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;;QAF7B,IAAI;;YAGJ,MAAM,iBAAC,yBAAyB;YAAhC,MAAM,CACH,OAAO,CAAC,GAAG,EAAE;gBACZ,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC;YAC/B,CAAC;;QAHH,MAAM;QAnBR,MAAM;QADR,GAAG;KA4BJ","entry-package-info":"entry|1.0.0"}} -{"key": "entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass3.ts", "val": {"version":3,"file":"StateTrackClass3.ets","sourceRoot":"","sources":["entry/src/main/ets/pages/stateTrack/StateTrackClass3.ets"],"names":[],"mappings":";;;;IAuCS,GAAG,GAAE,GAAG;;OAxBR,KAAK;AACd,MAAM,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;AACrC,MAAM,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;AACpC,MAAM,GAAG;IACP,CAAC,KAAK;IAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC;IAC9B,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC;IAClB,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAEtB,YAAY,OAAO,EAAE,MAAM;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;MAIM,OAAO;IAFd;;;;;kDAGoB,IAAI,GAAG,CAAC,cAAc,CAAC;;;KAL1C;;;;;;;;;;;;;;;;IAKC,wCAAY,GAAG,EAA2B;QAAnC,GAAG;;;QAAH,GAAG,WAAE,GAAG;;;IAEf;;YACE,GAAG;YAAH,GAAG,CAoBF,MAAM,CAAC,MAAM;;;YAnBZ,MAAM;YAAN,MAAM,CAiBL,KAAK,CAAC,MAAM;;;YAhBX,IAAI,QAAC,IAAI,CAAC,GAAG,CAAC,OAAO;YAArB,IAAI,CACD,QAAQ,CAAC,EAAE;YADd,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;YAF7B,IAAI,CAGD,OAAO,CAAC,GAAG,EAAE;gBACZ,4BAA4B;gBAC5B,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK;oBACvD,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE;oBACrB,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI;oBACzB,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ;oBACjC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACjC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBAEd,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,QAAQ,CAAC;YAC/B,CAAC;;QAdH,IAAI;QADN,MAAM;QADR,GAAG;KAqBJ","entry-package-info":"entry|1.0.0"}} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/generated/profile/default/BuildProfile.ets b/ArkUIKit/StateTrack/entry/build/default/generated/profile/default/BuildProfile.ets deleted file mode 100644 index 4f86832954caa31222c0fa6d6dd603bbc07b6efa..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/generated/profile/default/BuildProfile.ets +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Use these variables when you tailor your ArkTS code. They must be of the const type. - */ -export const BUNDLE_NAME = 'com.samples.statemanagementproject'; -export const BUNDLE_TYPE = 'app'; -export const VERSION_CODE = 1000000; -export const VERSION_NAME = '1.0.0'; -export const TARGET_NAME = 'default'; -export const PRODUCT_NAME = 'default'; -export const BUILD_MODE_NAME = 'debug'; -export const DEBUG = true; - -/** - * BuildProfile Class is used only for compatibility purposes. - */ -export default class BuildProfile { - static readonly BUNDLE_NAME = BUNDLE_NAME; - static readonly BUNDLE_TYPE = BUNDLE_TYPE; - static readonly VERSION_CODE = VERSION_CODE; - static readonly VERSION_NAME = VERSION_NAME; - static readonly TARGET_NAME = TARGET_NAME; - static readonly PRODUCT_NAME = PRODUCT_NAME; - static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; - static readonly DEBUG = DEBUG; -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/generated/r/default/ResourceTable.h b/ArkUIKit/StateTrack/entry/build/default/generated/r/default/ResourceTable.h deleted file mode 100644 index 22787e235e2f4991242507368b2c6b6b769cb12c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/generated/r/default/ResourceTable.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -#ifndef RESOURCE_TABLE_H -#define RESOURCE_TABLE_H - -#include - -namespace OHOS { -const int32_t STRING_ENTRYABILITY_DESC = 0x01000004; -const int32_t STRING_ENTRYABILITY_LABEL = 0x01000005; -const int32_t STRING_APP_NAME = 0x01000000; -const int32_t STRING_MODULE_DESC = 0x01000006; -const int32_t STRING_STATE_HELLO = 0x01000007; -const int32_t STRING_STATE_LAYOUT = 0x01000008; -const int32_t COLOR_START_WINDOW_BACKGROUND = 0x01000009; -const int32_t FLOAT_PAGE_TEXT_FONT_SIZE = 0x0100000a; -const int32_t MEDIA_BACKGROUND = 0x01000001; -const int32_t MEDIA_FOREGROUND = 0x01000002; -const int32_t MEDIA_LAYERED_IMAGE = 0x01000003; -const int32_t MEDIA_STARTICON = 0x0100000b; -const int32_t PROFILE_BACKUP_CONFIG = 0x0100000c; -const int32_t PROFILE_MAIN_PAGES = 0x0100000d; -} -#endif \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/hap_metadata/default/output_metadata.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/hap_metadata/default/output_metadata.json deleted file mode 100644 index 2d6e4e7b9ac2016ac77625baa0e8479d4446a5e4..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/hap_metadata/default/output_metadata.json +++ /dev/null @@ -1 +0,0 @@ -[{"hapName":"entry-default-unsigned.hap","deviceTypes":["default"],"isSigned":false}] diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/loader/default/loader.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/loader/default/loader.json deleted file mode 100644 index 784155bb8011b6955661fd5f20ccb6c358240dd3..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/loader/default/loader.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "modulePathMap": { - "entry": "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry" - }, - "compileMode": "esmodule", - "projectRootPath": "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack", - "nodeModulesPath": "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\loader_out\\default\\node_modules", - "byteCodeHarInfo": {}, - "declarationEntry": [], - "moduleName": "entry", - "hspNameOhmMap": {}, - "harNameOhmMap": {}, - "packageManagerType": "ohpm", - "compileEntry": [], - "otherCompileFiles": [], - "dynamicImportLibInfo": {}, - "routerMap": [], - "hspResourcesMap": {}, - "updateVersionInfo": {}, - "anBuildOutPut": "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\loader_out\\default\\an\\arm64-v8a", - "anBuildMode": "type", - "patchConfig": { - "changedFileList": "E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\patch\\default\\changedFileList.json" - } -} diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/loader/default/pkgContextInfo.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/loader/default/pkgContextInfo.json deleted file mode 100644 index 8cbda1a775fe255da423b0efb264b98a04d3c34a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/loader/default/pkgContextInfo.json +++ /dev/null @@ -1 +0,0 @@ -{"@ohos/lottie":{"packageName":"@ohos/lottie","bundleName":"","moduleName":"","version":"2.0.24","entryPath":"src/main/js/modules/full.js","isSO":false,"dependencyAlias":""},"@ohos/hypium":{"packageName":"@ohos/hypium","bundleName":"","moduleName":"","version":"1.0.24","entryPath":"index.js","isSO":false,"dependencyAlias":""},"@ohos/hamock":{"packageName":"@ohos/hamock","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"entry":{"packageName":"entry","bundleName":"","moduleName":"","version":"","entryPath":"src/main/","isSO":false,"dependencyAlias":""}} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/loader_out/default/ets/modules.abc b/ArkUIKit/StateTrack/entry/build/default/intermediates/loader_out/default/ets/modules.abc deleted file mode 100644 index 8e4cae44f6132489bafe4e1fbac72926c1e035f4..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/intermediates/loader_out/default/ets/modules.abc and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/loader_out/default/ets/sourceMaps.map b/ArkUIKit/StateTrack/entry/build/default/intermediates/loader_out/default/ets/sourceMaps.map deleted file mode 100644 index a6020f8e9584da6d7103cdae1a1ab2c00790b3c6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/loader_out/default/ets/sourceMaps.map +++ /dev/null @@ -1,68 +0,0 @@ -{ - "entry|entry|1.0.0|src/main/ets/entryability/EntryAbility.ts": { - "version": 3, - "file": "EntryAbility.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/entryability/EntryAbility.ets" - ], - "names": [], - "mappings": "YAcS,eAAe;OAAE,qBAAqB;OAAE,SAAS;YAAE,IAAI;OACvD,KAAK;YACL,MAAM;AAEf,MAAM,MAAM,GAAG,MAAM,CAAC;AAEtB,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,SAAS;IACjD,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,CAAC,WAAW,GAAG,IAAI;QAClE,IAAI;YACF,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;SACvG;QAAC,OAAO,GAAG,EAAE;YACZ,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,4CAA4C,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;SACnG;QACD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,kBAAkB,CAAC,CAAC;IAClE,CAAC;IAED,SAAS,IAAI,IAAI;QACf,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC;IACnE,CAAC;IAED,mBAAmB,CAAC,WAAW,EAAE,MAAM,CAAC,WAAW,GAAG,IAAI;QACxD,yDAAyD;QACzD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,6BAA6B,CAAC,CAAC;QAE3E,WAAW,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE;YAC7C,IAAI,GAAG,CAAC,IAAI,EAAE;gBACZ,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,+CAA+C,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;gBACrG,OAAO;aACR;YACD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,mCAAmC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,oBAAoB,IAAI,IAAI;QAC1B,yDAAyD;QACzD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,8BAA8B,CAAC,CAAC;IAC9E,CAAC;IAED,YAAY,IAAI,IAAI;QAClB,oCAAoC;QACpC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC;IACtE,CAAC;IAED,YAAY,IAAI,IAAI;QAClB,iCAAiC;QACjC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC;IACtE,CAAC;CACF", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/entrybackupability/EntryBackupAbility.ts": { - "version": 3, - "file": "EntryBackupAbility.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/entrybackupability/EntryBackupAbility.ets" - ], - "names": [], - "mappings": "OAcS,KAAK;OACL,sBAAsB;cAAE,aAAa,IAAb,aAAa;AAE9C,MAAM,MAAM,GAAG,MAAM,CAAC;AAEtB,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,sBAAsB;IACpE,KAAK,CAAC,QAAQ;QACZ,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QAC7C,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,aAAa,EAAE,aAAa;QAC1C,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,yBAAyB,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;QACxF,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;CACF", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/pages/Index.ts": { - "version": 3, - "file": "Index.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/pages/Index.ets" - ], - "names": [], - "mappings": ";;;;IAwCS,OAAO,GAAE,aAAa;;AAzB/B,UAAU,QAAQ;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,IAAI,UAAU,EAAE,QAAQ,EAAE,GAAG;IAC3B;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,kCAAkC;KAC3C;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,mCAAmC;KAC5C;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,mCAAmC;KAC5C;CAEF,CAAA;MAIM,KAAK;IAFZ;;;;;sDAGkC,SAAS;;;KAL1C;;;;;;;;;;;;;;;;IAKC,4CAAgB,aAAa,EAAa;QAAnC,OAAO;;;QAAP,OAAO,WAAE,aAAa;;;IAE7B;;YACE,MAAM;;;YACJ,IAAI;YAAJ,IAAI,CACD,MAAM,CAAC,IAAI;YADd,IAAI,CAED,KAAK,CAAC,MAAM;YAFf,IAAI,CAGD,SAAS,CAAC,SAAS,CAAC,MAAM;YAH7B,IAAI,CAID,QAAQ,CAAC,EAAE;YAJd,IAAI,CAKD,UAAU,CAAC,UAAU,CAAC,IAAI;YAL7B,IAAI,CAMD,eAAe,6BAAC,IAAI,CAAC,OAAO;YAN/B,IAAI,CAOD,SAAS,CAAC,KAAK,CAAC,KAAK;;QAPxB,IAAI;;YASJ,MAAM;YAAN,MAAM,CA+BL,KAAK,CAAC,MAAM;YA/Bb,MAAM,CAiCL,eAAe,CAAC,WAAW;YAjC5B,MAAM,CAkCL,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;;;YAjCjB,IAAI,QAAC,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE;YAAnC,IAAI,CAiBH,aAAa,CAAC,IAAI,CAAC,QAAQ;YAjB5B,IAAI,CAkBH,SAAS,CAAC,QAAQ,CAAC,GAAG;YAlBvB,IAAI,CAmBH,QAAQ,CAAC,GAAG;YAnBb,IAAI,CAoBH,OAAO,CAAC;gBACP,WAAW,EAAE,CAAC;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,EAAE;gBACf,SAAS,EAAE,EAAE;aACd;YAzBD,IAAI,CA0BH,UAAU,CAAC,UAAU,CAAC,MAAM;YA1B7B,IAAI,CA2BH,gBAAgB,CAAC,EAAE;YA3BpB,IAAI,CA4BH,KAAK,CAAC,KAAK;;;YA3BV,OAAO;mDAAkC,KAAK,EAAE,MAAM;;;;;;;4BACpD,QAAQ;;;;;;;;;;4BACN,MAAM;4BAAN,MAAM,CAML,OAAO,CAAC,GAAG,EAAE;gCACZ,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE;oCACrB,IAAI,CAAC,YAAY,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;iCAClE;4BACH,CAAC;;;4BATC,IAAI,QAAC,QAAQ,CAAC,IAAI;4BAAlB,IAAI,CACD,QAAQ,CAAC,EAAE;4BADd,IAAI,CAED,SAAS,6BAAC,IAAI,CAAC,OAAO;4BAFzB,IAAI,CAGD,QAAQ,CAAC,CAAC;;wBAHb,IAAI;wBADN,MAAM;wBADR,QAAQ;;;oBAAR,QAAQ;;;+CADF,UAAU;;QAAlB,OAAO;QADT,IAAI;QADN,MAAM;QAVR,MAAM;KA8CP", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass.ts": { - "version": 3, - "file": "StateTrackClass.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/pages/stateTrack/StateTrackClass.ets" - ], - "names": [], - "mappings": ";;;;IA0BS,IAAI,GAAE,IAAI;;OAXV,KAAK;AACd,MAAM,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;AACrC,MAAM,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;AACpC,MAAM,IAAI;IACR,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,CAAC;CACzB;MAIM,KAAK;IAFZ;;;;;mDAGsB,IAAI,IAAI,EAAE;;;KAL/B;;;;;;;;;;;;;;;;IAKC,yCAAa,IAAI,EAAc;QAAxB,IAAI;;;QAAJ,IAAI,WAAE,IAAI;;;IAEjB,mCAAmC;IACnC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;QAC7B,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;QACzD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;YACE,MAAM;YAAN,MAAM,CAoBL,MAAM,CAAC,MAAM;YApBd,MAAM,CAqBL,KAAK,CAAC,MAAM;;;YApBX,IAAI,QAAC,SAAS,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAA9B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;;QAD/B,IAAI;;YAEJ,IAAI,QAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAA5B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;;QAD/B,IAAI;;YAGJ,gCAAgC;YAChC,mBAAmB;YACnB,qCAAqC;YACrC,MAAM,iBAAC,aAAa;YAHpB,gCAAgC;YAChC,mBAAmB;YACnB,qCAAqC;YACrC,MAAM,CAAgB,OAAO,CAAC,GAAG,EAAE;gBACjC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;YAC1B,CAAC;;QALD,gCAAgC;QAChC,mBAAmB;QACnB,qCAAqC;QACrC,MAAM;;YAIN,+BAA+B;YAC/B,mBAAmB;YACnB,uCAAuC;YACvC,MAAM,iBAAC,YAAY;YAHnB,+BAA+B;YAC/B,mBAAmB;YACnB,uCAAuC;YACvC,MAAM,CAAe,OAAO,CAAC,GAAG,EAAE;gBAChC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YAClB,CAAC;;QALD,+BAA+B;QAC/B,mBAAmB;QACnB,uCAAuC;QACvC,MAAM;QAhBR,MAAM;KAsBP", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass2.ts": { - "version": 3, - "file": "StateTrackClass2.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/pages/stateTrack/StateTrackClass2.ets" - ], - "names": [], - "mappings": ";;;;IA0CS,QAAQ,GAAE,QAAQ;IAClB,WAAW,GAAE,WAAW;;OA5BxB,KAAK;AACd,MAAM,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;AACrC,MAAM,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;AAEpC,MAAM,QAAQ;IACZ,CAAC,KAAK;IAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAC3B,CAAC,KAAK;IAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAE3B,YAAY,IAAI,EAAE,MAAM;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;IACtB,CAAC;CACF;AAED,MAAM,WAAW;IACf,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAEpB,YAAY,IAAI,EAAE,MAAM;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;MAIM,MAAM;IAFb;;;;;uDAG8B,IAAI,QAAQ,CAAC,OAAO,CAAC;0DACf,IAAI,WAAW,CAAC,IAAI,CAAC;;;KANxD;;;;;;;;;;;;;;;;;;;;;IAKC,6CAAiB,QAAQ,EAAyB;QAA3C,QAAQ;;;QAAR,QAAQ,WAAE,QAAQ;;;IACzB,gDAAoB,WAAW,EAAyB;QAAjD,WAAW;;;QAAX,WAAW,WAAE,WAAW;;;IAE/B,QAAQ,CAAC,KAAK,EAAE,MAAM;QACpB,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,QAAQ,KAAK,cAAc,CAAC,CAAC;QAC5D,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;YACE,GAAG;YAAH,GAAG,CA2BF,MAAM,CAAC,MAAM;;;YA1BZ,MAAM;YAAN,MAAM,CAwBL,KAAK,CAAC,MAAM;;;YAvBX,IAAI,QAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;YAAvB,IAAI,CACD,EAAE,CAAC,MAAM;YADZ,IAAI,CAED,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAF5B,IAAI,CAGD,UAAU,CAAC,UAAU,CAAC,IAAI;;QAH7B,IAAI;;YAIJ,IAAI,QAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;YAAvB,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAD5B,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;;QAF7B,IAAI;;YAGJ,MAAM,iBAAC,sBAAsB;YAA7B,MAAM,CACH,EAAE,CAAC,MAAM;YADZ,MAAM,CAEH,OAAO,CAAC,GAAG,EAAE;gBACZ,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;YAC7B,CAAC;;QAJH,MAAM;;YAKN,IAAI,QAAC,IAAI,CAAC,WAAW,CAAC,IAAI;YAA1B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAD5B,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;;QAF7B,IAAI;;YAGJ,IAAI,QAAC,IAAI,CAAC,WAAW,CAAC,IAAI;YAA1B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAD5B,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;;QAF7B,IAAI;;YAGJ,MAAM,iBAAC,yBAAyB;YAAhC,MAAM,CACH,OAAO,CAAC,GAAG,EAAE;gBACZ,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC;YAC/B,CAAC;;QAHH,MAAM;QAnBR,MAAM;QADR,GAAG;KA4BJ", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass3.ts": { - "version": 3, - "file": "StateTrackClass3.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/pages/stateTrack/StateTrackClass3.ets" - ], - "names": [], - "mappings": ";;;;IAuCS,GAAG,GAAE,GAAG;;OAxBR,KAAK;AACd,MAAM,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;AACrC,MAAM,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;AACpC,MAAM,GAAG;IACP,CAAC,KAAK;IAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC;IAC9B,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC;IAClB,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAEtB,YAAY,OAAO,EAAE,MAAM;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;MAIM,OAAO;IAFd;;;;;kDAGoB,IAAI,GAAG,CAAC,cAAc,CAAC;;;KAL1C;;;;;;;;;;;;;;;;IAKC,wCAAY,GAAG,EAA2B;QAAnC,GAAG;;;QAAH,GAAG,WAAE,GAAG;;;IAEf;;YACE,GAAG;YAAH,GAAG,CAoBF,MAAM,CAAC,MAAM;;;YAnBZ,MAAM;YAAN,MAAM,CAiBL,KAAK,CAAC,MAAM;;;YAhBX,IAAI,QAAC,IAAI,CAAC,GAAG,CAAC,OAAO;YAArB,IAAI,CACD,QAAQ,CAAC,EAAE;YADd,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;YAF7B,IAAI,CAGD,OAAO,CAAC,GAAG,EAAE;gBACZ,4BAA4B;gBAC5B,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK;oBACvD,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE;oBACrB,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI;oBACzB,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ;oBACjC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACjC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBAEd,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,QAAQ,CAAC;YAC/B,CAAC;;QAdH,IAAI;QADN,MAAM;QADR,GAAG;KAqBJ", - "entry-package-info": "entry|1.0.0" - } -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/merge_profile/default/module.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/merge_profile/default/module.json deleted file mode 100644 index 229b6322b0b1e59c483fd09b3594ec7f02f4d78e..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/merge_profile/default/module.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "app": { - "bundleName": "com.samples.statemanagementproject", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name", - "apiReleaseType": "Release", - "compileSdkVersion": "6.0.0.47", - "targetAPIVersion": 60000020, - "minAPIVersion": 60000020, - "compileSdkType": "HarmonyOS", - "targetMinorAPIVersion": 0, - "targetPatchAPIVersion": 0, - "appEnvironments": [], - "bundleType": "app", - "buildMode": "debug", - "debug": true - }, - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "icon": "$media:layered_image", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ] - } - ], - "packageName": "entry" - } -} diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/package/default/module.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/package/default/module.json deleted file mode 100644 index 096e4e674ea182e09dade3eb8f1ad834e0f3722e..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/package/default/module.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "app": { - "bundleName": "com.samples.statemanagementproject", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name", - "apiReleaseType": "Release", - "compileSdkVersion": "6.0.0.47", - "targetAPIVersion": 60000020, - "minAPIVersion": 60000020, - "compileSdkType": "HarmonyOS", - "targetMinorAPIVersion": 0, - "targetPatchAPIVersion": 0, - "appEnvironments": [], - "bundleType": "app", - "buildMode": "debug", - "debug": true, - "iconId": 16777219, - "labelId": 16777216 - }, - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": ["default"], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [{ - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "icon": "$media:layered_image", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [{ - "entities": ["entity.system.home"], - "actions": ["ohos.want.action.home"] - }], - "descriptionId": 16777220, - "iconId": 16777219, - "labelId": 16777221, - "startWindowIconId": 16777227, - "startWindowBackgroundId": 16777225 - }], - "extensionAbilities": [{ - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [{ - "name": "ohos.extension.backup", - "resource": "$profile:backup_config", - "resourceId": 16777228 - }] - }], - "packageName": "entry", - "virtualMachine": "ark13.0.1.0", - "compileMode": "esmodule", - "dependencies": [], - "descriptionId": 16777222 - } -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/patch/default/base_native_libs.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/patch/default/base_native_libs.json deleted file mode 100644 index f374f010c198cc570e0a9986cfe8ffbfdeaa9745..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/patch/default/base_native_libs.json +++ /dev/null @@ -1 +0,0 @@ -{"libs":{},"stripped":{}} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/process_profile/default/module.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/process_profile/default/module.json deleted file mode 100644 index 05f418562341dfaaa3953bd783cd632c98079c23..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/process_profile/default/module.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "app": { - "bundleName": "com.samples.statemanagementproject", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name", - "apiReleaseType": "Release", - "compileSdkVersion": "6.0.0.47", - "targetAPIVersion": 60000020, - "minAPIVersion": 60000020, - "compileSdkType": "HarmonyOS", - "targetMinorAPIVersion": 0, - "targetPatchAPIVersion": 0, - "appEnvironments": [], - "bundleType": "app", - "buildMode": "debug", - "debug": true - }, - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "icon": "$media:layered_image", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "ohos.want.action.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [ - { - "name": "ohos.extension.backup", - "resource": "$profile:backup_config" - } - ] - } - ], - "packageName": "entry", - "virtualMachine": "ark13.0.1.0", - "compileMode": "esmodule", - "dependencies": [] - } -} diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/.caches/base/media/background.png b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/.caches/base/media/background.png deleted file mode 100644 index 1ab7ae20a327270995f1ad22c3dfc76db4fb1056..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/.caches/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/.caches/base/media/foreground.png b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/.caches/base/media/foreground.png deleted file mode 100644 index 418affbf658954b0c174c80847a26328ca86111e..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/.caches/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/ResourceTable.txt b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/ResourceTable.txt deleted file mode 100644 index c7a7c0fc9609727aeadc54b81bf0899dde5efb6c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/ResourceTable.txt +++ /dev/null @@ -1,14 +0,0 @@ -string EntryAbility_desc 0x01000004 -string EntryAbility_label 0x01000005 -string app_name 0x01000000 -string module_desc 0x01000006 -string state_hello 0x01000007 -string state_layout 0x01000008 -color start_window_background 0x01000009 -float page_text_font_size 0x0100000a -media background 0x01000001 -media foreground 0x01000002 -media layered_image 0x01000003 -media startIcon 0x0100000b -profile backup_config 0x0100000c -profile main_pages 0x0100000d \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/ark_module.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/ark_module.json deleted file mode 100644 index b921c6a8e706d746420b00536079c843ff027323..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/ark_module.json +++ /dev/null @@ -1 +0,0 @@ -{"app":{"bundleName":"com.samples.statemanagementproject","vendor":"example","versionCode":1000000,"versionName":"1.0.0","icon":"$media:layered_image","label":"$string:app_name","apiReleaseType":"Release","compileSdkVersion":"6.0.0.47","targetAPIVersion":60000020,"minAPIVersion":60000020,"compileSdkType":"HarmonyOS","targetMinorAPIVersion":0,"targetPatchAPIVersion":0,"appEnvironments":[],"bundleType":"app","buildMode":"debug","debug":true},"module":{"name":"entry","type":"entry","description":"$string:module_desc","mainElement":"EntryAbility","deviceTypes":["default"],"deliveryWithInstall":true,"installationFree":false,"pages":"$profile:main_pages","abilities":[{"name":"EntryAbility","srcEntry":"./ets/entryability/EntryAbility.ets","description":"$string:EntryAbility_desc","icon":"$media:layered_image","label":"$string:EntryAbility_label","startWindowIcon":"$media:startIcon","startWindowBackground":"$color:start_window_background","exported":true,"skills":[{"entities":["entity.system.home"],"actions":["ohos.want.action.home"]}]}],"extensionAbilities":[{"name":"EntryBackupAbility","srcEntry":"./ets/entrybackupability/EntryBackupAbility.ets","type":"backup","exported":false,"metadata":[{"name":"ohos.extension.backup","resource":"$profile:backup_config"}]}],"packageName":"entry","virtualMachine":"ark13.0.1.0","compileMode":"esmodule","dependencies":[]}} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/ids_map/id_defined.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/ids_map/id_defined.json deleted file mode 100644 index e4f5d0ab0ab9c16872224a03981bd80d19ee0031..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/ids_map/id_defined.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "record": [{ - "type": "string", - "name": "app_name", - "id": "0x01000000" - }, { - "type": "media", - "name": "background", - "id": "0x01000001" - }, { - "type": "media", - "name": "foreground", - "id": "0x01000002" - }, { - "type": "media", - "name": "layered_image", - "id": "0x01000003" - }, { - "type": "string", - "name": "EntryAbility_desc", - "id": "0x01000004" - }, { - "type": "string", - "name": "EntryAbility_label", - "id": "0x01000005" - }, { - "type": "string", - "name": "module_desc", - "id": "0x01000006" - }, { - "type": "string", - "name": "state_hello", - "id": "0x01000007" - }, { - "type": "string", - "name": "state_layout", - "id": "0x01000008" - }, { - "type": "color", - "name": "start_window_background", - "id": "0x01000009" - }, { - "type": "float", - "name": "page_text_font_size", - "id": "0x0100000A" - }, { - "type": "media", - "name": "startIcon", - "id": "0x0100000B" - }, { - "type": "profile", - "name": "backup_config", - "id": "0x0100000C" - }, { - "type": "profile", - "name": "main_pages", - "id": "0x0100000D" - }] -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/module.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/module.json deleted file mode 100644 index 096e4e674ea182e09dade3eb8f1ad834e0f3722e..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/module.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "app": { - "bundleName": "com.samples.statemanagementproject", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:layered_image", - "label": "$string:app_name", - "apiReleaseType": "Release", - "compileSdkVersion": "6.0.0.47", - "targetAPIVersion": 60000020, - "minAPIVersion": 60000020, - "compileSdkType": "HarmonyOS", - "targetMinorAPIVersion": 0, - "targetPatchAPIVersion": 0, - "appEnvironments": [], - "bundleType": "app", - "buildMode": "debug", - "debug": true, - "iconId": 16777219, - "labelId": 16777216 - }, - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": ["default"], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [{ - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "icon": "$media:layered_image", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [{ - "entities": ["entity.system.home"], - "actions": ["ohos.want.action.home"] - }], - "descriptionId": 16777220, - "iconId": 16777219, - "labelId": 16777221, - "startWindowIconId": 16777227, - "startWindowBackgroundId": 16777225 - }], - "extensionAbilities": [{ - "name": "EntryBackupAbility", - "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", - "type": "backup", - "exported": false, - "metadata": [{ - "name": "ohos.extension.backup", - "resource": "$profile:backup_config", - "resourceId": 16777228 - }] - }], - "packageName": "entry", - "virtualMachine": "ark13.0.1.0", - "compileMode": "esmodule", - "dependencies": [], - "descriptionId": 16777222 - } -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/opt-compression.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/opt-compression.json deleted file mode 100644 index f385d4026e8cd1d00f8866d113f1e1d6ed3ee867..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/opt-compression.json +++ /dev/null @@ -1 +0,0 @@ -{"context":{"extensionPath":"D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\hms\\toolchains\\lib\\libimage_transcoder_shared.dll"},"compression":{"media":{"enable":false},"filters":[]}} diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resConfig.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resConfig.json deleted file mode 100644 index f739f4763d960ee67158763456fbd4ea4d8813be..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resConfig.json +++ /dev/null @@ -1 +0,0 @@ -{"configPath":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\process_profile\\default\\module.json","packageName":"com.samples.statemanagementproject","output":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\res\\default","moduleNames":"entry","ResourceTable":["E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\generated\\r\\default\\ResourceTable.h"],"applicationResource":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\AppScope\\resources","moduleResources":["E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\src\\main\\resources"],"dependencies":[],"iconCheck":true,"compression":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\res\\default\\opt-compression.json","ids":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\res\\default\\ids_map","definedIds":"E:\\applications_app_samples\\code\\DocsSample\\ArkUISample\\StateTrack\\entry\\build\\default\\intermediates\\res\\default\\ids_map\\id_defined.json","definedSysIds":"D:\\devecostudio-windows-6.0.0.858\\DevEco Studio\\sdk\\default\\hms\\toolchains\\id_defined.json"} diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources.index b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources.index deleted file mode 100644 index a9d0ce157729ebe2219e9a41417ff0fa9ae6f271..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources.index and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/media/background.png b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/media/background.png deleted file mode 100644 index 1ab7ae20a327270995f1ad22c3dfc76db4fb1056..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/media/background.png and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/media/foreground.png b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/media/foreground.png deleted file mode 100644 index 418affbf658954b0c174c80847a26328ca86111e..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/media/foreground.png and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/media/layered_image.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/media/layered_image.json deleted file mode 100644 index 88e305e7ad5490d2333d1881cf965cff65e1c196..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/media/layered_image.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "layered-image": { - "background": "$media:16777217", - "foreground": "$media:16777218" - } -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/media/startIcon.png b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/media/startIcon.png deleted file mode 100644 index a31c7f86b9157290e9278a80f48ff93b61b5a60d..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/media/startIcon.png and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/profile/backup_config.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/profile/backup_config.json deleted file mode 100644 index 78f40ae7c494d71e2482278f359ec790ca73471a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/profile/backup_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "allowToBackupRestore": true -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/profile/main_pages.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/profile/main_pages.json deleted file mode 100644 index b08097bddd0499bd70fa407779c8030cd983fd32..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/base/profile/main_pages.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/stateTrack/StateTrackClass", - "pages/stateTrack/StateTrackClass2", - "pages/stateTrack/StateTrackClass3" - - ] -} diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/rawfile/customFont.ttf b/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/rawfile/customFont.ttf deleted file mode 100644 index b347ed51f4ce85fe56d09766d0a0a4410b828850..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/StateTrack/entry/build/default/intermediates/res/default/resources/rawfile/customFont.ttf and /dev/null differ diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/router_map/default/loader-router-map.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/router_map/default/loader-router-map.json deleted file mode 100644 index 0ec611b0f7ae29df1d089f3bb60294150b4e0a4d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/router_map/default/loader-router-map.json +++ /dev/null @@ -1 +0,0 @@ -{"routerMap":[]} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/router_map/default/temp-router-map.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/router_map/default/temp-router-map.json deleted file mode 100644 index 0ec611b0f7ae29df1d089f3bb60294150b4e0a4d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/router_map/default/temp-router-map.json +++ /dev/null @@ -1 +0,0 @@ -{"routerMap":[]} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/share_config/default/temp-share-config.json b/ArkUIKit/StateTrack/entry/build/default/intermediates/share_config/default/temp-share-config.json deleted file mode 100644 index 2a514991fa3df1a64c50845026d4e63e7c86cdd0..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/share_config/default/temp-share-config.json +++ /dev/null @@ -1 +0,0 @@ -{"crossAppSharedConfig":[]} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/intermediates/source_map/default/sourceMaps.map b/ArkUIKit/StateTrack/entry/build/default/intermediates/source_map/default/sourceMaps.map deleted file mode 100644 index a6020f8e9584da6d7103cdae1a1ab2c00790b3c6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/intermediates/source_map/default/sourceMaps.map +++ /dev/null @@ -1,68 +0,0 @@ -{ - "entry|entry|1.0.0|src/main/ets/entryability/EntryAbility.ts": { - "version": 3, - "file": "EntryAbility.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/entryability/EntryAbility.ets" - ], - "names": [], - "mappings": "YAcS,eAAe;OAAE,qBAAqB;OAAE,SAAS;YAAE,IAAI;OACvD,KAAK;YACL,MAAM;AAEf,MAAM,MAAM,GAAG,MAAM,CAAC;AAEtB,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,SAAS;IACjD,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,CAAC,WAAW,GAAG,IAAI;QAClE,IAAI;YACF,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;SACvG;QAAC,OAAO,GAAG,EAAE;YACZ,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,4CAA4C,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;SACnG;QACD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,kBAAkB,CAAC,CAAC;IAClE,CAAC;IAED,SAAS,IAAI,IAAI;QACf,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC;IACnE,CAAC;IAED,mBAAmB,CAAC,WAAW,EAAE,MAAM,CAAC,WAAW,GAAG,IAAI;QACxD,yDAAyD;QACzD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,6BAA6B,CAAC,CAAC;QAE3E,WAAW,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE;YAC7C,IAAI,GAAG,CAAC,IAAI,EAAE;gBACZ,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,+CAA+C,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;gBACrG,OAAO;aACR;YACD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,mCAAmC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,oBAAoB,IAAI,IAAI;QAC1B,yDAAyD;QACzD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,8BAA8B,CAAC,CAAC;IAC9E,CAAC;IAED,YAAY,IAAI,IAAI;QAClB,oCAAoC;QACpC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC;IACtE,CAAC;IAED,YAAY,IAAI,IAAI;QAClB,iCAAiC;QACjC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC;IACtE,CAAC;CACF", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/entrybackupability/EntryBackupAbility.ts": { - "version": 3, - "file": "EntryBackupAbility.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/entrybackupability/EntryBackupAbility.ets" - ], - "names": [], - "mappings": "OAcS,KAAK;OACL,sBAAsB;cAAE,aAAa,IAAb,aAAa;AAE9C,MAAM,MAAM,GAAG,MAAM,CAAC;AAEtB,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,sBAAsB;IACpE,KAAK,CAAC,QAAQ;QACZ,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QAC7C,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,aAAa,EAAE,aAAa;QAC1C,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,yBAAyB,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;QACxF,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;CACF", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/pages/Index.ts": { - "version": 3, - "file": "Index.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/pages/Index.ets" - ], - "names": [], - "mappings": ";;;;IAwCS,OAAO,GAAE,aAAa;;AAzB/B,UAAU,QAAQ;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,IAAI,UAAU,EAAE,QAAQ,EAAE,GAAG;IAC3B;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,kCAAkC;KAC3C;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,mCAAmC;KAC5C;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,mCAAmC;KAC5C;CAEF,CAAA;MAIM,KAAK;IAFZ;;;;;sDAGkC,SAAS;;;KAL1C;;;;;;;;;;;;;;;;IAKC,4CAAgB,aAAa,EAAa;QAAnC,OAAO;;;QAAP,OAAO,WAAE,aAAa;;;IAE7B;;YACE,MAAM;;;YACJ,IAAI;YAAJ,IAAI,CACD,MAAM,CAAC,IAAI;YADd,IAAI,CAED,KAAK,CAAC,MAAM;YAFf,IAAI,CAGD,SAAS,CAAC,SAAS,CAAC,MAAM;YAH7B,IAAI,CAID,QAAQ,CAAC,EAAE;YAJd,IAAI,CAKD,UAAU,CAAC,UAAU,CAAC,IAAI;YAL7B,IAAI,CAMD,eAAe,6BAAC,IAAI,CAAC,OAAO;YAN/B,IAAI,CAOD,SAAS,CAAC,KAAK,CAAC,KAAK;;QAPxB,IAAI;;YASJ,MAAM;YAAN,MAAM,CA+BL,KAAK,CAAC,MAAM;YA/Bb,MAAM,CAiCL,eAAe,CAAC,WAAW;YAjC5B,MAAM,CAkCL,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;;;YAjCjB,IAAI,QAAC,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE;YAAnC,IAAI,CAiBH,aAAa,CAAC,IAAI,CAAC,QAAQ;YAjB5B,IAAI,CAkBH,SAAS,CAAC,QAAQ,CAAC,GAAG;YAlBvB,IAAI,CAmBH,QAAQ,CAAC,GAAG;YAnBb,IAAI,CAoBH,OAAO,CAAC;gBACP,WAAW,EAAE,CAAC;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,EAAE;gBACf,SAAS,EAAE,EAAE;aACd;YAzBD,IAAI,CA0BH,UAAU,CAAC,UAAU,CAAC,MAAM;YA1B7B,IAAI,CA2BH,gBAAgB,CAAC,EAAE;YA3BpB,IAAI,CA4BH,KAAK,CAAC,KAAK;;;YA3BV,OAAO;mDAAkC,KAAK,EAAE,MAAM;;;;;;;4BACpD,QAAQ;;;;;;;;;;4BACN,MAAM;4BAAN,MAAM,CAML,OAAO,CAAC,GAAG,EAAE;gCACZ,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE;oCACrB,IAAI,CAAC,YAAY,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;iCAClE;4BACH,CAAC;;;4BATC,IAAI,QAAC,QAAQ,CAAC,IAAI;4BAAlB,IAAI,CACD,QAAQ,CAAC,EAAE;4BADd,IAAI,CAED,SAAS,6BAAC,IAAI,CAAC,OAAO;4BAFzB,IAAI,CAGD,QAAQ,CAAC,CAAC;;wBAHb,IAAI;wBADN,MAAM;wBADR,QAAQ;;;oBAAR,QAAQ;;;+CADF,UAAU;;QAAlB,OAAO;QADT,IAAI;QADN,MAAM;QAVR,MAAM;KA8CP", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass.ts": { - "version": 3, - "file": "StateTrackClass.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/pages/stateTrack/StateTrackClass.ets" - ], - "names": [], - "mappings": ";;;;IA0BS,IAAI,GAAE,IAAI;;OAXV,KAAK;AACd,MAAM,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;AACrC,MAAM,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;AACpC,MAAM,IAAI;IACR,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,CAAC;CACzB;MAIM,KAAK;IAFZ;;;;;mDAGsB,IAAI,IAAI,EAAE;;;KAL/B;;;;;;;;;;;;;;;;IAKC,yCAAa,IAAI,EAAc;QAAxB,IAAI;;;QAAJ,IAAI,WAAE,IAAI;;;IAEjB,mCAAmC;IACnC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;QAC7B,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;QACzD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;YACE,MAAM;YAAN,MAAM,CAoBL,MAAM,CAAC,MAAM;YApBd,MAAM,CAqBL,KAAK,CAAC,MAAM;;;YApBX,IAAI,QAAC,SAAS,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAA9B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;;QAD/B,IAAI;;YAEJ,IAAI,QAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAA5B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;;QAD/B,IAAI;;YAGJ,gCAAgC;YAChC,mBAAmB;YACnB,qCAAqC;YACrC,MAAM,iBAAC,aAAa;YAHpB,gCAAgC;YAChC,mBAAmB;YACnB,qCAAqC;YACrC,MAAM,CAAgB,OAAO,CAAC,GAAG,EAAE;gBACjC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;YAC1B,CAAC;;QALD,gCAAgC;QAChC,mBAAmB;QACnB,qCAAqC;QACrC,MAAM;;YAIN,+BAA+B;YAC/B,mBAAmB;YACnB,uCAAuC;YACvC,MAAM,iBAAC,YAAY;YAHnB,+BAA+B;YAC/B,mBAAmB;YACnB,uCAAuC;YACvC,MAAM,CAAe,OAAO,CAAC,GAAG,EAAE;gBAChC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YAClB,CAAC;;QALD,+BAA+B;QAC/B,mBAAmB;QACnB,uCAAuC;QACvC,MAAM;QAhBR,MAAM;KAsBP", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass2.ts": { - "version": 3, - "file": "StateTrackClass2.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/pages/stateTrack/StateTrackClass2.ets" - ], - "names": [], - "mappings": ";;;;IA0CS,QAAQ,GAAE,QAAQ;IAClB,WAAW,GAAE,WAAW;;OA5BxB,KAAK;AACd,MAAM,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;AACrC,MAAM,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;AAEpC,MAAM,QAAQ;IACZ,CAAC,KAAK;IAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAC3B,CAAC,KAAK;IAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAE3B,YAAY,IAAI,EAAE,MAAM;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;IACtB,CAAC;CACF;AAED,MAAM,WAAW;IACf,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAEpB,YAAY,IAAI,EAAE,MAAM;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;MAIM,MAAM;IAFb;;;;;uDAG8B,IAAI,QAAQ,CAAC,OAAO,CAAC;0DACf,IAAI,WAAW,CAAC,IAAI,CAAC;;;KANxD;;;;;;;;;;;;;;;;;;;;;IAKC,6CAAiB,QAAQ,EAAyB;QAA3C,QAAQ;;;QAAR,QAAQ,WAAE,QAAQ;;;IACzB,gDAAoB,WAAW,EAAyB;QAAjD,WAAW;;;QAAX,WAAW,WAAE,WAAW;;;IAE/B,QAAQ,CAAC,KAAK,EAAE,MAAM;QACpB,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,QAAQ,KAAK,cAAc,CAAC,CAAC;QAC5D,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;YACE,GAAG;YAAH,GAAG,CA2BF,MAAM,CAAC,MAAM;;;YA1BZ,MAAM;YAAN,MAAM,CAwBL,KAAK,CAAC,MAAM;;;YAvBX,IAAI,QAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;YAAvB,IAAI,CACD,EAAE,CAAC,MAAM;YADZ,IAAI,CAED,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAF5B,IAAI,CAGD,UAAU,CAAC,UAAU,CAAC,IAAI;;QAH7B,IAAI;;YAIJ,IAAI,QAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;YAAvB,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAD5B,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;;QAF7B,IAAI;;YAGJ,MAAM,iBAAC,sBAAsB;YAA7B,MAAM,CACH,EAAE,CAAC,MAAM;YADZ,MAAM,CAEH,OAAO,CAAC,GAAG,EAAE;gBACZ,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;YAC7B,CAAC;;QAJH,MAAM;;YAKN,IAAI,QAAC,IAAI,CAAC,WAAW,CAAC,IAAI;YAA1B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAD5B,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;;QAF7B,IAAI;;YAGJ,IAAI,QAAC,IAAI,CAAC,WAAW,CAAC,IAAI;YAA1B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAD5B,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;;QAF7B,IAAI;;YAGJ,MAAM,iBAAC,yBAAyB;YAAhC,MAAM,CACH,OAAO,CAAC,GAAG,EAAE;gBACZ,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC;YAC/B,CAAC;;QAHH,MAAM;QAnBR,MAAM;QADR,GAAG;KA4BJ", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass3.ts": { - "version": 3, - "file": "StateTrackClass3.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/pages/stateTrack/StateTrackClass3.ets" - ], - "names": [], - "mappings": ";;;;IAuCS,GAAG,GAAE,GAAG;;OAxBR,KAAK;AACd,MAAM,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;AACrC,MAAM,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;AACpC,MAAM,GAAG;IACP,CAAC,KAAK;IAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC;IAC9B,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC;IAClB,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAEtB,YAAY,OAAO,EAAE,MAAM;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;MAIM,OAAO;IAFd;;;;;kDAGoB,IAAI,GAAG,CAAC,cAAc,CAAC;;;KAL1C;;;;;;;;;;;;;;;;IAKC,wCAAY,GAAG,EAA2B;QAAnC,GAAG;;;QAAH,GAAG,WAAE,GAAG;;;IAEf;;YACE,GAAG;YAAH,GAAG,CAoBF,MAAM,CAAC,MAAM;;;YAnBZ,MAAM;YAAN,MAAM,CAiBL,KAAK,CAAC,MAAM;;;YAhBX,IAAI,QAAC,IAAI,CAAC,GAAG,CAAC,OAAO;YAArB,IAAI,CACD,QAAQ,CAAC,EAAE;YADd,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;YAF7B,IAAI,CAGD,OAAO,CAAC,GAAG,EAAE;gBACZ,4BAA4B;gBAC5B,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK;oBACvD,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE;oBACrB,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI;oBACzB,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ;oBACjC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACjC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBAEd,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,QAAQ,CAAC;YAC/B,CAAC;;QAdH,IAAI;QADN,MAAM;QADR,GAAG;KAqBJ", - "entry-package-info": "entry|1.0.0" - } -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/outputs/default/mapping/sourceMaps.map b/ArkUIKit/StateTrack/entry/build/default/outputs/default/mapping/sourceMaps.map deleted file mode 100644 index a6020f8e9584da6d7103cdae1a1ab2c00790b3c6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/outputs/default/mapping/sourceMaps.map +++ /dev/null @@ -1,68 +0,0 @@ -{ - "entry|entry|1.0.0|src/main/ets/entryability/EntryAbility.ts": { - "version": 3, - "file": "EntryAbility.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/entryability/EntryAbility.ets" - ], - "names": [], - "mappings": "YAcS,eAAe;OAAE,qBAAqB;OAAE,SAAS;YAAE,IAAI;OACvD,KAAK;YACL,MAAM;AAEf,MAAM,MAAM,GAAG,MAAM,CAAC;AAEtB,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,SAAS;IACjD,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,CAAC,WAAW,GAAG,IAAI;QAClE,IAAI;YACF,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;SACvG;QAAC,OAAO,GAAG,EAAE;YACZ,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,4CAA4C,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;SACnG;QACD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,kBAAkB,CAAC,CAAC;IAClE,CAAC;IAED,SAAS,IAAI,IAAI;QACf,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC;IACnE,CAAC;IAED,mBAAmB,CAAC,WAAW,EAAE,MAAM,CAAC,WAAW,GAAG,IAAI;QACxD,yDAAyD;QACzD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,6BAA6B,CAAC,CAAC;QAE3E,WAAW,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE;YAC7C,IAAI,GAAG,CAAC,IAAI,EAAE;gBACZ,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,+CAA+C,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;gBACrG,OAAO;aACR;YACD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,mCAAmC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,oBAAoB,IAAI,IAAI;QAC1B,yDAAyD;QACzD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,8BAA8B,CAAC,CAAC;IAC9E,CAAC;IAED,YAAY,IAAI,IAAI;QAClB,oCAAoC;QACpC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC;IACtE,CAAC;IAED,YAAY,IAAI,IAAI;QAClB,iCAAiC;QACjC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC;IACtE,CAAC;CACF", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/entrybackupability/EntryBackupAbility.ts": { - "version": 3, - "file": "EntryBackupAbility.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/entrybackupability/EntryBackupAbility.ets" - ], - "names": [], - "mappings": "OAcS,KAAK;OACL,sBAAsB;cAAE,aAAa,IAAb,aAAa;AAE9C,MAAM,MAAM,GAAG,MAAM,CAAC;AAEtB,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,sBAAsB;IACpE,KAAK,CAAC,QAAQ;QACZ,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QAC7C,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,aAAa,EAAE,aAAa;QAC1C,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,yBAAyB,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;QACxF,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;CACF", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/pages/Index.ts": { - "version": 3, - "file": "Index.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/pages/Index.ets" - ], - "names": [], - "mappings": ";;;;IAwCS,OAAO,GAAE,aAAa;;AAzB/B,UAAU,QAAQ;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,IAAI,UAAU,EAAE,QAAQ,EAAE,GAAG;IAC3B;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,kCAAkC;KAC3C;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,mCAAmC;KAC5C;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,mCAAmC;KAC5C;CAEF,CAAA;MAIM,KAAK;IAFZ;;;;;sDAGkC,SAAS;;;KAL1C;;;;;;;;;;;;;;;;IAKC,4CAAgB,aAAa,EAAa;QAAnC,OAAO;;;QAAP,OAAO,WAAE,aAAa;;;IAE7B;;YACE,MAAM;;;YACJ,IAAI;YAAJ,IAAI,CACD,MAAM,CAAC,IAAI;YADd,IAAI,CAED,KAAK,CAAC,MAAM;YAFf,IAAI,CAGD,SAAS,CAAC,SAAS,CAAC,MAAM;YAH7B,IAAI,CAID,QAAQ,CAAC,EAAE;YAJd,IAAI,CAKD,UAAU,CAAC,UAAU,CAAC,IAAI;YAL7B,IAAI,CAMD,eAAe,6BAAC,IAAI,CAAC,OAAO;YAN/B,IAAI,CAOD,SAAS,CAAC,KAAK,CAAC,KAAK;;QAPxB,IAAI;;YASJ,MAAM;YAAN,MAAM,CA+BL,KAAK,CAAC,MAAM;YA/Bb,MAAM,CAiCL,eAAe,CAAC,WAAW;YAjC5B,MAAM,CAkCL,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;;;YAjCjB,IAAI,QAAC,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE;YAAnC,IAAI,CAiBH,aAAa,CAAC,IAAI,CAAC,QAAQ;YAjB5B,IAAI,CAkBH,SAAS,CAAC,QAAQ,CAAC,GAAG;YAlBvB,IAAI,CAmBH,QAAQ,CAAC,GAAG;YAnBb,IAAI,CAoBH,OAAO,CAAC;gBACP,WAAW,EAAE,CAAC;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,EAAE;gBACf,SAAS,EAAE,EAAE;aACd;YAzBD,IAAI,CA0BH,UAAU,CAAC,UAAU,CAAC,MAAM;YA1B7B,IAAI,CA2BH,gBAAgB,CAAC,EAAE;YA3BpB,IAAI,CA4BH,KAAK,CAAC,KAAK;;;YA3BV,OAAO;mDAAkC,KAAK,EAAE,MAAM;;;;;;;4BACpD,QAAQ;;;;;;;;;;4BACN,MAAM;4BAAN,MAAM,CAML,OAAO,CAAC,GAAG,EAAE;gCACZ,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE;oCACrB,IAAI,CAAC,YAAY,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;iCAClE;4BACH,CAAC;;;4BATC,IAAI,QAAC,QAAQ,CAAC,IAAI;4BAAlB,IAAI,CACD,QAAQ,CAAC,EAAE;4BADd,IAAI,CAED,SAAS,6BAAC,IAAI,CAAC,OAAO;4BAFzB,IAAI,CAGD,QAAQ,CAAC,CAAC;;wBAHb,IAAI;wBADN,MAAM;wBADR,QAAQ;;;oBAAR,QAAQ;;;+CADF,UAAU;;QAAlB,OAAO;QADT,IAAI;QADN,MAAM;QAVR,MAAM;KA8CP", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass.ts": { - "version": 3, - "file": "StateTrackClass.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/pages/stateTrack/StateTrackClass.ets" - ], - "names": [], - "mappings": ";;;;IA0BS,IAAI,GAAE,IAAI;;OAXV,KAAK;AACd,MAAM,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;AACrC,MAAM,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;AACpC,MAAM,IAAI;IACR,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,CAAC;CACzB;MAIM,KAAK;IAFZ;;;;;mDAGsB,IAAI,IAAI,EAAE;;;KAL/B;;;;;;;;;;;;;;;;IAKC,yCAAa,IAAI,EAAc;QAAxB,IAAI;;;QAAJ,IAAI,WAAE,IAAI;;;IAEjB,mCAAmC;IACnC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;QAC7B,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;QACzD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;YACE,MAAM;YAAN,MAAM,CAoBL,MAAM,CAAC,MAAM;YApBd,MAAM,CAqBL,KAAK,CAAC,MAAM;;;YApBX,IAAI,QAAC,SAAS,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAA9B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;;QAD/B,IAAI;;YAEJ,IAAI,QAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAA5B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;;QAD/B,IAAI;;YAGJ,gCAAgC;YAChC,mBAAmB;YACnB,qCAAqC;YACrC,MAAM,iBAAC,aAAa;YAHpB,gCAAgC;YAChC,mBAAmB;YACnB,qCAAqC;YACrC,MAAM,CAAgB,OAAO,CAAC,GAAG,EAAE;gBACjC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;YAC1B,CAAC;;QALD,gCAAgC;QAChC,mBAAmB;QACnB,qCAAqC;QACrC,MAAM;;YAIN,+BAA+B;YAC/B,mBAAmB;YACnB,uCAAuC;YACvC,MAAM,iBAAC,YAAY;YAHnB,+BAA+B;YAC/B,mBAAmB;YACnB,uCAAuC;YACvC,MAAM,CAAe,OAAO,CAAC,GAAG,EAAE;gBAChC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YAClB,CAAC;;QALD,+BAA+B;QAC/B,mBAAmB;QACnB,uCAAuC;QACvC,MAAM;QAhBR,MAAM;KAsBP", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass2.ts": { - "version": 3, - "file": "StateTrackClass2.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/pages/stateTrack/StateTrackClass2.ets" - ], - "names": [], - "mappings": ";;;;IA0CS,QAAQ,GAAE,QAAQ;IAClB,WAAW,GAAE,WAAW;;OA5BxB,KAAK;AACd,MAAM,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;AACrC,MAAM,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;AAEpC,MAAM,QAAQ;IACZ,CAAC,KAAK;IAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAC3B,CAAC,KAAK;IAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAE3B,YAAY,IAAI,EAAE,MAAM;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;IACtB,CAAC;CACF;AAED,MAAM,WAAW;IACf,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAEpB,YAAY,IAAI,EAAE,MAAM;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;MAIM,MAAM;IAFb;;;;;uDAG8B,IAAI,QAAQ,CAAC,OAAO,CAAC;0DACf,IAAI,WAAW,CAAC,IAAI,CAAC;;;KANxD;;;;;;;;;;;;;;;;;;;;;IAKC,6CAAiB,QAAQ,EAAyB;QAA3C,QAAQ;;;QAAR,QAAQ,WAAE,QAAQ;;;IACzB,gDAAoB,WAAW,EAAyB;QAAjD,WAAW;;;QAAX,WAAW,WAAE,WAAW;;;IAE/B,QAAQ,CAAC,KAAK,EAAE,MAAM;QACpB,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,QAAQ,KAAK,cAAc,CAAC,CAAC;QAC5D,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;YACE,GAAG;YAAH,GAAG,CA2BF,MAAM,CAAC,MAAM;;;YA1BZ,MAAM;YAAN,MAAM,CAwBL,KAAK,CAAC,MAAM;;;YAvBX,IAAI,QAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;YAAvB,IAAI,CACD,EAAE,CAAC,MAAM;YADZ,IAAI,CAED,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAF5B,IAAI,CAGD,UAAU,CAAC,UAAU,CAAC,IAAI;;QAH7B,IAAI;;YAIJ,IAAI,QAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;YAAvB,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAD5B,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;;QAF7B,IAAI;;YAGJ,MAAM,iBAAC,sBAAsB;YAA7B,MAAM,CACH,EAAE,CAAC,MAAM;YADZ,MAAM,CAEH,OAAO,CAAC,GAAG,EAAE;gBACZ,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;YAC7B,CAAC;;QAJH,MAAM;;YAKN,IAAI,QAAC,IAAI,CAAC,WAAW,CAAC,IAAI;YAA1B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAD5B,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;;QAF7B,IAAI;;YAGJ,IAAI,QAAC,IAAI,CAAC,WAAW,CAAC,IAAI;YAA1B,IAAI,CACD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAD5B,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;;QAF7B,IAAI;;YAGJ,MAAM,iBAAC,yBAAyB;YAAhC,MAAM,CACH,OAAO,CAAC,GAAG,EAAE;gBACZ,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC;YAC/B,CAAC;;QAHH,MAAM;QAnBR,MAAM;QADR,GAAG;KA4BJ", - "entry-package-info": "entry|1.0.0" - }, - "entry|entry|1.0.0|src/main/ets/pages/stateTrack/StateTrackClass3.ts": { - "version": 3, - "file": "StateTrackClass3.ets", - "sourceRoot": "", - "sources": [ - "entry/src/main/ets/pages/stateTrack/StateTrackClass3.ets" - ], - "names": [], - "mappings": ";;;;IAuCS,GAAG,GAAE,GAAG;;OAxBR,KAAK;AACd,MAAM,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;AACrC,MAAM,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;AACpC,MAAM,GAAG;IACP,CAAC,KAAK;IAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC;IAC9B,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC;IAClB,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAEtB,YAAY,OAAO,EAAE,MAAM;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;MAIM,OAAO;IAFd;;;;;kDAGoB,IAAI,GAAG,CAAC,cAAc,CAAC;;;KAL1C;;;;;;;;;;;;;;;;IAKC,wCAAY,GAAG,EAA2B;QAAnC,GAAG;;;QAAH,GAAG,WAAE,GAAG;;;IAEf;;YACE,GAAG;YAAH,GAAG,CAoBF,MAAM,CAAC,MAAM;;;YAnBZ,MAAM;YAAN,MAAM,CAiBL,KAAK,CAAC,MAAM;;;YAhBX,IAAI,QAAC,IAAI,CAAC,GAAG,CAAC,OAAO;YAArB,IAAI,CACD,QAAQ,CAAC,EAAE;YADd,IAAI,CAED,UAAU,CAAC,UAAU,CAAC,IAAI;YAF7B,IAAI,CAGD,OAAO,CAAC,GAAG,EAAE;gBACZ,4BAA4B;gBAC5B,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK;oBACvD,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE;oBACrB,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI;oBACzB,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ;oBACjC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACjC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBAEd,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,QAAQ,CAAC;YAC/B,CAAC;;QAdH,IAAI;QADN,MAAM;QADR,GAAG;KAqBJ", - "entry-package-info": "entry|1.0.0" - } -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/entry/build/default/outputs/default/pack.info b/ArkUIKit/StateTrack/entry/build/default/outputs/default/pack.info deleted file mode 100644 index 5e2cc922445a13cdf558e16dda26feadd093623f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/entry/build/default/outputs/default/pack.info +++ /dev/null @@ -1 +0,0 @@ -{"summary":{"app":{"bundleName":"com.samples.statemanagementproject","bundleType":"app","version":{"code":1000000,"name":"1.0.0"}},"modules":[{"mainAbility":"EntryAbility","deviceType":["default"],"abilities":[{"name":"EntryAbility","label":"$string:EntryAbility_label"}],"extensionAbilities":[{"name":"EntryBackupAbility","forms":[]}],"distro":{"moduleType":"entry","installationFree":false,"deliveryWithInstall":true,"moduleName":"entry"},"apiVersion":{"compatible":20,"releaseType":"Release","target":20}}]},"packages":[{"deviceType":["default"],"moduleType":"entry","deliveryWithInstall":true,"name":"entry-default"}]} diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/CHANGELOG.md b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/CHANGELOG.md deleted file mode 100644 index 22a35bda8a1fab36dd81c1c7ae86addcc1f111cc..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/CHANGELOG.md +++ /dev/null @@ -1,4 +0,0 @@ -## 1.0.0 -- 修复once断言问题 -## 1.0.0-rc -- 提供DevEco Studio预览器场景使能的MockSetup装饰器 \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/LICENSE b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/LICENSE deleted file mode 100644 index 4947287f7b5ccb5d1e8b7b2d3aa5d89f322c160d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/README.md b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/README.md deleted file mode 100644 index c46981eb6b9163cb82723dd4c410b69b5e6a66cd..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# Hamock - -## 简介 - -Hamock 是 OpenHarmony 上的模拟框架,提供预览场景的模拟功能。 - -## 下载安装 - -```bash -ohpm install @ohos/hamock -``` - -OpenHarmony ohpm 环境配置等更多内容,请参考[如何安装 OpenHarmony ohpm 包](https://gitee.com/openharmony-tpc/docs/blob/master/OpenHarmony_har_usage.md) - -## 使用示例 - -Hamock 提供了 @MockSetup 用于修饰 Mock 方法,仅支持声明式范式的组件。当开发者预览该组件时,预览运行时将在组件初始化时执行被 @MockSetup 修饰的方法。因此,开发者可以在这个被修饰的方法内重定义组件的方法或重赋值组件的属性,其将在预览时生效。 - -> 说明: -> @MockSetup 修饰的方法仅在预览场景会自动触发,并先于组件的 aboutToAppear 执行。 - -### UI组件的方法 - -在 ArkTS 页面代码中引入 Hamock。在目标组件中定义一个方法,并用 @MockSetup 修饰该方法。在这个方法中,使用 MockKit 模拟目标方法。 - -```typescript -import { MockKit, when, MockSetup } from '@ohos/hamock'; - -@Entry -@Component -struct Index { - ... - @MockSetup - randomName() { - let mocker: MockKit = new MockKit(); - let mockfunc: Object = mocker.mockFunc(this, this.method1); - // mock 指定的方法在指定入参的返回值 - when(mockfunc)('test').afterReturn(1); - } - ... - // 业务场景调用方法 - const result: number = this.method1('test'); // in previewer, result = 1 -} -``` - -### UI组件的属性 - -在 ArkTS 页面代码中引入 Hamock。在目标组件中定义一个方法,并用 @MockSetup 修饰该方法。在这个方法中,对于需要 Mock 的属性,可以重新赋值。 - -```typescript -import { MockSetup } from '@ohos/hamock'; - -@Component -struct Person { - @Prop species: string; - ... - // 在 @MockSetup 片段中,定义对象属性 - @MockSetup - randomName() { - this.species = 'primates'; - } - ... - // 业务场景调用属性(如果从初始化到调用期间,该属性无变化) - const result: string = this.species; // in previewer, result = primates -} -``` - -## 约束与限制 - -在下述版本验证通过: - -DevEco Studio: 4.1 (4.1.3.400), SDK: API11 (4.1.0.36) - -MockSetup 仅在 API11 支持。 - -## 贡献代码 - -使用过程中发现任何问题都可以提[Issue](https://gitee.com/openharmony/testfwk_arkxtest/issues) 给我们,当然,我们也非常欢迎你给我们提[PR](https://gitee.com/openharmony/testfwk_arkxtest/pulls) 。 - -## 开源协议 - -本项目基于 [Apache License 2.0](https://gitee.com/openharmony/testfwk_arkxtest/blob/master/hamock/LICENSE) ,请自由地享受和参与开源。 \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/hvigorfile.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/hvigorfile.js deleted file mode 100644 index d7bda561c9bf09b92a7fac485141cc8648907388..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/hvigorfile.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { harTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/hvigorfile.ts b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/hvigorfile.ts deleted file mode 100644 index 960be7d7df0790853d6bdab1f52a3ec8c8e4a1ca..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/hvigorfile.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -export { harTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.d.ts b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.d.ts deleted file mode 100644 index 6bc7929ba5718da0e459721be04e903ec59289c0..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -export class ArgumentMatchers { - static any; - static anyString; - static anyBoolean; - static anyNumber; - static anyObj; - static anyFunction; - static matchRegexs(Regex: RegExp): void -} - -declare interface when { - afterReturn(value: any): any - afterReturnNothing(): undefined - afterAction(action: any): any - afterThrow(e_msg: string): string - (argMatchers?: any): when; -} - -export const when: when; - -export interface VerificationMode { - times(count: Number): void - never(): void - once(): void - atLeast(count: Number): void - atMost(count: Number): void -} - -export class MockKit { - constructor() - mockFunc(obj: Object, func: Function): Function - mockObject(obj: Object): Object - verify(methodName: String, argsArray: Array): VerificationMode - ignoreMock(obj: Object, func: Function): void - clear(obj: Object): void - clearAll(): void -} - -export declare function MockSetup( - target: Object, - propertyName: string | Symbol, - descriptor: TypedPropertyDescriptor<() => void> -): void; \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.ets b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.ets deleted file mode 100644 index c3a47320c2b674216cccde0fe217dbb8423625cc..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.ets +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -export { MockSetup, MockKit, when } from './src/main/mock/MockKit'; -export { ArgumentMatchers } from './src/main/mock/ArgumentMatchers'; \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.js deleted file mode 100644 index 1cb2b5e0256e00aa9276867f0753a89a7ac5e16f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2021-2023 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. - */ -export { MockSetup, MockKit, when } from './src/main/mock/MockKit.js'; -export { ArgumentMatchers } from './src/main/mock/ArgumentMatchers.js'; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.ts b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.ts deleted file mode 100644 index 608eb4fe72aaf0f6cca0ccb3baad94e9b6101de0..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2021-2023 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. - */ - -export { MockSetup, MockKit, when } from './src/main/mock/MockKit.js'; -export { ArgumentMatchers } from './src/main/mock/ArgumentMatchers.js'; \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ArgumentMatchers.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ArgumentMatchers.js deleted file mode 100644 index f06bbca0b287aac612f42f9263c064c0157ae03a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ArgumentMatchers.js +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ -export class ArgumentMatchers { - constructor() { - this.ANY = ""; - this.ANY_STRING = ""; - this.ANY_BOOLEAN = ""; - this.ANY_NUMBER = ""; - this.ANY_OBJECT = ""; - this.ANY_FUNCTION = ""; - this.MATCH_REGEXS = ""; - } - static any() { - } - static anyString() { - } - static anyBoolean() { - } - static anyNumber() { - } - static anyObj() { - } - static anyFunction() { - } - static matchRegexs(regex) { - if (ArgumentMatchers.isRegExp(regex)) { - return regex; - } - throw Error("not a regex"); - } - static isRegExp(value) { - return Object.prototype.toString.call(value) === "[object RegExp]"; - } - matcheReturnKey(...args) { - let arg = args[0]; - let regex = args[1]; - let stubSetKey = args[2]; - if (stubSetKey && stubSetKey == this.ANY) { - return this.ANY; - } - if (typeof arg === "string" && !regex) { - return this.ANY_STRING; - } - if (typeof arg === "boolean" && !regex) { - return this.ANY_BOOLEAN; - } - if (typeof arg === "number" && !regex) { - return this.ANY_NUMBER; - } - if (typeof arg === "object" && !regex) { - return this.ANY_OBJECT; - } - if (typeof arg === "function" && !regex) { - return this.ANY_FUNCTION; - } - if (typeof arg === "string" && regex) { - return regex.test(arg); - } - return null; - } - matcheStubKey(key) { - if (key === ArgumentMatchers.any) { - return this.ANY; - } - if (key === ArgumentMatchers.anyString) { - return this.ANY_STRING; - } - if (key === ArgumentMatchers.anyBoolean) { - return this.ANY_BOOLEAN; - } - if (key === ArgumentMatchers.anyNumber) { - return this.ANY_NUMBER; - } - if (key === ArgumentMatchers.anyObj) { - return this.ANY_OBJECT; - } - if (key === ArgumentMatchers.anyFunction) { - return this.ANY_FUNCTION; - } - if (ArgumentMatchers.isRegExp(key)) { - return key; - } - return null; - } -} diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ArgumentMatchers.ts b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ArgumentMatchers.ts deleted file mode 100644 index 262bea1afbeb611029db0cfaeb65767b92f97b91..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ArgumentMatchers.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -export class ArgumentMatchers { - ANY = ""; - ANY_STRING = ""; - ANY_BOOLEAN = ""; - ANY_NUMBER = ""; - ANY_OBJECT = ""; - ANY_FUNCTION = ""; - MATCH_REGEXS = ""; - - static any() { - } - - static anyString() { - } - - static anyBoolean() { - } - - static anyNumber() { - } - - static anyObj() { - } - - static anyFunction() { - } - - static matchRegexs(regex: any) { - if (ArgumentMatchers.isRegExp(regex)) { - return regex; - } - throw Error("not a regex"); - } - - static isRegExp(value: string) { - return Object.prototype.toString.call(value) === "[object RegExp]"; - } - - matcheReturnKey(...args: Array) { - let arg = args[0]; - let regex = args[1]; - let stubSetKey = args[2]; - - if (stubSetKey && stubSetKey == this.ANY) { - return this.ANY; - } - - if (typeof arg === "string" && !regex) { - return this.ANY_STRING; - } - - if (typeof arg === "boolean" && !regex) { - return this.ANY_BOOLEAN; - } - - if (typeof arg === "number" && !regex) { - return this.ANY_NUMBER; - } - - if (typeof arg === "object" && !regex) { - return this.ANY_OBJECT; - } - - if (typeof arg === "function" && !regex) { - return this.ANY_FUNCTION; - } - - if (typeof arg === "string" && regex) { - return regex.test(arg); - } - - return null; - } - - matcheStubKey(key: any) { - - if (key === ArgumentMatchers.any) { - return this.ANY; - } - - if (key === ArgumentMatchers.anyString) { - return this.ANY_STRING; - } - if (key === ArgumentMatchers.anyBoolean) { - return this.ANY_BOOLEAN; - } - if (key === ArgumentMatchers.anyNumber) { - return this.ANY_NUMBER; - } - if (key === ArgumentMatchers.anyObj) { - return this.ANY_OBJECT; - } - if (key === ArgumentMatchers.anyFunction) { - return this.ANY_FUNCTION; - } - - if (ArgumentMatchers.isRegExp(key)) { - return key; - } - - return null; - } -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ExtendInterface.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ExtendInterface.js deleted file mode 100644 index 52f9dff07f7b719900ca47d56c3020586db31d5b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ExtendInterface.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ -class ExtendInterface { - constructor(mocker) { - this.mocker = mocker; - } - stub() { - this.params = arguments; - return this; - } - stubMockedCall(returnInfo) { - this.mocker.stubApply(this, this.params, returnInfo); - } - afterReturn(value) { - this.stubMockedCall(function () { - return value; - }); - } - afterReturnNothing() { - this.stubMockedCall(function () { - return undefined; - }); - } - afterAction(action) { - this.stubMockedCall(action); - } - afterThrow(msg) { - this.stubMockedCall(function () { - throw msg; - }); - } - clear(obj) { - this.mocker.clear(obj); - } -} -export default ExtendInterface; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/MockKit.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/MockKit.js deleted file mode 100644 index c1ca51614abe9f9c149094f5186eeb750b00a074..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/MockKit.js +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright (c) 2022-2023 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 ExtendInterface from "./ExtendInterface.js"; -import VerificationMode from "./VerificationMode.js"; -import { ArgumentMatchers } from "./ArgumentMatchers.js"; -class MockKit { - constructor() { - this.mFunctions = []; - this.stubs = new Map(); - this.recordCalls = new Map(); - this.currentSetKey = new Map(); - this.mockObj = null; - this.recordMockedMethod = new Map(); - this.mFunctions = []; - this.stubs = new Map(); - this.recordCalls = new Map(); - this.currentSetKey = new Map(); - this.mockObj = null; - this.recordMockedMethod = new Map(); - } - init() { - this.reset(); - } - reset() { - this.mFunctions = []; - this.stubs = new Map(); - this.recordCalls = new Map(); - this.currentSetKey = new Map(); - this.mockObj = null; - this.recordMockedMethod = new Map(); - } - clearAll() { - this.reset(); - } - clear(obj) { - if (!obj) throw Error("Please enter an object to be cleaned"); - if (typeof (obj) !== 'object' && typeof (obj) !== 'function') throw new Error('Not a object or static class'); - this.recordMockedMethod.forEach(function (value, key, map) { - if (key) { - obj[key] = value; - } - }); - } - ignoreMock(obj, method) { - if (typeof (obj) !== 'object' && typeof (obj) !== 'function') throw new Error('Not a object or static class'); - if (typeof (method) !== 'function') throw new Error('Not a function'); - let og = this.recordMockedMethod.get(method.propName); - if (og) { - obj[method.propName] = og; - this.recordMockedMethod.set(method.propName, undefined); - } - } - extend(dest, source) { - dest["stub"] = source["stub"]; - dest["afterReturn"] = source["afterReturn"]; - dest["afterReturnNothing"] = source["afterReturnNothing"]; - dest["afterAction"] = source["afterAction"]; - dest["afterThrow"] = source["afterThrow"]; - dest["stubMockedCall"] = source["stubMockedCall"]; - dest["clear"] = source["clear"]; - return dest; - } - stubApply(f, params, returnInfo) { - let values = this.stubs.get(f); - if (!values) { - values = new Map(); - } - let key = params[0]; - if (typeof key === "undefined") { - key = "anonymous-mock-" + f.propName; - } - let matcher = new ArgumentMatchers(); - if (matcher.matcheStubKey(key)) { - key = matcher.matcheStubKey(key); - if (key) { - this.currentSetKey.set(f, key); - } - } - values.set(key, returnInfo); - this.stubs.set(f, values); - } - getReturnInfo(f, params) { - let values = this.stubs.get(f); - if (!values) { - return undefined; - } - let retrunKet = params[0]; - if (typeof retrunKet === "undefined") { - retrunKet = "anonymous-mock-" + f.propName; - } - let stubSetKey = this.currentSetKey.get(f); - - if (stubSetKey && (typeof (retrunKet) !== "undefined")) { - retrunKet = stubSetKey; - } - let matcher = new ArgumentMatchers(); - if (matcher.matcheReturnKey(params[0], undefined, stubSetKey) && matcher.matcheReturnKey(params[0], undefined, stubSetKey) !== stubSetKey) { - retrunKet = params[0]; - } - values.forEach(function (value, key, map) { - if (ArgumentMatchers.isRegExp(key) && matcher.matcheReturnKey(params[0], key)) { - retrunKet = key; - } - }); - return values.get(retrunKet); - } - findName(obj, value) { - let properties = this.findProperties(obj); - let name = ''; - properties.filter((item) => (item !== 'caller' && item !== 'arguments')).forEach(function (va1, idx, array) { - if (obj[va1] === value) { - name = va1; - } - }); - return name; - } - isFunctionFromPrototype(f, container, propName) { - if (container.constructor !== Object && container.constructor.prototype !== container) { - return container.constructor.prototype[propName] === f; - } - return false; - } - findProperties(obj, ...arg) { - function getProperty(new_obj) { - if (new_obj.__proto__ === null) { - return []; - } - let properties = Object.getOwnPropertyNames(new_obj); - return [...properties, ...getProperty(new_obj.__proto__)]; - } - return getProperty(obj); - } - recordMethodCall(originalMethod, args) { - originalMethod['getName'] = function () { - return this.name || this.toString().match(/function\s*([^(]*)\(/)[1]; - }; - let name = originalMethod.getName(); - let arglistString = name + '(' + Array.from(args).toString() + ')'; - let records = this.recordCalls.get(arglistString); - if (!records) { - records = 0; - } - records++; - this.recordCalls.set(arglistString, records); - } - mockFunc(originalObject, originalMethod) { - let tmp = this; - this.originalMethod = originalMethod; - const _this = this; - let f = function () { - let args = arguments; - let action = tmp.getReturnInfo(f, args); - if (originalMethod) { - tmp.recordMethodCall(originalMethod, args); - } - if (action) { - return action.apply(_this, args); - } - }; - f.container = null || originalObject; - f.original = originalMethod || null; - if (originalObject && originalMethod) { - if (typeof (originalMethod) != 'function') - throw new Error('Not a function'); - var name = this.findName(originalObject, originalMethod); - originalObject[name] = f; - this.recordMockedMethod.set(name, originalMethod); - f.propName = name; - f.originalFromPrototype = this.isFunctionFromPrototype(f.original, originalObject, f.propName); - } - f.mocker = this; - this.mFunctions.push(f); - this.extend(f, new ExtendInterface(this)); - return f; - } - verify(methodName, argsArray) { - if (!methodName) { - throw Error("not a function name"); - } - let a = this.recordCalls.get(methodName + '(' + argsArray.toString() + ')'); - return new VerificationMode(a ? a : 0); - } - mockObject(object) { - if (!object || typeof object === "string") { - throw Error(`this ${object} cannot be mocked`); - } - const _this = this; - let mockedObject = {}; - let keys = Reflect.ownKeys(object); - keys.filter(key => (typeof Reflect.get(object, key)) === 'function') - .forEach((key) => { - mockedObject[key] = object[key]; - mockedObject[key] = _this.mockFunc(mockedObject, mockedObject[key]); - }); - return mockedObject; - } -} -function ifMockedFunction(f) { - if (Object.prototype.toString.call(f) != "[object Function]" && - Object.prototype.toString.call(f) != "[object AsyncFunction]") { - throw Error("not a function"); - } - if (!f.stub) { - throw Error("not a mock function"); - } - return true; -} -function when(f) { - if (ifMockedFunction(f)) { - return f.stub.bind(f); - } -} -function MockSetup(target, propertyName, descriptor) { - const aboutToAppearOrigin = target.aboutToAppear; - const setup = descriptor.value; - target.aboutToAppear = function (...args) { - if (target.__Param) { // copy attributes and params of the original context - try { - const map = target.__Param; - for (const [key, val] of map) { - this[key] = val; // 'this' refers to context of current function - } - } - catch (e) { - throw new Error(`Mock setup param error: ${e}`); - } - } - if (setup) { // apply the mock content - try { - setup.apply(this); - } - catch (e) { - throw new Error(`Mock setup apply error: ${e}`); - } - } - if (aboutToAppearOrigin) { // append to aboutToAppear function of the original context - aboutToAppearOrigin.apply(this, args); - } - }; -} -export { MockSetup, MockKit, when }; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/MockKit.ts b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/MockKit.ts deleted file mode 100644 index 2807643e29d6da16ee7061ce5674b696a4fc3ca6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/MockKit.ts +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright (c) 2023 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 ExtendInterface from "./ExtendInterface.js"; -import VerificationMode from "./VerificationMode.js"; -import { ArgumentMatchers } from "./ArgumentMatchers.js"; - -interface IFunction extends Function { - container: any; - original: any; - propName: string; - originalFromPrototype: boolean - mocker: MockKit -} - -class MockKit { - - private mFunctions:Array = []; - private stubs = new Map(); - private recordCalls = new Map(); - private currentSetKey = new Map(); - private mockObj = null; - private recordMockedMethod = new Map(); - private originalMethod: any; - - constructor() { - this.mFunctions = []; - this.stubs = new Map(); - this.recordCalls = new Map(); - this.currentSetKey = new Map(); - this.mockObj = null; - this.recordMockedMethod = new Map(); - } - - init() { - this.reset(); - } - - reset() { - this.mFunctions = []; - this.stubs = new Map() - this.recordCalls = new Map(); - this.currentSetKey = new Map(); - this.mockObj = null; - this.recordMockedMethod = new Map(); - } - - clearAll() { - this.reset(); - } - - clear(obj: any) { - if (!obj) throw Error("Please enter an object to be cleaned"); - if (typeof (obj) != 'object') throw new Error('Not a object'); - this.recordMockedMethod.forEach(function (value, key, map) { - if (key) { - obj[key] = value; - } - }); - } - - ignoreMock(obj:any, method: any) { - if (typeof (obj) != 'object') throw new Error('Not a object'); - if (typeof (method) != 'function') throw new Error('Not a function'); - let og = this.recordMockedMethod.get(method.propName); - if (og) { - obj[method.propName] = og; - this.recordMockedMethod.set(method.propName, undefined); - } - } - - extend(dest: any, source:any) { - dest["stub"] = source["stub"]; - dest["afterReturn"] = source["afterReturn"]; - dest["afterReturnNothing"] = source["afterReturnNothing"]; - dest["afterAction"] = source["afterAction"]; - dest["afterThrow"] = source["afterThrow"]; - dest["stubMockedCall"] = source["stubMockedCall"]; - dest["clear"] = source["clear"]; - return dest; - } - - stubApply(f: any, params:any, returnInfo:any) { - let values = this.stubs.get(f); - if (!values) { - values = new Map(); - } - let key = params[0]; - if (typeof key == "undefined") { - key = "anonymous-mock-" + f.propName; - } - let matcher = new ArgumentMatchers(); - if (matcher.matcheStubKey(key)) { - key = matcher.matcheStubKey(key); - if (key) { - this.currentSetKey.set(f, key); - } - } - values.set(key, returnInfo); - this.stubs.set(f, values); - } - - getReturnInfo(f: any, params:any) { - let values = this.stubs.get(f); - if (!values) { - return undefined; - } - let retrunKet = params[0]; - if (typeof retrunKet == "undefined") { - retrunKet = "anonymous-mock-" + f.propName; - } - let stubSetKey = this.currentSetKey.get(f); - - if (stubSetKey && (typeof (retrunKet) != "undefined")) { - retrunKet = stubSetKey; - } - let matcher = new ArgumentMatchers(); - if (matcher.matcheReturnKey(params[0], undefined, stubSetKey) && matcher.matcheReturnKey(params[0], undefined, stubSetKey) != stubSetKey) { - retrunKet = params[0]; - } - - values.forEach(function (value: any, key: any, map: any) { - if (ArgumentMatchers.isRegExp(key) && matcher.matcheReturnKey(params[0], key)) { - retrunKet = key; - } - }); - - return values.get(retrunKet); - } - - findName(obj: any, value: any) { - let properties = this.findProperties(obj); - let name = ''; - properties.filter((item:any) => (item !== 'caller' && item !== 'arguments')).forEach( - function (va1:any, idx:any, array:any) { - if (obj[va1] === value) { - name = va1; - } - } - ); - return name; - } - - isFunctionFromPrototype(f: Function, container:Function, propName: string) { - if (container.constructor != Object && container.constructor.prototype !== container) { - return container.constructor.prototype[propName] === f; - } - return false; - } - - findProperties(obj: any, ...arg: Array) { - function getProperty(new_obj:any): Array { - if (new_obj.__proto__ === null) { - return []; - } - let properties = Object.getOwnPropertyNames(new_obj); - return [...properties, ...getProperty(new_obj.__proto__)]; - } - return getProperty(obj); - } - - recordMethodCall(originalMethod: any, args: any) { - originalMethod['getName'] = function () { - return this.name || this.toString().match(/function\s*([^(]*)\(/)[1]; - } - let name = originalMethod.getName(); - let arglistString = name + '(' + Array.from(args).toString() + ')'; - let records = this.recordCalls.get(arglistString); - if (!records) { - records = 0; - } - records++; - this.recordCalls.set(arglistString, records); - } - - mockFunc(originalObject:any, originalMethod:any) { - let tmp = this; - this.originalMethod = originalMethod; - const _this = this; - let f:any = function () { - let args = arguments; - let action = tmp.getReturnInfo(f, args); - if (originalMethod) { - tmp.recordMethodCall(originalMethod, args); - } - if (action) { - return action.apply(_this, args); - } - }; - - f.container = null || originalObject; - f.original = originalMethod || null; - - if (originalObject && originalMethod) { - if (typeof (originalMethod) != 'function') throw new Error('Not a function'); - var name = this.findName(originalObject, originalMethod); - originalObject[name] = f; - this.recordMockedMethod.set(name, originalMethod); - f.propName = name; - f.originalFromPrototype = this.isFunctionFromPrototype(f.original, originalObject, f.propName); - } - f.mocker = this; - this.mFunctions.push(f); - this.extend(f, new ExtendInterface(this)); - return f; - } - - verify(methodName:any, argsArray:any) { - if (!methodName) { - throw Error("not a function name"); - } - let a = this.recordCalls.get(methodName + '(' + argsArray.toString() + ')'); - return new VerificationMode(a ? a : 0); - } - - mockObject(object: any) { - if (!object || typeof object === "string") { - throw Error(`this ${object} cannot be mocked`); - } - const _this = this; - let mockedObject:any = {}; - let keys = Reflect.ownKeys(object); - keys.filter(key => (typeof Reflect.get(object, key)) === 'function') - .forEach((key:any) => { - mockedObject[key] = object[key]; - mockedObject[key] = _this.mockFunc(mockedObject, mockedObject[key]); - }); - return mockedObject; - } -} - -function ifMockedFunction(f: any) { - if (Object.prototype.toString.call(f) != "[object Function]" && - Object.prototype.toString.call(f) != "[object AsyncFunction]") { - throw Error("not a function"); - } - if (!f.stub) { - throw Error("not a mock function"); - } - return true; -} - -function when(f: any) { - if (ifMockedFunction(f)) { - return f.stub.bind(f); - } -} - -function MockSetup(target: Object, propertyName: string | Symbol, descriptor: TypedPropertyDescriptor<() => void>): void { - const aboutToAppearOrigin = target.aboutToAppear; - const setup = descriptor.value; - target.aboutToAppear = function (...args: any[]) { - if (target.__Param) { // copy attributes and params of the original context - try { - const map = target.__Param as Map; - for (const [key, val] of map) { - this[key] = val; // 'this' refers to context of current function - } - } catch (e) { - throw new Error(`Mock setup param error: ${e}`); - } - } - - if (setup) { // apply the mock content - try { - setup.apply(this); - } catch (e) { - throw new Error(`Mock setup apply error: ${e}`); - } - } - - if (aboutToAppearOrigin) { // append to aboutToAppear function of the original context - aboutToAppearOrigin.apply(this, args); - } - } -} - -export { - MockSetup, - MockKit, - when -}; \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/VerificationMode.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/VerificationMode.js deleted file mode 100644 index 21e10fb8037f59475510b2821fcf7432c9459a4a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/VerificationMode.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2022-2023 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. - */ -class VerificationMode { - constructor(times) { - this.doTimes = times; - } - times(count) { - if (count !== this.doTimes) { - throw Error(`expect ${count} actual ${this.doTimes}`); - } - } - never() { - if (this.doTimes !== 0) { - throw Error(`expect 0 actual ${this.doTimes}`); - } - } - once() { - if (this.doTimes !== 1) { - throw Error(`expect 1 actual ${this.doTimes}`); - } - } - atLeast(count) { - if (count > this.doTimes) { - throw Error('failed ' + count + ' greater than the actual execution times of method'); - } - } - atMost(count) { - if (count < this.doTimes) { - throw Error('failed ' + count + ' less than the actual execution times of method'); - } - } -} -export default VerificationMode; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/module.json b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/module.json deleted file mode 100644 index 384ae72f9bd2353fea8a5c9c5d6696ab5e67cb21..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/module.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "app": { - "bundleName": "com.example.hamock", - "debug": true, - "versionCode": 1000000, - "versionName": "1.0.0", - "minAPIVersion": 9, - "targetAPIVersion": 9, - "apiReleaseType": "Release" - }, - "module": { - "name": "hamock", - "type": "har", - "deviceTypes": [ - "default", - "tablet", - "tv", - "wearable", - "car" - ] - } -} diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/res/schemas/mock-config-json5-schema.json b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/res/schemas/mock-config-json5-schema.json deleted file mode 100644 index 96036325a316d827cb9fcb6908b3de23c53b4b79..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/res/schemas/mock-config-json5-schema.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "JSON schema for mock-config.json5 file", - "definitions": { - "sourceRedirection": { - "description": "A source redirection for mocked module.", - "type": "object", - "required": [ - "source" - ], - "properties": { - "source": { - "type": "string", - "maxLength": 128, - "minLength": 1 - } - } - } - }, - "patternProperties": { - ".+": { - "$ref": "#/definitions/sourceRedirection" - } - } -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/BuildProfile.ets b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/BuildProfile.ets deleted file mode 100644 index 3da4b66931cbd61e2b904640696d5dfcfe78a1bc..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/BuildProfile.ets +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Use these variables when you tailor your ArkTS code. They must be of the const type. - */ -export const HAR_VERSION = '1.0.24'; -export const BUILD_MODE_NAME = 'debug'; -export const DEBUG = true; -export const TARGET_NAME = 'default'; - -/** - * BuildProfile Class is used only for compatibility purposes. - */ -export default class BuildProfile { - static readonly HAR_VERSION = HAR_VERSION; - static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; - static readonly DEBUG = DEBUG; - static readonly TARGET_NAME = TARGET_NAME; -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/CHANGELOG.md b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/CHANGELOG.md deleted file mode 100644 index 3953f9d91b50454be0c6a192dc464d5ab3b68545..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/CHANGELOG.md +++ /dev/null @@ -1,33 +0,0 @@ -### 1.0.24 -- 提示信息优化 -### 1.0.23 -- 断言错误提示信息优化 -### 1.0.22 -- mock五参数失败问题修复 -### 1.0.21 -- mock支持多参数 -- describe中异步函数抛出日志信息 -- 修复多测试套时,执行单个测试套会打印其他测试套的日志信息 -## 1.0.14 -- 堆栈信息打印到cmd -## 1.0.15 -- 支持获取测试代码的失败堆栈信息 -- mock代码迁移至harmock包 -- 适配arkts语法 -- 修复覆盖率数据容易截断的bug -## 1.0.16 -- 修改覆盖率文件生成功能 -- 修改静态方法无法ignoreMock函数 - ## 1.0.17 -- 修改not断言失败提示日志 -- 自定义错误message信息 -- 添加xdescribe, xit API功能 - ## 1.0.18 -- 添加全局变量存储API get set -- 自定义断言功能 -## 1.0.18-rc.0 -添加框架worker执行能力 -## 1.0.19 -规范日志格式 -# 1.0.20 -代码告警整改 \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/LICENSE b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/LICENSE deleted file mode 100644 index 4947287f7b5ccb5d1e8b7b2d3aa5d89f322c160d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/README.md b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/README.md deleted file mode 100644 index c7a16a7eead030baf267502401d19228ed14c27c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/README.md +++ /dev/null @@ -1,229 +0,0 @@ -
Hypium
-
A unit test framework for OpenHarmonyOS application
- -## Hypium是什么? -*** -- Hypium是OpenHarmony上的测试框架,提供测试用例编写、执行、结果显示能力,用于OpenHarmony系统应用接口以及应用界面测试。 -- Hypium结构化模型:hypium工程主要由List.test.js与TestCase.test.js组成。 -``` -rootProject // Hypium工程根目录 -├── moduleA -│   ├── src -│      ├── main // 被测试应用目录 -│      ├── ohosTest // 测试用例目录 -│         ├── js/ets -│            └── test -│               └── List.test.js // 测试用例加载脚本,ets目录下为.ets后缀 -│               └── TestCase.test.js // 测试用例脚本,ets目录下为.ets后缀 -└── moduleB - ... -│               └── List.test.js // 测试用例加载脚本,ets目录下为.ets后缀 -│               └── TestCase.test.js // 测试用例脚本,ets目录下为.ets后缀 -``` - -## 安装使用 - -- 方式一 -```javascript -ohpm i @ohos/hypium -``` -- 方式二 -*** -- 在DevEco Studio内使用Hypium -- 工程级oh-package.json5内配置: -```json -"dependencies": { - "@ohos/hypium": "1.0.24" -} -``` -注: -hypium服务于OpenHarmonyOS应用对外接口测试、系统对外接口测试(SDK中接口),完成HAP自动化测试。详细指导: -[Deveco Studio](https://developer.harmonyos.com/cn/develop/deveco-studio) - -#### 通用语法 - -- 测试用例采用业内通用语法,describe代表一个测试套, it代表一条用例。 - -| No. | API | 功能说明 | -|-----| ----------------- |------------------------------------------------------------------------| -| 1 | describe | 定义一个测试套,支持两个参数:测试套名称和测试套函数。其中测试套函数不能是异步函数 | -| 2 | beforeAll | 在测试套内定义一个预置条件,在所有测试用例开始前执行且仅执行一次,支持一个参数:预置动作函数。 | -| 3 | beforeEach | 在测试套内定义一个单元预置条件,在每条测试用例开始前执行,执行次数与it定义的测试用例数一致,支持一个参数:预置动作函数。 | -| 4 | afterEach | 在测试套内定义一个单元清理条件,在每条测试用例结束后执行,执行次数与it定义的测试用例数一致,支持一个参数:清理动作函数。 | -| 5 | afterAll | 在测试套内定义一个清理条件,在所有测试用例结束后执行且仅执行一次,支持一个参数:清理动作函数。 | -| 6 | beforeItSpecified | @since1.0.15在测试套内定义一个单元预置条件,仅在指定测试用例开始前执行,支持两个参数:单个用例名称或用例名称数组、预置动作函数。 | -| 7 | afterItSpecified | @since1.0.15在测试套内定义一个单元清理条件,仅在指定测试用例结束后执行,支持两个参数:单个用例名称或用例名称数组、清理动作函数 | -| 8 | it | 定义一条测试用例,支持三个参数:用例名称,过滤参数和用例函数。 | -| 9 | expect | 支持bool类型判断等多种断言方法。 | -| 10 | xdescribe | @since1.0.17定义一个跳过的测试套,支持两个参数:测试套名称和测试套函数。 | -| 11 | xit | @since1.0.17定义一条跳过的测试用例,支持三个参数:用例名称,过滤参数和用例函数。 | | - -#### 断言库 - -- 示例代码: - -```javascript - expect(${actualvalue}).assertX(${expectvalue}) -``` - -- 断言功能列表: - -| No. | API | 功能说明 | -| :--- | :------------------------------- | ---------------------------------------------------------------------------------------------- | -| 1 | assertClose | 检验actualvalue和expectvalue(0)的接近程度是否是expectValue(1) | -| 2 | assertContain | 检验actualvalue中是否包含expectvalue | -| 3 | assertDeepEquals | @since1.0.4 检验actualvalue和expectvalue(0)是否是同一个对象 | -| 4 | assertEqual | 检验actualvalue是否等于expectvalue[0] | -| 5 | assertFail | 抛出一个错误 | -| 6 | assertFalse | 检验actualvalue是否是false | -| 7 | assertTrue | 检验actualvalue是否是true | -| 8 | assertInstanceOf | 检验actualvalue是否是expectvalue类型 | -| 9 | assertLarger | 检验actualvalue是否大于expectvalue | -| 10 | assertLess | 检验actualvalue是否小于expectvalue | -| 11 | assertNaN | @since1.0.4 检验actualvalue是否是NaN | -| 12 | assertNegUnlimited | @since1.0.4 检验actualvalue是否等于Number.NEGATIVE_INFINITY | -| 13 | assertNull | 检验actualvalue是否是null | -| 14 | assertPosUnlimited | @since1.0.4 检验actualvalue是否等于Number.POSITIVE_INFINITY | -| 15 | assertPromiseIsPending | @since1.0.4 检验actualvalue是否处于Pending状态【actualvalue为promse对象】 | -| 16 | assertPromiseIsRejected | @since1.0.4 检验actualvalue是否处于Rejected状态【同15】 | -| 17 | assertPromiseIsRejectedWith | @since1.0.4 检验actualvalue是否处于Rejected状态,并且比较执行的结果值【同15】 | -| 18 | assertPromiseIsRejectedWithError | @since1.0.4 检验actualvalue是否处于Rejected状态并有异常,同时比较异常的类型和message值【同15】 | -| 19 | assertPromiseIsResolved | @since1.0.4 检验actualvalue是否处于Resolved状态【同15】 | -| 20 | assertPromiseIsResolvedWith | @since1.0.4 检验actualvalue是否处于Resolved状态,并且比较执行的结果值【同15】 | -| 21 | assertThrowError | 检验actualvalue抛出Error内容是否是expectValue | -| 22 | assertUndefined | 检验actualvalue是否是undefined | -| 23 | not | @since1.0.4 断言结果取反 | -| 24 | message | @since1.0.17自定义断言异常信息 | - -示例代码: - -```javascript - import { describe, it, expect } from '@ohos/hypium'; - - export default async function assertCloseTest() { - describe('assertClose', function () { - it('assertClose_success', 0, function () { - let a = 100; - let b = 0.1; - expect(a).assertClose(99, b); - }) - }) - } -``` - -#### 公共系统能力 - -| No. | API | 功能描述 | -| ---- | ------------------------------------------------------- | ------------------------------------------------------------ | -| 1 | existKeyword(keyword: string, timeout: number): boolean | @since1.0.3 hilog日志中查找指定字段是否存在,keyword是待查找关键字,timeout为设置的查找时间 | -| 2 | actionStart(tag: string): void | @since1.0.3 cmd窗口输出开始tag | -| 3 | actionEnd(tag: string): void | @since1.0.3 cmd窗口输出结束tag | - -示例代码: - -```javascript -import { describe, it, expect, SysTestKit} from '@ohos/hypium'; - -export default function existKeywordTest() { - describe('existKeywordTest', function () { - it('existKeyword',DEFAULT, async function () { - console.info("HelloTest"); - let isExist = await SysTestKit.existKeyword('HelloTest'); - console.info('isExist ------>' + isExist); - }) - }) -} -``` -```javascript -import { describe, it, expect, SysTestKit} from '@ohos/hypium'; - -export default function actionTest() { - describe('actionTest', function () { - it('existKeyword',DEFAULT, async function () { - let tag = '[MyTest]'; - SysTestKit.actionStart(tag); - //do something - SysTestKit.actionEnd(tag); - }) - }) -} -``` - -#### 专项能力 - -- 测试用例属性筛选能力:hypium支持根据用例属性筛选执行指定测试用例,使用方式是先在测试用例上标记用例属性后,再在测试应用的启动shell命令后新增" -s ${Key} ${Value}"。 - -| Key | 含义说明 | Value取值范围 | -| -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -| level | 用例级别 | "0","1","2","3","4", 例如:-s level 1 | -| size | 用例粒度 | "small","medium","large", 例如:-s size small | -| testType | 用例测试类型 | "function","performance","power","reliability","security","global","compatibility","user","standard","safety","resilience", 例如:-s testType function | - -示例代码 - -```javascript -import { describe, it, expect, TestType, Size, Level } from '@ohos/hypium'; - -export default function attributeTest() { - describe('attributeTest', function () { - it("testAttributeIt", TestType.FUNCTION | Size.SMALLTEST | Level.LEVEL0, function () { - console.info('Hello Test'); - }) - }) -} -``` - -示例命令 -```shell -XX -s level 1 -s size small -s testType function -``` -该命令的作用是:筛选测试应用中同时满足a)用例级别是1 b)用例粒度是small c)用例测试类型是function 三个条件的用例执行。 - -- 测试套/测试用例名称筛选能力(测试套与用例名称用“#”号连接,多个用“,”英文逗号分隔) - -| Key | 含义说明 | Value取值范围 | -| -------- | ----------------------- | -------------------------------------------------------------------------------------------- | -| class | 指定要执行的测试套&用例 | ${describeName}#${itName},${describeName} , 例如:-s class attributeTest#testAttributeIt | -| notClass | 指定不执行的测试套&用例 | ${describeName}#${itName},${describeName} , 例如:-s notClass attributeTest#testAttributeIt | - -示例命令 -```shell -XX -s class attributeTest#testAttributeIt,abilityTest#testAbilityIt -``` -该命令的作用是:筛选测试应用中attributeTest测试套下的testAttributeIt测试用例,abilityTest测试套下的testAbilityIt测试用例,只执行这两条用例。 - -- 其他能力 - -| 能力项 | Key | 含义说明 | Value取值范围 | -| ------------ | ------- | ---------------------------- | ---------------------------------------------- | -| 随机执行能力 | random | 测试套&测试用例随机执行 | true, 不传参默认为false, 例如:-s random true | -| 空跑能力 | dryRun | 显示要执行的测试用例信息全集 | true , 不传参默认为false,例如:-s dryRun true | -| 异步超时能力 | timeout | 异步用例执行的超时时间 | 正整数 , 单位ms,例如:-s timeout 5000 | - -##### 约束限制 -随机执行能力和空跑能力从npm包1.0.3版本开始支持 - -#### Mock能力 - -##### 约束限制 - -单元测试框架Mock能力从npm包[1.0.1版本](https://repo.harmonyos.com/#/cn/application/atomService/@ohos%2Fhypium/v/1.0.1)开始支持 - -## 约束 - -*** - 本模块首批接口从OpenHarmony SDK API version 8开始支持。 - -## Hypium开放能力隐私声明 - -- 我们如何收集和使用您的个人信息 - 您在使用集成了Hypium开放能力的测试应用时,Hypium不会处理您的个人信息。 -- SDK处理的个人信息 - 不涉及。 -- SDK集成第三方服务声明 - 不涉及。 -- SDK数据安全保护 - 不涉及。 -- SDK版本更新声明 - 为了向您提供最新的服务,我们会不时更新Hypium版本。我们强烈建议开发者集成使用最新版本的Hypium。 - diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/build-profile.json5 b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/build-profile.json5 deleted file mode 100644 index e6773f9f5d76a66d6d19fddc9c6ddb3f5621d3b1..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/build-profile.json5 +++ /dev/null @@ -1,31 +0,0 @@ -{ - "apiType": "stageMode", - "buildOption": { - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - }, - "consumerFiles": [ - "./consumer-rules.txt" - ] - } - }, - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest" - } - ] -} diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/consumer-rules.txt b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/consumer-rules.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/hvigorfile.ts b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/hvigorfile.ts deleted file mode 100644 index 805c5d7f6809c51cff0b4adcc1142979f8f864b6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { harTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins: [] /* Custom plugin to extend the functionality of Hvigor. */ -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/index.d.ts b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/index.d.ts deleted file mode 100644 index 7272b5fa839a2cd510d0c70d517bb6800133dba2..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/index.d.ts +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ - -export const DEFAULT = 0B0000 - -export const when: when; - -export enum TestType { - FUNCTION = 0B1, - PERFORMANCE = 0B1 << 1, - POWER = 0B1 << 2, - RELIABILITY = 0B1 << 3, - SECURITY = 0B1 << 4, - GLOBAL = 0B1 << 5, - COMPATIBILITY = 0B1 << 6, - USER = 0B1 << 7, - STANDARD = 0B1 << 8, - SAFETY = 0B1 << 9, - RESILIENCE = 0B1 << 10 -} - -export enum Size { - SMALLTEST = 0B1 << 16, - MEDIUMTEST = 0B1 << 17, - LARGETEST = 0B1 << 18 -} - -export enum Level { - LEVEL0 = 0B1 << 24, - LEVEL1 = 0B1 << 25, - LEVEL2 = 0B1 << 26, - LEVEL3 = 0B1 << 27, - LEVEL4 = 0B1 << 28 -} -export { xdescribe, xit, describe, it } from './index'; - - - -export function beforeItSpecified(testCaseNames: Array | string, callback: Function): void - -export function afterItSpecified(testCaseNames: Array | string, callback: Function): void - -export function beforeEach(callback: Function): void - -export function afterEach(callback: Function): void - -export function beforeAll(callback: Function): void - -export function afterAll(callback: Function): void - - -export interface Assert { - assertClose(expectValue: number, precision: number): void - assertContain(expectValue: any): void - assertEqual(expectValue: any): void - assertFail(): void - assertFalse(): void - assertTrue(): void - assertInstanceOf(expectValue: string): void - assertLarger(expectValue: number): void - assertLess(expectValue: number): void - assertNull(): void - assertThrowError(expectValue: string | Function): void - assertUndefined(): void - assertLargerOrEqual(expectValue: number): void - assertLessOrEqual(expectValue: number): void - assertNaN(): void - assertNegUnlimited(): void - assertPosUnlimited(): void - not(): Assert; - assertDeepEquals(expectValue: any): void - assertPromiseIsPending(): Promise - assertPromiseIsRejected(): Promise - assertPromiseIsRejectedWith(expectValue?: any): Promise - assertPromiseIsRejectedWithError(...expectValue): Promise - assertPromiseIsResolved(): Promise - assertPromiseIsResolvedWith(expectValue?: any): Promise - message(msg: string): Assert -} - -export function expect(actualValue?: any): Assert - -export class ArgumentMatchers { - static any; - static anyString; - static anyBoolean; - static anyNumber; - static anyObj; - static anyFunction; - static matchRegexs(Regex: RegExp): void -} - -declare interface when { - afterReturn(value: any): any - afterReturnNothing(): undefined - afterAction(action: any): any - afterThrow(e_msg: string): string - (argMatchers?: any): when; -} - -export interface VerificationMode { - times(count: Number): void - never(): void - once(): void - atLeast(count: Number): void - atMost(count: Number): void -} - -export class MockKit { - constructor() - mockFunc(obj: Object, func: Function): Function - mockObject(obj: Object): Object - verify(methodName: String, argsArray: Array): VerificationMode - ignoreMock(obj: Object, func: Function): void - clear(obj: Object): void - clearAll(): void -} - -export class SysTestKit { - static getDescribeName(): string; - static getItName(): string; - static getItAttribute(): TestType | Size | Level - static actionStart(tag: string): void - static actionEnd(tag: string): void - static existKeyword(keyword: string, timeout?: number): boolean -} - -export class Hypium { - static setData(data: { [key: string]: any }): void - static setTimeConfig(systemTime: any) - static hypiumTest(abilityDelegator: any, abilityDelegatorArguments: any, testsuite: Function): void - static set(key: string, value: any): void - static get(key: string): any - static registerAssert(customAssertion: Function): void - static unregisterAssert(customAssertion: string | Function): void - static hypiumWorkerTest(abilityDelegator: Object, abilityDelegatorArguments: Object, testsuite: Function, workerPort: Object): void; - static hypiumInitWorkers(abilityDelegator: Object, scriptURL: string, workerNum: number, params: Object): void; -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/index.ets b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/index.ets deleted file mode 100644 index 98b0ec55fe1e1d9d0a9b8a4eacc0a3c1a8091d1e..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/index.ets +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2021-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 Core from './src/main/core'; -import {TestType, Size, Level, DEFAULT} from './src/main/Constant'; -import DataDriver from './src/main/module/config/DataDriver'; -import ExpectExtend from './src/main/module/assert/ExpectExtend'; -import OhReport from './src/main/module/report/OhReport'; -export { xdescribe, xit, describe, it } from './index.ts'; - -export declare class Hypium { - static setData(data: Object): void - static setTimeConfig(systemTime: Object): void - static hypiumTest(abilityDelegator: Object, abilityDelegatorArguments: Object, testsuite: Function): void - static set(key: string, value: Object): void - static get(key: string): Object - static registerAssert(customAssertion: Function): void - static unregisterAssert(customAssertion: string | Function): void - static hypiumWorkerTest(abilityDelegator: Object, abilityDelegatorArguments: Object, - testsuite: Function, workerPort: Object): void; - static hypiumInitWorkers(abilityDelegator: Object, scriptURL: string, workerNum: number, params: Object): void; -} - -export { - Core, - DataDriver, - ExpectExtend, - OhReport, - TestType, - Size, - Level, - DEFAULT -}; - -type allExpectType = Object | undefined | null - -export declare function beforeItSpecified(testCaseNames: Array | string, callback: Function): void - -export declare function afterItSpecified(testCaseNames: Array | string, callback: Function): void - -export declare function beforeEach(callback: Function): void - -export declare function afterEach(callback: Function): void - -export declare function beforeAll(callback: Function): void - -export declare function afterAll(callback: Function): void - -export declare interface Assert { - assertClose(expectValue: number, precision: number): void - assertContain(expectValue: allExpectType): void - assertEqual(expectValue: allExpectType): void - assertFail(): void - assertFalse(): void - assertTrue(): void - assertInstanceOf(expectValue: string): void - assertLarger(expectValue: number): void - assertLess(expectValue: number): void - assertNull(): void - assertThrowError(expectValue: string | Function): void - assertUndefined(): void - assertLargerOrEqual(expectValue: number):void - assertLessOrEqual(expectValue: number):void - assertNaN():void - assertNegUnlimited(): void - assertPosUnlimited(): void - not(): Assert; - assertDeepEquals(expectValue: allExpectType):void - assertPromiseIsPending(): Promise - assertPromiseIsRejected(): Promise - assertPromiseIsRejectedWith(expectValue?: allExpectType): Promise - assertPromiseIsRejectedWithError(...expectValue: allExpectType[]): Promise - assertPromiseIsResolved(): Promise - assertPromiseIsResolvedWith(expectValue?: allExpectType): Promise - message(msg: string): Assert -} - -export declare function expect(actualValue?: allExpectType): Assert - -export declare class ArgumentMatchers { - public static any: allExpectType; - public static anyString: string; - public static anyBoolean: Boolean; - public static anyNumber: Number; - public static anyObj: Object; - public static anyFunction: Function; - public static matchRegexs(regex: RegExp): void -} - -declare interface whenResult { - afterReturn: (value: allExpectType) => allExpectType - afterReturnNothing: () => undefined - afterAction: (action: allExpectType) => allExpectType - afterThrow: (e_msg: string) => string -} - -export declare function when(f:Function): (...args: (allExpectType | void)[]) => whenResult - -export declare interface VerificationMode { - times(count: Number): void - never(): void - once(): void - atLeast(count: Number): void - atMost(count: Number): void -} - -export declare class MockKit { - constructor() - mockFunc(obj: Object, func: Function): Function - mockObject(obj: Object): Object - verify(methodName: String, argsArray: Array): VerificationMode - ignoreMock(obj: Object, func: Function): void - clear(obj: Object): void - clearAll(): void -} - -export declare class SysTestKit { - static getDescribeName(): string; - static getItName(): string; - static getItAttribute(): TestType | Size | Level - static actionStart(tag: string): void - static actionEnd(tag: string): void - static existKeyword(keyword: string, timeout?: number): boolean -} - diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/index.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/index.js deleted file mode 100644 index 02d06d9d1b4b478aa2aec70ba3a73a5e123c98db..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/index.js +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (c) 2021-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 Core from './src/main/core'; -import { DEFAULT, TestType, Size, Level, TAG, PrintTag } from './src/main/Constant'; -import DataDriver from './src/main/module/config/DataDriver'; -import ExpectExtend from './src/main/module/assert/ExpectExtend'; -import OhReport from './src/main/module/report/OhReport'; -import SysTestKit from './src/main/module/kit/SysTestKit'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, beforeItSpecified, afterItSpecified, xdescribe, xit } from './src/main/interface'; -import { MockKit, when } from './src/main/module/mock/MockKit'; -import ArgumentMatchers from './src/main/module/mock/ArgumentMatchers'; -import worker from '@ohos.worker'; - -class Hypium { - static context = new Map(); - static setData(data) { - const core = Core.getInstance(); - const dataDriver = new DataDriver({ data }); - core.addService('dataDriver', dataDriver); - } - - static setTimeConfig(systemTime) { - SysTestKit.systemTime = systemTime; - } - - static set(key, value) { - Hypium.context.set(key, value); - } - - static get(key) { - return Hypium.context.get(key); - } - - static hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) { - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const ohReport = new OhReport({ - 'delegator': abilityDelegator, - 'abilityDelegatorArguments': abilityDelegatorArguments - }); - SysTestKit.delegator = abilityDelegator; - core.addService('report', ohReport); - core.init(); - core.subscribeEvent('spec', ohReport); - core.subscribeEvent('suite', ohReport); - core.subscribeEvent('task', ohReport); - const configService = core.getDefaultService('config'); - if (abilityDelegatorArguments !== null) { - let testParameters = configService.translateParams(abilityDelegatorArguments.parameters); - console.info(`${TAG}parameters:${JSON.stringify(testParameters)}`); - configService.setConfig(testParameters); - } - testsuite(); - core.execute(abilityDelegator); - } - static async hypiumInitWorkers(abilityDelegator, scriptURL, workerNum = 8, params) { - console.info(`${TAG}, hypiumInitWorkers call,${scriptURL}`); - let workerPromiseArray = []; - - // 开始统计时间 - let startTime = await SysTestKit.getRealTime(); - for (let i = 0; i < workerNum; i++) { - // 创建worker线程 - const workerPromise = Hypium.createWorkerPromise(scriptURL, i, params); - workerPromiseArray.push(workerPromise); - } - const ret = {total: 0, failure: 0, error: 0, pass: 0, ignore: 0, duration: 0}; - Promise.all(workerPromiseArray).then(async (items) => { - console.info(`${TAG}, all result from workers, ${JSON.stringify(items)}`); - let allItemList = new Array(); - // 统计执行结果 - Hypium.handleWorkerTestResult(ret, allItemList, items); - console.info(`${TAG}, all it result, ${JSON.stringify(allItemList)}`); - // 统计用例执行结果 - const retResult = {total: 0, failure: 0, error: 0, pass: 0, ignore: 0, duration: 0}; - // 标记用例执行结果 - Hypium.configWorkerItTestResult(retResult, allItemList); - // 打印用例结果 - Hypium.printWorkerTestResult(abilityDelegator, allItemList); - // 用例执行完成统计时间 - let endTime = await SysTestKit.getRealTime(); - const taskConsuming = endTime - startTime; - const message = - `\n${PrintTag.OHOS_REPORT_ALL_RESULT}: stream=Test run: runTimes: ${ret.total},total: ${retResult.total}, Failure: ${retResult.failure}, Error: ${retResult.error}, Pass: ${retResult.pass}, Ignore: ${retResult.ignore}` + - `\n${PrintTag.OHOS_REPORT_ALL_CODE}: ${retResult.failure > 0 || retResult.error > 0 ? -1 : 0}` + - `\n${PrintTag.OHOS_REPORT_ALL_STATUS}: taskconsuming=${taskConsuming > 0 ? taskConsuming : ret.duration}`; - abilityDelegator.printSync(message); - console.info(`${TAG}, [end] you worker test`); - abilityDelegator.finishTest('you worker test finished!!!', 0, () => {}); - }).catch((e) => { - console.info(`${TAG}, [end] error you worker test, ${JSON.stringify(e)}`); - abilityDelegator.finishTest('you worker test error finished!!!', 0, () => {}); - }).finally(() => { - console.info(`${TAG}, all promise finally end`); - }); - } - // 创建worker线程 - static createWorkerPromise(scriptURL, i, params) { - console.info(`${TAG}, createWorkerPromiser, ${scriptURL}, ${i}`); - const workerPromise = new Promise((resolve, reject) => { - const workerInstance = new worker.ThreadWorker(scriptURL, {name: `worker_${i}`}); - console.info(`${TAG}, send data to worker`); - // 发送数据到worker线程中 - workerInstance.postMessage(params); - workerInstance.onmessage = function (e) { - let currentThreadName = e.data?.currentThreadName; - console.info(`${TAG}, receview data from ${currentThreadName}, ${JSON.stringify(e.data)}`); - // - resolve(e.data?.summary); - console.info(`${TAG}, ${currentThreadName} finish`); - workerInstance.terminate(); - }; - workerInstance.onerror = function (e) { - console.info(`${TAG}, worker error, ${JSON.stringify(e)}`); - reject(e); - workerInstance.terminate(); - }; - workerInstance.onmessageerror = function (e) { - console.info(`${TAG}, worker message error, ${JSON.stringify(e)}`); - reject(e); - workerInstance.terminate(); - }; - }); - return workerPromise; - } - static handleWorkerTestResult(ret, allItemList, items) { - console.info(`${TAG}, handleWorkerTestResult, ${JSON.stringify(items)}`); - for (const {total, failure, error, pass, ignore, duration, itItemList} of items) { - ret.total += total; - ret.failure += failure; - ret.error += error; - ret.pass += pass; - ret.ignore += ignore; - ret.duration += duration; - Hypium.handleItResult(allItemList, itItemList); - } - } - static handleItResult(allItemList, itItemList) { - // 遍历所有的用例结果统计最终结果 - for (const {currentThreadName, description, result} of itItemList) { - let item = allItemList.find((it) => it.description === description); - if (item) { - let itResult = item.result; - // 当在worker中出现一次failure就标记为failure, 出现一次error就标记为error, 所有线程都pass才标记为pass - if (itResult === 0) { - item.result = result; - item.currentThreadName = currentThreadName; - } - } else { - let it = { - description: description, - currentThreadName: currentThreadName, - result: result - }; - allItemList.push(it); - } - } - } - static configWorkerItTestResult(retResult, allItemList) { - console.info(`${TAG}, configWorkerItTestResult, ${JSON.stringify(allItemList)}`); - for (const {currentThreadName, description, result} of allItemList) { - console.info(`${TAG}, description, ${description}, result,${result}`); - retResult.total ++; - if (result === 0) { - retResult.pass ++; - } else if (result === -1) { - retResult.error ++; - } else if (result === -2) { - retResult.failure ++; - } else { - retResult.ignore ++; - } - } - } - static printWorkerTestResult(abilityDelegator, allItemList) { - console.info(`${TAG}, printWorkerTestResult, ${JSON.stringify(allItemList)}`); - let index = 1; - for (const {currentThreadName, description, result} of allItemList) { - console.info(`${TAG}, description print, ${description}, result,${result}`); - let itArray = description.split('#'); - let des; - let itName; - if (itArray.length > 1) { - des = itArray[0]; - itName = itArray[1]; - } else if (itArray.length > 1) { - des = itArray[0]; - itName = itArray[0]; - } else { - des = 'undefined'; - itName = 'undefined'; - } - - let msg = `\n${PrintTag.OHOS_REPORT_WORKER_STATUS}: class=${des}`; - msg += `\n${PrintTag.OHOS_REPORT_WORKER_STATUS}: test=${itName}`; - msg += `\n${PrintTag.OHOS_REPORT_WORKER_STATUS}: current=${index}`; - msg += `\n${PrintTag.OHOS_REPORT_WORKER_STATUS}: CODE=${result}`; - abilityDelegator.printSync(msg); - index ++; - } - } - static hypiumWorkerTest(abilityDelegator, abilityDelegatorArguments, testsuite, workerPort) { - console.info(`${TAG}, hypiumWorkerTest call`); - SysTestKit.workerPort = workerPort; - let currentWorkerName = workerPort.name; - console.info(`${TAG}, hypiumWorkerTest_currentWorkerName: ${currentWorkerName}`); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); - - } - - static registerAssert(customAssertion) { - const core = Core.getInstance(); - const expectService = core.getDefaultService('expect'); - let matchers = {}; - matchers[customAssertion.name] = customAssertion; - expectService.addMatchers(matchers); - expectService.customMatchers.push(customAssertion.name); - console.info(`${TAG}success to register the ${customAssertion.name}`); - } - - static unregisterAssert(customAssertion) { - const core = Core.getInstance(); - const expectService = core.getDefaultService('expect'); - let customAssertionName = typeof customAssertion === 'function' ? customAssertion.name : customAssertion; - expectService.removeMatchers(customAssertionName); - console.info(`${TAG}success to unregister the ${customAssertionName}`); - } - -} - -export { - Hypium, - Core, - DEFAULT, - TestType, - Size, - Level, - DataDriver, - ExpectExtend, - OhReport, - SysTestKit, - describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, beforeItSpecified, afterItSpecified, xdescribe, xit, - MockKit, when, - ArgumentMatchers -}; \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/index.ts b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/index.ts deleted file mode 100644 index b7082ebc98214b58d41e8681791809f1aee48f12..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 { TestType, Size, Level } from "./src/main/Constant"; - -export declare function xdescribe(testSuiteName: string, func: Function): void; - -export declare namespace xdescribe { - function reason(reason: string): any; -}; - -export declare function describe(testSuiteName: string, func: Function): void; - -export declare function xit(testCaseName: string, attribute: TestType | Size | Level, func: Function): void; - -export declare namespace xit { - function reason(reason: string): any; -}; - -export declare function it(testCaseName: string, attribute: TestType | Size | Level, func: Function): void; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/obfuscation-rules.txt b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/obfuscation-rules.txt deleted file mode 100644 index 272efb6ca3f240859091bbbfc7c5802d52793b0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/obfuscation-rules.txt +++ /dev/null @@ -1,23 +0,0 @@ -# Define project specific obfuscation rules here. -# You can include the obfuscation configuration files in the current module's build-profile.json5. -# -# For more details, see -# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 - -# Obfuscation options: -# -disable-obfuscation: disable all obfuscations -# -enable-property-obfuscation: obfuscate the property names -# -enable-toplevel-obfuscation: obfuscate the names in the global scope -# -compact: remove unnecessary blank spaces and all line feeds -# -remove-log: remove all console.* statements -# -print-namecache: print the name cache that contains the mapping from the old names to new names -# -apply-namecache: reuse the given cache file - -# Keep options: -# -keep-property-name: specifies property names that you want to keep -# -keep-global-name: specifies names that you want to keep in the global scope - --enable-property-obfuscation --enable-toplevel-obfuscation --enable-filename-obfuscation --enable-export-obfuscation \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/oh-package.json5 b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/oh-package.json5 deleted file mode 100644 index fe6fe8a55daa47d4cfb0857724ae8bda70715258..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/oh-package.json5 +++ /dev/null @@ -1 +0,0 @@ -{"name":"@ohos/hypium","version":"1.0.24","description":"A unit test framework for OpenHarmony application","main":"index.js","keywords":["测试框架","except","mock"],"author":"huawei","license":"Apache-2.0","repository":"https://gitee.com/openharmony/testfwk_arkxtest","homepage":"https://gitee.com/openharmony/testfwk_arkxtest","dependencies":{},"metadata":{"sourceRoots":["./src/main"],"debug":true,"useNormalizedOHMUrl":false},"compatibleSdkVersion":17,"compatibleSdkType":"HarmonyOS","obfuscated":false} diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/Constant.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/Constant.js deleted file mode 100644 index dfd6b24a225a46f3ef21f1b9b3d6239e87449de9..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/Constant.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ - -/** - * define the testcase type : TestType, Size , Level - */ -export const TAG = '[Hypium]'; - -export const DEFAULT = 0B0000; - -export class PrintTag { - static OHOS_REPORT_WORKER_STATUS = 'OHOS_REPORT_WORKER_STATUS'; - static OHOS_REPORT_ALL_RESULT = 'OHOS_REPORT_ALL_RESULT'; - static OHOS_REPORT_ALL_CODE = 'OHOS_REPORT_ALL_CODE'; - static OHOS_REPORT_ALL_STATUS = 'OHOS_REPORT_ALL_STATUS'; - static OHOS_REPORT_RESULT = 'OHOS_REPORT_RESULT'; - static OHOS_REPORT_CODE = 'OHOS_REPORT_CODE'; - static OHOS_REPORT_STATUS = 'OHOS_REPORT_STATUS'; - static OHOS_REPORT_SUM = 'OHOS_REPORT_SUM'; - static OHOS_REPORT_STATUS_CODE = 'OHOS_REPORT_STATUS_CODE'; -}; - -export class TestType { - static FUNCTION = 0B1; - static PERFORMANCE = 0B1 << 1; - static POWER = 0B1 << 2; - static RELIABILITY = 0B1 << 3; - static SECURITY = 0B1 << 4; - static GLOBAL = 0B1 << 5; - static COMPATIBILITY = 0B1 << 6; - static USER = 0B1 << 7; - static STANDARD = 0B1 << 8; - static SAFETY = 0B1 << 9; - static RESILIENCE = 0B1 << 10; -}; - -export class Size { - static SMALLTEST = 0B1 << 16; - static MEDIUMTEST = 0B1 << 17; - static LARGETEST = 0B1 << 18; -}; - -export class Level { - static LEVEL0 = 0B1 << 24; - static LEVEL1 = 0B1 << 25; - static LEVEL2 = 0B1 << 26; - static LEVEL3 = 0B1 << 27; - static LEVEL4 = 0B1 << 28; -}; - -export const TESTTYPE = { - 'function': 1, - 'performance': 1 << 1, - 'power': 1 << 2, - 'reliability': 1 << 3, - 'security': 1 << 4, - 'global': 1 << 5, - 'compatibility': 1 << 6, - 'user': 1 << 7, - 'standard': 1 << 8, - 'safety': 1 << 9, - 'resilience': 1 << 10, -}; - -export const LEVEL = { - '0': 1 << 24, - '1': 1 << 25, - '2': 1 << 26, - '3': 1 << 27, - '4': 1 << 28, -}; - -export const SIZE = { - 'small': 1 << 16, - 'medium': 1 << 17, - 'large': 1 << 18, -}; - -export const KEYSET = [ - '-s class', '-s notClass', '-s suite', '-s itName', - '-s level', '-s testType', '-s size', '-s timeout', - '-s dryRun', '-s random', '-s breakOnError', '-s stress', - '-s coverage', '-s skipMessage', '-s runSkipped', - 'class', 'notClass', 'suite', 'itName', - 'level', 'testType', 'size', 'timeout', 'dryRun', 'random', - 'breakOnError', 'stress', 'coverage', 'skipMessage', 'runSkipped' -]; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/core.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/core.js deleted file mode 100644 index cfcb5f17287208f5e6869b4248faf6c9093002d9..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/core.js +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2021-2022 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 {SuiteService, SpecService, ExpectService, ReportService} from './service'; -import {ConfigService} from './module/config/configService'; -import {SpecEvent, TaskEvent, SuiteEvent} from './event'; - -/** - * core service for execute testcase. - */ -class Core { - static getInstance() { - if (!this.instance) { - this.instance = new Core(); - } - return this.instance; - } - - constructor() { - this.instance = null; - this.services = { - suite: {}, - spec: {}, - config: {}, - expect: {}, - log: {}, - report: {} - - }; - this.events = { - suite: {}, - spec: {}, - task: {} - }; - } - - addService(name, service) { - let serviceObj = {}; - if (!this.services[name]) { - this.services[name] = serviceObj; - } else { - serviceObj = this.services[name]; - } - serviceObj[service.id] = service; - } - - getDefaultService(name) { - return this.services[name].default; - } - - getServices(name) { - return this.services[name]; - } - - registerEvent(serviceName, event) { - let eventObj = {}; - if (!this.events[serviceName]) { - this.events[serviceName] = eventObj; - } else { - eventObj = this.events[serviceName]; - } - eventObj[event.id] = event; - } - - unRegisterEvent(serviceName, eventID) { - const eventObj = this.events[serviceName]; - if (eventObj) { - delete eventObj[eventID]; - } - } - - subscribeEvent(serviceName, serviceObj) { - const eventObj = this.events[serviceName]; - if (eventObj) { - for (const attr in eventObj) { - eventObj[attr]['subscribeEvent'](serviceObj); - } - } - } - - async fireEvents(serviceName, eventName) { - const eventObj = this.events[serviceName]; - if (!eventObj) { - return; - } - for (const attr in eventObj) { - await eventObj[attr][eventName](); - } - } - - addToGlobal(apis) { - if (typeof globalThis !== 'undefined') { - for (let api in apis) { - globalThis[api] = apis[api]; - } - } - for (const api in apis) { - this[api] = apis[api]; - } - } - - init() { - this.addService('suite', new SuiteService({id: 'default'})); - this.addService('spec', new SpecService({id: 'default'})); - this.addService('expect', new ExpectService({id: 'default'})); - this.addService('report', new ReportService({id: 'default'})); - this.addService('config', new ConfigService({id: 'default'})); - this.registerEvent('task', new TaskEvent({id: 'default', coreContext: this})); - this.registerEvent('suite', new SuiteEvent({id: 'default', coreContext: this})); - this.registerEvent('spec', new SpecEvent({id: 'default', coreContext: this})); - this.subscribeEvent('spec', this.getDefaultService('report')); - this.subscribeEvent('suite', this.getDefaultService('report')); - this.subscribeEvent('task', this.getDefaultService('report')); - const context = this; - for (const key in this.services) { - const serviceObj = this.services[key]; - for (const serviceID in serviceObj) { - const service = serviceObj[serviceID]; - service.init(context); - - if (typeof service.apis !== 'function') { - continue; - } - const apis = service.apis(); - if (apis) { - this.addToGlobal(apis); - } - } - } - } - - execute(abilityDelegator) { - const suiteService = this.getDefaultService('suite'); - const configService = this.getDefaultService('config'); - if (configService['dryRun'] === 'true') { - (async function () { - await suiteService.dryRun(abilityDelegator); - })(); - return; - } - setTimeout(() => { - suiteService.execute(); - }, 10); - } -} - -export default Core; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/event.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/event.js deleted file mode 100644 index 3be0211f01646c9c269c2425cbee82c87ac6d9ea..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/event.js +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ - -class SpecEvent { - constructor(attr) { - this.id = attr.id; - this.coreContext = attr.context; - this.eventMonitors = []; - } - - subscribeEvent(service) { - this.eventMonitors.push(service); - } - - async specStart() { - for (const monitor of this.eventMonitors) { - await monitor['specStart'](); - } - } - - async specDone() { - for (const monitor of this.eventMonitors) { - await monitor['specDone'](); - } - } -} - -class SuiteEvent { - constructor(attr) { - this.id = attr.id; - this.suiteContext = attr.coreContext; - this.eventMonitors = []; - } - - subscribeEvent(service) { - this.eventMonitors.push(service); - } - - async suiteStart() { - for (const monitor of this.eventMonitors) { - await monitor['suiteStart'](); - } - } - - async suiteDone() { - for (const monitor of this.eventMonitors) { - await monitor['suiteDone'](); - } - } -} - -class TaskEvent { - constructor(attr) { - this.id = attr.id; - this.coreContext = attr.coreContext; - this.eventMonitors = []; - } - - subscribeEvent(service) { - this.eventMonitors.push(service); - } - - async taskStart() { - for (const monitor of this.eventMonitors) { - await monitor['taskStart'](); - } - } - - async taskDone() { - for (const monitor of this.eventMonitors) { - await monitor['taskDone'](); - } - } - - incorrectFormat() { - for (const monitor of this.eventMonitors) { - monitor['incorrectFormat'](); - } - } - - incorrectTestSuiteFormat() { - for (const monitor of this.eventMonitors) { - monitor.incorrectTestSuiteFormat(); - } - } -} - -export { SpecEvent, TaskEvent, SuiteEvent }; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/interface.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/interface.js deleted file mode 100644 index 1bf43509ac3f70f1275e1da79388e1511e72a3f9..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/interface.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2021-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 Core from './core'; - -const core = Core.getInstance(); - -const describe = function (desc, func) { - return Reflect.has(core, 'describe') ? core.describe(desc, func) : (desc, func) => { }; -}; -const it = function (desc, filter, func) { - return Reflect.has(core, 'it') ? core.it(desc, filter, func) : (desc, filter, func) => { }; -}; -const beforeItSpecified = function (itDescs, func) { - return Reflect.has(core, 'beforeItSpecified') ? core.beforeItSpecified(itDescs, func) : (itDescs, func) => { }; -}; - -const afterItSpecified = function (itDescs, func) { - return Reflect.has(core, 'afterItSpecified') ? core.afterItSpecified(itDescs, func) : (itDescs, func) => { }; -}; -const beforeEach = function (func) { - return Reflect.has(core, 'beforeEach') ? core.beforeEach(func) : (func) => { }; -}; -const afterEach = function (func) { - return Reflect.has(core, 'afterEach') ? core.afterEach(func) : (func) => { }; -}; -const beforeAll = function (func) { - return Reflect.has(core, 'beforeAll') ? core.beforeAll(func) : (func) => { }; -}; -const afterAll = function (func) { - return Reflect.has(core, 'afterAll') ? core.afterAll(func) : (func) => { }; -}; -const expect = function (actualValue) { - return Reflect.has(core, 'expect') ? core.expect(actualValue) : (actualValue) => { }; -}; - -const xdescribe = function (desc, func) { - return Reflect.has(core, 'xdescribe') ? core.xdescribe(desc, func, null) : (desc, func, reason) => { }; -}; -xdescribe.reason = (reason) => { - return (desc, func) => { - return Reflect.has(core, 'xdescribe') ? core.xdescribe(desc, func, reason) : (desc, func, reason) => { }; - }; -}; -const xit = function (desc, filter, func) { - return Reflect.has(core, 'xit') ? core.xit(desc, filter, func, null) : (desc, filter, func, reason) => { }; -}; -xit.reason = (reason) => { - return (desc, filter, func) => { - return Reflect.has(core, 'xit') ? core.xit(desc, filter, func, reason) : (desc, filter, func, reason) => { }; - }; -}; - -export { - describe, it, beforeAll, beforeEach, afterEach, afterAll, expect, beforeItSpecified, afterItSpecified, xdescribe, xit -}; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module.json b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module.json deleted file mode 100644 index 7182854b6b51762c613e16b935c4d9e31087681a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "app": { - "bundleName": "com.hypium.myapplication", - "debug": true, - "versionCode": 1000000, - "versionName": "1.0.0", - "minAPIVersion": 50005017, - "targetAPIVersion": 50005017, - "apiReleaseType": "Release", - "compileSdkVersion": "5.0.5.165", - "compileSdkType": "HarmonyOS", - "appEnvironments": [], - "bundleType": "app", - "buildMode": "debug" - }, - "module": { - "name": "hypium", - "type": "har", - "deviceTypes": [ - "default", - "tablet", - "2in1" - ], - "packageName": "@ohos/hypium", - "installationFree": false, - "virtualMachine": "ark12.0.6.0", - "compileMode": "esmodule", - "dependencies": [] - } -} diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/ExpectExtend.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/ExpectExtend.js deleted file mode 100644 index d087755a446eebb4583db6137c71f56a6b3db724..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/ExpectExtend.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2021-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 assertNull from './assertNull'; -import assertClose from './assertClose'; -import assertContain from './assertContain'; -import assertLess from './assertLess'; -import assertLarger from './assertLarger'; -import assertFail from './assertFail'; -import assertUndefined from './assertUndefined'; -import assertFalse from './assertFalse'; -import assertInstanceOf from './assertInstanceOf'; -import assertThrowError from './assertThrowError'; -import assertLargerOrEqual from './assertLargerOrEqual'; -import assertLessOrEqual from './assertLessOrEqual'; -import assertNaN from './assertNaN'; -import assertNegUnlimited from './assertNegUnlimited'; -import assertPosUnlimited from './assertPosUnlimited'; -import assertDeepEquals from './deepEquals/assertDeepEquals'; -import assertPromiseIsPending from './assertPromiseIsPending'; -import assertPromiseIsRejected from './assertPromiseIsRejected'; -import assertPromiseIsRejectedWith from './assertPromiseIsRejectedWith'; -import assertPromiseIsRejectedWithError from './assertPromiseIsRejectedWithError'; -import assertPromiseIsResolved from './assertPromiseIsResolved'; -import assertPromiseIsResolvedWith from './assertPromiseIsResolvedWith'; -class ExpectExtend { - constructor(attr) { - this.id = attr.id; - this.matchers = {}; - } - - extendsMatchers() { - this.matchers.assertNull = assertNull; - this.matchers.assertClose = assertClose; - this.matchers.assertContain = assertContain; - this.matchers.assertLess = assertLess; - this.matchers.assertLarger = assertLarger; - this.matchers.assertFail = assertFail; - this.matchers.assertUndefined = assertUndefined; - this.matchers.assertFalse = assertFalse; - this.matchers.assertInstanceOf = assertInstanceOf; - this.matchers.assertThrowError = assertThrowError; - this.matchers.assertLargerOrEqual = assertLargerOrEqual; - this.matchers.assertLessOrEqual = assertLessOrEqual; - this.matchers.assertNaN = assertNaN; - this.matchers.assertNegUnlimited = assertNegUnlimited; - this.matchers.assertPosUnlimited = assertPosUnlimited; - this.matchers.assertDeepEquals = assertDeepEquals; - this.matchers.assertPromiseIsPending = assertPromiseIsPending; - this.matchers.assertPromiseIsRejected = assertPromiseIsRejected; - this.matchers.assertPromiseIsRejectedWith = assertPromiseIsRejectedWith; - this.matchers.assertPromiseIsRejectedWithError = assertPromiseIsRejectedWithError; - this.matchers.assertPromiseIsResolved = assertPromiseIsResolved; - this.matchers.assertPromiseIsResolvedWith = assertPromiseIsResolvedWith; - } - - init(coreContext) { - this.coreContext = coreContext; - this.extendsMatchers(); - const expectService = this.coreContext.getDefaultService('expect'); - expectService.addMatchers(this.matchers); - } - - apis() { - return { - 'expect': function (actualValue) { - return this.coreContext.getDefaultService('expect').expect(actualValue); - } - }; - } -} - -export default ExpectExtend; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertLarger.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertLarger.js deleted file mode 100644 index a74f4a8cedaf3add9c2dc2d3799081a83198732f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertLarger.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021-2022 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. - */ - -function assertLarger(actualValue, expected) { - return { - pass: (actualValue) > expected[0], - message: (actualValue) + ' is not larger than ' + expected[0] - }; -} - -export default assertLarger; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertLargerOrEqual.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertLargerOrEqual.js deleted file mode 100644 index e847e6c217364b7f69c173c66fb98d10efc45ef1..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertLargerOrEqual.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -function assertLargerOrEqual(actualValue, expected) { - return { - pass: (actualValue) >= expected[0], - message: (actualValue) + ' is not larger than ' + expected[0] - }; -} - -export default assertLargerOrEqual; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertLess.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertLess.js deleted file mode 100644 index 17e84b0abaeb20804048a5a15c19e0603634846d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertLess.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021-2022 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. - */ - -function assertLess(actualValue, expected) { - return { - pass: (actualValue) < expected[0], - message: (actualValue) + ' is not less than ' + expected[0] - }; -} - -export default assertLess; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertLessOrEqual.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertLessOrEqual.js deleted file mode 100644 index f754f97ffa9d24e7852efe2423a1dd35d448af82..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertLessOrEqual.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -function assertLessOrEqual(actualValue, expected) { - return { - pass: (actualValue) <= expected[0], - message: (actualValue) + ' is not less than ' + expected[0] - }; -} - -export default assertLessOrEqual; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertNaN.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertNaN.js deleted file mode 100644 index 8d45d6a93b86c5ed325a68b32ff014835993a58e..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertNaN.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -function assertNaN(actualValue) { - return { - pass: actualValue !== actualValue, - message: 'expect NaN, actualValue is ' + actualValue - }; -} - -export default assertNaN; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertNegUnlimited.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertNegUnlimited.js deleted file mode 100644 index ceac555afc826e057970e6cfe9c73b322c672aa2..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertNegUnlimited.js +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 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. -*/ - -function assertNegUnlimited(actualValue) { - return { - pass: actualValue === Number.NEGATIVE_INFINITY, - message: 'Expected actualValue not to be -Infinity. actualValue is,' + actualValue - }; -} - -export default assertNegUnlimited; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertNull.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertNull.js deleted file mode 100644 index 53a7bad827323a98d3302a4e7eea679551b459c5..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertNull.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021-2022 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. - */ - -function assertNull(actualValue) { - return { - pass: (actualValue) === null, - message: 'expect null, actualValue is ' + (actualValue) - }; -} - -export default assertNull; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPosUnlimited.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPosUnlimited.js deleted file mode 100644 index 6e68c0e2b6c499f4dc3dd56c13e9ea1073a3c54c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPosUnlimited.js +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 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. -*/ - -function assertPosUnlimited(actualValue) { - return { - pass: actualValue === Number.POSITIVE_INFINITY, - message: 'Expected actualValue is POSITIVE_INFINITY. actualValue is,' + actualValue - }; -} - -export default assertPosUnlimited; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejectedWithError.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejectedWithError.js deleted file mode 100644 index e515535394f1d9c455902aa9cc0cd324a3d2e71b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejectedWithError.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2022-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 isPromiseLike from './isPromiseLike'; - -function assertPromiseIsRejectedWithError(actualPromise, expectedValue) { - if (!isPromiseLike(actualPromise)) { - return Promise.reject().then(function () { - }, function () { - return {pass: false, message: 'Expected not be called on a promise.'}; - }); - } - return actualPromise.then( - function (got) { - return { - pass: false, - message: 'Expected a promise to be rejected but actualValue is resolve' - }; - }, - function (actualValue) { - return matchError(actualValue, expectedValue); - } - ); - -} - -function matchError(actualValue, expectedValue) { - if (expectedValue.length == 1 && typeof expectedValue[0] === 'function') { - if (expectedValue[0].name === actualValue.__proto__.name) { - return {pass: true, message: 'actual error type is ' + actualValue.name + '.'}; - } - return {pass: false, message: `except error type is ${expectedValue[0].name},but actual is ${actualValue.name}.`}; - } - - if (expectedValue.length == 1 && typeof expectedValue[0] === 'string') { - if (expectedValue[0] === actualValue.message) { - return {pass: true, message: `actual error message is ${actualValue.message}.`}; - } - return {pass: false, message: `except error message ${expectedValue[0]},but actual is ${actualValue.message}.`}; - } - - if (expectedValue.length == 1) { - return {pass: false, message: 'When only one parameter, it should be error type or error message.'}; - } - - if (expectedValue.length == 2 && typeof expectedValue[0] === 'function' && expectedValue[0].name === actualValue.name) { - if (typeof expectedValue[1] === 'string' && actualValue.message === expectedValue[1]) { - return {pass: true, message: 'actual error message is ' + actualValue.message + '.'}; - } - return {pass: false, message: `except error message is ${expectedValue[1]},but actual is ${actualValue.message}.`}; - } - - if (expectedValue.length == 2 && typeof expectedValue[0] === 'function' && expectedValue[0].name !== actualValue.name) { - if (typeof expectedValue[1] === 'string' && actualValue.message === expectedValue[1]) { - return {pass: false, message: `except error type is ${expectedValue[0].name},but actual is ${actualValue.name}.`}; - } - return {pass: false, message: 'except error type and message are incorrect.'}; - } - if (expectedValue.length > 2) { - return {pass: false, message: 'Up to two parameters are supported.'}; - } - return {pass: true, message: 'not equal type'}; -} - -export default assertPromiseIsRejectedWithError; \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsResolved.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsResolved.js deleted file mode 100644 index 86f559c32873f27b95d635452d760029de0ed657..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsResolved.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2022 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 isPromiseLike from './isPromiseLike'; - -function assertPromiseIsResolved(actualPromise) { - if (!isPromiseLike(actualPromise)) { - return Promise.reject().then(function () { - }, function () { - return {pass: false, message: 'Expected not be called on a promise.'}; - }); - } - - return actualPromise.then( - function (got) { - return {pass: true, message: 'actualValue is isResolved'}; - }, - function (rej) { - return { - pass: false, - message: 'Expected a promise to be resolved but it was ' + - 'rejected with ' + JSON.stringify(rej) + '.' - }; - } - ); -} - -export default assertPromiseIsResolved; \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertThrowError.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertThrowError.js deleted file mode 100644 index 876099808124955ce525d7450d79584c774f4887..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertThrowError.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ - -function assertThrowError(actualValue, expected) { - let result = false; - let message = ''; - let err; - if (typeof actualValue !== 'function') { - throw new Error('actualValue is not a function'); - } - try { - actualValue(); - return { - pass: result, - message: ' An error is not thrown while it is expected!' - }; - } catch (e) { - err = e; - } - if (err instanceof Error) { - let type = typeof expected[0]; - if (type === 'function') { - result = err.constructor.name === expected[0].name; - message = 'expected throw failed , ' + err.constructor.name + ' is not ' + expected[0].name; - } else if (type === 'string') { - result = err.message.includes(expected[0]); - message = 'expected throw failed , ' + err.message + ' is not ' + expected[0]; - } - } - return { - pass: result, - message: message - }; -} - -export default assertThrowError; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertUndefined.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertUndefined.js deleted file mode 100644 index 61f092d715dd1630297518b59ff13ef0940991e1..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertUndefined.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021-2022 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. - */ - -function assertUndefined(actualValue) { - return { - pass: undefined === (actualValue), - message: 'expect Undefined, actualValue is ' + (actualValue) - }; -} - -export default assertUndefined; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/deepEquals/DeepTypeUtils.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/deepEquals/DeepTypeUtils.js deleted file mode 100644 index 916824d9cb77a75d1fb35bc3500d7598bfc73e80..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/deepEquals/DeepTypeUtils.js +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -class DeepTypeUtils { - static getType(value) { - return Object.prototype.toString.apply(value); - } - static isA(typeName, value) { - return this.getType(value) === '[object ' + typeName + ']'; - } - static isAsymmetricEqualityTester(obj) { - return obj ? this.isA('Function', obj.asymmetricMatch) : false; - } - - /** - * 是否是function - * @param value - */ - static isFunction(value) { - return this.isA('Function', value); - } - - /** - * 是否是undefined - * @param obj - */ - static isUndefined(obj) { - return obj === void 0; - } - - /** - * 是否是Node - * @param obj - */ - static isDomNode(obj) { - return obj !== null && - typeof obj === 'object' && - typeof obj.nodeType === 'number' && - typeof obj.nodeName === 'string'; - } - - /** - * 是否是promise对象 - * @param obj - */ - static isPromise(obj) { - return !!obj && obj.constructor === Promise; - }; - /** - * 是否是map对象 - * @param obj - */ - static isMap(obj) { - return ( - obj !== null && - typeof obj !== 'undefined' && - obj.constructor === Map - ); - } - - /** - * 是否是set对象 - * @param obj 对象 - */ - static isSet(obj) { - return ( - obj !== null && - typeof obj !== 'undefined' && - obj.constructor === Set - ); - } - - /** - * 对象是否有key属性 - * @param obj 对象 - * @param key 对象属性名称 - */ - static has(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); - } - - /** - * 获取对象的自有属性 - * @param obj 对象 - * @param isArray 是否是数组,[object Array] - */ - static keys(obj, isArray) { - const extraKeys = []; - // 获取对象所有属性 - const allKeys = this.getAllKeys(obj); - if (!isArray) { - return allKeys; - } - if (allKeys.length === 0) { - return allKeys; - } - for (const k of allKeys) { - if (typeof k === 'symbol' || !/^[0-9]+$/.test(k)) { - extraKeys.push(k); - } - } - return extraKeys; - } - - /** - * 获取obj对象的所有属性 - * @param obj obj对象 - */ - static getAllKeys(obj) { - const keys = []; - for (let key in obj) { - if (this.has(obj, key)) { - keys.push(key); - } - } - const symbols = Object.getOwnPropertySymbols(obj); - for (const sym of symbols) { - // obj.propertyIsEnumerable(sym) - if (Object.prototype.propertyIsEnumerable.call(obj, sym)) { - keys.push(sym); - } - } - return keys; - } - -} -export default DeepTypeUtils; \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/deepEquals/assertDeepEquals.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/deepEquals/assertDeepEquals.js deleted file mode 100644 index f20758a7f3059b7eb7083ea01c4d5fa9afe90719..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/deepEquals/assertDeepEquals.js +++ /dev/null @@ -1,433 +0,0 @@ -/* - * Copyright (c) 2022-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 DeepTypeUtils from './DeepTypeUtils'; -function assertDeepEquals(actualValue, expected) { - let result = eq(actualValue, expected[0]); - let msg = logMsg(actualValue, expected[0]); - return { - pass: result, - message: msg - }; -} - -function getMapLog(item) { - let valueStr = ''; - let keyValue = ''; - if (item.length > 1) { - let key = item[0]; - let value = item[1]; - if (value !== value) { - valueStr = value; - } else { - valueStr = JSON.stringify(value); - } - keyValue = JSON.stringify(key); - } - return '[' + keyValue + ',' + valueStr + ']'; -} - -function getArrayLog(item) { - // NAN - if (item !== item) { - return item; - } - if (item === undefined) { - return 'undefined'; - } - return JSON.stringify(item); -} - - -function getCollectionLog(data) { - // 获取a的对象名称 - let finallyResult = ''; - const aClassName = Object.prototype.toString.call(data); - if (aClassName === '[object Map]') { - let result = Array.from(data); - finallyResult = result.flatMap((item) => { - return getMapLog(item); - }); - } - if (aClassName === '[object Set]') { - let setArray = Array.from(data); - finallyResult = setArray.flatMap((item) => { - return getArrayLog(item); - }); - } - if (aClassName === '[object Array]') { - finallyResult = data.flatMap((item) => { - return getArrayLog(item); - }); - } - return finallyResult; -} - -function getActualValueLog(actualValue) { - // 获取a的对象名称 - const aClassName = Object.prototype.toString.call(actualValue); - let actualMsg = ''; - if (aClassName === '[object Function]') { - actualMsg = 'actualValue Function'; - } else if (aClassName === '[object Promise]') { - actualMsg = 'actualValue Promise'; - } else if (aClassName === '[object Map]') { - let finallyResult = getCollectionLog(actualValue); - actualMsg = '[' + finallyResult + ']'; - } else if (aClassName === '[object Set]') { - let flatMapResult = getCollectionLog(actualValue); - actualMsg = '[' + flatMapResult + ']'; - } else if (aClassName === '[object Array]') { - let flatMapResult = getCollectionLog(actualValue); - actualMsg = '[' + flatMapResult + ']'; - } else if (aClassName === '[object RegExp]') { - actualMsg = JSON.stringify(actualValue.source.replace('\\', '')); - } else if (aClassName === '[object BigInt]') { - actualMsg = actualValue; - } else if (aClassName === '[object Error]') { - actualMsg = actualValue.message; - } else if (aClassName === '[object ArrayBuffer]') { - actualMsg = actualValue.byteLength; - } - else { - // NAN - if (actualValue !== actualValue) { - actualMsg = actualValue.toString(); - } else { - actualMsg = JSON.stringify(actualValue); - } - } - return actualMsg; -} - -function getExpectedLog(expected) { - const bClassName = Object.prototype.toString.call(expected); - let expectMsg = ''; - if (bClassName === '[object Function]') { - expectMsg = 'expected Function'; - } else if (bClassName === '[object Promise]') { - expectMsg = 'expected Promise'; - } else if (bClassName === '[object Map]') { - let finallyResult = getCollectionLog(expected); - expectMsg = '[' + finallyResult + ']'; - } else if (bClassName === '[object Set]') { - let flatMapResult = getCollectionLog(expected); - expectMsg = '[' + flatMapResult + ']'; - } else if (bClassName === '[object Array]') { - let flatMapResult = getCollectionLog(expected); - expectMsg = '[' + flatMapResult + ']'; - } else if (bClassName === '[object RegExp]') { - expectMsg = JSON.stringify(expected.source.replace('\\', '')); - } else if (bClassName === '[object BigInt]') { - expectMsg = expected; - } else if (bClassName === '[object Error]') { - expectMsg = expected.message; - } else if (bClassName === '[object ArrayBuffer]') { - expectMsg = expected.byteLength; - } - else { - // NAN - if (expected !== expected) { - expectMsg = expected.toString(); - } else { - expectMsg = JSON.stringify(expected); - } - } - return expectMsg; -} - -/** - * 获取失败显示日志 - * @param actualValue 实际对象 - * @param expected 期待比较对象 - */ -function logMsg(actualValue, expected) { - // 获取a的对象名称 - let actualMsg = getActualValueLog(actualValue); - let expectMsg = getExpectedLog(expected); - - return 'expect ' + actualMsg + ' deep equals ' + expectMsg; -} - -function eq(a, b) { - let result = true; - - if (a === b) { - result = a !== 0 || 1 / a === 1 / b; - return result; - } - - if (a === null || b === null) { - result = a === b; - return result; - } - // 获取a的对象名称 - const aClassName = Object.prototype.toString.call(a); - const bClassName = Object.prototype.toString.call(b); - // 不同类型不同对象 - if (aClassName !== bClassName) { - return false; - } - if (aClassName === '[object String]' || aClassName === '[object Number]' || aClassName === '[object Date]' || - aClassName === '[object Boolean]' || aClassName === '[object ArrayBuffer]' || - aClassName === '[object RegExp]' || aClassName === '[object Error]') { - result = isEqualSampleObj(a, b); - return result; - } - - if (typeof a !== 'object' || typeof b !== 'object') { - return false; - } - - if (DeepTypeUtils.isDomNode(a) || DeepTypeUtils.isPromise(a) || DeepTypeUtils.isFunction(a)) { - result = isEqualNodeOrPromiseOrFunction(a, b); - return result; - } - - if (aClassName === '[object Array]' || aClassName === '[object Map]' || aClassName === '[object Set]') { - result = isEqualCollection(a, b); - return result; - } - - result = isEqualObj(a, b); - return result; -} - -function isEqualNodeOrPromiseOrFunction(a, b) { - let equalNodeOrPromiseOrFunction = true; - if (DeepTypeUtils.isDomNode(a) && DeepTypeUtils.isDomNode(b)) { - const aIsDomNode = DeepTypeUtils.isDomNode(a); - const bIsDomNode = DeepTypeUtils.isDomNode(b); - if (aIsDomNode && bIsDomNode) { - // At first try to use DOM3 method isEqualNode - equalNodeOrPromiseOrFunction = a.isEqualNode(b); - return equalNodeOrPromiseOrFunction; - } - if (aIsDomNode || bIsDomNode) { - equalNodeOrPromiseOrFunction = false; - return false; - } - } - - if (DeepTypeUtils.isPromise(a) && DeepTypeUtils.isPromise(b)) { - const aIsPromise = DeepTypeUtils.isPromise(a); - const bIsPromise = DeepTypeUtils.isPromise(b); - // 俩个Promise对象 - if (aIsPromise && bIsPromise) { - equalNodeOrPromiseOrFunction = a === b; - return a === b; - } - } - if (DeepTypeUtils.isFunction(a) && DeepTypeUtils.isFunction(b)) { - // 俩个函数对象 - const aCtor = a.constructor, - bCtor = b.constructor; - if ( - aCtor !== bCtor && - DeepTypeUtils.isFunction(aCtor) && - DeepTypeUtils.isFunction(bCtor) && - a instanceof aCtor && - b instanceof bCtor && - !(aCtor instanceof aCtor && bCtor instanceof bCtor) - ) { - equalNodeOrPromiseOrFunction = false; - return false; - } - } - return equalNodeOrPromiseOrFunction; -} - -function isEqualCollection(a, b) { - let equalCollection = true; - // 获取a的对象名称 - const aClassName = Object.prototype.toString.call(a); - const bClassName = Object.prototype.toString.call(b); - // 都是数组 - if (aClassName === '[object Array]') { - equalCollection = isEqualArray(a, b); - return equalCollection; - } - - // 都是Map - if (DeepTypeUtils.isMap(a) && DeepTypeUtils.isMap(b)) { - equalCollection = isEqualMap(a, b); - return equalCollection; - } - - // 都是Set - if (DeepTypeUtils.isSet(a) && DeepTypeUtils.isSet(b)) { - equalCollection = isEqualSet(a, b); - return equalCollection; - } - - return true; -} - -function isEqualSampleObj(a, b) { - let equalSampleObj = true; - const aClassName = Object.prototype.toString.call(a); - const bClassName = Object.prototype.toString.call(b); - // 俩个string对象 - if (aClassName === '[object String]') { - equalSampleObj = a === String(b); - return equalSampleObj; - } - // 俩个Number对象 - if (aClassName === '[object Number]') { - // NAN - if (a !== a && b !== b) { - return a === b; - } - equalSampleObj = a !== +a ? b !== +b : a === 0 && b === 0 ? 1 / a === 1 / b : a === +b; - return equalSampleObj; - } - - // 俩个Date对象/ boolean对象 - if (aClassName === '[object Date]' || aClassName === '[object Boolean]') { - equalSampleObj = +a === +b; - return equalSampleObj; - } - - // 俩个ArrayBuffer - if (aClassName === '[object ArrayBuffer]') { - equalSampleObj = eq(new Uint8Array(a), new Uint8Array(b)); - return equalSampleObj; - } - - // 正则表达式 - if (aClassName === '[object RegExp]') { - return ( - a.source === b.source && - a.global === b.global && - a.multiline === b.multiline && - a.ignoreCase === b.ignoreCase - ); - } - - if (a instanceof Error && b instanceof Error) { - equalSampleObj = a.message === b.message; - return equalSampleObj; - } - - return equalSampleObj; -} - -function isEqualObj(a, b) { - let equalObj = true; - const aClassName = Object.prototype.toString.call(a); - const bClassName = Object.prototype.toString.call(b); - const aKeys = DeepTypeUtils.keys(a, aClassName === '[object Array]'); - let size = aKeys.length; - - // 俩个对象属性长度不一致, 俩对象不相同 - if (DeepTypeUtils.keys(b, bClassName === '[object Array]').length !== size) { - return false; - } - - // 俩对象属性数量相同, 递归比较每个属性值得值 - for (const key of aKeys) { - // b 没有 key 属性 - if (!DeepTypeUtils.has(b, key)) { - equalObj = false; - continue; - } - if (!eq(a[key], b[key])) { - equalObj = false; - } - } - return equalObj; -} - -function isEqualArray(a, b) { - let equalArray = true; - const aLength = a.length; - const bLength = b.length; - if (aLength !== bLength) { - // 数组长度不同,不是同一个对象 - return false; - } - for (let i = 0; i < aLength || i < bLength; i++) { - // 递归每一个元素是否相同 - equalArray = eq(i < aLength ? a[i] : void 0, i < bLength ? b[i] : void 0) && equalArray; - } - return equalArray; -} - -function isEqualMap(a, b) { - let equalMap = true; - if (a.size !== b.size) { - return false; - } - const keysA = []; - const keysB = []; - a.forEach(function(valueA, keyA) { - keysA.push(keyA); - }); - b.forEach(function(valueB, keyB) { - keysB.push(keyB); - }); - const mapKeys = [keysA, keysB]; - const cmpKeys = [keysB, keysA]; - for (let i = 0; equalMap && i < mapKeys.length; i++) { - const mapIter = mapKeys[i]; - const cmpIter = cmpKeys[i]; - - for (let j = 0; equalMap && j < mapIter.length; j++) { - const mapKey = mapIter[j]; - const cmpKey = cmpIter[j]; - const mapValueA = a.get(mapKey); - let mapValueB; - if (eq(mapKey, cmpKey)) { - mapValueB = b.get(cmpKey); - } else { - mapValueB = b.get(mapKey); - } - equalMap = eq(mapValueA, mapValueB); - } - } - return equalMap; -} - -function isEqualSet(a, b) { - let equalSet = true; - if (a.size !== b.size) { - return false; - } - const valuesA = []; - a.forEach(function(valueA) { - valuesA.push(valueA); - }); - const valuesB = []; - b.forEach(function(valueB) { - valuesB.push(valueB); - }); - const setPairs = [[valuesA, valuesB], [valuesB, valuesA]]; - for (let i = 0; equalSet && i < setPairs.length; i++) { - const baseValues = setPairs[i][0]; - const otherValues = setPairs[i][1]; - for (const baseValue of baseValues) { - let found = false; - for (let j = 0; !found && j < otherValues.length; j++) { - const otherValue = otherValues[j]; - // 深度比较对象 - found = eq(baseValue, otherValue); - } - equalSet = equalSet && found; - } - } - return equalSet; -} - -export default assertDeepEquals; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/isPromiseLike.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/isPromiseLike.js deleted file mode 100644 index f5e771477f04e9aadd6ff204558d74ff9b8e2d05..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/isPromiseLike.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ - -function isPromiseLike(obj) { - return !!obj && isFunction(obj.then); -} - -function isFunction(value) { - return isA('Function', value); -} - -function isA(typeName, value) { - return getType(value) === '[object ' + typeName + ']'; -} - -function getType(value) { - return Object.prototype.toString.apply(value); -} - -export default isPromiseLike; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/config/DataDriver.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/config/DataDriver.js deleted file mode 100644 index f86e4e479ad43dae1032e73bbe66ee1307b12d8b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/config/DataDriver.js +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ - -const SUITES_KEY = 'suites'; -const SPECS_KEY = 'items'; -const DESCRIBE_KEY = 'describe'; -const IT_KEY = 'it'; -const PARAMS_KEY = 'params'; -const STRESS_KEY = 'stress'; - -class ObjectUtils { - static get(object, name, defaultValue) { - let result = defaultValue; - for (const key in object) { - if (key === name) { - return object[key]; - } - } - return result; - } - - static has(object, key) { - return Object.prototype.hasOwnProperty.call(object, key); - } -} - -class DataDriver { - constructor(attr) { - this.id = 'dataDriver'; - this.data = attr.data || {}; - } - - init(coreContext) { - this.coreContext = coreContext; - this.suiteService = this.coreContext.getDefaultService('suite'); - this.specService = this.coreContext.getDefaultService('spec'); - } - - getSpecParamsValue(specs) { - let specParams = []; - let specDesc = this.specService.getCurrentRunningSpec().description; - if (specs === null || specs === undefined) { - return specParams; - } - for (const specItem of specs) { - if (ObjectUtils.has(specItem, IT_KEY) && ObjectUtils.get(specItem, IT_KEY) === specDesc) { - return ObjectUtils.get(specItem, PARAMS_KEY, specParams); - } - } - return specParams; - } - - getSpecParams() { - let specParams = []; - let suiteDesc = this.suiteService.getCurrentRunningSuite().description; - let specDesc = this.specService.getCurrentRunningSpec().description; - let suites = ObjectUtils.get(this.data, SUITES_KEY, []); - for (const suiteItem of suites) { - let describeValue = ObjectUtils.get(suiteItem, DESCRIBE_KEY, ''); - if (ObjectUtils.has(suiteItem, DESCRIBE_KEY) && (typeof describeValue === 'object') && describeValue.constructor === Array && describeValue.includes(suiteDesc)) { - let specs = ObjectUtils.get(suiteItem, SPECS_KEY, []); - return this.getSpecParamsValue(specs); - } - } - return specParams; - } - - getSuiteParams() { - let suiteParams = {}; - let suiteDesc = this.suiteService.getCurrentRunningSuite().description; - let suites = ObjectUtils.get(this.data, SUITES_KEY, []); - for (const suiteItem of suites) { - let describeValue = ObjectUtils.get(suiteItem, DESCRIBE_KEY, []); - if (ObjectUtils.has(suiteItem, DESCRIBE_KEY) && (typeof describeValue === 'object') && describeValue.constructor === Array && describeValue.includes(suiteDesc)) { - suiteParams = Object.assign({}, suiteParams, ObjectUtils.get(suiteItem, PARAMS_KEY, suiteParams)); - } - } - return suiteParams; - } - - getStressNum(specs, specDesc) { - let stress = 1; - if (specs === null || specs === undefined) { - return stress; - } - for (const specItem of specs) { - if (ObjectUtils.has(specItem, IT_KEY) && ObjectUtils.get(specItem, IT_KEY) === specDesc) { - let tempStress = ObjectUtils.get(specItem, STRESS_KEY, stress); - return (Number.isInteger(tempStress) && tempStress >= 1) ? tempStress : stress; - } - } - return stress; - } - - getSpecStress(specDesc) { - let stress = 1; - let suiteDesc = this.suiteService.getCurrentRunningSuite().description; - let suites = ObjectUtils.get(this.data, SUITES_KEY, []); - for (const suiteItem of suites) { - let describeValue = ObjectUtils.get(suiteItem, DESCRIBE_KEY, ''); - if (ObjectUtils.has(suiteItem, DESCRIBE_KEY) && (typeof describeValue === 'object') && describeValue.constructor === Array && describeValue.includes(suiteDesc)) { - let specs = ObjectUtils.get(suiteItem, SPECS_KEY, []); - return this.getStressNum(specs, specDesc); - } - } - return stress; - } - - getSuiteStress(suiteDesc) { - let stress = 1; - let suites = ObjectUtils.get(this.data, SUITES_KEY, []); - for (const suiteItem of suites) { - let describeValue = ObjectUtils.get(suiteItem, DESCRIBE_KEY, []); - if (ObjectUtils.has(suiteItem, DESCRIBE_KEY) && (typeof describeValue === 'object') && describeValue.constructor === Array && describeValue.includes(suiteDesc)) { - let tempStress = ObjectUtils.get(suiteItem, STRESS_KEY, stress); - return (Number.isInteger(tempStress) && tempStress >= 1) ? tempStress : stress; - } - } - return stress; - } -} - -export default DataDriver; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/config/Filter.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/config/Filter.js deleted file mode 100644 index 52f68560cac73a08a49c54e7f6d43b228f05f11c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/config/Filter.js +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2021-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 { LEVEL, SIZE, TESTTYPE } from '../../Constant'; - -class ClassFilter { - constructor(suiteName, itName, params) { - this.suiteName = suiteName; - this.itName = itName; - this.params = params; - } - - filterSuite() { - return !this.params.split(',').map(item => item.split('#')[0]).map(item => item == this.suiteName).reduce((pre, cur) => pre || cur, false); - } - - filterIt() { - let classArray = this.params.split(',') || []; - let suiteFilterResult = classArray.filter(item => !item.includes('#')).map(item => item == this.suiteName).reduce((pre, cur) => pre || cur, false); - let itFilterResult = classArray.filter(item => item.includes('#')).map(item => item == (this.suiteName + '#' + this.itName)).reduce((pre, cur) => pre || cur, false); - return !(suiteFilterResult || itFilterResult); - } -} - -class NotClassFilter { - constructor(suiteName, itName, params) { - this.suiteName = suiteName; - this.itName = itName; - this.params = params; - } - - filterSuite() { - return this.params.split(',').map(item => item == this.suiteName).reduce((pre, cur) => pre || cur, false); - } - - filterIt() { - return this.params.split(',').some(item => item == (this.suiteName + '#' + this.itName)); - } -} - -class SuiteAndItNameFilter { - constructor(suiteName, itName, params) { - this.suiteName = suiteName; - this.itName = itName; - this.params = params; - } - - filterSuite() { - return !this.params.split(',').map(item => item == this.suiteName).reduce((pre, cur) => pre || cur, false); - } - - filterIt() { - return !this.params.split(',').map(item => item == this.itName).reduce((pre, cur) => pre || cur, false); - } -} - - -class TestTypesFilter { - constructor(suiteName, itName, fi, params) { - this.suiteName = suiteName; - this.itName = itName; - this.params = params; - this.fi = fi; - } - - filterIt() { - return !((this.params === (this.fi & this.params)) || this.fi === 0); - } -} - -class NestFilter { - filterNestName(targetSuiteArray, targetSpecArray, suiteStack, desc) { - let targetSuiteName = ''; - for (let key in suiteStack) { - targetSuiteName = targetSuiteName + '.' + suiteStack[key].description; - } - targetSuiteName = targetSuiteName.substring(2); - const targetSpecName = targetSuiteName + '#' + desc; - let isFilter = true; - if (targetSpecArray.includes(targetSpecName)) { - return false; - } - for (let index in targetSuiteArray) { - if (targetSuiteName.startsWith(targetSuiteArray[index])) { - return false; - } - } - return isFilter; - } - - filterNotClass(notClass, suiteStack, desc) { - let filterNotClass = false; - if (notClass != null) { - let notClassArray = notClass.split(','); - let targetSuiteName = ''; - for (let key in suiteStack) { - targetSuiteName = targetSuiteName + '.' + suiteStack[key].description; - } - targetSuiteName = targetSuiteName.substring(2); - const targetSpecName = targetSuiteName + '#' + desc; - if (notClassArray.includes(targetSpecName) || notClassArray.some(key => targetSpecName.startsWith(key))) { - filterNotClass = true; - } - } - return filterNotClass; - } - - filterLevelOrSizeOrTestType(level, size, testType, filter) { - let result = false; - if (filter === 0 || filter === '0') { - return result; - } - if (level == null && size == null && testType == null) { - return result; - } - if (level != null) { - let levelFilter = LEVEL[`${level}`]; - result = result || filter === levelFilter; - } - if (size != null) { - let sizeFilter = SIZE[`${size}`]; - result = result || filter === sizeFilter; - } - if (testType != null) { - let testTypeFilter = TESTTYPE[`${testType}`]; - result = result || filter === testTypeFilter; - } - return !result; - } -} -export { ClassFilter, NotClassFilter, SuiteAndItNameFilter, TestTypesFilter, NestFilter }; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/config/configService.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/config/configService.js deleted file mode 100644 index 17674d8cf7e2343bcb4a14ad47eb11cd03c15aac..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/config/configService.js +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright (c) 2021-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 { ClassFilter, NotClassFilter, SuiteAndItNameFilter, TestTypesFilter, NestFilter } from './Filter'; -import { TAG, TESTTYPE, LEVEL, SIZE, KEYSET } from '../../Constant'; -const STRESS_RULE = /^[1-9]\d*$/; - -class ConfigService { - constructor(attr) { - this.id = attr.id; - this.supportAsync = true; // 默认异步处理测试用例 - this.random = false; - this.filterValid = []; - this.filter = 0; - this.flag = false; - this.suite = null; - this.itName = null; - this.testType = null; - this.level = null; - this.size = null; - this.class = null; - this.notClass = null; - this.timeout = null; - // 遇错即停模式配置 - this.breakOnError = false; - // 压力测试配置 - this.stress = null; - this.skipMessage = false; - this.runSkipped = ''; - this.filterXdescribe = []; - } - - init(coreContext) { - this.coreContext = coreContext; - } - - isNormalInteger(str) { - const n = Math.floor(Number(str)); - return n !== Infinity && String(n) === String(str) && n >= 0; - } - - - getStress() { - if (this.stress === undefined || this.stress === '' || this.stress === null) { - return 1; - } - return !this.stress.match(STRESS_RULE) ? 1 : Number.parseInt(this.stress); - } - - basicParamValidCheck(params) { - let size = params.size; - if (size !== undefined && size !== '' && size !== null) { - let sizeArray = ['small', 'medium', 'large']; - if (sizeArray.indexOf(size) === -1) { - this.filterValid.push('size:' + size); - } - } - let level = params.level; - if (level !== undefined && level !== '' && level !== null) { - let levelArray = ['0', '1', '2', '3', '4']; - if (levelArray.indexOf(level) === -1) { - this.filterValid.push('level:' + level); - } - } - let testType = params.testType; - if (testType !== undefined && testType !== '' && testType !== null) { - let testTypeArray = ['function', 'performance', 'power', 'reliability', 'security', - 'global', 'compatibility', 'user', 'standard', 'safety', 'resilience']; - if (testTypeArray.indexOf(testType) === -1) { - this.filterValid.push('testType:' + testType); - } - } - } - - filterParamValidCheck(params) { - let timeout = params.timeout; - if (timeout !== undefined && timeout !== '' && timeout !== null) { - if (!this.isNormalInteger(timeout)) { - this.filterValid.push('timeout:' + timeout); - } - } - - let paramKeys = ['dryRun', 'random', 'breakOnError', 'coverage', 'skipMessage']; - for (const key of paramKeys) { - if (params[key] !== undefined && params[key] !== 'true' && params[key] !== 'false') { - this.filterValid.push(`${key}:${params[key]}`); - } - } - - // 压力测试参数验证,正整数 - if (params.stress !== undefined && params.stress !== '' && params.stress !== null) { - if (!params.stress.match(STRESS_RULE)) { - this.filterValid.push('stress:' + params.stress); - } - } - - let nameRule = /^[A-Za-z]{1}[\w#,.]*$/; - let paramClassKeys = ['class', 'notClass']; - for (const key of paramClassKeys) { - if (params[key] !== undefined && params[key] !== '' && params[key] !== null) { - let classArray = params[key].split(','); - classArray.forEach(item => !item.match(nameRule) ? this.filterValid.push(`${key}:${params[key]}`) : null); - } - } - } - - setConfig(params) { - this.basicParamValidCheck(params); - this.filterParamValidCheck(params); - try { - this.class = params.class; - this.notClass = params.notClass; - this.flag = params.flag || { flag: false }; - this.suite = params.suite; - this.itName = params.itName; - this.filter = params.filter; - this.testType = params.testType; - this.level = params.level; - this.size = params.size; - this.timeout = params.timeout; - this.dryRun = params.dryRun; - this.breakOnError = params.breakOnError; - this.random = params.random === 'true' ? true : false; - this.stress = params.stress; - this.coverage = params.coverage; - this.skipMessage = params.skipMessage; - this.runSkipped = params.runSkipped; - this.filterParam = { - testType: TESTTYPE, - level: LEVEL, - size: SIZE - }; - this.parseParams(); - } catch (err) { - console.info(`${TAG}setConfig error: ${err.message}`); - } - } - - parseParams() { - if (this.filter != null) { - return; - } - let testTypeFilter = 0; - let sizeFilter = 0; - let levelFilter = 0; - if (this.testType != null) { - testTypeFilter = this.testType.split(',') - .map(item => this.filterParam.testType[item] || 0) - .reduce((pre, cur) => pre | cur, 0); - } - if (this.level != null) { - levelFilter = this.level.split(',') - .map(item => this.filterParam.level[item] || 0) - .reduce((pre, cur) => pre | cur, 0); - } - if (this.size != null) { - sizeFilter = this.size.split(',') - .map(item => this.filterParam.size[item] || 0) - .reduce((pre, cur) => pre | cur, 0); - } - this.filter = testTypeFilter | sizeFilter | levelFilter; - console.info(`${TAG}filter params:${this.filter}`); - } - - isCurrentSuite(description) { - if (this.suite !== undefined && this.suite !== '' && this.suite !== null) { - let suiteArray = this.suite.split(','); - return suiteArray.indexOf(description) !== -1; - } - return false; - } - - filterSuite(currentSuiteName) { - let filterArray = []; - if (this.suite !== undefined && this.suite !== '' && this.suite !== null) { - filterArray.push(new SuiteAndItNameFilter(currentSuiteName, '', this.suite)); - } - if (this.class !== undefined && this.class !== '' && this.class !== null) { - filterArray.push(new ClassFilter(currentSuiteName, '', this.class)); - } - if (this.notClass !== undefined && this.notClass !== '' && this.notClass !== null) { - filterArray.push(new NotClassFilter(currentSuiteName, '', this.notClass)); - } - - let result = filterArray.map(item => item.filterSuite()).reduce((pre, cur) => pre || cur, false); - return result; - } - - filterDesc(currentSuiteName, desc, fi, coreContext) { - let filterArray = []; - if (this.itName !== undefined && this.itName !== '' && this.itName !== null) { - filterArray.push(new SuiteAndItNameFilter(currentSuiteName, desc, this.itName)); - } - if (this.class !== undefined && this.class !== '' && this.class !== null) { - filterArray.push(new ClassFilter(currentSuiteName, desc, this.class)); - } - if (this.notClass !== undefined && this.notClass !== '' && this.notClass !== null) { - filterArray.push(new NotClassFilter(currentSuiteName, desc, this.notClass)); - } - if (typeof (this.filter) !== 'undefined' && this.filter !== 0 && fi !== 0) { - filterArray.push(new TestTypesFilter('', '', fi, this.filter)); - } - let result = filterArray.map(item => item.filterIt()).reduce((pre, cur) => pre || cur, false); - return result; - } - - filterWithNest(desc, filter) { - let filterArray = []; - const nestFilter = new NestFilter(); - const targetSuiteArray = this.coreContext.getDefaultService('suite').targetSuiteArray; - const targetSpecArray = this.coreContext.getDefaultService('suite').targetSpecArray; - const suiteStack = this.coreContext.getDefaultService('suite').suitesStack; - let isFilter = nestFilter.filterNestName(targetSuiteArray, targetSpecArray, suiteStack, desc); - const isFullRun = this.coreContext.getDefaultService('suite').fullRun; - if (typeof (this.filter) !== 'undefined' && this.filter !== 0 && filter !== 0) { - filterArray.push(new TestTypesFilter('', '', filter, this.filter)); - return filterArray.map(item => item.filterIt()).reduce((pre, cur) => pre || cur, false); - } - if (isFilter && !isFullRun) { - return true; - } - return nestFilter.filterNotClass(this.notClass, suiteStack, desc); - - } - - isRandom() { - return this.random || false; - } - - isBreakOnError() { - return this.breakOnError !== 'true' ? false : true; - } - - setSupportAsync(value) { - this.supportAsync = value; - } - - isSupportAsync() { - return this.supportAsync; - } - - translateParams(parameters) { - const keySet = new Set(KEYSET); - let targetParams = {}; - for (const key in parameters) { - if (keySet.has(key)) { - var newKey = key.replace('-s ', ''); - targetParams[newKey] = parameters[key]; - } - } - return targetParams; - } - translateParamsToString(parameters) { - const keySet = new Set(KEYSET); - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key]; - } - } - return targetParams.trim(); - } - - execute() { - } - - checkIfSuiteInSkipRun(desc) { - return this.runSkipped.split(',').some(item => { - return item === desc || item.startsWith(desc + '.') || item.startsWith(desc + '#') || desc.startsWith(item + '.') || this.runSkipped === 'skipped'; - }); - } - - checkIfSpecInSkipRun(desc) { - return this.runSkipped.split(',').some(item => { - if (item.includes('#')) { - return item === desc; - } else { - return desc.startsWith(item + '.') || desc.startsWith(item + '#') || this.runSkipped === 'skipped'; - } - } - ); - } -} - -export { - ConfigService -}; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/coverage/coverageCollect.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/coverage/coverageCollect.js deleted file mode 100644 index 334a33db9561dd2070c4081457632decf2589b83..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/coverage/coverageCollect.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2023 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 SysTestKit from '../kit/SysTestKit'; -import fs from '@ohos.file.fs'; -import {TAG} from '../../Constant'; - -const jsCoverageFileName = 'js_coverage.json'; - -export async function collectCoverageData() { - if (globalThis.__coverage__ === undefined) { - console.info(`${TAG} globalThis not have coverage`); - return; - } - const strJson = JSON.stringify(globalThis.__coverage__); - let testMode = globalThis.__testMode__; - console.info(`${TAG} coverage data testMode: ${testMode}`); - let savePath = globalThis.__savePath__; - console.info(`${TAG} write coverage data to: ${savePath}`); - let readPath = globalThis.__readPath__; - console.info(`${TAG} read coverage data in: ${readPath}`); - - // run callback mode if local test or (save path and read path ) is not defined - if (!testMode || !isCoveragePathValid(savePath)) { - console.info(`${TAG} run coverage data in call back mode`); - const strLen = strJson.length; - const maxLen = 500; - const maxCount = Math.floor(strLen / maxLen); - const OHOS_REPORT_COVERAGE_DATA = 'OHOS_REPORT_COVERAGE_DATA:'; - for (let count = 0; count <= maxCount; count++) { - console.info(`${OHOS_REPORT_COVERAGE_DATA} ${strJson.substring(count * maxLen, (count + 1) * maxLen)}`); - await SysTestKit.print(`${OHOS_REPORT_COVERAGE_DATA} ${strJson.substring(count * maxLen, (count + 1) * maxLen)}`); - } - return; - } - console.info(`${TAG} run coverage data in save file mode`); - if (fs.accessSync(savePath)) { - fs.unlinkSync(savePath); - } - - let inputPathDir = savePath.substring(0, savePath.length - jsCoverageFileName.length); - if (!fs.accessSync(inputPathDir)) { - console.info(`${TAG} coverage data create dir: ${inputPathDir}`); - fs.mkdirSync(inputPathDir); - } - - let file = fs.openSync(savePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - let writeLen = fs.writeSync(file.fd, strJson, {encoding:'utf-8'}); - console.info(`${TAG} write coverage data success: ${writeLen}`); - fs.closeSync(file); - const OHOS_REPORT_COVERAGE_PATH = 'OHOS_REPORT_COVERAGE_PATH:'; - await SysTestKit.print(`${OHOS_REPORT_COVERAGE_PATH} ${readPath}`); - console.info(`${OHOS_REPORT_COVERAGE_PATH} ${readPath}`); -} - -function isCoveragePathValid(inputPath) { - if (!inputPath) { - return false; - } - if (inputPath.indexOf(jsCoverageFileName) === -1) { - return false; - } - return true; -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/kit/SysTestKit.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/kit/SysTestKit.js deleted file mode 100644 index 6e2f256514cff87450f910098b1130943a40e39c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/kit/SysTestKit.js +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2022-2023 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 {TAG} from '../../Constant'; -import Core from '../../core.js'; - -export default class SysTestKit { - - static delegator = null; - static systemTime = null; - static workerPort = null; - - constructor() { - this.id = 'sysTestKit'; - this.index = 0; - } - - static getDescribeName() { - return Core.getInstance().getDefaultService('suite').getCurrentRunningSuite().description; - } - - static getItName() { - return Core.getInstance().getDefaultService('spec').getCurrentRunningSpec().description; - } - - static getItAttribute() { - return Core.getInstance().getDefaultService('spec').getCurrentRunningSpec().fi; - } - - static actionStart(tag) { - console.info(`${TAG}${JSON.stringify(tag)}`); - var message = '\n' + 'OHOS_REPORT_ACTIONSTART: ' + JSON.stringify(tag) + '\n'; - SysTestKit.print(message); - console.info(`${TAG}${JSON.stringify(tag)} actionStart print success`); - } - - static actionEnd(tag) { - console.info(`${TAG}${JSON.stringify(tag)}`); - var message = '\n' + 'OHOS_REPORT_ACTIONEND: ' + JSON.stringify(tag) + '\n'; - SysTestKit.print(message); - console.info(`${TAG}${JSON.stringify(tag)} actionEnd print success`); - } - - static async existKeyword(keyword, timeout) { - let reg = new RegExp(/^[a-zA-Z0-9]{1,}$/); - if (!reg.test(keyword)) { - throw new Error('keyword must contain more than one string, and only letters and numbers are supported.'); - } - timeout = timeout || 4; - - let searchResult = false; - let cmd = 'hilog -x | grep -i \'' + keyword + '\' | wc -l'; - await executePromise(cmd, timeout).then((data) => { - searchResult = data; - }); - return searchResult; - } - static async print(message) { - if ('printSync' in SysTestKit.delegator) { - console.info(`${TAG}printSync called ...`); - SysTestKit.delegator.printSync(message); - } else { - await SysTestKit.delegator.print(message); - } - } - - static async getRealTime() { - let currentTime = new Date().getTime(); - if (SysTestKit.systemTime !== null && SysTestKit.systemTime !== undefined) { - await SysTestKit.systemTime.getRealTime().then((time) => { - console.info(`${TAG}systemTime.getRealTime success data: ${JSON.stringify(time)}`); - currentTime = time; - }).catch((error) => { - console.error(`${TAG}failed to systemTime.getRealTime because ${JSON.stringify(error)}`); - }); - } - return currentTime; - } -} - -function executePromise(cmd, timeout) { - return new Promise((resolve, reject) => { - SysTestKit.delegator.executeShellCommand(cmd, timeout, - (error, data) => { - console.info(`${TAG}existKeyword CallBack: err : ${JSON.stringify(error)}`); - console.info(`${TAG}existKeyword CallBack: data : ${JSON.stringify(data)}`); - resolve(parseInt(data.stdResult) > 3 ? true : false); - }); - }); -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/mock/ArgumentMatchers.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/mock/ArgumentMatchers.js deleted file mode 100644 index 1e69ac401049589986968a8575ca45a02a299327..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/mock/ArgumentMatchers.js +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -class ArgumentMatchers { - ANY = ''; - ANY_STRING = ''; - ANY_BOOLEAN = ''; - ANY_NUMBER = ''; - ANY_OBJECT = ''; - ANY_FUNCTION = ''; - MATCH_REGEXS = ''; - - static any() { - } - - static anyString() { - } - - static anyBoolean() { - } - - static anyNumber() { - } - - static anyObj() { - } - - static anyFunction() { - } - - static matchRegexs() { - let regex = arguments[0]; - if (ArgumentMatchers.isRegExp(regex)) { - return regex; - } - throw Error('not a regex'); - } - - static isRegExp(value) { - return Object.prototype.toString.call(value) === '[object RegExp]'; - } - - matcheReturnKey() { - let arg = arguments[0]; - let regex = arguments[1]; - let stubSetKey = arguments[2]; - - if (stubSetKey && stubSetKey == this.ANY) { - return this.ANY; - } - - if (typeof arg === 'string' && !regex) { - return this.ANY_STRING; - } - - if (typeof arg === 'boolean' && !regex) { - return this.ANY_BOOLEAN; - } - - if (typeof arg === 'number' && !regex) { - return this.ANY_NUMBER; - } - - if (typeof arg === 'object' && !regex) { - return this.ANY_OBJECT; - } - - if (typeof arg === 'function' && !regex) { - return this.ANY_FUNCTION; - } - - if (typeof arg === 'string' && regex) { - return regex.test(arg); - } - - return null; - } - - matcheStubKey() { - let key = arguments[0]; - - if (key === ArgumentMatchers.any) { - return this.ANY; - } - - if (key === ArgumentMatchers.anyString) { - return this.ANY_STRING; - } - if (key === ArgumentMatchers.anyBoolean) { - return this.ANY_BOOLEAN; - } - if (key === ArgumentMatchers.anyNumber) { - return this.ANY_NUMBER; - } - if (key === ArgumentMatchers.anyObj) { - return this.ANY_OBJECT; - } - if (key === ArgumentMatchers.anyFunction) { - return this.ANY_FUNCTION; - } - - if (ArgumentMatchers.isRegExp(key)) { - return key; - } - - return null; - } -} - -export default ArgumentMatchers; \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/mock/MockKit.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/mock/MockKit.js deleted file mode 100644 index da220c7116bcb2ce6c41f14db2b05da539322520..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/mock/MockKit.js +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Copyright (c) 2022-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 ExtendInterface from './ExtendInterface'; -import VerificationMode from './VerificationMode'; -import ArgumentMatchers from './ArgumentMatchers'; - -class MockKit { - constructor() { - this.mFunctions = []; - this.stubs = new Map(); - this.recordCalls = new Map(); - this.currentSetKey = new Map(); - this.mockObj = null; - this.recordMockedMethod = new Map(); - } - - init() { - this.reset(); - } - - reset() { - this.mFunctions = []; - this.stubs = {}; - this.recordCalls = {}; - this.currentSetKey = new Map(); - this.mockObj = null; - this.recordMockedMethod = new Map(); - } - - clearAll() { - this.reset(); - var props = Object.keys(this); - for (var i = 0; i < props.length; i++) { - delete this[props[i]]; - } - - var props = Object.getOwnPropertyNames(this); - for (var i = 0; i < props.length; i++) { - delete this[props[i]]; - } - for (var key in this) { - delete this[key]; - } - } - - clear(obj) { - if (!obj) { - throw Error('Please enter an object to be cleaned'); - } - if (typeof obj !== 'object' && typeof obj !== 'function') { - throw new Error('Not a object or static class'); - } - this.recordMockedMethod.forEach(function (value, key, map) { - if (key) { - obj[key] = value; - } - }); - } - - ignoreMock(obj, method) { - if (typeof obj !== 'object' && typeof obj !== 'function') { - throw new Error('Not a object or static class'); - } - if (typeof method !== 'function') { - throw new Error('Not a function'); - } - let og = this.recordMockedMethod.get(method.propName); - if (og) { - obj[method.propName] = og; - this.recordMockedMethod.set(method.propName, undefined); - } - } - - extend(dest, source) { - dest['stub'] = source['stub']; - dest['afterReturn'] = source['afterReturn']; - dest['afterReturnNothing'] = source['afterReturnNothing']; - dest['afterAction'] = source['afterAction']; - dest['afterThrow'] = source['afterThrow']; - dest['stubMockedCall'] = source['stubMockedCall']; - dest['clear'] = source['clear']; - return dest; - } - - stubApply(f, params, returnInfo) { - let values = this.stubs.get(f); - if (!values) { - values = new Map(); - } - let key = params[0]; - if (typeof key === 'undefined') { - key = 'anonymous-mock-' + f.propName; - } else { - key = []; - const matcher = new ArgumentMatchers(); - for (let i = 0; i < params.length; i++) { - const param = params[i]; - const matchKey = matcher.matcheStubKey(param); - if (matchKey) { - key.push(matchKey); - } else { - key.push(param); - } - } - } - this.currentSetKey.set(f, key); - values.set(key, returnInfo); - this.stubs.set(f, values); - } - - getReturnInfo(f, params) { - let values = this.stubs.get(f); - if (!values) { - return undefined; - } - let returnKet = params[0]; - const anonymousName = 'anonymous-mock-' + f.propName; - if (typeof returnKet === 'undefined') { - returnKet = anonymousName; - let stubSetKey = this.currentSetKey.get(f); - - if (stubSetKey && (typeof (returnKet) !== 'undefined')) { - returnKet = stubSetKey; - } - } else { - returnKet = this.getReturnKet(values, params, returnKet, anonymousName); - } - - return values.get(returnKet); - } - - getReturnKet(values, params, defaultValue, anonymousName) { - let flag = true; - let returnKet = defaultValue; - values.forEach((value, paramsKey, map) => { - if ( - flag && - paramsKey !== anonymousName && - paramsKey.length === params.length && - this.checkIsRightValue(paramsKey, params) - ) { - returnKet = paramsKey; - flag = false; - } - }); - return returnKet; - } - - checkIsRightValue(paramsKey, params) { - const matcher = new ArgumentMatchers(); - return paramsKey.every((key, j) => { - if (ArgumentMatchers.isRegExp(key) && typeof params[j] === 'string') { - return key.test(params[j]); - } - const matchKey = matcher.matcheReturnKey(params[j], undefined, key); - if (matchKey && matchKey === key) { - return true; - } else if (this.checkIsEqual(params[j], key)) { - return true; - } - return false; - }); - } - - checkIsEqual(value1, value2) { - if (value1 === value2) { - return true; - } - if (typeof value1 !== typeof value2) { - return false; - } - if (Array.isArray(value1) && Array.isArray(value2)) { - if (value1.length !== value2.length) { - return false; - } - for (let i = 0; i < value1.length; i++) { - if (!this.checkIsEqual(value1[i], value2[i])) { - return false; - } - } - return true; - } - if (Object.prototype.toString.call(value1) === '[object Object]' && - Object.prototype.toString.call(value2) === '[object Object]') { - const keys1 = Object.keys(value1); - const keys2 = Object.keys(value2); - if (keys1.length !== keys2.length) { - return false; - } - for (let key of keys1) { - if (!keys2.includes(key) || !this.checkIsEqual(value1[key], value2[key])) { - return false; - } - } - return true; - } - if (Object.prototype.toString.call(value1) === '[object Date]' && - Object.prototype.toString.call(value2) === '[object Date]' && - value1.getTime() === value2.getTime()) { - return true; - } - if (Object.prototype.toString.call(value1) === '[object RegExp]' && - Object.prototype.toString.call(value2) === '[object RegExp]' && - value1.toString() === value2.toString()) { - return true; - } - return false; - } - - findName(obj, value) { - let properties = this.findProperties(obj); - let name = null; - properties - .filter((item) => item !== 'caller' && item !== 'arguments') - .forEach(function (va1, idx, array) { - if (obj[va1] === value) { - name = va1; - } - }); - return name; - } - - isFunctionFromPrototype(f, container, propName) { - if ( - container.constructor !== Object && - container.constructor.prototype !== container - ) { - return container.constructor.prototype[propName] === f; - } - return false; - } - - findProperties(obj, ...arg) { - function getProperty(newObj) { - if (newObj.__proto__ === null) { - return []; - } - let properties = Object.getOwnPropertyNames(newObj); - return [...properties, ...getProperty(newObj.__proto__)]; - } - return getProperty(obj); - } - - recordMethodCall(originalMethod, args) { - Function.prototype.getName = function () { - return this.name || this.toString().match(/function\s*([^(]*)\(/)[1]; - }; - let name = originalMethod.getName(); - let arglistString = name + '(' + Array.from(args).toString() + ')'; - let records = this.recordCalls.get(arglistString); - if (!records) { - records = 0; - } - records++; - this.recordCalls.set(arglistString, records); - } - - mockFunc(originalObject, originalMethod) { - let tmp = this; - this.originalMethod = originalMethod; - let f = function () { - let args = arguments; - let action = tmp.getReturnInfo(f, args); - if (originalMethod) { - tmp.recordMethodCall(originalMethod, args); - } - if (action) { - return action.apply(this, args); - } - }; - - f.container = null || originalObject; - f.original = originalMethod || null; - - if (originalObject && originalMethod) { - if (typeof originalMethod !== 'function') { - throw new Error('Not a function'); - } - var name = this.findName(originalObject, originalMethod); - originalObject[name] = f; - this.recordMockedMethod.set(name, originalMethod); - f.propName = name; - f.originalFromPrototype = this.isFunctionFromPrototype( - f.original, - originalObject, - f.propName - ); - } - f.mocker = this; - this.mFunctions.push(f); - this.extend(f, new ExtendInterface(this)); - return f; - } - - verify(methodName, argsArray) { - if (!methodName) { - throw Error('not a function name'); - } - let a = this.recordCalls.get(methodName + '(' + argsArray.toString() + ')'); - return new VerificationMode(a ? a : 0); - } - - mockObject(object) { - if (!object || typeof object === 'string') { - throw Error(`this ${object} cannot be mocked`); - } - const _this = this; - let mockedObject = {}; - let keys = Reflect.ownKeys(object); - keys - .filter((key) => typeof Reflect.get(object, key) === 'function') - .forEach((key) => { - mockedObject[key] = object[key]; - mockedObject[key] = _this.mockFunc(mockedObject, mockedObject[key]); - }); - return mockedObject; - } -} - -function ifMockedFunction(f) { - if ( - Object.prototype.toString.call(f) !== '[object Function]' && - Object.prototype.toString.call(f) !== '[object AsyncFunction]' - ) { - throw Error('not a function'); - } - if (!f.stub) { - throw Error('not a mock function'); - } - return true; -} - -function when(f) { - if (!ifMockedFunction(f)) { - throw Error('not a mock function'); - } - return f.stub.bind(f); -} - -export { MockKit, when }; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/report/LogExpectError.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/report/LogExpectError.js deleted file mode 100644 index 5a94cecb4625205797ae886c19ac592f189c2232..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/report/LogExpectError.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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. - */ - -class LogExpectError { - static getErrorMsg(matcherName, actualValue, expect, originMsg) { - if (matcherName === 'assertNull') { - return 'expect not null, actualValue is ' + (actualValue); - } - if (matcherName === 'assertTrue') { - return 'expect not true, actualValue is ' + (actualValue); - } - if (matcherName === 'assertFalse') { - return 'expect not false, actualValue is ' + (actualValue); - } - if (matcherName === 'assertEqual') { - return 'expect not Equal, actualValue is ' + actualValue + ' equals ' + expect; - } - if (matcherName === 'assertContain') { - return 'expect not have, ' + actualValue + ' have ' + expect; - } - if (matcherName === 'assertInstanceOf') { - return 'expect not InstanceOf, ' + actualValue + ' is ' + - Object.prototype.toString.call(actualValue) + expect; - } - if (matcherName === 'assertLarger') { - return 'expect not Larger, ' + - (actualValue) + ' is larger than ' + expect; - } - if (matcherName === 'assertLargerOrEqual') { - return 'expect not LargerOrEqual, ' + (actualValue) + ' larger than ' + expect; - } - if (matcherName === 'assertLess') { - return 'expect not Less, ' + (actualValue) + ' less than ' + expect; - } - if (matcherName === 'assertLessOrEqual') { - return 'expect not LessOrEqual, ' + (actualValue) + ' is less than ' + expect; - } - if (matcherName === 'assertNaN') { - return 'expect not NaN, actualValue is ' + (actualValue); - } - if (matcherName === 'assertNegUnlimited') { - return 'expect not NegUnlimited, actualValue is ' + (actualValue); - } - if (matcherName === 'assertPosUnlimited') { - return 'expect not PosUnlimited, actualValue is ' + (actualValue); - } - if (matcherName === 'assertUndefined') { - return 'expect not Undefined, actualValue is ' + (actualValue); - } - return originMsg; - } -} -export default LogExpectError; \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/report/OhReport.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/report/OhReport.js deleted file mode 100644 index d9327b4b2dc08e7452a3d9a6524f065285b80fd3..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/report/OhReport.js +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (c) 2021-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 SysTestKit from '../kit/SysTestKit'; -import { collectCoverageData } from '../coverage/coverageCollect'; -import { TAG, PrintTag } from '../../Constant'; - -class OhReport { - constructor(attr) { - this.delegator = attr.delegator; - this.abilityDelegatorArguments = attr.abilityDelegatorArguments; - this.id = 'report'; - this.index = 0; - this.duration = 0; - this.currentThreadName = 'mainThread'; - } - - init(coreContext) { - this.coreContext = coreContext; - this.suiteService = this.coreContext.getDefaultService('suite'); - this.specService = this.coreContext.getDefaultService('spec'); - if (SysTestKit.workerPort !== null) { - this.currentThreadName = SysTestKit.workerPort.name; - } - } - - taskStart() { - } - - async taskDone() { - let summary = this.suiteService.getSummary(); - if (this.abilityDelegatorArguments !== null) { - this.taskDoneTime = new Date().getTime(); - const configService = this.coreContext.getDefaultService('config'); - const suiteService = this.coreContext.getDefaultService('suite'); - const specService = this.coreContext.getDefaultService('spec'); - if (configService['coverage'] === 'true') { - await collectCoverageData(); - } - let message = '\n' + `${PrintTag.OHOS_REPORT_RESULT}: stream=Tests run: ` + summary.total + ', Failure: ' + summary.failure; - message += ', Error: ' + summary.error; - message += ', Pass: ' + summary.pass; - message += ', Ignore: ' + summary.ignore; - if (specService.skipSpecNum > 0) { - message += ', SkipSpec: ' + specService.skipSpecNum; - } - message += '\n' + `${PrintTag.OHOS_REPORT_CODE}: ` + (summary.failure > 0 ? -1 : 0) + '\n'; - let isHasError = summary.failure > 0 || summary.error > 0; - let config = this.coreContext.getDefaultService('config'); - if (config.isBreakOnError() && isHasError) { - // 未执行全部说明 - message += '\n' + `${PrintTag.OHOS_REPORT_RESULT}: breakOnError model, Stopping whole test suite if one specific test case failed or error` + '\n'; - } - message += `${PrintTag.OHOS_REPORT_STATUS}: taskconsuming=` + summary.duration + '\n'; - console.info(`${message}`); - await SysTestKit.print(message); - } - if (SysTestKit.workerPort === null || SysTestKit.workerPort === undefined) { - // 主线程执行完成 结束任务。 - console.info(`${TAG}report print success`); - this.delegator.finishTest('your test finished!!!', 0, () => { }); - } else { - // worker线程执行完成将数据发送到主线程中。 - let sendData = { - currentThreadName: this.currentThreadName, - summary: summary - }; - console.info(`${TAG}, send data to mainThread, ${this.currentThreadName}, ${JSON.stringify(sendData)}`); - SysTestKit.workerPort.postMessage(sendData); - } - } - - incorrectFormat() { - if (this.coreContext.getDefaultService('config').filterValid.length !== 0) { - var value = this.coreContext.getDefaultService('config').filterValid; - var message = 'this param ' + value.join(',') + ' is invalid' + '\n'; - this.delegator.finishTest(message, 0, () => { - }); - } - } - - incorrectTestSuiteFormat() { - if (this.coreContext.getDefaultService('config').filterXdescribe.length !== 0) { - let value = this.coreContext.getDefaultService('config').filterXdescribe; - let message = 'xdescribe ' + value.join(',') + ' should not contain it' + '\n'; - this.delegator.finishTest(message, 0, () => { - }); - } - } - async suiteStart() { - if (this.abilityDelegatorArguments !== null) { - let specArr = []; - this.suiteService.getAllChildSuiteNum(this.suiteService.getCurrentRunningSuite(), specArr); - let message = '\n' + `${PrintTag.OHOS_REPORT_SUM}: ` + specArr.length; - this.suiteService.setCurrentRunningSuiteDesc(this.suiteService.getRootSuite(), this.suiteService.getCurrentRunningSuite(), ''); - message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: class=` + this.suiteService.getCurrentRunningSuiteDesc() + '\n'; - if (this.suiteService.currentRunningSuite.isSkip) { - message += `${PrintTag.OHOS_REPORT_STATUS}: skipReason=` + this.suiteService.currentRunningSuite.skipReason + '\n'; - } - if (SysTestKit.workerPort !== null) { - message += `${PrintTag.OHOS_REPORT_STATUS}: currentWorkerName=` + this.currentThreadName; - } - console.info(`${message}`); - await SysTestKit.print(message); - console.info(`${TAG}${this.suiteService.getCurrentRunningSuite().description} suiteStart print success`); - } - } - - async suiteDone() { - if (this.abilityDelegatorArguments !== null) { - const currentRunningSuite = this.suiteService.getCurrentRunningSuite(); - this.suiteService.setCurrentRunningSuiteDesc(this.suiteService.getRootSuite(), currentRunningSuite, ''); - let message = '\n' + `${PrintTag.OHOS_REPORT_STATUS}: class=` + this.suiteService.getCurrentRunningSuiteDesc(); - if (this.suiteService.currentRunningSuite.isSkip && this.suiteService.currentRunningSuite.skipReason !== '') { - message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: skipReason=` + this.suiteService.currentRunningSuite.skipReason; - } - const isPromiseError = currentRunningSuite.isPromiseError; - if (isPromiseError) { - message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: shortMsg=Promise(async, await) in describe is not allowed!`; - } - message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: suiteconsuming=` + currentRunningSuite.duration; - if (currentRunningSuite.hookError) { - message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: ${currentRunningSuite.hookError.message}`; - } - message += '\n'; - if (SysTestKit.workerPort !== null) { - message += `${PrintTag.OHOS_REPORT_STATUS}: currentWorkerName=` + this.currentThreadName; - } - console.info(`${message}`); - await SysTestKit.print(message); - console.info(`${TAG}${currentRunningSuite.description} suiteDone print success`); - } - } - - async specStart() { - if (this.abilityDelegatorArguments !== null) { - let message = '\n' + `${PrintTag.OHOS_REPORT_STATUS}: class=` + this.suiteService.getCurrentRunningSuiteDesc(); - message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: current=` + (++this.index); - message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: id=JS`; - message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: numtests=` + this.specService.getTestTotal(); - message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: stream=`; - message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: test=` + this.specService.currentRunningSpec.description; - message += '\n' + `${PrintTag.OHOS_REPORT_STATUS_CODE}: 1` + '\n'; - if (this.specService.currentRunningSpec.isSkip) { - message += `${PrintTag.OHOS_REPORT_STATUS}: skipReason=` + this.specService.currentRunningSpec.skipReason + '\n'; - } - if (SysTestKit.workerPort !== null) { - message += `${PrintTag.OHOS_REPORT_STATUS}: currentWorkerName=` + this.currentThreadName; - } - console.info(`${message}`); - await SysTestKit.print(message); - console.info(`${TAG}${this.specService.currentRunningSpec.description} specStart start print success`); - } - } - - async specDone() { - if (this.abilityDelegatorArguments !== null) { - let message = '\n' + `${PrintTag.OHOS_REPORT_STATUS}: class=` + this.suiteService.getCurrentRunningSuiteDesc(); - message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: current=` + (this.index); - message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: id=JS`; - message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: numtests=` + this.specService.getTestTotal(); - let messageStack = ''; - let messageCode = ''; - if (this.specService.currentRunningSpec.error) { - messageStack = `${PrintTag.OHOS_REPORT_STATUS}: stack=` + this.specService.currentRunningSpec.error?.stack?.slice(0, -1); - messageCode += `${PrintTag.OHOS_REPORT_STATUS}: stream=`; - messageCode += this.specService.currentRunningSpec.expectMsg !== '' ? - `message: ${this.specService.currentRunningSpec.expectMsg}, Error in ${this.specService.currentRunningSpec.description}, ${this.specService.currentRunningSpec.error?.message}` : - `Error in ${this.specService.currentRunningSpec.description}, ${this.specService.currentRunningSpec.error?.message}`; - messageCode += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: test=` + this.specService.currentRunningSpec.description; - messageCode += '\n' + `${PrintTag.OHOS_REPORT_STATUS_CODE}: -1` + '\n'; - } else if (this.specService.currentRunningSpec) { - if (this.specService.currentRunningSpec.fail) { - messageStack += `${PrintTag.OHOS_REPORT_STATUS}: stack=` + this.specService.currentRunningSpec.fail?.stack?.slice(0, -1); - messageCode += `${PrintTag.OHOS_REPORT_STATUS}: stream=`; - messageCode += this.specService.currentRunningSpec.expectMsg !== '' ? - `message: ${this.specService.currentRunningSpec.expectMsg}, Error in ${this.specService.currentRunningSpec.description}, ${this.specService.currentRunningSpec.fail?.message}` : - `Error in ${this.specService.currentRunningSpec.description}, ${this.specService.currentRunningSpec.fail?.message}`; - messageCode += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: test=` + this.specService.currentRunningSpec.description; - messageCode += '\n' + `${PrintTag.OHOS_REPORT_STATUS_CODE}: -2` + '\n'; - } else { - messageStack += `${PrintTag.OHOS_REPORT_STATUS}: stream=`; - messageCode += `${PrintTag.OHOS_REPORT_STATUS}: test=` + this.specService.currentRunningSpec.description; - messageCode += '\n' + `${PrintTag.OHOS_REPORT_STATUS_CODE}: 0` + '\n'; - messageCode += this.specService.currentRunningSpec.isSkip ? (`${PrintTag.OHOS_REPORT_STATUS}: skipReason=` + this.specService.currentRunningSpec.skipReason + '\n') : ''; - } - } else { - messageCode += '\n'; - } - messageCode += `${PrintTag.OHOS_REPORT_STATUS}: consuming=` + this.specService.currentRunningSpec.duration + '\n'; - if (SysTestKit.workerPort !== null) { - messageCode += `${PrintTag.OHOS_REPORT_STATUS}: currentWorkerName=` + this.currentThreadName; - } - console.info(`${message}`); - console.info(`\n${messageStack}`); - console.info(`\n${messageCode}`); - await SysTestKit.print(message); - await SysTestKit.print(messageStack); - await SysTestKit.print(messageCode); - console.info(`${TAG}${this.specService.currentRunningSpec.description} specDone end print success`); - } - } -} - -export default OhReport; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/report/ReportExtend.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/report/ReportExtend.js deleted file mode 100644 index 4a75453f4337224291a206975096f252df7d4b74..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/report/ReportExtend.js +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ - -class ReportExtend { - constructor(fileModule) { - this.id = 'extend'; - this.fileModule = fileModule; - } - - init(coreContext) { - this.coreContext = coreContext; - this.suiteService = this.coreContext.getDefaultService('suite'); - } - - taskStart() { - - } - - handleSpecs(specs, report, suiteReport, testsuite) { - for (let testcase of specs) { - report.tests++; - suiteReport.tests++; - let caseReport = { - tag: 'testcase', - name: testcase.description, - status: 'run', - time: '0.0', - classname: testsuite.description - }; - if (testcase.error) { - caseReport.result = false; - caseReport.children = [{ - tag: 'error', - type: '', - message: testcase.error.message - }]; - report.errors++; - suiteReport.errors++; - } else if (testcase.result.failExpects.length > 0) { - caseReport.result = false; - let message = ''; - testcase.result.failExpects.forEach(failExpect => { - message += failExpect.message || ('expect ' + failExpect.actualValue + ' ' + failExpect.checkFunc + ' ' + (failExpect.expectValue || '')) + ';'; - }); - caseReport.children = [{ - tag: 'failure', - type: '', - message: message - }]; - report.failures++; - suiteReport.failures++; - } else { - caseReport.result = true; - } - suiteReport.children.push(caseReport); - } - } - - taskDone() { - const report = { - tag: 'testsuites', - name: 'summary_report', - timestamp: new Date().toDateString(), - time: '1', - errors: 0, - failures: 0, - tests: 0, - children: [] - }; - const rootSuite = this.suiteService.rootSuite; - if (rootSuite && rootSuite.childSuites) { - for (let testsuite of rootSuite.childSuites) { - let suiteReport = { - tag: 'testsuite', - name: testsuite['description'], - errors: 0, - tests: 0, - failures: 0, - time: '0.1', - children: [] - }; - let specs = testsuite['specs']; - this.handleSpecs(specs, report, suiteReport, testsuite); - report.children.push(suiteReport); - } - } - - writeXmlReport(report); - } -} - -function writeXmlReport(report) { - let reportXml = '\n' + json2xml(report); - this.fileModule.writeText({ - uri: 'internal://app/report.xml', - text: reportXml, - success: function () { - console.info('call success callback success'); - }, - fail: function (data, code) { - console.info('call fail callback success:'); - }, - complete: function () { - console.info('call complete callback success'); - } - }); -} - -function handleChild(json, key, hasChildren, childrenStr) { - if (json[key].length > 0) { - hasChildren = true; - for (let child of json[key]) { - childrenStr += json2xml(child); - } - } -} - -function json2xml(json) { - let tagName; - let hasChildren = false; - let childrenStr = ''; - let attrStr = ''; - for (let key in json) { - if (key === 'tag') { - tagName = json[key]; - } else if (key === 'children') { - handleChild(json, key, hasChildren, childrenStr); - } else { - attrStr += ` ${key}="${json[key]}"`; - } - } - let xml = `<${tagName}${attrStr}`; - xml += hasChildren ? `>${childrenStr}` : '/>'; - return xml; -} - -export default ReportExtend; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/service.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/service.js deleted file mode 100644 index 0ca605e4269e58d9784a5ba9c13d000ac6cba0bd..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/service.js +++ /dev/null @@ -1,1265 +0,0 @@ -/* - * Copyright (c) 2021-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 SysTestKit from './module/kit/SysTestKit'; -import { TAG } from './Constant'; -import LogExpectError from './module/report/LogExpectError'; -import { NestFilter } from './module/config/Filter'; - -function assertTrueFun(actualValue) { - let result = { - pass: (actualValue) === true, - message: 'expect true, actualValue is ' + actualValue - }; - return result; -} - -function assertEqualFun(actualValue, args) { - let msg = 'expect ' + actualValue + ' equals ' + args[0]; - if (actualValue === args[0]) { // 数值相同,提示数据类型 - const aClassName = Object.prototype.toString.call(actualValue); - const bClassName = Object.prototype.toString.call(args[0]); - msg = 'expect ' + actualValue + aClassName + ' equals ' + args[0] + bClassName + 'strict mode inspect type'; - } - let result = { - pass: (actualValue) === args[0], - expectValue: args[0], - message: msg - }; - return result; -} - -function assertThrowFun(actual, args) { - const result = { - pass: false - }; - if (typeof actual !== 'function') { - result.message = 'toThrow\'s Actual should be a Function'; - } else { - let hasThrow = false; - let throwError; - try { - actual(); - } catch (e) { - hasThrow = true; - throwError = e; - } - if (!hasThrow) { - result.message = 'function did not throw an exception'; - } else if (throwError && throwError.message === args[0]) { - result.pass = true; - } else { - result.message = `expect to throw ${args[0]} , actual throw ${throwError.message}`; - } - } - return result; -} - -class AssertException extends Error { - constructor(message) { - super(); - this.name = 'AssertException'; - this.message = message; - } -} - -function getFuncWithArgsZero(func, timeout, isStressTest) { - return new Promise(async (resolve, reject) => { - let timer = null; - if (!isStressTest) { - timer = setTimeout(() => { - reject(new Error('execute timeout ' + timeout + 'ms')); - }, timeout); - } - try { - await func(); - } catch (err) { - reject(err); - } - timer !== null ? clearTimeout(timer) : null; - resolve(); - }); -} - -function getFuncWithArgsOne(func, timeout, isStressTest) { - return new Promise(async (resolve, reject) => { - let timer = null; - if (!isStressTest) { - timer = setTimeout(() => { - reject(new Error('execute timeout ' + timeout + 'ms')); - }, timeout); - } - - function done() { - timer !== null ? clearTimeout(timer) : null; - resolve(); - } - - try { - await func(done); - } catch (err) { - timer !== null ? clearTimeout(timer) : null; - reject(err); - } - }); -} - -function getFuncWithArgsTwo(func, timeout, paramItem, isStressTest) { - return new Promise(async (resolve, reject) => { - let timer = null; - if (!isStressTest) { - timer = setTimeout(() => { - reject(new Error('execute timeout ' + timeout + 'ms')); - }, timeout); - } - - function done() { - timer !== null ? clearTimeout(timer) : null; - resolve(); - } - - try { - await func(done, paramItem); - } catch (err) { - timer !== null ? clearTimeout(timer) : null; - reject(err); - } - }); -} - -function processFunc(coreContext, func) { - let argNames = ((func || '').toString() - .replace(/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg, '') - .match(/^(function)?\s*[^\(]*\(\s*([^\)]*)\)/m) || ['', '', ''])[2] - .split(',') // split parameters - .map(item => item.replace(/^\s*(_?)(.+?)\1\s*$/, name => name.split('=')[0].trim())) - .filter(String); - let funcLen = func.length; - let processedFunc; - const config = coreContext.getDefaultService('config'); - config.setSupportAsync(true); - const timeout = + (config.timeout === undefined ? 5000 : config.timeout); - const isStressTest = (coreContext.getServices('dataDriver') !== undefined || config.getStress() > 1); - switch (funcLen) { - case 0: { - processedFunc = function () { - return getFuncWithArgsZero(func, timeout, isStressTest); - }; - break; - } - case 1: { - processedFunc = function () { - return getFuncWithArgsOne(func, timeout, isStressTest); - }; - break; - } - default: { - processedFunc = function (paramItem) { - return getFuncWithArgsTwo(func, timeout, paramItem, isStressTest); - }; - break; - } - } - return processedFunc; -} - -function secureRandomNumber() { - return crypto.randomBytes(8).readUInt32LE() / 0xffffffff; -} - - - -class SuiteService { - constructor(attr) { - this.id = attr.id; - this.rootSuite = new SuiteService.Suite({}); - this.currentRunningSuite = this.rootSuite; - this.suitesStack = [this.rootSuite]; - this.targetSuiteArray = []; - this.targetSpecArray = []; - this.currentRunningSuiteDesc = null; - this.fullRun = false; - this.isSkipSuite = false; - this.suiteSkipReason = null; - } - - describe(desc, func) { - const configService = this.coreContext.getDefaultService('config'); - if (this.suitesStack.some(suite => { return suite.description === desc })) { - console.error(`${TAG} Loop nesting occurs : ${desc}`); - this.suiteSkipReason = ''; - this.isSkipSuite = false; - return; - } - let isFilter = this.analyzeConfigServiceClass(configService.class, desc); - if (configService.filterSuite(desc) && isFilter) { - if (this.currentRunningSuite.description === '' || this.currentRunningSuite.description == null) { - console.info(`${TAG}filter suite : ${desc}`); - this.suiteSkipReason = ''; - this.isSkipSuite = false; - return; - } - } - const suite = new SuiteService.Suite({ description: desc }); - if (this.isSkipSuite) { - suite.isSkip = true; - suite.skipReason = this.suiteSkipReason; - } - this.suiteSkipReason = ''; - this.isSkipSuite = false; - if (typeof this.coreContext.getServices('dataDriver') !== 'undefined' && configService['dryRun'] !== 'true') { - let suiteStress = this.coreContext.getServices('dataDriver').dataDriver.getSuiteStress(desc); - for (let i = 1; i < suiteStress; i++) { - this.currentRunningSuite.childSuites.push(suite); - } - } - this.currentRunningSuite.childSuites.push(suite); - this.currentRunningSuite = suite; - this.suitesStack.push(suite); - const res = func.call(); - if (Object.prototype.toString.call(res) === '[object Promise]') { - suite.isPromiseError = true; - } - this.suitesStack.pop(); - this.currentRunningSuite = this.suitesStack.pop(); - this.suitesStack.push(this.currentRunningSuite); - } - xdescribe(desc, func, reason) { - const configService = this.coreContext.getDefaultService('config'); - if (!configService.skipMessage && configService.runSkipped !== 'all') { - if (configService.runSkipped != null && configService.runSkipped !== '') { - let finalDesc = ''; - this.suitesStack.map(suite => { - finalDesc = finalDesc + '.' + suite.description; - }); - finalDesc = (finalDesc + '.' + desc).substring(2); - console.info(`${TAG} finalDesc ${finalDesc}`); - if (configService.checkIfSuiteInSkipRun(finalDesc)) { - console.info(`${TAG} runSkipped suite: ${desc}`); - } else { - console.info(reason == null ? `${TAG} skip suite: ${desc}` : `${TAG} skip suite: ${desc}, and the reason is ${reason}`); - return; - } - } else { - console.info(reason == null ? `${TAG} skip suite: ${desc}` : `${TAG} skip suite: ${desc}, and the reason is ${reason}`); - return; - } - } - this.isSkipSuite = true; - this.suiteSkipReason = reason; - this.describe(desc, func); - } - - beforeAll(func) { - this.currentRunningSuite.beforeAll.push(processFunc(this.coreContext, func)); - } - - beforeEach(func) { - this.currentRunningSuite.beforeEach.push(processFunc(this.coreContext, func)); - } - - beforeItSpecified(itDescs, func) { - this.currentRunningSuite.beforeItSpecified.set(itDescs, processFunc(this.coreContext, func)); - } - - afterItSpecified(itDescs, func) { - this.currentRunningSuite.afterItSpecified.set(itDescs, processFunc(this.coreContext, func)); - } - - afterAll(func) { - this.currentRunningSuite.afterAll.push(processFunc(this.coreContext, func)); - } - - afterEach(func) { - this.currentRunningSuite.afterEach.push(processFunc(this.coreContext, func)); - } - - getCurrentRunningSuite() { - return this.currentRunningSuite; - } - - setCurrentRunningSuite(suite) { - this.currentRunningSuite = suite; - } - - getRootSuite() { - return this.rootSuite; - } - - getCurrentRunningSuiteDesc() { - return this.currentRunningSuiteDesc; - } - - - setCurrentRunningSuiteDesc(suite, currentSuite, prefix) { - if (suite != null && suite === currentSuite) { - this.currentRunningSuiteDesc = prefix; - } else if (suite != null && suite !== currentSuite) { - suite.childSuites.forEach(it => { - let temp = prefix; - if (it.description != null || it.description !== '') { - temp = prefix === '' ? it.description : prefix + '.' + it.description; - } - this.setCurrentRunningSuiteDesc(it, currentSuite, temp); - } - ); - } - } - analyzeConfigServiceClass(configServiceClass, desc) { - if (configServiceClass == null || configServiceClass === '') { - this.fullRun = true; - return false; - } - const targetArray = configServiceClass.split(',').map(item => item.trim()).filter(item => item !== ''); - if (this.targetSuiteArray.length === 0) { - for (let index in targetArray) { - if (targetArray[index].includes('#')) { - this.targetSpecArray.push(targetArray[index]); - } else { - this.targetSuiteArray.push(targetArray[index]); - } - } - - } - return targetArray.indexOf(desc) === -1; - - } - traversalResults(suite, obj, breakOnError) { - if (suite.childSuites.length === 0 && suite.specs.length === 0) { - return; - } - if (suite.specs.length > 0) { - for (const itItem of suite.specs) { - obj.total++; - let itInfo = { - currentThreadName: 'mainThread', - description: suite.description + '#' + itItem.description, - result: -3 - }; - if (SysTestKit.workerPort !== null) { - itInfo.currentThreadName = SysTestKit.workerPort.name; - } - obj.itItemList.push(itInfo); - if (breakOnError && (obj.error > 0 || obj.failure > 0)) { // breakOnError模式 - continue; - } - if (itItem.error) { - obj.error++; - itInfo.result = -1; - } else if (itItem.fail) { - obj.failure++; - itInfo.result = -2; - } else if (itItem.pass === true) { - obj.pass++; - itInfo.result = 0; - } - } - } - - obj.duration += suite.duration; - - if (suite.childSuites.length > 0) { - for (const suiteItem of suite.childSuites) { - this.traversalResults(suiteItem, obj, breakOnError); - } - } - - } - - async setSuiteResults(suite, error, coreContext) { - if (suite.childSuites.length === 0 && suite.specs.length === 0) { - return; - } - if (suite.specs.length > 0) { - const specService = coreContext.getDefaultService('spec'); - for (const specItem of suite.specs) { - specService.setCurrentRunningSpec(specItem); - if (error instanceof AssertException) { - specItem.fail = error; - } else { - specItem.error = error; - } - await coreContext.fireEvents('spec', 'specStart', specItem); - await coreContext.fireEvents('spec', 'specDone', specItem); - } - } - if (suite.childSuites.length > 0) { - for (const suiteItem of suite.childSuites) { - await this.setSuiteResults(suiteItem, error, coreContext); - } - } - } - - getSummary() { - let suiteService = this.coreContext.getDefaultService('suite'); - let rootSuite = suiteService.rootSuite; - const specService = this.coreContext.getDefaultService('spec'); - const configService = this.coreContext.getDefaultService('config'); - let breakOnError = configService.isBreakOnError(); - let isError = specService.getStatus(); - let isBreaKOnError = breakOnError && isError; - // itItemList 保存当前用例执行情况, 发送到主线程用例计算最终结果 - let obj = { total: 0, failure: 0, error: 0, pass: 0, ignore: 0, duration: 0, itItemList: []}; - for (const suiteItem of rootSuite.childSuites) { - this.traversalResults(suiteItem, obj, isBreaKOnError); - } - obj.ignore = obj.total - obj.pass - obj.failure - obj.error; - return obj; - } - - init(coreContext) { - this.coreContext = coreContext; - } - - traversalSuites(suite, obj, configService) { - if (suite.childSuites.length === 0 && suite.specs.length === 0) { - return []; - } - if (suite.specs.length > 0) { - let itArray = []; - for (const itItem of suite['specs']) { - if (!configService.filterDesc(suite.description, itItem.description, itItem.fi, null)) { - itArray.push({ 'itName': itItem.description }); - } - } - obj[suite.description] = itArray; - } - if (suite.childSuites.length > 0) { - let suiteArray = []; - for (const suiteItem of suite.childSuites) { - let suiteObj = {}; - this.traversalSuites(suiteItem, suiteObj, configService); - if (!configService.filterSuite(suiteItem.description)) { - suiteArray.push(suiteObj); - } - } - obj.suites = suiteArray; - } - } - - async dryRun(abilityDelegator) { - console.info(`${TAG} rootSuite : ` + JSON.stringify(this.rootSuite)); - let obj = this.rootSuite; - let prefixStack = []; - let suiteArray = []; - let skipSuiteArray = []; - this.analyzeSuitesArray(prefixStack, suiteArray, skipSuiteArray, obj); - const configService = this.coreContext.getDefaultService('config'); - let result; - if (configService.skipMessage) { - result = { 'suites': suiteArray, 'skipSuites': skipSuiteArray }; - } else { - result = { 'suites': suiteArray }; - } - let strJson = JSON.stringify(result); - let strLen = strJson.length; - let maxLen = 500; - let maxCount = Math.floor(strLen / maxLen); - for (let count = 0; count <= maxCount; count++) { - await SysTestKit.print(strJson.substring(count * maxLen, (count + 1) * maxLen)); - } - console.info(`${TAG}dryRun print success`); - abilityDelegator.finishTest('dry run finished!!!', 0, () => { }); - } - - //将suitesArray的嵌套结构展开成三层结构 - analyzeSuitesArray(prefixStack, suiteArray, skipSuiteArray, obj) { - obj.childSuites.map(suite => { - if (suite.description != null && suite.description !== '') { - let prefix = ''; - if (prefixStack.length > 0) { - prefix = prefixStack.join('.') + '.' + suite.description; - } else { - prefix = suite.description; - } - prefixStack.push(suite.description); - let temp = {}; - temp[prefix] = []; - let skipTemp = {}; - skipTemp[prefix] = []; - suite.specs.map(spec => { - let it = { 'itName': spec.description }; - spec.isSkip ? skipTemp[prefix].push(it) : temp[prefix].push(it); - }); - suiteArray.push(temp); - skipSuiteArray.push(skipTemp); - } - this.analyzeSuitesArray(prefixStack, suiteArray, skipSuiteArray, suite); - prefixStack.pop(); - }); - } - //获取当前测试套下的所有测试用例数量 - getAllChildSuiteNum(suite, specArray) { - if (suite.specs != null) { - suite.specs.forEach(spec => specArray.push(spec)); - } - if (suite.childSuites != null) { - suite.childSuites.forEach(it => this.getAllChildSuiteNum(it, specArray)); - } - } - - execute() { - const configService = this.coreContext.getDefaultService('config'); - if (configService.filterValid.length !== 0) { - this.coreContext.fireEvents('task', 'incorrectFormat'); - return; - } - if (configService.filterXdescribe.length !== 0) { - this.coreContext.fireEvents('task', 'incorrectTestSuiteFormat'); - return; - } - if (configService.isRandom() && this.rootSuite.childSuites.length > 0) { - this.rootSuite.childSuites.sort(function () { - return +('0.' + (+ new Date() + '').split('').reverse().join('')) > 0.5 ? -1 : 1; - }); - this.currentRunningSuite = this.rootSuite.childSuites[0]; - } - if (configService.isSupportAsync()) { - console.info(`${TAG} rootSuite:` + JSON.stringify(this.rootSuite)); - let asyncExecute = async () => { - await this.coreContext.fireEvents('task', 'taskStart'); - await this.rootSuite.asyncRun(this.coreContext); - }; - asyncExecute().then(async () => { - await this.coreContext.fireEvents('task', 'taskDone'); - }); - } else { - console.info('${TAG} rootSuite:' + JSON.stringify(this.rootSuite)); - this.coreContext.fireEvents('task', 'taskStart'); - this.rootSuite.run(this.coreContext); - this.coreContext.fireEvents('task', 'taskDone'); - } - } - - apis() { - const _this = this; - return { - describe: function (desc, func) { - return _this.describe(desc, func); - }, - xdescribe: function (desc, func, reason) { - return _this.xdescribe(desc, func, reason); - }, - beforeItSpecified: function (itDescs, func) { - return _this.beforeItSpecified(itDescs, func); - }, - afterItSpecified: function (itDescs, func) { - return _this.afterItSpecified(itDescs, func); - }, - beforeAll: function (func) { - return _this.beforeAll(func); - }, - beforeEach: function (func) { - return _this.beforeEach(func); - }, - afterAll: function (func) { - return _this.afterAll(func); - }, - afterEach: function (func) { - return _this.afterEach(func); - } - }; - } -} - -SuiteService.Suite = class { - constructor(attrs) { - this.description = attrs.description || ''; - this.childSuites = []; - this.specs = []; - this.beforeAll = []; - this.afterAll = []; - this.beforeItSpecified = new Map(); - this.afterItSpecified = new Map(); - this.beforeEach = []; - this.afterEach = []; - this.duration = 0; - this.hookError = null; - this.isSkip = false; - this.skipReason = ''; - } - - pushSpec(spec) { - this.specs.push(spec); - } - - removeSpec(desc) { - this.specs = this.specs.filter((item, index) => { - return item.description !== desc; - }); - } - - getSpecsNum() { - return this.specs.length; - } - - isRun(coreContext) { - const configService = coreContext.getDefaultService('config'); - const suiteService = coreContext.getDefaultService('suite'); - const specService = coreContext.getDefaultService('spec'); - let breakOnError = configService.isBreakOnError(); - let isError = specService.getStatus(); - return breakOnError && isError; - } - - run(coreContext) { - const suiteService = coreContext.getDefaultService('suite'); - suiteService.setCurrentRunningSuite(this); - if (this.description !== '') { - coreContext.fireEvents('suite', 'suiteStart', this); - } - this.runHookFunc('beforeAll'); - if (this.specs.length > 0) { - const configService = coreContext.getDefaultService('config'); - if (configService.isRandom()) { - this.specs.sort(function () { - return +('0.' + (+ new Date() + '').split('').reverse().join('')) > 0.5 ? -1 : 1; - }); - } - for (let spec in this.specs) { - let isBreakOnError = this.isRun(coreContext); - if (isBreakOnError) { - break; - } - this.runHookFunc('beforeEach'); - spec.run(coreContext); - this.runHookFunc('afterEach'); - } - } - if (this.childSuites.length > 0) { - for (let suite in this.childSuites) { - let isBreakOnError = this.isRun(coreContext); - if (isBreakOnError) { - break; - } - suite.run(coreContext); - suiteService.setCurrentRunningSuite(suite); - } - } - this.runHookFunc('afterAll'); - if (this.description !== '') { - coreContext.fireEvents('suite', 'suiteDone'); - } - } - - async runBeforeItSpecified(beforeItSpecified, specItem) { - for (const [itNames, hookFunc] of beforeItSpecified) { - if ((Object.prototype.toString.call(itNames) === '[object Array]' && itNames.includes(specItem.description)) || - (Object.prototype.toString.call(itNames) === '[object String]' && itNames === specItem.description)) { - await Reflect.apply(hookFunc, null, []); - } - break; - } - } - - async runAfterItSpecified(beforeItSpecified, specItem) { - for (const [itNames, hookFunc] of beforeItSpecified) { - if ((Object.prototype.toString.call(itNames) === '[object Array]' && itNames.includes(specItem.description)) || - (Object.prototype.toString.call(itNames) === '[object String]' && itNames === specItem.description)) { - await Reflect.apply(hookFunc, null, []); - } - break; - } - } - - async asyncRunSpecs(coreContext) { - const configService = coreContext.getDefaultService('config'); - if (configService.isRandom()) { - this.specs.sort(function () { - return +('0.' + (+ new Date() + '').split('').reverse().join('')) > 0.5 ? -1 : 1; - }); - } - const specService = coreContext.getDefaultService('spec'); - for (let specItem of this.specs) { - specService.setCurrentRunningSpec(specItem); - // 遇错即停模式,发现用例有问题,直接返回,不在执行后面的it - let isBreakOnError = this.isRun(coreContext); - if (isBreakOnError) { - console.info('break description :' + this.description); - break; - } - await coreContext.fireEvents('spec', 'specStart', specItem); - try { - await this.runBeforeItSpecified(this.beforeItSpecified, specItem); - await this.runAsyncHookFunc('beforeEach'); - await specItem.asyncRun(coreContext); - await this.runAfterItSpecified(this.afterItSpecified, specItem); - await this.runAsyncHookFunc('afterEach'); - } catch (e) { - console.error(`${TAG}stack:${e?.stack}`); - console.error(`${TAG}stack end`); - if (e instanceof AssertException) { - specItem.fail = e; - } else { - specItem.error = e; - } - specService.setStatus(true); - } - specItem.setResult(); - await coreContext.fireEvents('spec', 'specDone', specItem); - specService.setCurrentRunningSpec(null); - } - } - - async asyncRunChildSuites(coreContext) { - for (let i = 0; i < this.childSuites.length; i++) { - // 遇错即停模式, 发现用例有问题,直接返回,不在执行后面的description - let isBreakOnError = this.isRun(coreContext); - if (isBreakOnError) { - console.info(`${TAG}break description : ${this.description}`); - break; - } - await this.childSuites[i].asyncRun(coreContext); - } - } - - async asyncRun(coreContext) { - const suiteService = coreContext.getDefaultService('suite'); - const specService = coreContext.getDefaultService('spec'); - - suiteService.setCurrentRunningSuite(this); - suiteService.suitesStack.push(this); - if (this.description !== '') { - await coreContext.fireEvents('suite', 'suiteStart', this); - } - - try { - await this.runAsyncHookFunc('beforeAll'); - } catch (error) { - console.error(`${TAG}${error?.stack}`); - this.hookError = error; - } - - if (this.hookError !== null) { - specService.setStatus(true); - await suiteService.setSuiteResults(this, this.hookError, coreContext); - } - - if (this.specs.length > 0 && this.hookError === null) { - await this.asyncRunSpecs(coreContext); - } - - if (this.childSuites.length > 0 && this.hookError === null) { - await this.asyncRunChildSuites(coreContext); - } - - try { - await this.runAsyncHookFunc('afterAll'); - } catch (error) { - console.error(`${TAG}${error?.stack}`); - this.hookError = error; - specService.setStatus(true); - } - - if (this.description !== '') { - await coreContext.fireEvents('suite', 'suiteDone'); - let childSuite = suiteService.suitesStack.pop(); - let currentRunningSuite = suiteService.suitesStack.pop(); - suiteService.setCurrentRunningSuite(currentRunningSuite); - suiteService.suitesStack.push(currentRunningSuite); - } - } - - runHookFunc(hookName) { - if (this[hookName] && this[hookName].length > 0) { - this[hookName].forEach(func => { - try { - func(); - } catch (e) { - console.error(`${TAG}${e.stack}`); - } - }); - } - } - - async runAsyncHookFunc(hookName) { - for (const hookItem of this[hookName]) { - try { - await hookItem(); - } catch (error) { - error['message'] += `, error in ${hookName} function`; - throw error; - } - - } - } -}; - -class SpecService { - constructor(attr) { - this.id = attr.id; - this.totalTest = 0; - this.hasError = false; - this.skipSpecNum = 0; - this.isSkipSpec = false; - this.specSkipReason = ''; - } - - init(coreContext) { - this.coreContext = coreContext; - } - - setCurrentRunningSpec(spec) { - this.currentRunningSpec = spec; - } - - setStatus(obj) { - this.hasError = obj; - } - - getStatus() { - return this.hasError; - } - - getTestTotal() { - return this.totalTest; - } - - getCurrentRunningSpec() { - return this.currentRunningSpec; - } - - - getSkipSpecNum() { - return this.skipSpecNum; - } - - initSpecService() { - this.isSkipSpec = false; - this.specSkipReason = ''; - } - - it(desc, filter, func) { - const suiteService = this.coreContext.getDefaultService('suite'); - const configService = this.coreContext.getDefaultService('config'); - let isFilter = new NestFilter().filterNestName(suiteService.targetSuiteArray, suiteService.targetSpecArray, suiteService.suitesStack, desc); - if (configService.filterWithNest(desc, filter)) { - console.info(`${TAG}filter it :${desc}`); - this.initSpecService(); - return; - } - if (configService.filterDesc(suiteService.currentRunningSuite.description, desc, filter, this.coreContext) && isFilter && !suiteService.fullRun) { - console.info(`${TAG}filter it :${desc}`); - this.initSpecService(); - } else { - let processedFunc = processFunc(this.coreContext, func); - const spec = new SpecService.Spec({ description: desc, fi: filter, fn: processedFunc }); - if (this.isSkipSpec) { - spec.isSkip = true; - spec.skipReason = this.specSkipReason; - } - this.initSpecService(); - if (configService.runSkipped === 'skipped' && !spec.isSkip) { - console.info(`${TAG} runSkipped is skipped , just run xit, don't run it: ${spec.description}`); - return; - } - if (suiteService.getCurrentRunningSuite().isSkip && !spec.isSkip) { - configService.filterXdescribe.push(suiteService.getCurrentRunningSuite().description); - } - if (typeof this.coreContext.getServices('dataDriver') !== 'undefined' && configService['dryRun'] !== 'true') { - let specStress = this.coreContext.getServices('dataDriver').dataDriver.getSpecStress(desc); - for (let i = 1; i < specStress; i++) { - this.totalTest++; - suiteService.getCurrentRunningSuite().pushSpec(spec); - } - } - // dryRun 状态下不统计压力测试重复数据 - if (configService['dryRun'] !== 'true') { - let stress = configService.getStress(); // 命令配置压力测试 - console.info(`${TAG}stress length : ${stress}`); - for (let i = 1; i < stress; i++) { - this.totalTest++; - suiteService.getCurrentRunningSuite().pushSpec(spec); - } - } - this.totalTest++; - suiteService.getCurrentRunningSuite().pushSpec(spec); - } - } - - xit(desc, filter, func, reason) { - const configService = this.coreContext.getDefaultService('config'); - const suiteService = this.coreContext.getDefaultService('suite'); - if (!configService.skipMessage && configService.runSkipped !== 'all') { - if (configService.runSkipped != null && configService.runSkipped !== '') { - let finalDesc = ''; - suiteService.suitesStack.map(suite => { - finalDesc = finalDesc + '.' + suite.description; - }); - finalDesc = (finalDesc + '#' + desc).substring(2); - if (configService.checkIfSpecInSkipRun(finalDesc)) { - console.info(`${TAG} runSkipped spec: ${desc}`); - } else { - console.info(reason == null ? `${TAG} skip spec: ${desc}` : `${TAG} skip spec: ${desc}, and the reason is ${reason}`); - return; - } - } else { - console.info(reason == null ? `${TAG} skip spec: ${desc}` : `${TAG} skip spec: ${desc}, and the reason is ${reason}`); - return; - } - } - this.skipSpecNum++; - this.isSkipSpec = true; - this.specSkipReason = reason; - this.it(desc, filter, func); - } - - apis() { - const _this = this; - return { - it: function (desc, filter, func) { - return _this.it(desc, filter, func); - }, - xit: function (desc, filter, func, reason) { - return _this.xit(desc, filter, func, reason); - } - }; - } -} - -SpecService.Spec = class { - constructor(attrs) { - this.description = attrs.description || ''; - this.fi = attrs.fi; - this.fn = attrs.fn || function () { - }; - this.fail = undefined; - this.error = undefined; - this.duration = 0; - this.startTime = 0; - this.isExecuted = false; // 当前用例是否执行 - this.isSkip = false; - this.skipReason = ''; - this.expectMsg = ''; - } - - setResult() { - if (this.fail) { - this.pass = false; - } else { - this.pass = true; - } - } - - run(coreContext) { - const specService = coreContext.getDefaultService('spec'); - specService.setCurrentRunningSpec(this); - coreContext.fireEvents('spec', 'specStart', this); - this.isExecuted = true; - try { - let dataDriver = coreContext.getServices('dataDriver'); - if (typeof dataDriver === 'undefined') { - this.fn(); - } else { - let suiteParams = dataDriver.dataDriver.getSuiteParams(); - let specParams = dataDriver.dataDriver.getSpecParams(); - console.info(`${TAG}[suite params] ${JSON.stringify(suiteParams)}`); - console.info(`${TAG}[spec params] ${JSON.stringify(specParams)}`); - if (this.fn.length === 0) { - this.fn(); - } else if (specParams.length === 0) { - this.fn(suiteParams); - } else { - specParams.forEach(paramItem => this.fn(Object.assign({}, paramItem, suiteParams))); - } - } - this.setResult(); - } catch (e) { - this.error = e; - specService.setStatus(true); - } - coreContext.fireEvents('spec', 'specDone', this); - } - - async asyncRun(coreContext) { - const dataDriver = coreContext.getServices('dataDriver'); - if (typeof dataDriver === 'undefined') { - await this.fn(); - } else { - const suiteParams = dataDriver.dataDriver.getSuiteParams(); - const specParams = dataDriver.dataDriver.getSpecParams(); - console.info(`[suite params] ${JSON.stringify(suiteParams)}`); - console.info(`[spec params] ${JSON.stringify(specParams)}`); - if (this.fn.length === 0) { - await this.fn(); - } else if (specParams.length === 0) { - await this.fn(suiteParams); - } else { - for (const paramItem of specParams) { - await this.fn(Object.assign({}, paramItem, suiteParams)); - } - } - } - - this.isExecuted = true; - } - - filterCheck(coreContext) { - const specService = coreContext.getDefaultService('spec'); - specService.setCurrentRunningSpec(this); - return true; - } -}; - -class ExpectService { - constructor(attr) { - this.id = attr.id; - this.matchers = {}; - this.customMatchers = []; - } - - expect(actualValue) { - return this.wrapMatchers(actualValue); - } - - init(coreContext) { - this.coreContext = coreContext; - this.addMatchers(this.basicMatchers()); - } - - addMatchers(matchers) { - for (const matcherName in matchers) { - if (Object.prototype.hasOwnProperty.call(matchers, matcherName)) { - this.matchers[matcherName] = matchers[matcherName]; - } - } - } - - removeMatchers(customAssertionName) { - if (customAssertionName === 'all') { - for (const matcherName in this.matchers) { - this.matchers[matcherName] = this.customMatchers.includes(matcherName) - ? (() => {throw new Error(`${matcherName} is unregistered`)}) : undefined; - } - } else { - this.matchers[customAssertionName] = () => { - throw new Error(`${customAssertionName} is unregistered`); - }; - } - } - - basicMatchers() { - return { - assertTrue: assertTrueFun, - assertEqual: assertEqualFun, - assertThrow: assertThrowFun - }; - } - - initWrapMatchers(currentRunningSpec) { - return { - // 翻转标识 - isNot: false, - // 翻转方法 - not: function () { - this.isNot = true; - return this; - }, - message: function (msg) { - currentRunningSpec.expectMsg = msg; - console.info(`${TAG} msg: ${msg}`); - return this; - } - }; - - } - - handleWithAssertPromise(_this, wrappedMatchers, matcherName, actualValue, currentRunningSpec, currentRunningSuite) { - wrappedMatchers[matcherName] = async function (...args) { - await _this.matchers[matcherName](actualValue, args).then(function (result) { - if (wrappedMatchers.isNot) { - result.pass = !result.pass; - } - result.actualValue = actualValue; - result.checkFunc = matcherName; - if (!result.pass) { - const assertError = new AssertException(result.message); - currentRunningSpec ? currentRunningSpec.fail = assertError : currentRunningSuite.hookError = assertError; - throw assertError; - } - }); - }; - } - - handleWithoutAssertPromise(_this, wrappedMatchers, matcherName, actualValue, currentRunningSpec, currentRunningSuite) { - wrappedMatchers[matcherName] = function (...args) { - const result = _this.customMatchers.includes(matcherName) - ? _this.matchers[matcherName](actualValue, args[0]) : _this.matchers[matcherName](actualValue, args); - if (wrappedMatchers.isNot) { - result.pass = !result.pass; - result.message = LogExpectError.getErrorMsg(matcherName, actualValue, args[0], result.message); - } - result.actualValue = actualValue; - result.checkFunc = matcherName; - if (!result.pass) { - const assertError = new AssertException(result.message); - currentRunningSpec ? currentRunningSpec.fail = assertError : currentRunningSuite.hookError = assertError; - throw assertError; - } - }; - } - - addAssert(wrappedMatchers, matcherName, actualValue) { - const _this = this; - const specService = _this.coreContext.getDefaultService('spec'); - const currentRunningSpec = specService.getCurrentRunningSpec(); - const currentRunningSuite = _this.coreContext.getDefaultService('suite').getCurrentRunningSuite(); - if (matcherName.search('assertPromise') === 0) { - this.handleWithAssertPromise(_this, wrappedMatchers, matcherName, actualValue, currentRunningSpec, currentRunningSuite); - } else { - this.handleWithoutAssertPromise(_this, wrappedMatchers, matcherName, actualValue, currentRunningSpec, currentRunningSuite); - } - } - - wrapMatchers(actualValue) { - const _this = this; - const specService = _this.coreContext.getDefaultService('spec'); - const currentRunningSpec = specService.getCurrentRunningSpec(); - const wrappedMatchers = this.initWrapMatchers(currentRunningSpec); - const currentRunningSuite = _this.coreContext.getDefaultService('suite').getCurrentRunningSuite(); - for (const matcherName in this.matchers) { - let result = Object.prototype.hasOwnProperty.call(this.matchers, matcherName); - if (!result) { - continue; - } - this.addAssert(wrappedMatchers, matcherName, actualValue); - } - return wrappedMatchers; - } - - apis() { - const _this = this; - return { - expect: function (actualValue) { - return _this.expect(actualValue); - } - }; - } -} - -class ReportService { - constructor(attr) { - this.id = attr.id; - } - - init(coreContext) { - this.coreContext = coreContext; - this.specService = this.coreContext.getDefaultService('spec'); - this.suiteService = this.coreContext.getDefaultService('suite'); - this.duration = 0; - } - - taskStart() { - console.info(`${TAG}[start] start run suites`); - } - - async suiteStart() { - console.info(`${TAG}[suite start]${this.suiteService.getCurrentRunningSuite().description}`); - } - - async specStart() { - console.info(`${TAG}start running case '${this.specService.currentRunningSpec.description}'`); - this.index = this.index + 1; - let spec = this.specService.currentRunningSpec; - spec.startTime = await SysTestKit.getRealTime(); - } - - async specDone() { - let msg = ''; - let spec = this.specService.currentRunningSpec; - let suite = this.suiteService.currentRunningSuite; - spec.duration = await SysTestKit.getRealTime() - spec.startTime; - suite.duration += spec.duration; - if (spec.error) { - this.formatPrint('error', spec.description + ' ; consuming ' + spec.duration + 'ms'); - this.formatPrint('errorDetail', spec.error); - } else if (spec.fail) { - this.formatPrint('fail', spec.description + ' ; consuming ' + spec.duration + 'ms'); - this.formatPrint('failDetail', spec.fail?.message); - } else { - this.formatPrint('pass', spec.description + ' ; consuming ' + spec.duration + 'ms'); - } - this.formatPrint(this.specService.currentRunningSpec.error, msg); - } - - suiteDone() { - let suite = this.suiteService.currentRunningSuite; - let message = suite.hookError ? `, ${suite.hookError?.message}` : ''; - console.info(`[suite end] ${suite.description} consuming ${suite.duration} ms${message}`); - } - - taskDone() { - let msg = ''; - let summary = this.suiteService.getSummary(); - msg = 'total cases:' + summary.total + ';failure ' + summary.failure + ',' + 'error ' + summary.error; - msg += ',pass ' + summary.pass + '; consuming ' + summary.duration + 'ms'; - console.info(`${TAG}${msg}`); - console.info(`${TAG}[end] run suites end`); - } - - incorrectFormat() { - if (this.coreContext.getDefaultService('config').filterValid.length !== 0) { - this.coreContext.getDefaultService('config').filterValid.forEach(function (item) { - console.info(`${TAG}this param ${item} is invalid`); - }); - } - } - - incorrectTestSuiteFormat() { - if (this.coreContext.getDefaultService('config').filterXdescribe.length !== 0) { - this.coreContext.getDefaultService('config').filterXdescribe.forEach(function (item) { - console.info(`${TAG}xdescribe: ${item} should not contain it`); - }); - } - } - - formatPrint(type, msg) { - switch (type) { - case 'pass': - console.info(`${TAG}[pass]${msg}`); - break; - case 'fail': - console.info(`${TAG}[fail]${msg}`); - break; - case 'failDetail': - console.info(`${TAG}[failDetail]${msg}`); - break; - case 'error': - console.info(`${TAG}[error]${msg}`); - break; - case 'errorDetail': - console.info(`${TAG}[errorDetail]${msg}`); - break; - } - } - - sleep(numberMillis) { - var now = new Date(); - var exitTime = now.getTime() + numberMillis; - while (true) { - now = new Date(); - if (now.getTime() > exitTime) { - return; - } - } - } -} - -export { - SuiteService, - SpecService, - ExpectService, - ReportService -}; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/testrunner/OpenHarmonyTestRunner.ts b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/testrunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index e6f4c1b12dd69714ed5a4524671abca1fbcaa58c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/testrunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2023-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 { abilityDelegatorRegistry, TestRunner } from '@kit.TestKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { resourceManager } from '@kit.LocalizationKit'; -import { util } from '@kit.ArkTS'; -import { Hypium } from '@ohos/hypium'; -import testsuite from '../test/List.test'; - -let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator; -let abilityDelegatorArguments: abilityDelegatorRegistry.AbilityDelegatorArgs; -let jsonPath: string = 'mock/mock-config.json'; -let domain: number = 0x0000; //日志标识,0x0000作为测试框架的业务标识 -let tag: string = 'testTag'; //日志标识字符串,作为tag标识当前runner类下的测试行为 - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - hilog.info(domain, tag, '%{public}s', 'OpenHarmonyTestRunner OnPrepare'); - } - - async onRun() { - hilog.info(domain, tag, '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = abilityDelegatorRegistry.getArguments(); - abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); - let moduleName = abilityDelegatorArguments.parameters['-m']; - let context = abilityDelegator.getAppContext().getApplicationContext().createModuleContext(moduleName); - let mResourceManager = context.resourceManager; - await checkMock(abilityDelegator, mResourceManager); - hilog.info(domain, tag, '%{public}s', 'start run testcase!!!'); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); - hilog.info(domain, tag, '%{public}s', 'OpenHarmonyTestRunner onRun end'); - } -} - -async function checkMock(abilityDelegator: abilityDelegatorRegistry.AbilityDelegator, resourceManager: resourceManager.ResourceManager) { - let rawFile: Uint8Array; - try { - rawFile = resourceManager.getRawFileContentSync(jsonPath); - hilog.info(domain, tag, 'MockList file exists'); - let mockStr: string = util.TextDecoder.create("utf-8", { ignoreBOM: true }).decodeWithStream(rawFile); - let mockMap: Record = getMockList(mockStr); - try { - abilityDelegator.setMockList(mockMap); - } catch (error) { - let code = (error as BusinessError).code; - let message = (error as BusinessError).message; - hilog.error(domain, tag, `abilityDelegator.setMockList failed, error code: ${code}, message: ${message}.`); - } - } catch (error) { - let code = (error as BusinessError).code; - let message = (error as BusinessError).message; - hilog.error(domain, tag, `ResourceManager:callback getRawFileContent failed, error code: ${code}, message: ${message}.`); - } -} - -function getMockList(jsonStr: string) { - let jsonObj: Record = JSON.parse(jsonStr); - let map: Map = new Map(Object.entries(jsonObj)); - let mockList: Record = {}; - map.forEach((value: object, key: string) => { - let realValue: string = value['source'].toString(); - mockList[key] = realValue; - }); - hilog.info(domain, tag, '%{public}s', 'mock-json value:' + JSON.stringify(mockList) ?? ''); - return mockList; -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/BuildProfile.ets b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/BuildProfile.ets deleted file mode 100644 index 6ebcbce1855368b60f68bd8807c749dbec719dff..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/BuildProfile.ets +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Use these variables when you tailor your ArkTS code. They must be of the const type. - */ -export const HAR_VERSION = '2.0.24'; -export const BUILD_MODE_NAME = 'debug'; -export const DEBUG = true; -export const TARGET_NAME = 'default'; - -/** - * BuildProfile Class is used only for compatibility purposes. - */ -export default class BuildProfile { - static readonly HAR_VERSION = HAR_VERSION; - static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; - static readonly DEBUG = DEBUG; - static readonly TARGET_NAME = TARGET_NAME; -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/CHANGELOG.md b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/CHANGELOG.md deleted file mode 100644 index 130b621fab7c6b0727c0a790e5692dc995855901..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/CHANGELOG.md +++ /dev/null @@ -1,339 +0,0 @@ -## v2.0.24 - Release version 2.0.24. - -## v2.0.24-rc.1 - feature: Supports synchronous clearing of all caches, including the current animation cache. - fix: Fix the issue of some animation content displaying abnormally outside the designated area. - fix: Fix the network image loading issue caused by the failure to create multiple layers of directories in the sandbox. - -## v2.0.24-rc.0 - fix: Fix the issue where the current animation frame number is abnormal when setting animation color dynamically. - fix: Fixed the issue of frame index out-of-bounds in reverse playback or nested animations in goToAndStop. - fix: Fix the issue where changeColor fails to modify the current frame color in transparency scenarios. - fix: Optimize the logic of the filling mode. - -## v2.0.23 - Release version 2.0.23. - -## v2.0.23-rc.2 - fix: Optimize the code by replacing deprecated interfaces with the latest and standardized ones. - -## v2.0.23-rc.1 - fix: Support the loading function of animation files in .zip and .lottie formats in the rawfile directory. - -## v2.0.23-rc.0 - feature: Support the loading function of animation files in .zip and .lottie formats in the rawfile directory. - -## v2.0.22 - fix: Fixed the animation crashing issue caused by the failure to read AbilityInfo.name in specific scenarios. - -## v2.0.21 - Release version 2.0.21. - -## v2.0.21-rc.1 - fix: Fix the complete callback exception caused by calling the playSegments method and enhance the fault-tolerant handling mechanism for illegal numbers NaN. - -## v2.0.21-rc.0 - fix: Fix the issue of abnormal animation playback in sub window scenes. - -## v2.0.20 - Release version 2.0.20. - -## v2.0.20-rc.3 - fix: Optimized the code for dynamically modifying the colors of each layer in Lottie animation, improving its performance, readability, and maintainability. - fix: Add a condition to determine whether the context2D object has the getJsonData method to avoid calling an error when the method does not exist. - -## v2.0.20-rc.2 - fix: Fix the issue in the HSP module where animations cannot be played due to the input of context context. - -## v2.0.20-rc.1 - fix: Optimize the loading logic of ZIP format network animation resources and fix some resource loading failures caused by format parsing exceptions. - fix: Fixed the issue where dynamically modifying the current frame color during animation pause was ineffective. - -## v2.0.20-rc.0 - fix: Fix and enhance the compatibility of loading. jpg/. jpg network animation images with enhanced animations. - fix: Fix the feature support issue where the animation playback frame rate can be set higher than the animation resource frame rate. - -## v2.0.19 - fix: Fixed the issue of process freezing caused by the while loop condition not being met, by adding a protection mechanism that forces the loop to exit when it reaches 2000 executions. - -## v2.0.18 - fix: Fixed the issue where Lottie's call to the goToAndStop interface resulted in the animation not correctly jumping to the last frame due to the total number of frames passed in. - -## v2.0.18-rc.1 - fix: Fix the compatibility issue of Lottie animation playback in some API 13 mirrored versions, targeting scenes where the canvas2d.on and canvas2d.off interfaces are not provided in this version, to ensure that the animation can play normally. - -## v2.0.18-rc.0 - feature: Supports normal playback of animations in multi ability scenarios. - -## v2.0.17 - fix: Optimize the Lottie lifecycle to solve redundant drawing in complex scenes. - Release version 2.0.17 - -## v2.0.17-rc.3 - fix: Fix getContext() in specific scenarios The problem of error reporting when obtaining the path of the sandbox file cacheDir using the method. - -## v2.0.17-rc.2 - fix: Fix due to this_ The type of the absoluteFramePlayed parameter is changed from number to non number, resulting in the failure of calling the. toPixed() method and causing errors. - -## v2.0.17-rc.1 - fix: Fixed the issue of accidentally clearing other array objects when destroying animations, resulting in the failure of loading other animations. - fix: Adjust the animation playback speed so that it can accurately control the playback rate in decimal form. - fix: Fix animation loading support for directly reading animation resource files from the sandbox through path mode for playback. - -## v2.0.17-rc.0 - fix: At the end of each frame of the animation, reset CanvasRendering Context2D to its default state, clear the background buffer, and improve drawing performance. - feature: Supplement log switch function interface. - -## v2.0.16 - Release version 2.0.16. - -## v2.0.16-rc.3 - fix:Fixed the issue where the animation loading execution was incomplete and destroyed, and the internal closure was not fully executed, resulting in the object being held indefinitely. - -## v2.0.16-rc.2 - fix:Fix the issue of abnormal font and animation effects playback size in animations. - -## v2.0.16-rc.1 - fix:Fixed the issue of ineffective animation gradient transparency caused by array index out of bounds. - -## v2.0.16-rc.0 - fix:Fixed the issue where the parent component node was hidden while the child component canvas node was visible, causing the animation to still play. - -## v2.0.15 - fix: Fix the issue where animations are automatically destroyed when their state is not visible in a specific scene. - fix: Fix the issue of failed dynamic modification of multiple keyframe colors in animation. - -## v2.0.15-rc.1 - fix: Optimized and solved the problem of keyframe colors not taking effect in dynamic replacement animations. - fix: Fixed the issue of ineffective transparency settings for dynamic gradient colors in animations. - fix: Fix the issue of incorrect text display position in animation. - -## v2.0.15-rc.0 - fix: Fixed the issue where one or more animations were destroyed during simultaneous loading and playback, resulting in a low probability of crashes in the application. - feature: Support specifying replacement animation images. - fix: Fix the issue of abnormal animation font playback and animation effect size. - fix: Fix the problem of reading errors in sandbox image resources caused by insufficient read permissions or missing files. - -## v2.0.14 - Release version 2.0.14. - -## v2.0.14-rc.2 - fix: Fix the issue of reading the image_stource property incorrectly when the image data is incorrect. - fix: Modify and clear cache interface, clearing all/individual caches using the same interface. - -## v2.0.14-rc.1 - feature:When the animation is completely invisible, the current animation will automatically pause and stop sending drawing instructions to optimize performance and reduce power consumption. - -## v2.0.14-rc.0 - feature:支持清除全部缓存, 清除当前动画缓存。 - feature:支持判断动画是否为网络播放。 - feature:优化animator的使用方式,使用displaySync替代animator机制。 - fix: 修复使用animationData方式加载播放网络资源图片失败的问题。 - -## v2.0.13 - 发布2.0.13正式版。 - -## v2.0.13-rc.0 - fix: 修复json动画资源文件缺少e属性导致动画图片加载不出来的问题。 - fix: 优化加载网络资源代码结构。 - -## v2.0.12 - 发布2.0.12正式版。 - -## v2.0.12-rc.3 - fix: 修复在自动播放状态下,加载动画第一帧重复播放的问题。 - -## v2.0.12-rc.2 - fix: 修复使用animateItem.destroy销毁方式,导致底层animator没有停止而一直在刷帧的问题。 - fix: 修复动画暂停重新播放后,帧率使用默认帧率播放的问题。 - -## v2.0.12-rc.1 - fix: 修复网络动画资源图片下载失败和字体没显示问题。 - -## v2.0.12-rc.0 - fix: 修复部分含字体动画播放显示不全的问题。 - -## v2.0.11 - 发布2.0.11正式版。 - -## v2.0.11-rc.7 - feature:支持读取指定路径下的图片资源。 - fix: 修复加载多个zip资源导致加载异常。 - fix: 修复频繁调用goToAndPlay()方法导致动画概率性出现播放不正常的问题。 - -## v2.0.11-rc.6 - fix: 修复lottie 网络资源下载异常处理。 - fix: 修复lottie 网络资源下载通知显示下载进度。 - fix: 修复lottie动态修改动画颜色时蒙版图层不需要改动的问题。 - -## v2.0.11-rc.5 - fix: 修复读取错误网络资源链接导致动画加载崩溃的问题。 - -## v2.0.11-rc.4 - fix: 修复动画执行pause时,底层animator没有停止的问题。 - fix:修复特殊场景下时间戳跳变引起时间差为负,导致动画播放跳到开始帧并完成播放的问题。 - fix:修复下载的zip资源中带有文件夹导致动画加载失败。 - -## v2.0.11-rc.3 - fix: 修复读取缓存资源,加载zip动画闪退的问题。 - -## v2.0.11-rc.2 - fix: 修复动画被销毁时,重新设置当前存活animation的最高帧率。 - feature:支持加载网络资源和通过URI路径方式加载动画。 - -## v2.0.11-rc.1 - fix: 修复lottie跳帧不渲染的问题。 - -## v2.0.11-rc.0 - fix: 修复图片资源默认使用图片自身宽高问题。 - -## v2.0.10 - feature:新增支持设置animator的刷帧率功能。 - fix: 修复无法触发'config_ready'、'data_ready'、'error'、'data_failed'监听事件问题。 - fix: 使用saveLayer和restoreLayer方案替代原来的方式实现动画蒙版动效,优化动画性能。 - feature:新增动画支持设置填充模式:Fill,Top,Cover,Bottom,Contain。 - fix: 修复动画圆圈的虚线无法展现实际动画效果的问题。 - fix: 修复图形变形没恢复导致画布重绘有残留图像的问题。 - fix: 修复动画json资源文件含有音频和正则表达式内容,动画加载播放的失败问题。 - fix: 修复加载多个动画,在特定场景下销毁个别正在播放的动画时animator没停止的问题。 - fix: 修复在特殊情况下动画暂停再恢复,画面内容不连贯问题。 - fix: 修复动画json有依赖图片资源不存在时,动画也可以加载播放的问题。 - -## v2.0.10-rc.4 - feature:新增支持设置animator的刷帧率功能 - -## v2.0.10-rc.3 - fix: 修复无法触发'config_ready'、'data_ready'、'error'、'data_failed'监听事件问题。 - fix: 使用saveLayer和restoreLayer方案替代原来的方式实现动画蒙版动效,优化动画性能。 - -## v2.0.10-rc.2 - feature:新增动画支持设置填充模式:Fill,Top,Cover,Bottom,Contain。 - fix: 修复动画圆圈的虚线无法展现实际动画效果的问题。 - fix: 修复图形变形没恢复导致画布重绘有残留图像的问题。 - -## v2.0.10-rc.1 - fix: 修复动画json资源文件含有音频和正则表达式内容,动画加载播放的失败问题。 - fix: 修复加载多个动画,在特定场景下销毁个别正在播放的动画时animator没停止的问题。 - -## v2.0.10-rc.0 - fix: 修复在特殊情况下动画暂停再恢复,画面内容不连贯问题。 - fix: 修复动画json有依赖图片资源不存在时,动画也可以加载播放的问题。 - -## v2.0.9 - fix: 新增支持动画mask相减蒙版模式特性。 - fix: 修复动画播放在折叠屏设备上出现残影的问题。 - -## v2.0.9-rc.0 - fix: 修复动画json文件里缺少e属性值导致外部资源图片加载失败的问题。 - -## v2.0.8 - fix: 添加传入应用包名接口,用于日志打印区分不同模块调用启动animator线程,packageName可以不传。 - fix: 更改animator的使用方式,适配lottie在插件模块下可以播放动画。 - -## v2.0.7 - feature:新增支持读取沙箱路径下的图片资源。 - fix: 为了适配HSP场景,loadAnimation接口新增当前场景上下文context可选参数传入,在HSP场景下需要传正确的context,非HSP场景不影响,context可以不传。 - -## v2.0.7-rc.0 - feature:新增支持更改动画颜色的透明值和关键帧渐变色颜色特性。 - -## v2.0.6 - feature:新增支持Canvas渲染动画的高斯模糊动效特性。 - fix: piexlmap改成不可编辑状态,优化图形图像端读取速度。 - -## v2.0.5 - fix: 优化性能,释放pixel_map,防止内存泄漏。 - -## v2.0.5-rc.0 - fix: 修复lottie的registeredAnimations[i].animation空指针报错问题。 - fix: 修正替换play函数为gotoFrame,防止play方法创建Animator对象,导致修改颜色后刷帧问题。 - -## v2.0.4 - fix: 修复lottie播放mask动画多次调用getPixelMap方法,导致动画播放掉帧的问题。 - fix: 适配ArkTs语法。 - -## v2.0.3 - fix: 修复lottie不同版本在同一个界面启动,导致动画播放失败的问题。 - fix: 修复动画销毁,重新刷新界面导致应用的崩溃问题。 - -## v2.0.2 - feature:新增支持Canvas渲染中mask部分特性 - 支持渲染本地图片,包含base64编码和文件路径方式。 - fix: 修正圆形动画加载小球不重叠。 - fix: 修正动画全部播放完后,Animator也要停止刷帧。 - updated: 适配DevEco Studio: 4.0 Canary2(4.0.3.312)。 - 适配SDK: API10 (4.0.9.3)。 - -## v2.0.1 - feature:新增动画动态渲染颜色能力。 - fix: 修正License文件版权。 - fix: 添加Array.apply()函数的参数检验,如果长度为undefined时,设置长度为0。 - updated: 适配DevEco Studio: 4.0 Canary1(4.0.0.112)。 - 适配SDK: API10 (4.0.7.2)。 - updated: 修改Library目录结构根目录名称。 - -## v2.0.0 - feature: 动画加载代码解耦。 - updated: 包管理工具由npm切换为ohpm - 适配DevEco Studio: 3.1 Beta2(3.1.0.400) - 适配SDK: API9 Release(3.2.11.9) - -## v1.1.2 - fix: 未设置动画数据就直接加载动画,销毁动画时,导致的空指针异常。 - fix: 修正根据路径加载不到动画数据时的处理方式,不进行构建动画配置。 - fix: 删除动画加载限制,重复加载动画前需手动销毁上一个已加载动画。 - fix: 补充readme文件内Lottie组件使用注意事项 - loadAnimation使用时须在页面加载完成之后,例如Canvas.onReady()生命周期。 - loadAnimation加载动画使用path参数设置时,需要注意path参数只支持entry/src/main/ets文件夹下的相对路径,不支持跨包设置。 - 同一Canvas组件加载多次/不同动画资源,需要手动销毁动画(lottie.destroy()/animationItem.destroy()),之后才可再次加载其他动画资源。 - -## v1.1.1 - feature:补充svg渲染能力。 - 适配原库5.10.0版本。 -不支持特性: -* 不支持SVG渲染中filter效果 -* 不支持SVG渲染中mask部分特性 -* 不支持渲染本地图片及网络图片资源 - -## v1.1.0 - updated: 名称由lottieETS修改为lottie。 - updated: 旧的包@ohos/lottieETS已不再维护,请使用新包@ohos/lottie。 - fix:修复多次在同一画布上加载动画,导致动画重叠的问题。 - -不支持特性: -* 不支持SVG、HTML渲染方式 -* 不支持组件控制动画显示、隐藏、resize -* 不支持注册动画 -* 不支持查找动画 -* 不支持更新动画数据 -* 不支持部分效果 -* 不支持含有表达式的动画 - - -## v1.0.3 - fix:修复销毁动画时未清空画布的bug。 - fix:添加对通过路径获取动画文件json数据的非空校验,如果未获取到将抛出异常进行提示。 - - -## v1.0.2 - 适配API9 Stage 模型。 - - -## v1.0.1 - 升级IDE到3.0.0.900,使项目能在该环境下运行。 - - -## v1.0.0 - 适配兼容OpenHarmony系统,完成相关功能,具体如下: -* 动画播放、暂停、停止、切换暂停、跳到某一时刻并停止、跳到某一时刻并播放等动画基础功能。 -* 播放指定片段、重置动画、设置播放速度、设置播放方向、添加监听状态、获取动画时长等扩展功能。 -* canvas渲染。 - - - -### 对源库改动如下: -* 删除html渲染。 -* 删除svg渲染,等待后续迭代。 - - diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/LICENSE b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/LICENSE deleted file mode 100644 index 9c1cd7cb84357f4aa3d57ff961cd37d993055ef5..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Bodymovin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/NOTICE b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/NOTICE deleted file mode 100644 index f4bdacacf502d08c89ea748ca525beed72ed62c2..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/NOTICE +++ /dev/null @@ -1,22 +0,0 @@ -OPEN SOURCE SOFTWARE NOTICE - -Please note we provide an open source software notice for the third party open source software along with this software and/or this software component (in the following just “this SOFTWARE”). The open source software licenses are granted by the respective right holders. - -Warranty Disclaimer -THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS. - -Copyright Notice and License Texts - ----------------------------------------------------------------------- -Software: lottie-web 5.10.2 - -Copyright notice: -Copyright (c) 2015 Bodymovin - -License: The MIT License (MIT) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/README.OpenSource b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/README.OpenSource deleted file mode 100644 index 55879bcb9350e206927cb44c1ae7b61a23ef064f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/README.OpenSource +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "Name": "lottie-web", - "License": "MIT License", - "License File": "LICENSE.md", - "Version Number": "5.10.2", - "Owner": "xiafeng@huawei.com", - "Upstream URL": "https://github.com/airbnb/lottie-web", - "Description": "Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/" - } -] diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/README.md b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/README.md deleted file mode 100644 index 5fac633a3f3fd130ceb917fc0d403f21d4bf8415..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/README.md +++ /dev/null @@ -1,709 +0,0 @@ -# lottie - -> **We recommend using [lottie-turbo](https://gitcode.com/openharmony-sig/lottie_turbo): Its declarative invocation is more concise, supporting parallel loading, in-memory caching, and sub-thread rendering. This leads to a performance improvement of over 30%, ensuring a smoother UI experience in scenarios with multiple or complex animations.** - - -## Introduction - -Lottie is an animation library for OpenHarmony that parses Adobe After Effects animations, exported as JSON files with Bodymovin, and renders them natively on mobile devices. - -![showlottie](./screenshot/showlottie_EN.gif) - - -## How to Install - -``` - ohpm install @ohos/lottie -``` -For details about the OpenHarmony ohpm environment configuration, see [OpenHarmony HAR](https://gitcode.com/openharmony-tpc/docs/blob/master/OpenHarmony_har_usage.en.md). - -## Example -### Example -``` -import lottie, { AnimationItem } from '@ohos/lottie'; - -@Entry -@Component -struct Index { - // Build a rendering context. - private renderingSettings: RenderingContextSettings = new RenderingContextSettings(true) - private canvasRenderingContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.renderingSettings) - private animateItem: AnimationItem | null = null; - private animateName: string = "animation"; // name - - // Destroy the animation. - aboutToDisappear(): void { - console.info('aboutToDisappear'); - lottie.destroy(); - } - - build() { - Row() { - // Configure a canvas. - Canvas(this.canvasRenderingContext) - .width(200) - .height(200) - .backgroundColor(Color.Gray) - .onReady(() => { - // Load the animation. - if (this.animateItem != null) { - // Load animations during canvas onReady, ensure that the animation size is correct. - this.animateItem?.resize(); - } else { - // Anti-aliasing settings. - this.canvasRenderingContext.imageSmoothingEnabled = true; - this.canvasRenderingContext.imageSmoothingQuality = 'medium' - this.loadAnimation(); - } - }) - } - } - - loadAnimation() { - this.animateItem = lottie.loadAnimation({ - container: this.canvasRenderingContext, - renderer: 'canvas', // canvas renderer - loop: true, - autoplay: false, - name: this.animateName, - contentMode: 'Contain', - path: 'common/animation.json', - }) - // Animations are loaded asynchronously, any operations on animateItem should be performed within the callback function for when the animation has finished loading. - this.animateItem.addEventListener('DOMLoaded', (args: Object): void => { - this.animateItem.changeColor([225, 25, 100, 1]); - this.animateItem.play(); - }); - } - - destroy() { - this.animateItem.removeEventListener('DOMLoaded'); - lottie.destroy(this.animateName); - this.animateItem = null; - } -} - -``` -### Important Notes -- 1. It is recommended to load the animation in the onReady method of canvas, and call the lottie.destroy(name) method before loading the animation to ensure that the animation will not be loaded repeatedly. -- 2. It is recommended to put the operation of the animation animateItem in the 'DOMLoaded' callback listener of addEventListener, and ensure that the animation-related operations are performed after the complete construction and parsing are completed, so as to avoid potential loading order problems. Because if it is the same code block, the animation is loaded asynchronously. -- 3. It is recommended to add animation anti-aliasing, such as the sample code code 67 to 68 line, to reduce the jagged phenomenon of the animation edge, make the animation screen smoother and more delicate, and achieve the best animation effect. -- 4. For the destruction of animation, it is recommended to use the lottie.destroy(name) method, which is more performance-friendly than directly using animateItem.destroy(). -- 5. It is recommended to destroy all animations on the page when the page is destroyed or uninstalled to ensure that the page resources are properly managed and released. -- 6. If the obfuscation mode compilation fails, it is recommended to add the configuration in the obfuscation-rules.txt file under the corresponding module: -keep ./oh_modules/@ohos/lottie. -- 7. It is recommended that the aspect ratio of the canvas be consistent with that of the animation. For example, if the aspect ratio of the animation is 1000 * 2000 (i.e., a ratio of 1:2), then the width and height of the canvas can be set to 200 * 400, also maintaining a ratio of 1:2. It is recommended that the width and height of the canvas should not be larger than the original width and height of the animation. -- 8. Note: When loading external resource images, if the specified path is used: imagePage:'lottie/images/', the path of the external resource image refers to the path under the rawfile directory or the file directory in the sandbox. -- 9. The external image resources referenced in Lottie's JSON file need to be stored in the rawfile directory. For example, if "u":"images/" in the json file, a folder named images is created in the rawfile directory to store the images. - - -## How to Use - -### To start off, get required data prepared. - -Lottie animations are created in Adobe After Effects and exported with Bodymovin as JSON files. - -When creating an animation in Adobe After Effects, you need to set the animation width (**w**), animation height (**h**), bodymovin version (**v**), frame rate (**fr**), start frame (**ip**), -end frame (**op**), static resource information (**assets**), and layer information (**layers**). - -For demo test purposes, you can use the [JSON file in the example project](https://gitcode.com/openharmony-tpc/lottieArkTS/tree/master/entry/src/main/ets/common/lottie). - -### 1. Import the component to the corresponding class. - - ``` - import lottie from '@ohos/lottie'; - ``` - -### 2. Build a rendering context. - - ``` - private mainRenderingSettings: RenderingContextSettings = new RenderingContextSettings(true); - private mainCanvasRenderingContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.mainRenderingSettings); - ``` - -### 3. Place the JSON file required by the animation in the directory at the same level as the **pages** directory and reference the file. (In this example, the JSON file used is **entry/src/main/ets/common/lottie/data.json**). - - Note: The JSON file path cannot be a relative path, such as one that starts with a single dot (.) or double dot (..), followed by a slash (/). Using a relative path will result in a failure to fetch the animation source. - - This is because a relative path referenced in the **index** page is based on the **index.ets** file, whereas the path passed to the **loadAnimation** API is based on the **pages** folder. - - Therefore, if the JSON file is stored in the **pages** folder, the path should be **pages/common/data.json**. - - ``` - private path:string = 'common/lottie/data.json'; - Or - private jsonData:string = {"v":"4.6.6","fr":24,"ip":0,"op":72,"w":1000,"h":1000,"nm":"Comp 2","ddd":0,"assets":[],...}; - ``` - -### 4. Configure a canvas. - - ``` - Canvas(this.mainCanvasRenderingContext) - .width('50%') - .height(360 + 'px') - .backgroundColor(Color.Gray) - .onReady(()=>{ - // Anti-aliasing settings. - this.mainCanvasRenderingContext.imageSmoothingEnabled = true; - this.mainCanvasRenderingContext.imageSmoothingQuality = 'medium'; - }) - ``` - - Note: It is recommended that the aspect ratio set for the canvas be the same as that of the JSON animation resource. For example, if the aspect ratio of the JSON animation resource is 1:2, the aspect ratio set for the canvas should also be 1:2. - - The anti-aliasing settings in this example: **mainCanvasRenderingContext.imageSmoothingEnabled = true** and **mainCanvasRenderingContext.imageSmoothingQuality = 'medium'**. - - A canvas is cleared before an animation is drawn on it. - -### 5. Load the animation. - - Pay attention to the time when you want your animation to load. If you want the animation to load upon a button click, simply place the animation loading logic in the click event. If you want the animation to load automatically once the page where it is located is displayed, you must place the animation loading logic within or after the **onReady()** lifecycle callback. - - For a canvas to load one animation multiple times or load different animations, manually destroy the previously loaded animation (by calling **lottie.destroy('name')**) each time before the canvas loads again. - - ``` - lottie.destroy('2016'); // Destroy the previously loaded animation before loading a new one. - this.animationItem = lottie.loadAnimation({ - container: this.mainCanvasRenderingContext, // Rendering context. - renderer: 'canvas', // Rendering mode. - loop: true, // Whether to loop the playback. The default value is true. - autoplay: true, // Whether to enable automatic playback. The default value is true. - name: '2016', // Animation name. - contentMode: 'Contain', // Fill mode. - frameRate: 30, // Set the frame rate to 30. - imagePath: 'lottie/images/', // Load and read images in the specified path. - path: this.path, // JSON file path. - initialSegment: [10,50] // Initial segment of the animation. - }) - Or - lottie.loadAnimation({ - container: this.mainCanvasRenderingContext, // Rendering context. - renderer: 'canvas', // Rendering mode. - loop: true, // Whether to loop the playback. The default value is true. - autoplay: true, // Whether to enable automatic playback. The default value is true. - contentMode: 'Contain', // Fill mode. - frameRate: 30, // Set the frame rate to 30. - animationData: this.jsonData, // JSON object data. - initialSegment: [10,50] // Initial segment of the animation. - }) - Or - lottie.loadAnimation({ - uri: 'https: // assets7.lottiefiles.com/packages/lf20_sF7uci.json', // Internet resources specified by URI. - container: this.canvasRenderingContext, // Rendering context. - renderer: 'canvas', // Canvas rendering mode. - loop: true, // Whether to loop the playback. The default value is true. - autoplay: true, // Whether to enable automatic playback. The default value is true. - name: this.animateName, // Animation name. - }) - ``` - - To load an animation, use either **path** or **animationData**. - - - **path**: Only relative paths under **entry/src/main/ets** are allowed. Cross-package file search is not supported. - - **animationData**: Set this parameter based on **ResourceManager**. - - **uri**: Internet animations can be loaded through URIs. In this case, you must request the permissions **ohos.permission.INTERNET** and **ohos.permission.GET_NETWORK_INFO**. - - Loading external resource images: By default, the application reads images in the sandbox path. If the specified images are not found in the sandbox, the application searches for them in **rawfile**. - -### 6. Load an animation with an HSP. - - To load an animation with an HSP, When an HSP is involved, lottie loads the JSON resource file through **animationData**. As such, you must place the JSON resource file in **rawfile**. - - - ``` - lottie.loadAnimation({ - container: this.mainCanvasRenderingContext, // Rendering context. - renderer: 'canvas', // Rendering mode. - loop: true, // Whether to loop the playback. The default value is true. - autoplay: true, // Whether to enable automatic playback. The default value is true. - animationData: this.jsonData, // JSON object data. - contentMode: 'Contain', // Fill mode. - initialSegment: [10,50] // Initial segment of the animation. - }) - ``` - - - To load an animation, use **animationData**. - - **animationData**: Set this parameter based on **ResourceManager**. - - ``` - let resStr = new util.TextDecoder('utf-8',{ignoreBOM: true}); - let context = getContext(this).createModuleContext('library') as common.UIAbilityContext; - context.resourceManager.getRawFile('grunt.json',(err: Error,data: Uint8Array) =>{ - if(data === null || data === undefined || data.buffer=== undefined){ - return; - } - let lottieStr = resStr.decode(new Uint8Array(data.buffer)); - this.jsonData = JSON.parse(lottieStr); - }) - ``` - -### 7. Control animation playback. - -- Play the animation. - - ``` - lottie.play(); // Play all animations. - Or - animationItem.play(); // Play a given animation. - ``` - -- Stop the animation. - - ``` - lottie.stop(); // Stop all animations. - Or - animationItem.stop(); // Stop a given animation. - ``` - -- Pause the animation. - - ``` - lottie.pause(); // Pause all animations. - Or - animationItem.pause(); // Pause a given animation. - ``` - -- Switch the animation playback state between running and paused. - - ``` - lottie.togglePause(); // Switch the playback state between running and paused for all animations. - Or - animationItem.togglePause(); // Switch the playback state between running and paused for a given animation. - ``` - -- Set the playback speed. - > Note: If the speed is greater than **0**, the animation plays forwards. If the speed is less than **0**, the animation plays backwards. If the speed is **0**, the animation is paused. If the speed is **1.0** or **-1.0**, the animation plays at the normal speed. - - ``` - lottie.setSpeed(1); // Set the playback speed for all animations. - Or - animationItem.setSpeed(1); // Set the playback speed for a given animation. - ``` - -- Set the playback direction. - > Note: The value **1** indicates forward, and **-1** indicates backward. - - ``` - lottie.setDirection(1); // Set the playback direction for all animations. - Or - animationItem.setDirection(1); // Set the playback direction for a given animation. - ``` - -- Destroy the animation. - > Note: An animation needs to be destroyed when the page where it is located disappears or exits. The **destroy()** API can be used together with the **aboutToDisappear()** and **onPageHide()** callbacks of the page or the **onDisAppear()** callback of the canvas component. - - ``` - lottie.destroy(); // Destroy all animations. - Or - lottie.destroy('name'); // Destroy a given animation. - ``` - -- Clear Cache. - ``` - lottie.clearFileCache(); //Clear all animation caches. - Or - lottie.clearFileCache('path'); //Clear the specified animation cache. - Or - lottie.clearFileCache('path',container); //Clear the network resource cache in the specified local animation. - ``` - -- Stop the animation at a frame or a point of time. - > Note: The second parameter specifies whether to control by frame or time (in milliseconds). The value **true** means to control by frame, and **false** (default) means to control by time. - - ``` - animationItem.goToAndStop(250,true); - Or - animationItem.goToAndStop(5000,false); - ``` - -- Start the animation from a frame or a point of time. - > Note: The second parameter specifies whether to control by frame or time (in milliseconds). The value **true** means to control by frame, and **false** (default) means to control by time. - ``` - animationItem.goToAndPlay(250,true); - Or - animationItem.goToAndPlay(12000,false); - ``` - -- Set an animation segment to limit the frame range for animation playback. - - ``` - animationItem.setSegment(5,15); - ``` - -- Play animation segments. - > Note: The second parameter specifies whether the setting takes effect immediately. The value **true** indicates the setting takes effect immediately, and **false** indicates that the setting takes effect upon the next playback. - - ``` - animationItem.playSegments([5,15],[20,30],true); - ``` - -- Reset animation segments so that the animation plays from the start frame. - > Note: The parameter specifies whether the setting takes effect immediately. The value **true** indicates the setting takes effect immediately, and **false** indicates that the setting takes effect upon the next playback. - - ``` - animationItem.resetSegments(5,15); - ``` - -- Obtain the animation duration or number of frames. - > Note: The value **true** means to obtain the number of frames, and **false** means to obtain the duration (in ms). - - ``` - animationItem.getDuration(); - ``` - -- Add an event listener. - > Note: For an event listener to be removed correctly, its callback function must be the same as that of the event listener already added and must be predefined. - - ``` - AnimationEventName = 'drawnFrame' | 'enterFrame' | 'loopComplete' | 'complete' | 'segmentStart' | 'destroy' | 'config_ready' | 'data_ready' | 'DOMLoaded' | 'error' | 'data_failed' | 'loaded_images'; - - animationItem.addEventListener("enterFrame",function(){ - // TODO something - }) - ``` - -- Change the animation color. - - > Note: The first parameter indicates the RGB/RGBA color value. The second parameter indicates the animation layer and is optional. The third parameter indicates the index of the element corresponding to the animation layer and is optional. - - ``` - animationItem.changeColor([255,150,203,0.8]); // Change the color of the entire animation. - Or - animationItem.changeColor([255,150,203,0.8],2); // Change the color of the second layer of the animation. - Or - animationItem.changeColor([255,150,203,0.8],2,2); // Change the color of the second element at the second layer of the animation. - ``` - -- Remove an event listener. - - ``` - animationItem.removeEventListener("enterFrame",function(){ - // TODO something - }) - ``` - -- Resize the animation layout. - - ``` - animationItem.resize(); - ``` - -- Set the animation fill mode. - - > Note: There are five fill modes: **Fill**, **Cover**, **Top**, **Bottom**, and **Contain**. The default mode is **Contain**. - - ``` - animationItem.setContentMode('Cover'); - ``` - -- Set the frame rate range of the animation. - - > Note: The frame rate ranges from 1 to 120. A larger frame rate causes higher power consumption. - - ``` - animationItem.setFrameRate(30); - ``` - -- Clear cache file. - > Note: the container is with canvas component binding context CanvasRenderingContext2D, json file path for local resources. - ``` - lottie.clearFileCache() //Clear all animation cache files. - Or - lottie.clearFileCache('path') //Clear the specified animation cache file. - Or - lottie.clearFileCache('path',container) //Clears the network resource cache file in the specified local animation. - ``` - -### 8. Destroy the animation. - - Generally, the animation is destroyed in the **onDisAppear()** API of the canvas component or in the **aboutToDisappear()** method during page destruction. - - With lottie, you can destroy an animation in two modes: - - - **lottie.destroy**: destroys all animations; **lottie.destroy(name)** destroys the animation with the specified name. You are advised to use this mode to destroy animations. - - **animationItem.destroy**: destroys a given animation. Improper use may cause memory leakage. To destroy a given animation, you are advised to use **lottie.destroy(name)**.
- - > Note 1: When there are multiple animations on one page and the animation instance is assigned to the same variable **animationItem**, only the last animation is destroyed when **animationItem.destroy** is called. In the following code example, the animations whose names are **cat** and **2016** are assigned to **this.animationItem**. Calling **animationItem.destroy()** destroys only the animation whose name is **2016**, but not the one whose name is **cat**. - - ``` - this.animationItem = lottie.loadAnimation({ - container: this.mainCanvasRenderingContext, // Rendering context. - renderer: 'canvas', // Rendering mode. - loop: true, // Whether to loop the playback. The default value is true. - autoplay: true, // Whether to enable automatic playback. The default value is true. - name: 'cat', // Animation name. - contentMode: 'Contain', // Fill mode. - path: this.path, // JSON file path. - initialSegment: [10,50] // Initial segment of the animation. - }) - - this.animationItem = lottie.loadAnimation({ - container: this.mainCanvasRenderingContext, // Rendering context. - renderer: 'canvas', // Rendering mode. - loop: true, // Whether to loop the playback. The default value is true. - autoplay: true, // Whether to enable automatic playback. The default value is true. - name: '2016', // Animation name. - contentMode: 'Contain', // Fill mode. - path: this.path, // JSON file path. - initialSegment: [10,50] // Initial segment of the animation. - }) - - ``` - - > Note 2: If you call the following APIs in the same code block as **lottie.loadAnimation** before animation loading is complete, the settings may not take effect: **stop**, **togglePause**, **pause**, **goToAndStop**, **goToAndPlay**, **setSegment**, **getDuration**, **changeColor**, and **setContentMode**. Call these APIs after the animation is loaded. You can use **animationItem.addEventListener('DOMLoaded') **to listen for the animation loading completion. - - ``` - // The animation is not completely loaded. The settings of changeColor and setContentMode are invalid. - Button('Load 2016') - .onClick(() => { - if (this.animationItem2 == null) { - this.animationItem2 = lottie.loadAnimation({ - container: this.canvasRenderingContext, - renderer: 'canvas', // Canvas rendering mode. - name: '2016', - path: 'common/lottie/data.json', - }) - this.animationItem2.changeColor([255,150,203,0.8]); - this.animationItem2.setContentMode('Top'); - } - }) - - ``` - - ``` - // After animationItem.addEventListener('DOMLoaded') is invoked, the settings of changeColor and setContentMode are valid. - Button('Load 2016') - .onClick(() => { - if (this.animationItem2 == null) { - this.animationItem2 = lottie.loadAnimation({ - container: this.canvasRenderingContext, - renderer: 'canvas', // Canvas rendering mode. - loop: true, - autoplay: false, - name: '2016', - contentMode: 'Contain', - path: 'common/lottie/data.json', - }) - - this.animationItem2.addEventListener('DOMLoaded', (args: Object): void => { - this.animationItem2.changeColor([255,150,203,0.8]); - // this.animationItem2.setContentMode('Top'); - // ... - }); // The event is triggered after the animation is loaded but before it is played. - } - }) - - ``` - -### 9. About obfuscation -- Code obfuscation, please see[Code Obfuscation](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/arkts-utils/source-obfuscation.md). -- If you want the lottie library not to be obfuscated during code obfuscation, you need to add corresponding exclusion rules in the obfuscation rule configuration file obfuscation-rules.txt. -``` --keep -./oh_modules/@ohos/lottie -``` - -### 10. Determine whether the animation resource is a network load example -``` - this.isNet = 'Whether to load the network' + this.animateItem.isNetLoad; -``` -### 11. Log switch function -``` - LogUtil.mLogLevel = LogUtil.ON; //open log - LogUtil.mLogLevel = LogUtil.OFF; //close log -``` - -### 12. Drawing when animation is invisible - -Lottie supports skipping drawing when the animation slides to the invisible area to reduce redundant drawing(This feature is only supported in API 13 and above versions). The current processing logic assumes that lottie is bound to a specific canvas node, but in some complex interaction scenarios, it fails to track changes in the binding relationship, making it inapplicable when there are complex changes in the UI logic, including: - -- Preloading scenario, when the canvas node has no binding relationship with lottie. This includes explicit preloading by the developer and implicit preloading by the system caused by the cache mechanism of lazyforeach. -- Node reuse scenario, when the node may form a binding relationship with different animations. -- Node destruction and reconstruction scenario, when the old node has changed and the association relationship of the new node is reestablished. The above situations cannot be handled currently. As a result, lottie cannot accurately perceive the state of the canvas node, redundant drawing occurs, and even obvious experience problems such as inactivity when it should be active. - -Therefore, the coordinator object with CanvasRenderingContext2D as the core is introduced to track the dynamic relationship between lottie animation, CanvasRenderingContext2D, and Canvas. Only when the CanvasRenderingContext2D associated with lottie corresponds to a visible canvas, the drawing will be actually performed, otherwise the drawing will be skipped to avoid redundant load. When the coordinator cannot confirm the accurate canvas node status, compatibility processing is introduced: when the user does not explicitly call the bindContext2dToCoordinator interface, the drawing is performed by default, otherwise no further callback notifications such as drawing are performed. In order to avoid inconsideration of compatibility processing, the setAttachedCanvasHasVisibleArea interface is introduced to support developers to force the correction of the canvas node status associated with context2d to support escape. - -Usage examples: -1. Use canvas + lottie.loadAnimation method -After the CanvasRenderingContext2D object is created, before it is referenced by canvas, the bindContext2dToCoordinator interface is called, and when the page is destroyed, the unbindContext2dFromCoordinator interface is called to unbind. - -``` -import lottie from '@ohos/lottie' - -@Entry -@Component -struct InvisibleAreaAutoPlay { - private renderingSettings: RenderingContextSettings = new RenderingContextSettings(true); - private canvas2D: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.renderingSettings); - - aboutToAppear(): void { - lottie.bindContext2dToCoordinator(this.canvas2D); - } - - aboutToDisappear(): void { - lottie.unbindContext2dFromCoordinator(this.canvas2D); - lottie.destroy("robotYoga"); - } - - build() { - Stack() { - Canvas(this.canvas2D) - .width(300) - .height(300) - .backgroundColor(Color.Gray) - .onReady(() => { - lottie.loadAnimation({ - container: this.canvas2D, - renderer: 'canvas', - loop: true, - autoplay: true, - contentMode: 'Contain', - name: 'robotYoga', - path: 'common/lottie/robotYoga.json' - }) - }) - }.height('40%') - .width('100%') - .backgroundColor(Color.Gray) - } -} -``` - -### 13. Preventing Animation Memory Leaks - -- Avoid using the @state decorator for animation objects: When using @state to decorate an animationItem object, it may prevent the animation from being properly destroyed, leading to memory leak issues. - - -- Destroy animations in a timely manner: When an animation is no longer in use or when the page is about to be destroyed, the animation must be actively destroyed. If animations are only created but not actively destroyed, the animationItem objects will continue to exist, thereby causing memory leaks. It is recommended to use the lottie.destroy(name) method to destroy animations. - - - -## Available APIs - -### AnimationItem - -| API | Type | Description | -|-----------------------------------|--------------------------------------|-----------------------------------------------------------------------------------------------| -| play() | name? | Plays the animation. | -| stop() | name? | Stops the animation. | -| pause() | name? | Pauses the animation. | -| togglePause() | name? | Switches the animation playback state between running and paused. | -| destroy() | name? | Destroys the animation. | -| goToAndStop() | value, isFrame?, name? | Seeks to a certain frame or point of time and then stops the animation. | -| goToAndPlay() | value, isFrame?, name? | Seeks to a certain frame or point of time and then starts the animation. | -| setSegment() | init,end | Sets an animation segment. | -| playSegments() | arr, forceFlag | Plays animation segments. | -| resetSegments() | forceFlag | Resets the animation. | -| setSpeed() | speed | Sets the playback speed. | -| resize() | width?, height? | Refresh animation layout. | -| setDirection() | direction | Sets the playback direction. | -| getDuration() | isFrames? | Obtains the animation duration. | -| addEventListener() | eventName,callback | Adds an event listener. | -| removeEventListener() | name,callback? | Removes an event listener. | -| changeColor() | color, layer?, index? | Changes the animation color. | -| setContentMode() | contentMode | Sets the fill mode. | -| setFrameRate() | frameRate | Sets the animation frame rate. | - - -### LottiePlayer - -| API | Type | Description | -|-----------------------------------|----------------------------------------------|------------------------------------------------------------------------------------------------| -| play() | name?, onlyCurrentAbility? | Plays the animation. | -| stop() | name?, onlyCurrentAbility? | Stops the animation. | -| pause() | name?, onlyCurrentAbility? | Pauses the animation. | -| togglePause() | name?, onlyCurrentAbility? | Switches the animation playback state between running and paused. | -| destroy() | name?, onlyCurrentAbility? | Destroys the animation. | -| goToAndStop() | value, isFrame?, name?, onlyCurrentAbility? | Seeks to a certain frame or point of time and then stops the animation. | -| goToAndPlay() | value, isFrame?, name?, onlyCurrentAbility? | Seeks to a certain frame or point of time and then starts the animation. | -| setSpeed() | speed, name?, onlyCurrentAbility? | Sets the playback speed. | -| resize() | width?, height?, onlyCurrentAbility? | SRefresh animation layout. | -| setDirection() | direction, name?, onlyCurrentAbility? | Sets the playback direction. | -| setContentMode() | contentMode, name?, onlyCurrentAbility? | Sets the fill mode. | -| loadAnimation() | loadAnimation | Load Animation. | -| setFrameRate() | frameRate | Sets the animation frame rate. | -| clearFileCache() | url?, container? | Clear cache file. | -| bindContext2dToCoordinator() | CanvasRenderingContext2D | Track the dynamic relationship between lottie animation, CanvasRenderingContext2D, and Canvas. | -| unbindContext2dFromCoordinator() | CanvasRenderingContext2D | Remove tracking relationship. | -| setAttachedCanvasHasVisibleArea() | CanvasRenderingContext2D, boolean | Supports forced correction of the canvas node status associated with context2d. | - -## New Features -1. The animation color can be changed in canvas rendering mode. -- The color value can be in RGB format. -- The color value can be in RGBA format. -- The color can be set for the start keyframe. - -2. Certain masks and mattes features are supported for canvas rendering. -- For masks, the supported modes are: mode = a, mode = s, mode = f. -- For mattes, the supported modes are: tt = 1, tt = 2. - -3. The Gaussian blur effect is added for animations in canvas rendering mode. - -4. External resource images can be loaded in canvas rendering mode. -- External resource images in the sandbox (which is searched before the **rawfile** folder) can be loaded. -- External resource images in the **rawfile** folder can be loaded. - -5. The fill mode can be set, with the following options available: -- Fill (may be stretched, not cropped) -- Top (aligned with the top edge, not cropped) -- Bottom (aligned with the bottom edge, not cropped) -- Cover (may be cropped) -- Contain (aligned with the center vertically, may be cropped) - -6. The frame rate can be set for animations. - -7. Internet animations and animations specified by URIs can be loaded. -- Animations in the path specified by URIs can be rendered. -- Internet animation can be rendered. -- Note: If the animation file contains Internet resources, you must request the permissions **ohos.permission.INTERNET** and **ohos.permission.GET_NETWORK_INFO**. - -8. When the animation is completely invisible, the current animation will automatically pause and stop sending drawing instructions to optimize performance and reduce power consumption. - -## Constraints - -This project has been verified in the following version: -- DevEco Studio: NEXT Developer Beta3 (5.0.3.524), SDK: API 12 (5.0.0.25) -- DevEco Studio: NEXT Developer Beta1 (5.0.3.122), SDK: API 12 (5.0.0.18) - -## Directory Structure - -```` -/lottie # Root directory of the project -├── entry # Sample code -├── library # Lottie library folder -│ └─ src/main/js # Core code, including JSON parsing, animation drawing, and animation manipulation -│ └─ 3rd_party -│ └─ animation -│ └─ effects -│ └─ elements -│ └─ modules -│ └─ renderers -│ └─ utils -│ └─ EffectsManager.js -│ └─ main.js -│ └─ mask.js -│ └─index.d.ts # API declaration -├── README.md # Readme -├── README_zh.md # Readme -```` - -## How to Contribute - -If you find any problem when using lottie, submit an [issue](https://gitcode.com/openharmony-tpc/lottieArkTS/issues) or a [PR](https://gitcode.com/openharmony-tpc/lottieArkTS/pulls). - -## License - -This project is licensed under [MIT License](https://gitcode.com/openharmony-tpc/lottieArkTS/blob/master/LICENSE). - -## Features Not Yet Supported - -* HTML rendering mode -* Filter effect in SVG rendering -* Some masks and mattes features -* Luminance mask (that is, tt = 3) -* Animation visibility control in components -* Animation registration -* Animation search -* Animation data update -* Certain effects -* Animations containing expressions diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/README_zh.md b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/README_zh.md deleted file mode 100644 index 565f156650642dc35e7a64f48eae3d968845e3db..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/README_zh.md +++ /dev/null @@ -1,696 +0,0 @@ -# lottie - -> **推荐使用[lottie-turbo](https://gitcode.com/openharmony-sig/lottie_turbo):声明式调用更加简洁,支持并行加载、内存缓存、子线程渲染,性能优化30%+,多动画/复杂动画场景下UI界面更流畅。** - -## 简介 - -lottie是一个适用于OpenHarmony的动画库,它可以解析Adobe After Effects软件通过Bodymovin插件导出的json格式的动画,并在移动设备上进行本地渲染。 - -![showlottie](./screenshot/showlottie.gif) - - -## 下载安裝 - -``` - ohpm install @ohos/lottie -``` -OpenHarmony ohpm 环境配置等更多内容,请参考[如何安装 OpenHarmony ohpm 包](https://gitcode.com/openharmony-tpc/docs/blob/master/OpenHarmony_har_usage.md)。 - -## 使用示例 -### 完整示例 -``` -import lottie, { AnimationItem } from '@ohos/lottie'; - -@Entry -@Component -struct Index { - // 构建上下文 - private renderingSettings: RenderingContextSettings = new RenderingContextSettings(true); - private canvasRenderingContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.renderingSettings); - private animateItem: AnimationItem | null = null; - private animateName: string = 'animation'; - - // 页面销毁时释放动画资源 - aboutToDisappear(): void { - console.info('aboutToDisappear'); - lottie.destroy(); - } - - build() { - Row() { - // 关联画布 - Canvas(this.canvasRenderingContext) - .width(200) - .height(200) - .backgroundColor(Color.Gray) - .onReady(() => { - // 加载动画 - if (this.animateItem != null) { - // 可在此生命回调周期中加载动画,可以保证动画尺寸正确 - this.animateItem?.resize(); - } else { - // 抗锯齿的设置 - this.canvasRenderingContext.imageSmoothingEnabled = true; - this.canvasRenderingContext.imageSmoothingQuality = 'medium'; - this.loadAnimation(); - } - }) - } - } - - loadAnimation() { - this.animateItem = lottie.loadAnimation({ - container: this.canvasRenderingContext, - renderer: 'canvas', // canvas 渲染模式 - loop: true, - autoplay: false, - name: this.animateName, - contentMode: 'Contain', - path: 'common/animation.json', - }) - // 因为动画是异步加载,所以对animateItem的操作需要放在动画加载完成回调里操作 - this.animateItem.addEventListener('DOMLoaded', (args: Object): void => { - this.animateItem.changeColor([225, 25, 100, 1]); - this.animateItem.play(); - }); - } - - destroy() { - this.animateItem.removeEventListener('DOMLoaded'); - lottie.destroy(this.animateName); - this.animateItem = null; - } -} - -``` -### 注意事项 -- 1.建议在 canvas 的 onReady 方法中加载动画,并在加载该动画之前先调用 lottie.destroy(name) 方法,以确保动画不会重复加载。 -- 2.建议对动画animateItem的操作放在addEventListener的'DOMLoaded'回调监听中,确保在完全构建并解析完成后,再执行与动画相关的操作,从而避免潜在的加载顺序问题。因为如果是同一个代码块,动画的加载是异步加载的。 -- 3.建议添加动画抗锯齿,如示例代码67到68行,以减少动画边缘的锯齿状现象,使动画画面更加平滑细腻,实现更佳的动画效果。 -- 4.动画的销毁,推荐使用lottie.destroy(name)方法,相较于直接使用animateItem.destroy(),性能更友好。 -- 5.建议在页面销毁或卸载时,将页面上所有的动画进行销毁,确保页面资源得到妥善管理和释放。 -- 6.混淆模式编译报错,建议在对应的模块下的obfuscation-rules.txt文件添加配置:-keep ./oh_modules/@ohos/lottie。 -- 7.建议canvas的宽高比例与动画的宽高比例保持一致。例如动画的宽高比是1000 * 2000(即1:2的比例),那么可以将canvas的宽高设置为 200 * 400,同样保持1:2的比例。建议canvas的宽高不要大于动画的原始宽高。 -- 8.注意:加载外部资源图片时,若采用指定路径的方式:imagePath:'lottie/images/',外部资源图片的路径是指rawfile目录下的或者沙箱里file目录下的路径。 -- 9.Lottie的JSON文件中引用的外部图片资源,需要存放在rawfile目录下。例如json文件中 "u":"images/",则在rawfile目录下创建一个名为images的文件夹,存放图片。 - -## 使用说明 - -### 前提:数据准备 - -lottie动画文件是由设计人员使用Adobe After Effects软件通过bodymovin插件导出json格式的文件。 - -AE软件创建动画时需要设置动画的宽(w)、高(h)、bodymovin插件的版本号(v)、帧率(fr)、开始帧(ip)、 -结束帧(op)、静态资源信息(assets)、图层信息(layers)等重要信息。 - -如果仅是用于demo测试,可以使用[工程示例中的json文件](https://gitcode.com/openharmony-tpc/lottieArkTS/tree/master/entry/src/main/ets/common/lottie)。 - -### 1.在相应的类中引入组件 - -``` -import lottie from '@ohos/lottie'; -``` - -### 2.构建渲染上下文 - -``` - private mainRenderingSettings: RenderingContextSettings = new RenderingContextSettings(true); - private mainCanvasRenderingContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.mainRenderingSettings); -``` - -### 3.將动画需要的json文件放到pages同级别目录下,然后引用。(json路径为entry/src/main/ets/common/lottie/data.json) - -注意:json文件路径不能使用 ./ 或者 ../ 等相对路径,相对路径获取不到动画源数据,会导致动画加载不出来。 - -传递给loadAnimation 方法的路径是相对于pages父文件夹为基准的,而index页面内引入的相对路径的动画是以index.ets文件为基准的,两者基准不一致。 - -所以如果json文件放置在pages文件夹下,路径应为 'pages/common/data.json' 样式。 - -``` - private path:string = "common/lottie/data.json"; - 或 - private jsonData:string = {"v":"4.6.6","fr":24,"ip":0,"op":72,"w":1000,"h":1000,"nm":"Comp 2","ddd":0,"assets":[],...}; -``` - -### 4.关联画布 - -``` - Canvas(this.mainCanvasRenderingContext) - .width('50%') - .height(360 + 'px') - .backgroundColor(Color.Gray) - .onReady(()=>{ - //抗锯齿的设置 - this.mainCanvasRenderingContext.imageSmoothingEnabled = true; - this.mainCanvasRenderingContext.imageSmoothingQuality = 'medium'; - }) -``` -注意:canvas设置的宽高比例建议和动画json资源里面的宽高比例一致,如:json动画资源里的宽高比例是 1:2 ,则canvas设置的宽高也是 1:2。 -- 想要的抗锯齿效果:mainCanvasRenderingContext.imageSmoothingEnabled = true 与 mainCanvasRenderingContext.imageSmoothingQuality = 'medium'。 - -- 动画绘制前会对canvas画布进行清空处理,画布清空后再绘制动画。 - -### 5.加载动画 - -- 加载动画的时机需要注意,点击按钮加载动画可按照正常逻辑放在点击事件内,如果想要实现进入页面自动播放动画,需要结合Canvas组件的onReady()生命回调周期实现,加载动画时机需放置在onReady()生命周期回调内或及之后。 -- 同一Canvas组件加载多次/不同动画资源,需要手动销毁动画(lottie.destroy('name')),之后才可再次加载其他动画资源。 - -``` - lottie.destroy('2016'); //加载动画前先销毁之前加载的动画 - this.animationItem = lottie.loadAnimation({ - container: this.mainCanvasRenderingContext, // 渲染上下文 - renderer: 'canvas', // 渲染方式 - loop: true, // 是否循环播放,默认true - autoplay: true, // 是否自动播放,默认true - name: '2016', // 动画名称 - contentMode: 'Contain', // 填充的模式 - frameRate: 30, //设置animator的刷帧率为30 - imagePath: 'lottie/images/', // 加载读取指定路径下的图片资源 - path: this.path, // json路径 - initialSegment: [10,50] // 播放的动画片段 - }) - 或 - lottie.loadAnimation({ - container: this.mainCanvasRenderingContext, // 渲染上下文 - renderer: 'canvas', // 渲染方式 - loop: true, // 是否循环播放,默认true - autoplay: true, // 是否自动播放,默认true - contentMode: 'Contain', // 填充的模式 - frameRate: 30, //设置animator的刷帧率为30 - animationData: this.jsonData, // json对象数据 - initialSegment: [10,50] // 播放的动画片段 - }) - 或 - lottie.loadAnimation({ - uri: "https://assets7.lottiefiles.com/packages/lf20_sF7uci.json", // uri网络资源 - container: this.canvasRenderingContext, // 渲染上下文 - renderer: 'canvas', // canvas 渲染模式 - loop: true, // 是否循环播放,默认true - autoplay: true, // 是否自动播放,默认true - name: this.animateName, // 动画名 - }) -``` - -- 加载动画时,path 参数和 animationData 参数,二者选其一。 -- path 参数:只支持加载entry/src/main/ets 文件夹下的相对路径,不支持跨包查找文件。 -- animationData 参数:可结合ResourceManager进行读取资源文件内容进行设置。 -- uri 参数:支持加载网络资源和通过URI路径方式加载动画,该方式需申请 ohos.permission.INTERNET,ohos.permission.GET_NETWORK_INFO两个权限。 -- 加载外部资源图片:应用默认读取沙箱路径下的图片,如果沙箱下没有对应的资源图片,则会继续读取rawfile下的对应资源图片。 - -### 6.HSP场景 -- 为了适配HSP场景,lottie加载动画json资源文件需通过animationData方式加载,需把动画json资源文件放在rawfile下进行读取加载。 - -``` - lottie.loadAnimation({ - container: this.mainCanvasRenderingContext, // 渲染上下文 - renderer: 'canvas', // 渲染方式 - loop: true, // 是否循环播放,默认true - autoplay: true, // 是否自动播放,默认true - animationData: this.jsonData, // json对象数据 - contentMode: 'Contain', // 填充的模式 - initialSegment: [10,50] // 播放的动画片段 - }) -``` - -- 加载动画时,animationData 参数。 -- animationData 参数:可结合ResourceManager进行读取资源文件内容进行设置。 - -``` - try { - application.createModuleContext(getContext(this), 'sharedLibrary').then((data: Context) => { - this.moduleContext = data; - this.moduleContext?.resourceManager.getRawFileContent('animation.json',(err: Error,data: Uint8Array) =>{ - if(data === null || data === undefined || data.buffer=== undefined){ - return; - } - let resStr = util.TextDecoder.create('utf-8',{ignoreBOM: true}); - let lottieStr = resStr.decodeToString(new Uint8Array(data.buffer)); - this.mLottieData = JSON.parse(lottieStr); - }) - }).catch((error: BusinessError) => { - }) - } catch (error) { - } -``` - -### 7.控制动画 - -- 播放动画 - - ``` - lottie.play(); //所有动画播放 - 或 - animationItem.play(); //当前指定animationItem动画播放 - ``` - -- 停止动画 - - ``` - lottie.stop(); //所有动画停止 - 或 - animationItem.stop(); //当前指定animationItem动画停止 - ``` - -- 暂停动画 - - ``` - lottie.pause(); //所有动画暂停 - 或 - animationItem.pause(); //当前指定animationItem动画暂停 - ``` - -- 切换暂停/播放 - - ``` - lottie.togglePause(); //所有动画切换暂停/播放 - 或 - animationItem.togglePause(); //当前指定animationItem动画切换暂停/播放 - ``` - -- 设置播放速度
-注意:speed>0正向播放, speed<0反向播放, speed=0暂停播放, speed=1.0/-1.0正常速度播放。 - - ``` - lottie.setSpeed(1); //所有动画设置播放速度 - 或 - animationItem.setSpeed(1); //当前指定animationItem动画设置播放速度 - ``` - -- 设置动画播放方向
-注意:direction 1为正向,-1为反向。 - - ``` - lottie.setDirection(1); //所有动画设置播放方向 - 或 - animationItem.setDirection(1); //当前指定animationItem动画设置播放方向 - ``` - -- 销毁动画
-注意:页面不显示或退出页面时,需要销毁动画; 可配合页面生命周期aboutToDisappear()及onPageHide(),或者Canvas组件的onDisAppear()使用。 - - ``` - lottie.destroy(); //销毁所有动画 - 或 - lottie.destroy('name'); //销毁指定name动画 - ``` - -- 控制动画停止在某一帧或某一时刻
-注意:根据第二个参数判断按帧还是按毫秒控制,true 按帧控制,false 按时间控制,缺省默认为false。 - - ``` - animationItem.goToAndStop(250,true); - 或 - animationItem.goToAndStop(5000,false); - ``` - -- 控制动画从某一帧或某一时刻开始播放
-注意:根据第二参数判断按帧还是按毫秒控制,true 按帧控制,false 按时间控制,缺省默认为false。 - ``` - animationItem.goToAndPlay(250,true); - 或 - animationItem.goToAndPlay(12000,false); - ``` - -- 限定动画资源播放时的整体帧范围,即设置动画片段 - - ``` - animationItem.setSegment(5,15); - ``` - -- 播放动画片段
-注意:第二参数值为true立刻生效, 值为false循环下次播放的时候生效。 - - ``` - animationItem.playSegments([5,15],[20,30],true); - ``` - -- 重置动画播放片段,使动画从起始帧开始播放完整动画
-注意:参数值为true立刻生效,值为false循环下次播放的时候生效。 - - ``` - animationItem.resetSegments(5,15); - ``` - -- 获取动画时长/帧数
-注意:参数值为true时获取帧数,值为false时获取时间(单位ms)。 - - ``` - animationItem.getDuration(); - ``` - -- 添加侦听事件
-注意:添加和移除的事件监听,回调函数需是同一个,需预先定义,否则将不能正确移除。 - - ``` - AnimationEventName = 'drawnFrame' | 'enterFrame' | 'loopComplete' | 'complete' | 'segmentStart' | 'destroy' | 'config_ready' | 'data_ready' | 'DOMLoaded' | 'error' | 'data_failed' | 'loaded_images'; - - animationItem.addEventListener("enterFrame",function(){ - // TODO something - }) - ``` - -- 更改动画渲染颜色
-注意:第一个参数颜色是RGB/RGBA值,第二个参数是动画的层次 可不填,第三个参数是对应动画层次的元素的下标值 可不填。 - - ``` - animationItem.changeColor([255,150,203,0.8]); //修改整个动画的颜色 - 或 - animationItem.changeColor([255,150,203,0.8],2); //修改该动画第二层的颜色 - 或 - animationItem.changeColor([255,150,203,0.8],2,2); //修改该动画第二层第二个元素的颜色 - ``` - -- 移除侦听事件 - - ``` - animationItem.removeEventListener("enterFrame",function(){ - // TODO something - }) - ``` - -- 刷新动画布局 - - ``` - animationItem.resize(); - ``` - -- 动画填充模式
-注意:动画填充模式共有5种:Fill、Cover、Top、Bottom、Contain,其中默认的填充模式是:Contain。 - - ``` - animationItem.setContentMode('Cover'); - - ``` - -- 设置动画的刷帧率
-注意:设置动画animator的刷帧率,范围是1~120 帧率越大,功耗越严重。 - - ``` - animationItem.setFrameRate(30); - - ``` - -- 清除缓存文件
-注意:container是与canvas组件绑定的上下文CanvasRenderingContext2D,用于本地资源路径json文件。 - - ``` - lottie.clearFileCache(); //清除所有动画缓存文件 - 或 - lottie.clearFileCache('https://p3-dcd.byteimg.com/obj/motor-mis-img/5ec2c8af22bc17aedafe147a1d38f21d.json'); //清除指定动画缓存文件 - 或 - lottie.clearFileCache('common/lottie/data_url.json',container); //清除指定本地动画中网络资源缓存文件 - ``` - -### 8.动画销毁 -- lottie销毁的时机:动画的销毁一般在canvas组件生命周期的onDisAppear()方法进行,或者在页面销毁时的aboutToDisappear()方法里执行。 -- lottie销毁动画支持以下两种方式: - 1. lottie.destroy:销毁所有动画播放,lottie.destroy(name)销毁指定name的动画, 建议使用该方式销毁动画。 - 2. animationItem.destroy:销毁当前指定animationItem的动画播放,,该销毁方式使用不当可能会引起内存泄漏问题,建议使用lottie.destroy(name)销毁方式。
-- 执行this.animationItem.destroy(),只会销毁name为2016的动画,name为cat的动画不会被销毁。建议动画销毁时,使用lottie.destroy方式进行销毁。 - - > 说明一:当同一个页面中存在多个动画,且动画实例赋值给同一个变量animationItem时,使用animationItem.destroy销毁动画时,只会销毁最后一个。如下代码示例,将name为cat和2016的动画同时赋值给this.animationItem,执行animationItem.destroy()销毁动画时,仅销毁最后加载的name为2016动画。name为cat的动画不会被销毁。 - ``` - this.animationItem = lottie.loadAnimation({ - container: this.mainCanvasRenderingContext, // 渲染上下文 - renderer: 'canvas', // 渲染方式 - loop: true, // 是否循环播放,默认true - autoplay: true, // 是否自动播放,默认true - name: 'cat', // 动画名称 - contentMode: 'Contain', // 填充的模式 - path: this.path, // json路径 - initialSegment: [10,50] // 播放的动画片段 - }) - - this.animationItem = lottie.loadAnimation({ - container: this.mainCanvasRenderingContext, // 渲染上下文 - renderer: 'canvas', // 渲染方式 - loop: true, // 是否循环播放,默认true - autoplay: true, // 是否自动播放,默认true - name: '2016', // 动画名称 - contentMode: 'Contain', // 填充的模式 - path: this.path, // json路径 - initialSegment: [10,50] // 播放的动画片段 - }) - - ``` - -> 说明二:当lottie未加载完成前( lottie.loadAnimation方法和下述方法在同一代码块中同时使用),调用下述方法可能导致设置无效:stop、togglePause、pause、goToAndStop、goToAndPlay、setSegment、getDuration、changeColor、setContentMode。应将上述方法在动画加载完成之后再执行,通过animationItem.addEventListener('DOMLoaded')监听动画加载完成,示例如下: - -``` -// 动画未加载完成,changeColor和setContentMode设置无效 -Button('加载2016') - .onClick(() => { - if (this.animationItem2 == null) { - this.animationItem2 = lottie.loadAnimation({ - container: this.canvasRenderingContext, - renderer: 'canvas', // canvas 渲染模式 - name: '2016', - path: 'common/lottie/data.json', - }) - this.animationItem2.changeColor([255,150,203,0.8]); - this.animationItem2.setContentMode('Top'); - } - }) - -``` - -``` -// animationItem.addEventListener('DOMLoaded')监听后执行方法,changeColor和setContentMode设置有效 -Button('加载2016') - .onClick(() => { - if (this.animationItem2 == null) { - this.animationItem2 = lottie.loadAnimation({ - container: this.canvasRenderingContext, - renderer: 'canvas', // canvas 渲染模式 - loop: true, - autoplay: false, - name: '2016', - contentMode: 'Contain', - path: 'common/lottie/data.json', - }) - - this.animationItem2.addEventListener('DOMLoaded', (args: Object): void => { - this.animationItem2?.changeColor([255,150,203,0.8]); - // this.animationItem2?.setContentMode('Top'); - // ... - }); //动画加载完成,播放之前触发 - } - }) - -``` - -### 9.关于混淆 -- 代码混淆,请查看[代码混淆简介](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/arkts-utils/source-obfuscation.md)。 -- 如果希望lottie库在代码混淆过程中不会被混淆,需要在混淆规则配置文件obfuscation-rules.txt中添加相应的排除规则。 -``` --keep -./oh_modules/@ohos/lottie -``` -### 10.判断动画资源是否为网络加载使用示例 -``` - this.isNet = '是否为网络加载' + this.animateItem.isNetLoad; -``` - -### 11.日志开关功能 -``` - LogUtil.mLogLevel = LogUtil.ON; //打开日志信息 - LogUtil.mLogLevel = LogUtil.OFF; //关闭日志信息 -``` - -### 12.动画不可见时绘制 - -lottie支持动画滑动到不可见区域时,跳过绘制,减少冗余绘制(需要在API 13及以上的版本才支持该功能)。当前处理逻辑假定了lottie跟一个具体的canvas节点已经绑定,但是在一些复杂交互场景下,未能追踪绑定关系变化,使得UI逻辑存在复杂变化时出现不适用,包括: - -- 预加载场景,此时canvas节点跟lottie尚无绑定关系。这又包括开发者显式预加载以及lazyforeach的cache机制引起的系统隐式预加载。 -- 节点复用场景,此时节点可能会跟不同的动画形成绑定关系。 -- 节点销毁后又重建的场景,此时旧节点已发生变化,新节点的关联关系被重新建立。 - -以上几种情况,当前都无法处理。导致lottie无法准确感知canvas节点状态,出现冗余绘制,甚至应该活动时不活动等明显的体验问题。 因此引入以CanvasRenderingContext2D为核心的协调员coordinator对象,用来跟踪 lottie动画、 CanvasRenderingContext2D、 Canvas 三者之间的动态关联关系。只有当lottie所关联CanvasRenderingContext2D对应了一个可见的canvas时,才会真正执行绘制,否则都会跳过绘制,避免冗余负载。当coordinator无法确认准确的canvas节点状态时,引入兼容性处理:当用户未显式调用bindContext2dToCoordinator接口时,默认进行绘制,否则不进行绘制等进一步的回调通知。为了避免兼容性处理考虑不周,引入setAttachedCanvasHasVisibleArea接口,支持开发者强制修正context2d所关联的canvas节点状态,以便支持逃生。 - -使用示例: - - 1. 使用canvas + lottie.loadAnimation方式 - 在CanvasRenderingContext2D对象创建后,尚未被canvas引用前显示调用bindContext2dToCoordinator接口时,页面销毁时调用unbindContext2dFromCoordinator接口解除绑定。 - -``` -import lottie from '@ohos/lottie'; - -@Entry -@Component -struct InvisibleAreaAutoPlay { - private renderingSettings: RenderingContextSettings = new RenderingContextSettings(true); - private canvas2D: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.renderingSettings); - - aboutToAppear(): void { - lottie.bindContext2dToCoordinator(this.canvas2D); - } - - aboutToDisappear(): void { - lottie.unbindContext2dFromCoordinator(this.canvas2D); - lottie.destroy('robotYoga'); - } - - build() { - Stack() { - Canvas(this.canvas2D) - .width(300) - .height(300) - .backgroundColor(Color.Gray) - .onReady(() => { - lottie.loadAnimation({ - container: this.canvas2D, - renderer: 'canvas', - loop: true, - autoplay: true, - contentMode: 'Contain', - name: 'robotYoga', - path: 'common/lottie/robotYoga.json' - }) - }) - }.height('40%') - .width('100%') - .backgroundColor(Color.Gray) - } -} -``` - -### 13.防止动画内存泄漏 - -- 避免使用@state修饰动画对象:当使用@state来修饰animationItem对象时,可能会导致动画无法被正常销毁,从而引发内存泄漏问题。 - - -- 及时销毁动画:当动画不再使用或页面即将销毁时,必须主动销毁动画。若仅创建动画而不主动销毁,animationItem对象会持续存在,进而引发内存泄漏。建议采用lottie.destroy(name)方法来销毁动画。 - - -## 接口说明 - -### AnimationItem - -| 使用方法 | 类型 | 相关描述 | -|-----------------------------------|-----------------------|---------| -| play() | name? | 播放 | -| stop() | name? | 停止 | -| pause() | name? | 暂停 | -| togglePause() | name? | 切换暂停 | -| destroy() | name? | 销毁动画 | -| goToAndStop() | value, isFrame?, name? | 跳到某一时刻并停止 | -| goToAndPlay() | value, isFrame?, name? | 跳到某一时刻并播放 | -| setSegment() | init,end | 设置动画片段 | -| playSegments() | arr, forceFlag | 播放指定片段 | -| resetSegments() | forceFlag | 重置动画 | -| setSpeed() | speed | 设置播放速度 | -| resize() | width?, height? | 刷新动画布局 | -| setDirection() | direction | 设置播放方向 | -| getDuration() | isFrames? | 获取动画时长 | -| addEventListener() | eventName,callback | 添加监听状态 | -| removeEventListener() | name,callback? | 移除监听状态 | -| changeColor() | color, layer?, index? | 更改动画颜色 | -| setContentMode() | contentMode | 设置填充模式 | -| setFrameRate() | frameRate | 设置动画刷帧率 | - - -### LottiePlayer - -| 使用方法 | 类型 | 相关描述 | -|-----------------------------------|---------------------------------------------|-----------------------------------------------------------| -| play() | name?, onlyCurrentAbility? | 播放 | -| stop() | name?, onlyCurrentAbility? | 停止 | -| pause() | name?, onlyCurrentAbility? | 暂停 | -| togglePause() | name?, onlyCurrentAbility? | 切换暂停 | -| destroy() | name?, onlyCurrentAbility? | 销毁动画 | -| goToAndStop() | value, isFrame?, name?, onlyCurrentAbility? | 跳到某一时刻并停止 | -| goToAndPlay() | value, isFrame?, name?, onlyCurrentAbility? | 跳到某一时刻并播放 | -| setSpeed() | speed, name?, onlyCurrentAbility? | 设置播放速度 | -| resize() | width?, height?, onlyCurrentAbility? | 刷新动画布局 | -| setDirection() | direction, name?, onlyCurrentAbility? | 设置播放方向 | -| setContentMode() | contentMode, name?, onlyCurrentAbility? | 设置填充模式 | -| loadAnimation() | params | 加载动画 | -| setFrameRate() | frameRate | 设置动画刷帧率 | -| cacheFileClear() | url?, container? | 清除文件缓存 | -| bindContext2dToCoordinator() | CanvasRenderingContext2D | 跟踪 lottie动画, CanvasRenderingContext2D, Canvas 三者之间的动态关联关系 | -| unbindContext2dFromCoordinator() | CanvasRenderingContext2D | 解除追踪关系 | -| setAttachedCanvasHasVisibleArea() | CanvasRenderingContext2D, boolean | 支持强制修正context2d所关联的canvas节点状态 | - - - - -## 新增特性 -1. 支持canvas渲染模式下动画的颜色修改。 -- 支持设置RGB格式颜色。 -- 支持设置RGBA格式颜色。 -- 支持设置起始关键帧颜色。 - -2. 支持canvas渲染模式下动画的masks/mattes部分特性。 -- masks模式支持 mode = a, mode = s, mode = f 模式。 -- mattes模式支持 tt = 1, tt = 2 模式。 - -3. 支持canvas渲染模式下动画的高斯模糊效果。 - -4. 支持canvas渲染模式下加载外部资源图片。 -- 支持加载沙箱路径的外部资源图片(优先查找的路径)。 -- 支持加载rawfile目录下的外部资源图片。 - -5. 支持设置填充模式。 -- Fill 填充拉伸(可能被拉伸、不会被裁剪)。 -- Top 等比填充-顶对齐(不会被裁剪、长边对齐)。 -- Bottom 等比填充-底对齐(不会被裁剪、长边对齐)。 -- Cover 等比缩放填充(可能被裁剪、短边对齐)。 -- Contain 等比填充-纵向中对齐(不会被裁剪、长边对齐)。 - -6. 支持设置动画animator的刷帧率。 - -7. 支持加载网络资源和通过URI路径方式加载动画。 -- 支持通过URI方式指定资源路径渲染动画。 -- 支持根据在线资源渲染动画。 -- 说明:如果lottie文件含有网络资源,需申请 ohos.permission.INTERNET,ohos.permission.GET_NETWORK_INFO两个权限。 - -8. 支持当动画处于隐藏状态或完全不可见时,当前动画将自动暂停其向canvas底层发送绘制指令,以此优化性能并减少功耗。 - -## 约束与限制 - -在下述版本验证通过: -- DevEco Studio: NEXT Developer Beta3(5.0.3.524), SDK: API12(5.0.0.25)。 -- DevEco Studio: NEXT Developer Beta1(5.0.3.122), SDK: API12(5.0.0.18)。 - -## 目录结构 - -```` -/lottie # 项目根目录 -├── entry # 示例代码文件夹 -├── library # lottie库文件夹 -│ └─ src/main/js # 核心代码,包含json解析,动画绘制,操作动画 -│ └─ 3rd_party -│ └─ animation -│ └─ effects -│ └─ elements -│ └─ modules -│ └─ renderers -│ └─ utils -│ └─ EffectsManager.js -│ └─ main.js -│ └─ mask.js -│ └─index.d.ts -├── README.md # 安装使用方法 -├── README_zh.md # 安装使用方法 -```` - -## 贡献代码 - -使用过程中发现任何问题都可以提交 [Issue](https://gitcode.com/openharmony-tpc/lottieArkTS/issues),当然,也非常欢迎提交 [PR](https://gitcode.com/openharmony-tpc/lottieArkTS/pulls) 。 - -## 开源协议 - -本项目遵循 [MIT License](https://gitcode.com/openharmony-tpc/lottieArkTS/blob/master/LICENSE)。 - -## 不支持能力 - -* 不支持HTML渲染方式 -* 不支持SVG渲染中filter效果 -* 不支持动画中masks,mattes部分特性 -* 不支持亮度遮罩模式,即:tt=3 -* 不支持组件控制动画显示、隐藏 -* 不支持注册动画 -* 不支持查找动画 -* 不支持更新动画数据 -* 不支持部分效果 -* 不支持含有表达式的动画 diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/build-profile.json5 b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/build-profile.json5 deleted file mode 100644 index 35dff6d53cb3a241f8de4fb68bd01d38ade0f108..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/build-profile.json5 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "apiType": "stageMode", - "buildOption": { - } -} diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/hvigorfile.ts b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/hvigorfile.ts deleted file mode 100644 index 42ed4b4a54a873e2b53441556aae93fab24b794f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/hvigorfile.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -module.exports = require('@ohos/hvigor-ohos-plugin').harTasks - diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/index.d.ts b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/index.d.ts deleted file mode 100644 index 6cad6ec6b6920e131f5ed78a93b1f20d22883263..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/index.d.ts +++ /dev/null @@ -1,839 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2015 Bodymovin - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -import common from '@ohos.app.ability.common'; -import { image } from '@kit.ImageKit'; -import { AsyncCallback } from '@kit.BasicServicesKit'; - -/** - * 动画运行方向 - * @since 8 - * @design - */ -export type AnimationDirection = 1 | -1; - -/** - * 动画片段声明 - * @since 8 - * @design - */ -export type AnimationSegment = [number, number]; - -/** - * 动画事件类型 - * @since 8 - * @design - */ -export type AnimationEventName = 'drawnFrame' | 'enterFrame' | 'loopComplete' | 'complete' | 'segmentStart' | 'destroy' | 'config_ready' | 'data_ready' | 'DOMLoaded' | 'error' | 'data_failed' | 'loaded_images'; -/** - * 动画事件回调函数声明 - * @since 8 - * @design - */ -export type AnimationEventCallback = (args: T) => void; - - -/** Specifies the data for each event type. */ -export interface AnimationEvents { - DOMLoaded: undefined; - complete: BMCompleteEvent; - config_ready: undefined; - data_failed: undefined; - data_ready: undefined; - destroy: BMDestroyEvent; - drawnFrame: BMEnterFrameEvent; - enterFrame: BMEnterFrameEvent; - error: undefined; - loaded_images: undefined; - loopComplete: BMCompleteLoopEvent; - segmentStart: BMSegmentStartEvent; -} - -export interface BMCompleteEvent { - direction: number; - type: "complete"; -} - -export interface BMCompleteLoopEvent { - currentLoop: number; - direction: number; - totalLoops: number; - type: "loopComplete"; -} - -export interface BMDestroyEvent { - type: "destroy"; -} - -export interface BMEnterFrameEvent { - /** The current time in frames. */ - currentTime: number; - direction: number; - /** The total number of frames. */ - totalTime: number; - type: "enterFrame"; -} - -export interface BMSegmentStartEvent { - firstFrame: number; - totalFrames: number; - type: "segmentStart"; -} - -/** - * 动画实例, Lottie.loadAnimation接口返回值 - * @since 8 - * @design - */ -export type AnimationItem = { - /** - * 动画所属的上下文 - * @since 13 - * @design - */ - context: common.UIAbilityContext; - - /** - * 动画名称 - * @since 8 - * @design - */ - name: string; - - /** - * 动画是否已加载 - * @since 8 - * @design - */ - isLoaded: boolean; - - /** - * 当前播放的帧号, 默认精度为>=0.0的浮点数, 调用setSubframe(false)后精度为去小数点后的正整数 - * @since 8 - * @design - */ - currentFrame: number; - - /** - * 当前播放帧数, 精度为>=0.0的浮点数 - * @since 8 - * @design - */ - currentRawFrame: number; - - /** - * 当前播放片段的第一帧帧号 - * @since 8 - * @design - */ - firstFrame: number; - - /** - * 当前播放片段的总帧数 - * @since 8 - * @design - */ - totalFrames: number; - - /** - * 帧率 (frame/s) - * @since 8 - * @design - */ - frameRate: number; - - /** - * 帧率 (frame/ms) - * @since 8 - * @design - */ - frameMult: number; - - /** - * 播放速率, 值为>=1的正整数 - * @since 8 - * @design - */ - playSpeed: number; - - /** - * 播放方向, 1为正放, -1为倒放 - * @since 8 - * @design - */ - playDirection: number; - - /** - * 动画完成播放的次数 - * @since 8 - * @design - */ - playCount: number; - - /** - * 当前动画是否已暂停, 值为true动画已暂停 - * @since 8 - * @design - */ - isPaused: boolean; - - /** - * 当前动画是否网络加载 - * @since 8 - * @design - */ - isNetLoad: boolean; - - /** - * 加载动画后是否自动播放, 若值为false需要再调用play()接口开始播放 - * @since 8 - * @design - */ - autoplay: boolean; - - /** - * 类型为boolean时是否循环播放, 类型为number时播放次数 - * @since 8 - * @design - */ - loop: boolean | number; - - /** - * 动画渲染对象, 根据渲染类型而定 - * @since 8 - * @design - */ - renderer: any; - - /** - * 动画ID - * @since 8 - * @design - */ - animationID: string; - - /** - * 当前动画片段完成单次播放的帧数, 受AnimationSegment设置影响, 与totalFrames属性值相同 - * @since 8 - * @design - */ - timeCompleted: number; - - /** - * 当前动画片段序号, 值为>=0的正整数; - * @since 8 - * @design - */ - segmentPos: number; - - /** - * 是否尽可能地更新动画帧率 - * @since 8 - * @design - */ - isSubframeEnabled: boolean; - - /** - * 当前动画待播放片段 - * @since 8 - * @design - */ - segments: AnimationSegment | AnimationSegment[]; - - /** - * 播放动画 - * @param name 被指定的动画名, 缺省默认为空 - * @since 8 - * @design - */ - play(name?: string): void; - - /** - * 停止动画 - * @param name 被指定的动画名, 可缺省默认为空 - * @since 8 - * @design - */ - stop(name?: string): void; - - /** - * 播放或暂停动画 - * @param name 被指定的动画名, 可缺省默认为空 - * @since 8 - * @design - */ - togglePause(name?: string): void; - - /** - * 销毁动画 - * @param name 被指定的动画名, 可缺省默认为空 - * @since 8 - * @design - */ - destroy(name?: string): void; - - /** - * 暂停动画 - * @param name 被指定的动画名, 可缺省默认为空 - * @since 8 - * @design - */ - pause(name?: string): void; - - /** - * 控制动画画面停止在某一帧或某个时刻 - * @param value 帧号(值>=0)或时刻(ms) - * @param isFrame true按帧控制, false按时间控制, 缺省默认false - * @param name 被指定的动画名, 可缺省默认为空 - * @since 8 - * @design - */ - goToAndStop(value: number, isFrame?: boolean, name?: string): void; - - /** - * 控制动画画面从在某一帧或某个时刻开始播放 - * @param value 帧号(>=0)或时刻(ms) - * @param isFrame true按帧控制, false按时间控制, 缺省默认false - * @param name 被指定的动画名, 可缺省默认为空 - * @since 8 - * @design - */ - goToAndPlay(value: number, isFrame?: boolean, name?: string): void; - - /** - * 限定动画资源播放时的整体帧范围 - * @param init 起始帧号 - * @param end 结束帧号 - * @since 8 - * @design - */ - setSegment(init: number, end: number): void; - - /** - * 重置动画播放片段, 使动画重新从第一帧开始播放完整动画 - * @param forceFlag 值为true立刻生效, 值为false循环下次播放的时候生效 - * @since 8 - * @design - */ - resetSegments(forceFlag: boolean): void; - - /** - * 刷新动画布局 - * @since 8 - * @design - */ - resize(width?: number, height?: number): void; - - /** - * 设置播放速度 - * @param speed 值为浮点类型, speed>0正向播放, speed<0反向播放, speed=0暂停播放, speed=1.0/-1.0正常速度播放 - * @since 8 - * @design - */ - setSpeed(speed: number): void; - - /** - * 设置播放方向 - * @param direction 1为正向, -1为反向 - * @since 8 - * @design - */ - setDirection(direction: AnimationDirection): void; - - /** - * 设置仅播放指定范围的帧动画 - * @param segments 片段或片段数组; 若传入的是数组, 且当前loop!=0, 播放结束后, 仅循环播放最后一个片段 - * @param forceFlag 值为true立刻生效, 值为false循环下次播放的时候生效 - * @since 8 - * @design - */ - playSegments(segments: AnimationSegment | AnimationSegment[], forceFlag?: boolean): void; - - /** - * 设置是否尽可能地更新动画帧率 - * @param useSubFrames 默认值是true, 值为true时尽可能的更新动画帧率, 值为false时尊重原始AE fps - * @since 8 - * @design - */ - setSubframe(useSubFrames: boolean): void; - - /** - * 获取动画单次完整播放的时间(与播放速度无关)或帧数, 与Lottie.loadAnimation接口入参initialSegment有关 - * @param inFrames 值为true时获取帧数, 值为false时获取时间(单位ms) - * @since 8 - * @design - */ - getDuration(inFrames?: boolean): number; - - /** - * 直接触发指定事件的所有已设置的回调 - * @param name 事件名称, 有效范围见AnimationEventName声明 - * @param args 用户自定义回调参数 - * @since 8 - * @design - */ - triggerEvent(name: T, args: AnimationEvents[T]): void; - - /** - * 添加侦听事件, 事件完成后会触发指定回调函数 - * @param name 事件名称, 有效范围见AnimationEventName声明 - * @param AnimationEventCallback 用户自定义回调函数 - * @since 8 - * @design - */ - addEventListener(name: T, callback: AnimationEventCallback): () => void; - - /** - * 删除侦听事件 - * @param name 事件名称, 有效范围见AnimationEventName声明 - * @param AnimationEventCallback 用户自定义回调函数; 缺省为空时, 删除此事件的所有回调函数。 - * @since 8 - * @design - */ - removeEventListener(name: T, callback?: AnimationEventCallback): void; - - /** - * 修改动画颜色 - * @param color 颜色数组RGBA - * @param layer 层次的下标值 - * @param index 对应层次里面的elements的下标值 - */ - changeColor(color: number[], layer?: number, index?: number): void; - - /** - * 修改动画的关键帧颜色 - * @param startColor 开始颜色数组RGBA - * @param endColor 结束颜色数组RGBA - * @param layer 层次的下标值 - * @param index 对应层次里面的elements的下标值 - */ - changeColor(startColor: number[],endColor: number[], layer?: number, index?: number): void; - - /** - * 动画填充模式,默认的填充模式是:Contain - * @param contentMode 模式:'Fill','Top','Bottom','Cover','Contain' - */ - setContentMode(contentMode: string): void; - - /** - * 设置当前动画的播放帧率,范围1~120。 - * 可通过设置0帧率来取消该限制。 - * @param frameRate 播放帧率 - * @since 12 - */ - setFrameRate(frameRate: number): void; - - -}; - -export type AnimationConfig = { - /** - * 与canvas组件绑定的上下文CanvasRenderingContext2D, 提供最基础的绘制渲染能力 - * @since 8 - * - * @design - */ - container: CanvasRenderingContext2D; - - /** - * 渲染类型, 目前支持canvas方式 - * @since 8 - * @design - */ - renderer?: string; - - /** - * 动画播放结束后, 是否循环播放,默认值true, 值为true时无限循环播放; 值类型为number, 且>=1时为设置重复播放的次数 - * @since 8 - * @design - */ - loop?: boolean | number; - - /** - * 自动播放设置 - * @since 8 - * @design - */ - autoplay?: boolean; - - /** - * 初始化动画资源播放时的整体帧范围 - * @since 8 - * @design - */ - initialSegment?: AnimationSegment; - - /** - * 动画名称, 动画成功加载后, 可在Lottie相关接口上, 应用该名称进行动画控制 - * @since 8 - * @design - */ - name?: string; - - /** - * 应用上下文 Context 在HSP场景下需要传正确的context,非HSP场景不影响,context可以不传 - * @since 8 - * @design - */ - context?: common.UIAbilityContext; - - /** - * 应用包名 用于打印日志区分不同模块调用启动aniamtor,packageName可以不传 - * @since 8 - * @design - */ - packageName?: string; - - /** - * 动画填充模式 支持填充模式:Fill, Top, Cover, Bottom, Contain 默认模式是:Contain - * @since 8 - * @design - */ - contentMode?: string; - - /** - * 设置animator的刷帧率,范围1~120 - * @since 8 - * @design - */ - frameRate?: number; - - /** - * 读取来自网络路径的动画数据,支持json和zip格式 - * @since 8 - * @design - */ - uri?: string; - - /** - * true优先读取网络资源,false优先读取本地缓存资源 - * @since 8 - * @design - */ - isNetwork?: boolean; - - /** - * 读取指定路径下的图片资源 - * @since 8 - * @design - */ - imagePath?: string; - - /** - * 当动画不可见时,是否跳过绘制:设为true则跳过绘制,设为false则不跳过绘制(即无条件绘制),默认值为true - * @since 13 - * @design - */ - autoSkip?: boolean; - - /** - * 在加载图片时,调用此接口获取获取绘制的 PixelMap 对象 - */ - imageAssetDelegate?: (imagePath: string, callback: AsyncCallback) => void; - -}; - -/** - * 动画文件配置信息, 推荐此方式 - * @since 8 - * @design - */ -export type AnimationConfigWithPath = AnimationConfig & { - /** - * 应用内的动画数据文件路径, 仅限json格式 - * path 路径仅支持entry/src/main/ets 路径下的相对路径,不支持跨包路径设置 - * @example path: 'common/lottie/data.json' - * @since 8 - * @design - */ - path?: string; -}; - -/** - * 数据动画配置信息 - * @since 8 - * @design - */ -export type AnimationConfigWithData = AnimationConfig & { - /** - * json格式的动画数据, 仅限json格式 - * @since 8 - * @design - */ - animationData?: any; -}; - -/** - * LottiePlayer组件提供动画加载与控制播放能力 - * @since 8 - * @design - */ -export type LottiePlayer = { - - /** - * 通过动画名称控制, 播放动画 - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时播放所有动画 - * @param onlyCurrentAbility 仅播放当前ability内的动画. 缺省时播放所有动画 - * @since 8 - * @design - */ - play(name?: string, onlyCurrentAbility?: boolean): void; - - /** - * 通过动画名称控制,暂停动画 - * @param name 被指定的动画名, 同loadAnimation接口入参name, 缺省时暂停所有动画 - * @param onlyCurrentAbility 仅暂停当前ability内的动画. 缺省时暂停所有动画 - * @since 8 - * @design - */ - pause(name?: string, onlyCurrentAbility?: boolean): void; - - /** - * 通过动画名称控制,停止动画 - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时停止所有动画 - * @param onlyCurrentAbility 仅停止当前ability内的动画. 缺省时停止所有动画 - * @since 8 - * @design - */ - stop(name?: string, onlyCurrentAbility?: boolean): void; - - /** - * 通过动画名称控制,设置播放速度 - * @param speed 值为浮点类型, speed>0正向播放, speed<0反向播放, speed=0暂停播放, speed=1.0/-1.0正常速度播放 - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时设置所有动画速度 - * @param onlyCurrentAbility 仅设置当前ability内的动画. 缺省时设置所有动画速度 - * @since 8 - * @design - */ - setSpeed(speed: number, name?: string, onlyCurrentAbility?: boolean): void; - - /** - * 通过动画名称控制,设置播放方向 - * @param direction 1为正向, -1为反向; 当设置为反向时, 从当前播放进度开始回播直到首帧, loop值为true时可无限倒放, speed<0叠加时也是倒放 - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时设置所有动画方向 - * @param onlyCurrentAbility 仅设置当前ability内的动画. 缺省时设置所有动画方向 - * @since 8 - * @design - */ - setDirection(direction: AnimationDirection, name?: string, onlyCurrentAbility?: boolean): void; - - /** - * 通过动画名称控制,暂停或播放动画 - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时停止所有动画 - * @param onlyCurrentAbility 仅停止当前ability内的动画. 缺省时停止所有动画 - * @since 8 - * @design - */ - togglePause(name?: string, onlyCurrentAbility?: boolean): void - - /** - * 加载动画, 须在组件完成布局后调用, 如可在点击事件回调中及Canvas组件的onReady()生命周期回调内调用; - * 页面退出时, 须与destory()配对使用; - * 目前支持canvas渲染方式, 支持传入json动画资源路径或json格式动画数据; - * 声明式范式下可配合组件生命周期onPageShow()使用, web范式下可配合生命周期onShow()使用; - * @param params 详见AnimationConfigWithPath或AnimationConfigWithData的声明 - * @return AnimationItem 动画对象, 可控制动画播放。 - * @since 9 - * @design - */ - loadAnimation(params: AnimationConfigWithPath | AnimationConfigWithData): AnimationItem; - - /** - * 通过动画名称控制, 销毁动画; 声明式范式下可配合组件生命周期onDisappear()与onPageHide()使用, web范式下可配合配合生命周期onHide()使用 - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时销毁所有动画 - * @param onlyCurrentAbility 仅销毁当前ability内的动画. 缺省时销毁所有动画 - * @since 8 - * @design - */ - destroy(name?: string, onlyCurrentAbility?: boolean): void; - - /** - * 设置所有动画的播放帧率,范围1~120。 - * 该设置具备持久性,即不论对于已加载还是新加载的动画都生效。可通过设置0帧率来取消该限制。 - * @param frameRate 播放帧率 - * @since 12 - */ - setFrameRate(frameRate: number): void; - - /** - * 异步清除缓存 - * @param url 具体动画被清除缓存的地址 - * @param container 与canvas组件绑定的上下文CanvasRenderingContext2D,用于本地资源路径json文件 - * @design - */ - clearFileCache(url?: string, container?: CanvasRenderingContext2D): void; - - /** - * 同步清除缓存 - * @param url 具体动画被清除缓存的地址 - * @param container 与canvas组件绑定的上下文CanvasRenderingContext2D,用于本地资源路径json文件 - * @design - */ - clearFileCacheSync(url?: string, container?: CanvasRenderingContext2D): void; - - /** - * 把CanvasRenderingContext2D绑定到用来跟踪生命周期变化的协调器coordinator上. - * - * 借助coordinator, 可跟踪"lottie动画", "CanvasRenderingContext2D"以及"Canvas"三者之间的动态关联关系, - * coordinator伺机通知"lottie动画"是否跳过绘制,以达到有效控制冗余绘制的目的. - * - * 当coordinator跟踪节点变化时, 可能各相关节点已完成其各自的生命周期活动, 因此会存在coordinator未知状态的情形. 比如: - * 某个canvas曾经关联了其它context2d对象, 并处于可见状态, 其可见性回调已经发生过. - * 现在canvas要attached到本context2d对象上来, 由于canvas可见性状态并未改变, 因此canvas的可见性回调也并不会再发生. - * 尽管coordinator会获取当前节点的visibility以及attached的状态,但即便两个状态均为true也并不意味着canvas节点具备可见面积. - * 为了避免这种情况发生, 需要调用者在所有与动画相关的canvas节点被创建之前,把该canvas所关联的CanvasRenderingContext2D对象绑定给coordinator, - * 以便coordinator有能力跟踪到相关canvas节点的准确状态. - * - * 该接口建议在CanvasRenderingContext2D对象刚刚创建之时进行调用, 以做到第一时间感知其生命周期. - * - * @param context2d 待绑定给coordinator的CanvasRenderingContext2D对象 - */ - bindContext2dToCoordinator(context2d: CanvasRenderingContext2D): void; - - /** - * 从coordinator中把CanvasRenderingContext2D剔除, 不再监听相关节点的生命周期. - * - * 需要注意的是, 该接口一旦调用, coordinator将不再跟踪相关节点的状态变化. - * 因此通常应该在所有相关的"lottie动画", "CanvasRenderingContext2D"以及"Canvas"均销毁后才可调用. - * - * @param context2d 待从coordinator中剔除的CanvasRenderingContext2D对象 - */ - unbindContext2dFromCoordinator(context2d: CanvasRenderingContext2D): void; - - /** - * 对 CanvasRenderingContext2D 所绑定的canvas节点可见性进行修正. - * - * coordinator会认为新绑定的canvas节点初始并无可见面积, 等待可见性回调发生时再做判断, 从而有效避免冗余绘制. - * 但是当canvas节点在绑定context2d之前已经完成了可见性回调时, coordinator就无法正常处理. - * 通常, 调用者可以在该canvas节点创建之前, 对其所(即将)关联的context2d做一次bindContextToCoordinator调用, 即可让coordinator正常感知. - * 但为了处理可能的难以预知的复杂场景, 此处提供一个逃生接口, 给调用者显式调整canvas节点可见性的选择. - * - * 该接口仅建议在通过bindContextToCoordinator接口无法跟踪canvas节点可见性状态时才需要被使用. - * 注意: 当context2d尚未绑定任何canvas时, 该接口不做任何处理. - * - * @param context2d 已经绑定给coordinator的CanvasRenderingContext2D对象 - * @param visible 与context2d所绑定的canvas节点可见性状态. - */ - setAttachedCanvasHasVisibleArea(context2d: CanvasRenderingContext2D, visible?: boolean): void; - - /** - * 获取当前存活的动画, 以数组形式返回. - * @design - */ - getRegisteredAnimations(): AnimationItem[]; - - /** - * 动画填充模式,默认的填充模式是:Contain - * @param contentMode 模式:'Fill','Top','Bottom','Cover','Contain' - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时设置所有动画 - * @param onlyCurrentAbility 仅设置当前ability内的动画. 缺省时设置所有动画 - */ - setContentMode(contentMode: string, name?: string, onlyCurrentAbility?: boolean): void; - - /** - * 刷新动画布局 - * @param width 布局宽度 - * @param height 布局高度 - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时刷新所有动画 - * @param onlyCurrentAbility 仅刷新当前ability内的动画. 缺省时刷新所有动画 - * @design - */ - resize(width: number, height: number, name?: string, onlyCurrentAbility?: boolean): void; - - /** - * 控制动画画面停止在某一帧或某个时刻 - * @param value 帧号(值>=0)或时刻(ms) - * @param isFrame true按帧控制, false按时间控制, 缺省默认false - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时处理所有动画 - * @param onlyCurrentAbility 仅处理当前ability内的动画. 缺省时处理所有动画 - * @design - */ - goToAndStop(value:number, isFrame:boolean, name?: string, onlyCurrentAbility?: boolean): void; - - /** - * 控制动画画面从在某一帧或某个时刻开始播放 - * @param value 帧号(>=0)或时刻(ms) - * @param isFrame true按帧控制, false按时间控制, 缺省默认false - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时处理所有动画 - * @param onlyCurrentAbility 仅处理当前ability内的动画. 缺省时处理所有动画 - * @design - */ - goToAndPlay(value:number, isFrame:boolean, name?: string, onlyCurrentAbility?: boolean): void; - - /** - * 冻结动画 - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时冻结所有动画 - * @param onlyCurrentAbility 仅冻结当前ability内的动画. 缺省时冻结所有动画 - * TODO: 暂不放开 - */ - //freeze(name?: string, onlyCurrentAbility?: boolean): void; - - /** - * 动画解冻 - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时解冻所有动画 - * @param onlyCurrentAbility 仅解冻当前ability内的动画. 缺省时解冻所有动画 - * TODO: 暂不放开 - */ - //unfreeze(name?: string, onlyCurrentAbility?: boolean): void; - - /** - * 动画静音 - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时静音所有动画 - * @param onlyCurrentAbility 仅静音当前ability内的动画. 缺省时静音所有动画 - * TODO: 暂不放开 - */ - // mute(name?: string, onlyCurrentAbility?: boolean): void; - - /** - * 动画放音 - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时放音所有动画 - * @param onlyCurrentAbility 仅放音当前ability内的动画. 缺省时放音所有动画 - * TODO: 暂不放开 - */ - // unmute(name?: string, onlyCurrentAbility?: boolean): void; - - /** - * 设置动画音量 - * @param volume 动画音量 - * @param name 被指定的动画名, 同loadAnimation接口参数name, 缺省时设置所有动画 - * @param onlyCurrentAbility 仅设置当前ability内的动画. 缺省时设置所有动画 - * TODO: 暂不放开 - */ - // setVolume(volume: number, name?: string, onlyCurrentAbility?: boolean): void; -}; - -export { LogUtil } from './src/main/js/utils/LogUtil'; - -/** - * Lottie 声明Lottie实例 - * @since 8 - * @design - */ -declare const Lottie: LottiePlayer; - -/** - * 默认仅导出Lottie示例对象 - * @since 8 - * @design - */ -export default Lottie; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/oh-package.json5 b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/oh-package.json5 deleted file mode 100644 index 846d5cfe7b995f5f96f7ad72095bb59791f9f596..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/oh-package.json5 +++ /dev/null @@ -1 +0,0 @@ -{"types":"index.d.ts","keywords":["OpenHarmony","HarmonyOS","Lottie"],"author":"ohos_tpc","ohos":{"org":"opensource"},"description":"lottie是一个适用于OpenHarmony的动画库,它可以使用Bodymovin解析以json格式导出的Adobe After Effects动画,并在移动设备上进行本地渲染","main":"src/main/js/modules/full.js","repository":"https://gitcode.com/openharmony-tpc/lottieArkTS.git","type":"module","version":"2.0.24","tags":["Animation"],"dependencies":{},"license":"MIT","devDependencies":{},"name":"@ohos/lottie","metadata":{"sourceRoots":["./src/main"],"debug":true},"compatibleSdkVersion":12,"compatibleSdkType":"OpenHarmony","obfuscated":false} diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/3rd_party/BezierEaser.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/3rd_party/BezierEaser.js deleted file mode 100644 index 76d18d8060527e990a798d9c487cc46d03c8f954..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/3rd_party/BezierEaser.js +++ /dev/null @@ -1,167 +0,0 @@ -/* eslint-disable */ -const BezierFactory = (function () { - /** - * BezierEasing - use bezier curve for transition easing function - * by Gaëtan Renaudeau 2014 - 2015 – MIT License - * - * Credits: is based on Firefox's nsSMILKeySpline.cpp - * Usage: - * var spline = BezierEasing([ 0.25, 0.1, 0.25, 1.0 ]) - * spline.get(x) => returns the easing value | x must be in [0, 1] range - * - */ - - var ob = {}; - ob.getBezierEasing = getBezierEasing; - var beziers = {}; - - function getBezierEasing(a, b, c, d, nm) { - var str = safeReplace(nm, a, b, c, d); - if (beziers[str]) { - return beziers[str]; - } - var bezEasing = new BezierEasing([a, b, c, d]); - beziers[str] = bezEasing; - return bezEasing; - } - - function safeReplace(nm, a, b, c, d) { - if (nm) { - return nm; - } - // 强制转换为字符串,避免 undefinde - const parts = ['bez_', String(a), '_', String(b), '_', String(c), '_', String(d)].join(''); - return parts.replace(/\./g, 'p'); - } - - // These values are established by empiricism with tests (tradeoff: performance VS precision) - var NEWTON_ITERATIONS = 4; - var NEWTON_MIN_SLOPE = 0.001; - var SUBDIVISION_PRECISION = 0.0000001; - var SUBDIVISION_MAX_ITERATIONS = 10; - - var kSplineTableSize = 11; - var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); - - var float32ArraySupported = typeof Float32Array === 'function'; - - function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; } - function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; } - function C(aA1) { return 3.0 * aA1; } - - // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. - function calcBezier(aT, aA1, aA2) { - return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; - } - - // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2. - function getSlope(aT, aA1, aA2) { - return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); - } - - function binarySubdivide(aX, aA, aB, mX1, mX2) { - var currentX, - currentT, - i = 0; - do { - currentT = aA + (aB - aA) / 2.0; - currentX = calcBezier(currentT, mX1, mX2) - aX; - if (currentX > 0.0) { - aB = currentT; - } else { - aA = currentT; - } - } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); - return currentT; - } - - function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) { - for (var i = 0; i < NEWTON_ITERATIONS; ++i) { - var currentSlope = getSlope(aGuessT, mX1, mX2); - if (currentSlope === 0.0) return aGuessT; - var currentX = calcBezier(aGuessT, mX1, mX2) - aX; - aGuessT -= currentX / currentSlope; - } - return aGuessT; - } - - /** - * points is an array of [ mX1, mY1, mX2, mY2 ] - */ - function BezierEasing(points) { - this._p = points; - this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); - this._precomputed = false; - - this.get = this.get.bind(this); - } - - BezierEasing.prototype = { - - get: function (x) { - var mX1 = this._p[0], - mY1 = this._p[1], - mX2 = this._p[2], - mY2 = this._p[3]; - if (!this._precomputed) this._precompute(); - if (mX1 === mY1 && mX2 === mY2) return x; // linear - // Because JavaScript number are imprecise, we should guarantee the extremes are right. - if (x === 0) return 0; - if (x === 1) return 1; - return calcBezier(this._getTForX(x), mY1, mY2); - }, - - // Private part - - _precompute: function () { - var mX1 = this._p[0], - mY1 = this._p[1], - mX2 = this._p[2], - mY2 = this._p[3]; - this._precomputed = true; - if (mX1 !== mY1 || mX2 !== mY2) { this._calcSampleValues(); } - }, - - _calcSampleValues: function () { - var mX1 = this._p[0], - mX2 = this._p[2]; - for (var i = 0; i < kSplineTableSize; ++i) { - this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); - } - }, - - /** - * getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection. - */ - _getTForX: function (aX) { - var mX1 = this._p[0], - mX2 = this._p[2], - mSampleValues = this._mSampleValues; - - var intervalStart = 0.0; - var currentSample = 1; - var lastSample = kSplineTableSize - 1; - - for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) { - intervalStart += kSampleStepSize; - } - --currentSample; - - // Interpolate to provide an initial guess for t - var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]); - var guessForT = intervalStart + dist * kSampleStepSize; - - var initialSlope = getSlope(guessForT, mX1, mX2); - if (initialSlope >= NEWTON_MIN_SLOPE) { - return newtonRaphsonIterate(aX, guessForT, mX1, mX2); - } if (initialSlope === 0.0) { - return guessForT; - } - return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); - }, - }; - - return ob; -}()); - -export default BezierFactory; \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/3rd_party/seedrandom.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/3rd_party/seedrandom.js deleted file mode 100644 index 8d18f809cf5a204edebc2449028fd1af0abdc6a2..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/3rd_party/seedrandom.js +++ /dev/null @@ -1,236 +0,0 @@ -/* eslint-disable */ -/* - Copyright 2014 David Bau. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - */ - -function seedRandom(pool, math) { -// -// The following constants are related to IEEE 754 limits. -// - var global = this, - width = 256, // each RC4 output is 0 <= x < 256 - chunks = 6, // at least six RC4 outputs for each double - digits = 52, // there are 52 significant digits in a double - rngname = 'random', // rngname: name for Math.random and Math.seedrandom - startdenom = math.pow(width, chunks), - significance = math.pow(2, digits), - overflow = significance * 2, - mask = width - 1, - nodecrypto; // node.js crypto module, initialized at the bottom. - -// -// seedrandom() -// This is the seedrandom function described above. -// - function seedrandom(seed, options, callback) { - var key = []; - options = (options === true) ? { entropy: true } : (options || {}); - - // Flatten the seed string or build one from local entropy if needed. - var shortseed = mixkey(flatten( - options.entropy ? [seed, tostring(pool)] : - (seed === null) ? autoseed() : seed, 3), key); - - // Use the seed to initialize an ARC4 generator. - var arc4 = new ARC4(key); - - // This function returns a random double in [0, 1) that contains - // randomness in every bit of the mantissa of the IEEE 754 value. - var prng = function() { - var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48 - d = startdenom, // and denominator d = 2 ^ 48. - x = 0; // and no 'extra last byte'. - while (n < significance) { // Fill up all significant digits by - n = (n + x) * width; // shifting numerator and - d *= width; // denominator and generating a - x = arc4.g(1); // new least-significant-byte. - } - while (n >= overflow) { // To avoid rounding up, before adding - n /= 2; // last byte, shift everything - d /= 2; // right using integer math until - x >>>= 1; // we have exactly the desired bits. - } - return (n + x) / d; // Form the number within [0, 1). - }; - - prng.int32 = function() { return arc4.g(4) | 0; }; - prng.quick = function() { return arc4.g(4) / 0x100000000; }; - prng.double = prng; - - // Mix the randomness into accumulated entropy. - mixkey(tostring(arc4.S), pool); - - // Calling convention: what to return as a function of prng, seed, is_math. - return (options.pass || callback || - function(prng, seed, is_math_call, state) { - if (state) { - // Load the arc4 state from the given state if it has an S array. - if (state.S) { copy(state, arc4); } - // Only provide the .state method if requested via options.state. - prng.state = function() { return copy(arc4, {}); }; - } - - // If called as a method of Math (Math.seedrandom()), mutate - // Math.random because that is how seedrandom.js has worked since v1.0. - if (is_math_call) { math[rngname] = prng; return seed; } - - // Otherwise, it is a newer calling convention, so return the - // prng directly. - else return prng; - })( - prng, - shortseed, - 'global' in options ? options.global : (this == math), - options.state); - } - math['seed' + rngname] = seedrandom; - -// -// ARC4 -// -// An ARC4 implementation. The constructor takes a key in the form of -// an array of at most (width) integers that should be 0 <= x < (width). -// -// The g(count) method returns a pseudorandom integer that concatenates -// the next (count) outputs from ARC4. Its return value is a number x -// that is in the range 0 <= x < (width ^ count). -// - function ARC4(key) { - var t, keylen = key.length, - me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; - - // The empty key [] is treated as [0]. - if (!keylen) { key = [keylen++]; } - - // Set up S using the standard key scheduling algorithm. - while (i < width) { - s[i] = i++; - } - for (i = 0; i < width; i++) { - s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))]; - s[j] = t; - } - - // The "g" method returns the next (count) outputs as one number. - me.g = function(count) { - // Using instance members instead of closure state nearly doubles speed. - var t, r = 0, - i = me.i, j = me.j, s = me.S; - while (count--) { - t = s[i = mask & (i + 1)]; - r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))]; - } - me.i = i; me.j = j; - return r; - // For robust unpredictability, the function call below automatically - // discards an initial batch of values. This is called RC4-drop[256]. - }; - } - -// -// copy() -// Copies internal state of ARC4 to or from a plain object. -// - function copy(f, t) { - t.i = f.i; - t.j = f.j; - t.S = f.S.slice(); - return t; - } - -// -// flatten() -// Converts an object tree to nested arrays of strings. -// - function flatten(obj, depth) { - var result = [], typ = (typeof obj), prop; - if (depth && typ == 'object') { - for (prop in obj) { - try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} - } - } - return (result.length ? result : typ == 'string' ? obj : obj + '\0'); - } - -// -// mixkey() -// Mixes a string seed into a key that is an array of integers, and -// returns a shortened string seed that is equivalent to the result key. -// - function mixkey(seed, key) { - var stringseed = seed + '', smear, j = 0; - while (j < stringseed.length) { - key[mask & j] = - mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++)); - } - return tostring(key); - } - -// -// autoseed() -// Returns an object for autoseeding, using window.crypto and Node crypto -// module if available. -// - function autoseed() { - try { - if (nodecrypto) { return tostring(nodecrypto.randomBytes(width)); } - var out = new Uint8Array(width); - (global.crypto || global.msCrypto).getRandomValues(out); - return tostring(out); - } catch (e) { - var browser = global.navigator, - plugins = browser && browser.plugins; - return [+new Date(), global, plugins, global.screen, tostring(pool)]; - } - } - -// -// tostring() -// Converts an array of charcodes to a string -// - function tostring(a) { - return String.fromCharCode.apply(0, a); - } - -// -// When seedrandom.js is loaded, we immediately mix a few bits -// from the built-in RNG into the entropy pool. Because we do -// not want to interfere with deterministic PRNG state later, -// seedrandom will not call math.random on its own again after -// initialization. -// - mixkey(math.random(), pool); - -// -// Nodejs and AMD support: export the implementation as a module using -// either convention. -// - -// End anonymous scope, and pass initial values. -}; - -function initialize(BMMath) { - seedRandom([], BMMath); -} - -export default initialize; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/3rd_party/transformation-matrix.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/3rd_party/transformation-matrix.js deleted file mode 100644 index 560f5d7096c9ca722fd05b5a189212eb5cbd9a46..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/3rd_party/transformation-matrix.js +++ /dev/null @@ -1,426 +0,0 @@ -import { - createTypedArray, -} from '../utils/helpers/arrays'; - -/*! - Transformation Matrix v2.0 - (c) Epistemex 2014-2015 - www.epistemex.com - By Ken Fyrstenberg - Contributions by leeoniya. - License: MIT, header required. - */ - -/** - * 2D transformation matrix object initialized with identity matrix. - * - * The matrix can synchronize a canvas context by supplying the context - * as an argument, or later apply current absolute transform to an - * existing context. - * - * All values are handled as floating point values. - * - * @param {CanvasRenderingContext2D} [context] - Optional context to sync with Matrix - * @prop {number} a - scale x - * @prop {number} b - shear y - * @prop {number} c - shear x - * @prop {number} d - scale y - * @prop {number} e - translate x - * @prop {number} f - translate y - * @prop {CanvasRenderingContext2D|null} [context=null] - set or get current canvas context - * @constructor - */ - -const Matrix = (function () { - var _cos = Math.cos; - var _sin = Math.sin; - var _tan = Math.tan; - var _rnd = Math.round; - - function reset() { - this.props[0] = 1; - this.props[1] = 0; - this.props[2] = 0; - this.props[3] = 0; - this.props[4] = 0; - this.props[5] = 1; - this.props[6] = 0; - this.props[7] = 0; - this.props[8] = 0; - this.props[9] = 0; - this.props[10] = 1; - this.props[11] = 0; - this.props[12] = 0; - this.props[13] = 0; - this.props[14] = 0; - this.props[15] = 1; - return this; - } - - function rotate(angle) { - if (angle === 0) { - return this; - } - var mCos = _cos(angle); - var mSin = _sin(angle); - return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); - } - - function rotateX(angle) { - if (angle === 0) { - return this; - } - var mCos = _cos(angle); - var mSin = _sin(angle); - return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1); - } - - function rotateY(angle) { - if (angle === 0) { - return this; - } - var mCos = _cos(angle); - var mSin = _sin(angle); - return this._t(mCos, 0, mSin, 0, 0, 1, 0, 0, -mSin, 0, mCos, 0, 0, 0, 0, 1); - } - - function rotateZ(angle) { - if (angle === 0) { - return this; - } - var mCos = _cos(angle); - var mSin = _sin(angle); - return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); - } - - function shear(sx, sy) { - return this._t(1, sy, sx, 1, 0, 0); - } - - function skew(ax, ay) { - return this.shear(_tan(ax), _tan(ay)); - } - - function skewFromAxis(ax, angle) { - var mCos = _cos(angle); - var mSin = _sin(angle); - return this._t(mCos, mSin, 0, 0, -mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) - ._t(1, 0, 0, 0, _tan(ax), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) - ._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); - // return this._t(mCos, mSin, -mSin, mCos, 0, 0)._t(1, 0, _tan(ax), 1, 0, 0)._t(mCos, -mSin, mSin, mCos, 0, 0); - } - - function scale(sx, sy, sz) { - if (!sz && sz !== 0) { - sz = 1; - } - if (sx === 1 && sy === 1 && sz === 1) { - return this; - } - return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1); - } - - function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) { - this.props[0] = a; - this.props[1] = b; - this.props[2] = c; - this.props[3] = d; - this.props[4] = e; - this.props[5] = f; - this.props[6] = g; - this.props[7] = h; - this.props[8] = i; - this.props[9] = j; - this.props[10] = k; - this.props[11] = l; - this.props[12] = m; - this.props[13] = n; - this.props[14] = o; - this.props[15] = p; - return this; - } - - function translate(tx, ty, tz) { - tz = tz || 0; - if (tx !== 0 || ty !== 0 || tz !== 0) { - return this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tx, ty, tz, 1); - } - return this; - } - - function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) { - var _p = this.props; - - if (a2 === 1 && b2 === 0 && c2 === 0 && d2 === 0 && e2 === 0 && f2 === 1 && g2 === 0 && h2 === 0 && i2 === 0 && j2 === 0 && k2 === 1 && l2 === 0) { - // NOTE: commenting this condition because TurboFan deoptimizes code when present - // if(m2 !== 0 || n2 !== 0 || o2 !== 0){ - _p[12] = _p[12] * a2 + _p[15] * m2; - _p[13] = _p[13] * f2 + _p[15] * n2; - _p[14] = _p[14] * k2 + _p[15] * o2; - _p[15] *= p2; - // } - this._identityCalculated = false; - return this; - } - - var a1 = _p[0]; - var b1 = _p[1]; - var c1 = _p[2]; - var d1 = _p[3]; - var e1 = _p[4]; - var f1 = _p[5]; - var g1 = _p[6]; - var h1 = _p[7]; - var i1 = _p[8]; - var j1 = _p[9]; - var k1 = _p[10]; - var l1 = _p[11]; - var m1 = _p[12]; - var n1 = _p[13]; - var o1 = _p[14]; - var p1 = _p[15]; - - /* matrix order (canvas compatible): - * ace - * bdf - * 001 - */ - _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2; - _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2; - _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2; - _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2; - - _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2; - _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2; - _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2; - _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2; - - _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2; - _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2; - _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2; - _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2; - - _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2; - _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2; - _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2; - _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2; - - this._identityCalculated = false; - return this; - } - - function isIdentity() { - if (!this._identityCalculated) { - this._identity = !(this.props[0] !== 1 || this.props[1] !== 0 || this.props[2] !== 0 || this.props[3] !== 0 || this.props[4] !== 0 || this.props[5] !== 1 || this.props[6] !== 0 || this.props[7] !== 0 || this.props[8] !== 0 || this.props[9] !== 0 || this.props[10] !== 1 || this.props[11] !== 0 || this.props[12] !== 0 || this.props[13] !== 0 || this.props[14] !== 0 || this.props[15] !== 1); - this._identityCalculated = true; - } - return this._identity; - } - - function equals(matr) { - var i = 0; - while (i < 16) { - if (matr.props[i] !== this.props[i]) { - return false; - } - i += 1; - } - return true; - } - - function clone(matr) { - var i; - for (i = 0; i < 16; i += 1) { - matr.props[i] = this.props[i]; - } - return matr; - } - - function cloneFromProps(props) { - var i; - for (i = 0; i < 16; i += 1) { - this.props[i] = props[i]; - } - } - - function applyToPoint(x, y, z) { - return { - x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12], - y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13], - z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14], - }; - /* return { - x: x * me.a + y * me.c + me.e, - y: x * me.b + y * me.d + me.f - }; */ - } - function applyToX(x, y, z) { - return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12]; - } - function applyToY(x, y, z) { - return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13]; - } - function applyToZ(x, y, z) { - return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]; - } - - function getInverseMatrix() { - var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4]; - var a = this.props[5] / determinant; - var b = -this.props[1] / determinant; - var c = -this.props[4] / determinant; - var d = this.props[0] / determinant; - var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / determinant; - var f = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / determinant; - var inverseMatrix = new Matrix(); - inverseMatrix.props[0] = a; - inverseMatrix.props[1] = b; - inverseMatrix.props[4] = c; - inverseMatrix.props[5] = d; - inverseMatrix.props[12] = e; - inverseMatrix.props[13] = f; - return inverseMatrix; - } - - function inversePoint(pt) { - var inverseMatrix = this.getInverseMatrix(); - return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0); - } - - function inversePoints(pts) { - var i; - var len = pts.length; - var retPts = []; - for (i = 0; i < len; i += 1) { - retPts[i] = inversePoint(pts[i]); - } - return retPts; - } - - function applyToTriplePoints(pt1, pt2, pt3) { - var arr = createTypedArray('float32', 6); - if (this.isIdentity()) { - arr[0] = pt1[0]; - arr[1] = pt1[1]; - arr[2] = pt2[0]; - arr[3] = pt2[1]; - arr[4] = pt3[0]; - arr[5] = pt3[1]; - } else { - var p0 = this.props[0]; - var p1 = this.props[1]; - var p4 = this.props[4]; - var p5 = this.props[5]; - var p12 = this.props[12]; - var p13 = this.props[13]; - arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12; - arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13; - arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12; - arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13; - arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12; - arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13; - } - return arr; - } - - function applyToPointArray(x, y, z) { - var arr; - if (this.isIdentity()) { - arr = [x, y, z]; - } else { - arr = [ - x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12], - x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13], - x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14], - ]; - } - return arr; - } - - function applyToPointStringified(x, y) { - if (this.isIdentity()) { - return x + ',' + y; - } - var _p = this.props; - return Math.round((x * _p[0] + y * _p[4] + _p[12]) * 100) / 100 + ',' + Math.round((x * _p[1] + y * _p[5] + _p[13]) * 100) / 100; - } - - function toCSS() { - // Doesn't make much sense to add this optimization. If it is an identity matrix, it's very likely this will get called only once since it won't be keyframed. - /* if(this.isIdentity()) { - return ''; - } */ - var i = 0; - var props = this.props; - var cssValue = 'matrix3d('; - var v = 10000; - while (i < 16) { - cssValue += _rnd(props[i] * v) / v; - cssValue += i === 15 ? ')' : ','; - i += 1; - } - return cssValue; - } - - function roundMatrixProperty(val) { - var v = 10000; - if ((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) { - return _rnd(val * v) / v; - } - return val; - } - - function to2dCSS() { - // Doesn't make much sense to add this optimization. If it is an identity matrix, it's very likely this will get called only once since it won't be keyframed. - /* if(this.isIdentity()) { - return ''; - } */ - var props = this.props; - var _a = roundMatrixProperty(props[0]); - var _b = roundMatrixProperty(props[1]); - var _c = roundMatrixProperty(props[4]); - var _d = roundMatrixProperty(props[5]); - var _e = roundMatrixProperty(props[12]); - var _f = roundMatrixProperty(props[13]); - return 'matrix(' + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ')'; - } - - return function () { - this.reset = reset; - this.rotate = rotate; - this.rotateX = rotateX; - this.rotateY = rotateY; - this.rotateZ = rotateZ; - this.skew = skew; - this.skewFromAxis = skewFromAxis; - this.shear = shear; - this.scale = scale; - this.setTransform = setTransform; - this.translate = translate; - this.transform = transform; - this.applyToPoint = applyToPoint; - this.applyToX = applyToX; - this.applyToY = applyToY; - this.applyToZ = applyToZ; - this.applyToPointArray = applyToPointArray; - this.applyToTriplePoints = applyToTriplePoints; - this.applyToPointStringified = applyToPointStringified; - this.toCSS = toCSS; - this.to2dCSS = to2dCSS; - this.clone = clone; - this.cloneFromProps = cloneFromProps; - this.equals = equals; - this.inversePoints = inversePoints; - this.inversePoint = inversePoint; - this.getInverseMatrix = getInverseMatrix; - this._t = this.transform; - this.isIdentity = isIdentity; - this._identity = true; - this._identityCalculated = false; - - this.props = createTypedArray('float32', 16); - this.reset(); - }; -}()); - -export default Matrix; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/EffectsManager.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/EffectsManager.js deleted file mode 100644 index 3603538a25656a41f3e09aaabcfbd3a37705add5..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/EffectsManager.js +++ /dev/null @@ -1,83 +0,0 @@ -import { - extendPrototype, -} from './utils/functionExtensions'; -import { - SliderEffect, - AngleEffect, - ColorEffect, - PointEffect, - LayerIndexEffect, - MaskIndexEffect, - CheckboxEffect, - NoValueEffect, -} from './effects/SliderEffect'; -import DynamicPropertyContainer from './utils/helpers/dynamicProperties'; - -function EffectsManager(data, element) { - var effects = data.ef || []; - this.effectElements = []; - var i; - var len = effects.length; - var effectItem; - for (i = 0; i < len; i += 1) { - effectItem = new GroupEffect(effects[i], element); - this.effectElements.push(effectItem); - } -} - -function GroupEffect(data, element) { - this.init(data, element); -} - -extendPrototype([DynamicPropertyContainer], GroupEffect); - -GroupEffect.prototype.getValue = GroupEffect.prototype.iterateDynamicProperties; - -GroupEffect.prototype.init = function (data, element) { - this.data = data; - this.effectElements = []; - this.initDynamicPropertyContainer(element); - var i; - var len = this.data.ef.length; - var eff; - var effects = this.data.ef; - for (i = 0; i < len; i += 1) { - eff = null; - switch (effects[i].ty) { - case 0: - eff = new SliderEffect(effects[i], element, this); - break; - case 1: - eff = new AngleEffect(effects[i], element, this); - break; - case 2: - eff = new ColorEffect(effects[i], element, this); - break; - case 3: - eff = new PointEffect(effects[i], element, this); - break; - case 4: - case 7: - eff = new CheckboxEffect(effects[i], element, this); - break; - case 10: - eff = new LayerIndexEffect(effects[i], element, this); - break; - case 11: - eff = new MaskIndexEffect(effects[i], element, this); - break; - case 5: - eff = new EffectsManager(effects[i], element, this); - break; - // case 6: - default: - eff = new NoValueEffect(effects[i], element, this); - break; - } - if (eff) { - this.effectElements.push(eff); - } - } -}; - -export default EffectsManager; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/animation/AnimationItem.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/animation/AnimationItem.js deleted file mode 100644 index 7114a94ccce5a2c625db1905da99284562ee2bea..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/animation/AnimationItem.js +++ /dev/null @@ -1,1324 +0,0 @@ -import { - extendPrototype, -} from '../utils/functionExtensions'; - -import audioControllerFactory from '../utils/audio/AudioController'; -import { - getSubframeEnabled, - BMEnterFrameEvent, - BMCompleteEvent, - BMCompleteLoopEvent, - BMSegmentStartEvent, - BMDestroyEvent, - BMRenderFrameErrorEvent, - BMConfigErrorEvent, - createElementID, - getExpressionsPlugin, -} from '../utils/common'; -import ImagePreloader from '../utils/imagePreloader'; -import BaseEvent from '../utils/BaseEvent'; -import dataManager from '../utils/DataManager'; -import markerParser from '../utils/markers/markerParser'; -import ProjectInterface from '../utils/expressions/ProjectInterface'; -import { getRenderer, getRegisteredRenderer } from '../renderers/renderersManager'; -import downloadManager from '../utils/DownloadManager'; -import { - readJson, - handleAssets, - createFilesDir, - handleZipAssets, - isCacheExist, - isHaveImg, - createImageFilesDir, - isJsonFile, - isCompressdFile, - isExistNetworkAssets -} from '../utils/DataUtil'; -import {LogUtil} from '../utils/LogUtil' -import deviceInfo from '@ohos.deviceInfo'; - -const AnimationItem = function () { - this._cbs = []; - this.name = ''; - this.path = ''; - this.source = null; - this.isLoaded = false; - this.absoluteFrameToPlay = -1; //absolute frame number based by 0, regardless of whether playing segments - this._absoluteFramePlayed = -1; - this.firstFrame = 0; //the number of the started frame which is in playing segments - this.endFrame = 0; - this.offsetFrame = 0; //the minimum number of segment frames. Note that it's not certainly firstFrame - this.totalFrames = 0; - this.frameRate = 0; - this.frameMult = 0; - this._speed = 1; - this._direction = 1; - this.playCount = 0; - this.animationData = {}; - this.assets = []; - this.isPaused = true; - this.autoplay = false; - this.loop = true; - this.renderer = null; - this.animationID = createElementID(); - this.assetsPath = ''; - this.timeCompleted = 0; - this.segmentPos = 0; - this.isSubframeEnabled = getSubframeEnabled(); - this.segments = []; - this._idle = true; - this.projectInterface = ProjectInterface(); - this.imagePreloader = new ImagePreloader(); - this.audioController = audioControllerFactory(); - this.markers = []; - this.configAnimation = this.configAnimation.bind(this); - this.onSetupError = this.onSetupError.bind(this); - this.onSegmentComplete = this.onSegmentComplete.bind(this); - this.drawnFrameEvent = new BMEnterFrameEvent('drawnFrame', 0, 0, 0); - this.context = null; - this.packageName = ''; - this.contentMode = ''; - this.userPlayingFrameRate = 0; // the max playing frame rate of this animation - this.lastTimestamp = 0; - this._loopCompleteTime = 20; - this._firstTime = 0; - this.isFirstLoaded = false; - this.isNetLoad = false; - this.isAutoSkip = true; - this._hasArea = true; - this._isCanvasStatusDeterminate = false; - - /* - * for backward compatiblity - * relative frame based by offsetFrame. - */ - Object.defineProperty(this, 'currentRawFrame', { - get() { - return this.absoluteFrameToPlay; - }, - set(value) { - let nextFrame = this.getNextFrameToPlay(value); - this.absoluteFrameToPlay = this.relativeFrameToAbsolute(nextFrame); - } - }); - - /* - * for backward compatiblity - * relative frame based by offsetFrame. Integerized when subFrame is false. - */ - Object.defineProperty(this, 'currentFrame', { - get() { - let frameToPlay = this.isSubframeEnabled ? this.absoluteFrameToPlay: Math.floor(this.absoluteFrameToPlay); - // for backward compatiblity - return this.absoluteFrameToRelative(frameToPlay); - }, - set(value) { - let frameToPlay = this.getNextFrameToPlay(value); - let absoluteFrame = this.relativeFrameToAbsolute(frameToPlay); - this.absoluteFrameToPlay = this.isSubframeEnabled ? absoluteFrame : Math.floor(absoluteFrame); - } - }); - - /* - * for backward compatiblity - * 播放速率, 值为>=1的正整数. - */ - Object.defineProperty(this, 'playSpeed', { - get() { - return this._speed; - }, - set(value) { - this.setSpeed(value); - } - }); - - /* - * for backward compatiblity - * 播放速率, 值为>=1的正整数. - */ - Object.defineProperty(this, 'playDirection', { - get() { - return this._direction; - }, - set(value) { - this.setDirection(value); - } - }); - -}; - -extendPrototype([BaseEvent], AnimationItem); - -AnimationItem.prototype._getLogTag = function() { - let abilityName = this.getUiContext()?.getHostContext()?.abilityInfo?.name; - return `<(${abilityName} ${this.animationID})> ${this.packageName} ${this.name} animation`; -}; - -AnimationItem.prototype.loadCacheData = function (uri, resultDir) { - let existResult = isCacheExist(uri, resultDir.route); // 沙箱中是否有下载的资源 - if (existResult?.isExist) { - let cacheData = readJson(uri, resultDir.route, this.triggerEvent.bind(this)); - // 优先读取缓存 - if (isJsonFile(uri)) { - if (cacheData?.assets?.length && isExistNetworkAssets(cacheData?.assets)) { - let newJsonData = handleAssets(cacheData); - this.setupAnimation(newJsonData); // 加载有图片资源的json资源 - } else { - this.setupAnimation(cacheData); // 加载无图片资源的json资源 - }; - } else if (isCompressdFile(uri)) { - // 修改u路径 - let newCacheData = handleZipAssets(cacheData, resultDir.route); - this.setupAnimation(newCacheData); - }; - this.isNetLoad = false; - } else { - // 若缓存无资源,加载网络资源 - downloadManager.loadNetworkAnimation(uri, (jsonData, isNetLoad) => { - this.isNetLoad = isNetLoad; - this.setupAnimation(jsonData); - }, this.triggerEvent.bind(this), resultDir, false); - }; -}; - -AnimationItem.prototype.loadAnimationData = function (jsonData, isNetwork) { - try { - if (jsonData?.assets?.length && isExistNetworkAssets(jsonData?.assets)) { - this.loadImage(jsonData, isNetwork); - } else { - // 无网络图片 - this.setupAnimation(jsonData); - } - } catch (error) { - LogUtil.error(`${this._getLogTag()} error.message: ${JSON.stringify(error.message)}, error.stack: ${JSON.stringify(error.stack)}`); - } -}; - -AnimationItem.prototype.loadImage = function (jsonData, isNetwork) { - if (isNetwork) { - downloadManager.loadNetworkImage(jsonData).then((results) => { - let newJsonData = handleAssets(jsonData); - this.setupAnimation(newJsonData); - }) - .catch((err) => { - // 处理网络异常加载缓存 - let imgRouterFilesDir = createImageFilesDir(); - let isImg = isHaveImg(imgRouterFilesDir); // 沙箱中是否有下载的图片资源 - if (isImg) { - let cacheImagesData = handleAssets(jsonData); - this.setupAnimation(cacheImagesData); - } else { - // 缓存无资源,返回加载异常 - this.triggerEvent('error', err); - } - ; - }); - } else { - // false 优先加载缓存资源 - let imgRouterFilesDir = createImageFilesDir(); - let isImg = isHaveImg(imgRouterFilesDir); // 沙箱中是否有下载的图片资源 - if (isImg) { - let filesJsonData = handleAssets(jsonData); - this.setupAnimation(filesJsonData); - } else { - downloadManager.loadNetworkImage(jsonData).then((results) => { - let newJsonData = handleAssets(jsonData); - this.setupAnimation(newJsonData); - }) - .catch((err) => { - // 下载失败,返回加载异常 - this.triggerEvent('error', err); - }); - } - ; - } -}; - -AnimationItem.prototype.getUiContext = function () { - return this.wrapper?.canvas?.uiContext_; -}; - -AnimationItem.prototype.setParams = function (params) { - if (params.wrapper || params.container) { - this.wrapper = params.wrapper || params.container; - } - var animType = 'svg'; - if (params.animType) { - animType = params.animType; - } else if (params.renderer) { - animType = params.renderer; - } - this.name = params.name ? params.name : ''; - const RendererClass = getRenderer(animType); - this.renderer = new RendererClass(this, params.rendererSettings); - this.context = getContext(); - let resContext = 'context' in params ? params.context : getContext(); - let imagePath = 'imagePath' in params ? params.imagePath : ''; - let imageAssetDelegate = 'imageAssetDelegate' in params ? params.imageAssetDelegate : null; - this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs, resContext, imagePath); - this.imagePreloader.setImageAssetDelegate(imageAssetDelegate) - this.renderer.setProjectInterface(this.projectInterface); - this.animType = animType; - if (params.loop === '' - || params.loop === null - || params.loop === undefined - || params.loop === true) { - this.loop = true; - } else if (params.loop === false) { - this.loop = false; - } else { - this.loop = parseInt(params.loop, 10); - } - this.contentMode = 'contentMode' in params ? params.contentMode : ''; - this.packageName = 'packageName' in params ? params.packageName : ''; - if (params.frameRate) { - this.setFrameRate(params.frameRate); - } - this.autoplay = 'autoplay' in params ? params.autoplay : true; - this.isAutoSkip = 'autoSkip' in params ? params.autoSkip : true; - this.autoloadSegments = - Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true; - this.assetsPath = params.assetsPath; - this.initialSegment = params.initialSegment; - if (params.audioFactory) { - this.audioController.setAudioFactory(params.audioFactory); - } - - if (params.animationData) { - this.source = 'data'; - this.loadAnimationData(params.animationData, params.isNetwork); - } else if (params.path) { - this.source = params.path; - if (params.path.lastIndexOf('\\') !== -1) { - this.path = params.path.substr(0, params.path.lastIndexOf('\\') + 1); - } else { - this.path = params.path.substr(0, params.path.lastIndexOf('/') + 1); - } - this.fileName = params.path.substr(params.path.lastIndexOf('/') + 1); - this.fileName = this.fileName.substr(0, this.fileName.lastIndexOf('.json')); - try { - dataManager.loadAnimation( - this.wrapper, - params.path, - params.isNetwork, - this.configAnimation, - this.onSetupError - ); - } catch (err) { - this.triggerEvent('error', err); - } - } else if (params.uri) { - this.source = params.uri; - this.loadNetworkResource(params.uri, params.isNetwork) - } -}; - -AnimationItem.prototype.onCanvasHasVisibleArea = function(canvasUniqueId, hasArea) { - LogUtil.info(`${this._getLogTag()} canvas(${canvasUniqueId}) has ${hasArea ? 'visible' : 'no'} area.`); - this._isCanvasStatusDeterminate = true; - this._visibleAreaChanged(canvasUniqueId, hasArea); -}; - -AnimationItem.prototype.loadNetworkResource = function (uri, isNetwork) { - let resultDir = createFilesDir(uri); - if (isNetwork) { - // true 优先加载网络资源 - downloadManager.loadNetworkAnimation(uri, (jsonData, isNetLoad) => { - this.isNetLoad = isNetLoad; - this.setupAnimation(jsonData); - }, this.triggerEvent.bind(this), resultDir, true); - } else { - // false 优先加载缓存资源 - this.loadCacheData(uri, resultDir); - } -}; - -AnimationItem.prototype.onSetupError = function () { - this.trigger('data_failed'); -}; - -AnimationItem.prototype.setupAnimation = function (data) { - dataManager.completeAnimation( - data, - this.configAnimation - ); -}; - -// web only -AnimationItem.prototype.setData = function (wrapper, animationData) { - if (animationData) { - if (typeof animationData !== 'object') { - animationData = JSON.parse(animationData); - } - } - var params = { - wrapper: wrapper, - animationData: animationData, - }; - var wrapperAttributes = wrapper.attributes; - - params.path = wrapperAttributes.getNamedItem('data-animation-path') // eslint-disable-line no-nested-ternary - ? wrapperAttributes.getNamedItem('data-animation-path').value - : wrapperAttributes.getNamedItem('data-bm-path') // eslint-disable-line no-nested-ternary - ? wrapperAttributes.getNamedItem('data-bm-path').value - : wrapperAttributes.getNamedItem('bm-path') - ? wrapperAttributes.getNamedItem('bm-path').value - : ''; - params.animType = wrapperAttributes.getNamedItem('data-anim-type') // eslint-disable-line no-nested-ternary - ? wrapperAttributes.getNamedItem('data-anim-type').value - : wrapperAttributes.getNamedItem('data-bm-type') // eslint-disable-line no-nested-ternary - ? wrapperAttributes.getNamedItem('data-bm-type').value - : wrapperAttributes.getNamedItem('bm-type') // eslint-disable-line no-nested-ternary - ? wrapperAttributes.getNamedItem('bm-type').value - : wrapperAttributes.getNamedItem('data-bm-renderer') // eslint-disable-line no-nested-ternary - ? wrapperAttributes.getNamedItem('data-bm-renderer').value - : wrapperAttributes.getNamedItem('bm-renderer') - ? wrapperAttributes.getNamedItem('bm-renderer').value - : getRegisteredRenderer() || 'canvas'; - - var loop = wrapperAttributes.getNamedItem('data-anim-loop') // eslint-disable-line no-nested-ternary - ? wrapperAttributes.getNamedItem('data-anim-loop').value - : wrapperAttributes.getNamedItem('data-bm-loop') // eslint-disable-line no-nested-ternary - ? wrapperAttributes.getNamedItem('data-bm-loop').value - : wrapperAttributes.getNamedItem('bm-loop') - ? wrapperAttributes.getNamedItem('bm-loop').value - : ''; - if (loop === 'false') { - params.loop = false; - } else if (loop === 'true') { - params.loop = true; - } else if (loop !== '') { - params.loop = parseInt(loop, 10); - } - var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') // eslint-disable-line no-nested-ternary - ? wrapperAttributes.getNamedItem('data-anim-autoplay').value - : wrapperAttributes.getNamedItem('data-bm-autoplay') // eslint-disable-line no-nested-ternary - ? wrapperAttributes.getNamedItem('data-bm-autoplay').value - : wrapperAttributes.getNamedItem('bm-autoplay') - ? wrapperAttributes.getNamedItem('bm-autoplay').value - : true; - params.autoplay = autoplay !== 'false'; - - params.name = wrapperAttributes.getNamedItem('data-name') // eslint-disable-line no-nested-ternary - ? wrapperAttributes.getNamedItem('data-name').value - : wrapperAttributes.getNamedItem('data-bm-name') // eslint-disable-line no-nested-ternary - ? wrapperAttributes.getNamedItem('data-bm-name').value - : wrapperAttributes.getNamedItem('bm-name') - ? wrapperAttributes.getNamedItem('bm-name').value - : ''; - var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') // eslint-disable-line no-nested-ternary - ? wrapperAttributes.getNamedItem('data-anim-prerender').value - : wrapperAttributes.getNamedItem('data-bm-prerender') // eslint-disable-line no-nested-ternary - ? wrapperAttributes.getNamedItem('data-bm-prerender').value - : wrapperAttributes.getNamedItem('bm-prerender') - ? wrapperAttributes.getNamedItem('bm-prerender').value - : ''; - - if (prerender === 'false') { - params.prerender = false; - } - if (!params.path) { - this.trigger('destroy'); - } else { - this.setParams(params); - } -}; - -AnimationItem.prototype.includeLayers = function (data) { - if (data.op > this.animationData.op) { - this.animationData.op = data.op; - this.totalFrames = Math.floor(data.op - this.animationData.ip); - } - var layers = this.animationData.layers; - var i; - var len = layers.length; - var newLayers = data.layers; - var j; - var jLen = newLayers.length; - for (j = 0; j < jLen; j += 1) { - i = 0; - while (i < len) { - if (layers[i].id === newLayers[j].id) { - layers[i] = newLayers[j]; - break; - } - i += 1; - } - } - if (!!this.renderer) { - if (data.chars || data.fonts) { - this.renderer.globalData.fontManager.addChars(data.chars); - this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs); - } - } - if (data.assets) { - len = data.assets.length; - for (i = 0; i < len; i += 1) { - this.animationData.assets.push(data.assets[i]); - } - } - this.animationData.__complete = false; - dataManager.completeAnimation( - this.animationData, - this.onSegmentComplete - ); -}; - -AnimationItem.prototype.onSegmentComplete = function (data) { - this.animationData = data; - var expressionsPlugin = getExpressionsPlugin(); - if (expressionsPlugin) { - expressionsPlugin.initExpressions(this); - } - this.loadNextSegment(); -}; - -AnimationItem.prototype.loadNextSegment = function () { - var segments = this.animationData.segments; - if (!segments || segments.length === 0 || !this.autoloadSegments) { - this.trigger('data_ready'); - this.timeCompleted = this.totalFrames; - return; - } - var segment = segments.shift(); - this.timeCompleted = segment.time * this.frameRate; - var segmentPath = this.path + this.fileName + '_' + this.segmentPos + '.json'; - this.segmentPos += 1; - dataManager.loadData(segmentPath, this.includeLayers.bind(this), function () { - this.trigger('data_failed'); - }.bind(this)); -}; - -AnimationItem.prototype.loadSegments = function () { - var segments = this.animationData.segments; - if (!segments) { - this.timeCompleted = this.totalFrames; - } - this.loadNextSegment(); -}; - -AnimationItem.prototype.imagesLoaded = function () { - this.trigger('loaded_images'); - this.checkLoaded(); -}; - -AnimationItem.prototype.preloadImages = function () { - this.imagePreloader.setAssetsPath(this.assetsPath); - this.imagePreloader.setPath(this.path); - this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this)); -}; - -AnimationItem.prototype.configAnimation = function (animData, isNetLoad) { - if (isNetLoad != undefined) { - this.isNetLoad = isNetLoad - } - if (!this.renderer) { - return; - } - try { - this.animationData = animData; - this.renderer.configAnimation(animData); - if (!animData.assets) { - animData.assets = []; - } - - this.assets = this.animationData.assets; - if(!this.animationData.fr || this.animationData.fr <= 0) { - this.frameRate = 10; - LogUtil.warn(`${this._getLogTag()} with 0 fr. use ${this.frameRate} instead.`); - } else { - this.frameRate = this.animationData.fr; - } - this.frameMult = this.frameRate / 1000; - this.renderer.searchExtraCompositions(animData.assets); - this.markers = markerParser(animData.markers || []); - - this.trigger('config_ready', this); - this.preloadImages(); - this.loadSegments(); - this.updateFrameModifier(); - this.waitForFontsLoaded(); - if (this.isPaused) { - this.audioController.pause(); - } - - if (this.initialSegment) { - this.setSegment(this.initialSegment[0], this.initialSegment[1]); - } else { - this.setSegment(this.animationData.ip, this.animationData.op); - } - - } catch (error) { - LogUtil.warn(`${this._getLogTag()} exception in configAnimation: ${error.message} , ${error.stack}`); - this.triggerConfigError(error); - } -}; - -AnimationItem.prototype.waitForFontsLoaded = function () { - if (!this.renderer) { - return; - } - if (this.renderer.globalData.fontManager.isLoaded) { - this.checkLoaded(); - } else { - setTimeout(this.waitForFontsLoaded.bind(this), 20); - } -}; - -AnimationItem.prototype.checkLoaded = function () { - if (!this.renderer) { - return; - } - if (!this.isLoaded - && this.renderer.globalData.fontManager.isLoaded - && (this.imagePreloader.loadedImages() || this.renderer.rendererType !== 'canvas') - && (this.imagePreloader.loadedFootages()) - ) { - this.isLoaded = true; - var expressionsPlugin = getExpressionsPlugin(); - if (expressionsPlugin) { - expressionsPlugin.initExpressions(this); - } - this.renderer.initItems(); - setTimeout(function() { - this.trigger('DOMLoaded', this); - }.bind(this), 0); - - LogUtil.info(`${this._getLogTag()} created from ${this.source ? this.source : 'data'}`); - - if (this.autoplay) { - this.isFirstLoaded = true; - if (!this._isCanvasStatusDeterminate) { - LogUtil.warn(`${this._getLogTag()} playing with indeterminate canvas(${this.wrapper?.canvas?.getUniqueId()}) status.`); - } - this.play(); - } else { - this.gotoCurrentFrame(); - } - } -}; - -AnimationItem.prototype.setContentMode = function (contentMode) { - //防止this.renderer为null,导致读取updateContentMode属性失败 - if (!!this.renderer && contentMode) { - LogUtil.info(`${this._getLogTag()} setContentMode: ${contentMode}`); - this.renderer.updateContentMode(contentMode); - } -}; - -/* - * 注意:这里虽然叫setFrameRate, 但本质是为了设置"播放帧率", 而不是动画源帧率. 动画源帧率是固定值. - */ -AnimationItem.prototype.setFrameRate = function (playingFrameRate) { - LogUtil.info(`${this._getLogTag()} setFrameRate: ${playingFrameRate}`); - - this.userPlayingFrameRate = playingFrameRate; -}; - -/* - * 注意:这里虽然叫getFrameRate, 但本质是为了获取"播放帧率", 而不是动画源帧率. 在获取动画源帧率时不可调用此接口. - * 此处保持与setFrameRate命名风格一致是为了保持对称. 由于setFrameRate接口已经开出去了, 不能再更改. - */ -AnimationItem.prototype.getFrameRate = function () { - if (this.userPlayingFrameRate > 0 && this.userPlayingFrameRate <= 120) { - return this.userPlayingFrameRate; - } else { - return this.frameRate; - } -} - -AnimationItem.prototype.resize = function (width, height) { - // Adding this validation for backwards compatibility in case an event object was being passed down - let _width = typeof width === 'number' ? width : undefined; - let _height = typeof height === 'number' ? height : undefined; - - //防止this.renderer为null,导致读取updateContainerSize属性失败 - if (!!this.renderer && !!this.renderer.updateContainerSize) { - this.renderer.updateContainerSize(_width, _height); - } -}; - -AnimationItem.prototype.setSubframe = function (flag) { - LogUtil.info(`${this._getLogTag()} setSubframe: ${flag}`); - - this.isSubframeEnabled = !!flag; -}; - -AnimationItem.prototype.gotoCurrentFrame = function (skipOverdraw) { - - if (this.timeCompleted !== this.totalFrames && this.absoluteFrameToPlay > this.timeCompleted) { - this.absoluteFrameToPlay = this.timeCompleted; - } - - if (!skipOverdraw || this._absoluteFramePlayed !== this.absoluteFrameToPlay) { - if (this.renderCurrentFrame()) { - this._absoluteFramePlayed = this.absoluteFrameToPlay; - return true; - } - } - - return false; -}; - -AnimationItem.prototype.changeColor = function (color, endColor, layer, index) { - if (!this.renderer) { - return; - } - LogUtil.info(`${this._getLogTag()} changeColor: ${color}-${endColor}, ${layer} layer, ${index} element`); - - try { - this.renderer.changeColor(color, endColor, layer, index); - this.renderer.renderFrame(this.absoluteFrameToPlay, true); - this.gotoCurrentFrame(false); - } catch (error) { - LogUtil.warn(`${this._getLogTag()} exception in changeColor: ${error.message}`); - // TODO: decide how to handle catch case - } -} - -AnimationItem.prototype.renderCurrentFrame = function () { - if (this.isLoaded === false || !this.renderer) { - return false; - } - - let frameToPlay = this.isSubframeEnabled ? this.absoluteFrameToPlay: Math.floor(this.absoluteFrameToPlay); - try { - this.trigger('enterFrame'); - this.renderer.renderFrame(frameToPlay); - this.trigger('drawnFrame'); - } catch (error) { - LogUtil.warn(`${this._getLogTag()} exception in renderCurrentFrame: ${error.message} , ${error.stack}`); - this.triggerRenderFrameError(error); - return false; - } - - return true; -}; - -AnimationItem.prototype._updateIdleStatus = function () { - if (this.isPaused || (!this._hasArea && this.isAutoSkip)) { - if (!this._idle) { - this._idle = true; - this.trigger('_idle', this); - } - } else { - if (this._idle) { - this._idle = false; - this.trigger('_active', this); - } - } -}; - -AnimationItem.prototype._visibleAreaChanged = function (canvasUniqueId, isVisible) { - let hasArea = this._hasArea; - this._hasArea = isVisible; - if (hasArea !== this._hasArea) { - LogUtil.info(`${this._getLogTag()} canvas(${canvasUniqueId}) is ${isVisible ? 'moved in' : 'moved out'}`); - this._updateIdleStatus(); - } -}; - -AnimationItem.prototype.play = function (name) { - if (name && this.name !== name) { - return; - } - LogUtil.info(`${this._getLogTag()} play: ${this.isPaused ? 'paused' : 'playing'}`); - - if (this.isPaused === true) { - this.isPaused = false; - this.lastTimestamp = 0; //此处赋值不可省掉,它决定了时间是否暂停 - this.trigger('_play'); - LogUtil.info(`${this._getLogTag()} is playing`); - this.audioController.resume(); - this._updateIdleStatus(); - } -}; - -AnimationItem.prototype.pause = function (name) { - if (name && this.name !== name) { - return; - } - LogUtil.info(`${this._getLogTag()} pause: ${this.isPaused ? 'paused' : 'playing'}`); - - if (this.isPaused === false) { - this.isPaused = true; - this.trigger('_pause'); - LogUtil.info(`${this._getLogTag()} is paused`); - this._updateIdleStatus(); - this.audioController.pause(); - } -}; - -AnimationItem.prototype.togglePause = function (name) { - if (name && this.name !== name) { - return; - } - LogUtil.info(`${this._getLogTag()} togglePause: ${this.isPaused ? 'paused' : 'playing'}`); - if (this.isPaused === true) { - this.play(); - } else { - this.pause(); - } -}; - -AnimationItem.prototype.getNextFrameToPlay = function (frames) { - if(frames < 0) { - frames = -frames; - } - - let nextFrame = frames; - if((this._direction > 0 && this.firstFrame > this.endFrame) // 逆序segment且正向播放 - || (this._direction < 0 && this.firstFrame < this.endFrame)) { // 正序segment且逆向播放 - //改为用大值(初始值)作为起点 - nextFrame = this.totalFrames - 1 - frames; - } - - return nextFrame; -}; - -AnimationItem.prototype._complete = function (name, explicitly) { - if (name && this.name !== name) { - return; - } - - this.pause(); - LogUtil.info(`${this._getLogTag()} completed${explicitly ? ' explicitly' : - ''}. playing ${this.playCount} times`); - // 如果是人工干预停止, 则不触发事件回调,保持与旧版本逻辑相同 - if (!explicitly) { - this.trigger('complete'); - } - this.playCount = 0; -}; - -AnimationItem.prototype.stop = function (name) { - if (name && this.name !== name) { - return; - } - - LogUtil.info(`${this._getLogTag()} stop: ${this.isPaused ? 'paused' : 'playing'}`); - let nextFrame = this.getNextFrameToPlay(0); - this.gotoRelativeFrame(nextFrame); - this._complete(name, true); -}; - -AnimationItem.prototype.getMarkerData = function (markerName) { - var marker; - for (var i = 0; i < this.markers.length; i += 1) { - marker = this.markers[i]; - if (marker.payload && marker.payload.name === markerName) { - return marker; - } - } - return null; -}; - -AnimationItem.prototype.goToAndStop = function (framesOrMarker, isFrame, name) { - if (name && this.name !== name) { - return; - } - LogUtil.info(`${this._getLogTag()} goToAndStop: ${framesOrMarker} ${isFrame ? 'frame' : 'ms(or marker)'} ${name ? name : ''}`); - - if (Number.isNaN(framesOrMarker)) { - LogUtil.info(`${this._getLogTag()} goToAndStop: frame is NaN`); - return; - } - - if (isFrame) { - let nextFrame = this.getNextFrameToPlay(framesOrMarker); - this.goToFrame(nextFrame); - } else { - let numValue = Number(framesOrMarker); - if (isNaN(numValue)) { - let marker = this.getMarkerData(framesOrMarker); - if (marker) { - this.playCount = 0; - if (!marker.duration) { - let nextFrame = this.adjustSegment([marker.time, this.animationData.op]); - this.goToFrame(nextFrame); - } else { - let nextFrame = this.adjustSegment([marker.time, marker.time + marker.duration]); - this.goToFrame(nextFrame); - } - } - } else { - let nextFrame = this.getNextFrameToPlay(framesOrMarker * this.frameModifier); - this.goToFrame(nextFrame); - } - } - - this.pause(); -}; - -AnimationItem.prototype.goToAndPlay = function (framesOrMarker, isFrame, name) { - if (name && this.name !== name) { - return; - } - LogUtil.info(`${this._getLogTag()} goToAndPlay: ${framesOrMarker} ${isFrame ? 'frame' : - 'ms(or marker)'} ${name ? name : ''}`); - - if (Number.isNaN(framesOrMarker)) { - this.goToAndStop(this.firstFrame, isFrame, name); - } else { - this.goToAndStop(framesOrMarker, isFrame, name); - } - - this.play(); -}; - -AnimationItem.prototype.resume = function (timeStamp, displaySynced) { - if (this.isPaused === true || this.isLoaded === false) { - this.lastTimestamp = timeStamp; - return; - } else if (!this._hasArea && this.isAutoSkip) { //canvas完全隐藏且用户不要求强行绘制时,跳过执行绘制。 - return; - } - - if(displaySynced && this.isFirstLoaded) { - /* - * 刚刚加载完动画后,displaySync首帧的timestamp还是加载动画之前的vsync所携带的时间戳,在动画解析时间过长的场景下该timestamp会过早从而引起跳帧。 - * 比如解析30fps动画,假设需要210ms,则时间戳会提前210ms左右,导致绘制逻辑计算后会跳过7帧。 - * 通过简单跳过并直接绘制首帧来workaround。最终表现为首帧会多显示2个左右的周期。 - * TODO: 如果能够将负载卸载到其它线程,降低主线程负载,则可将此逻辑优化掉,否则需要保留,以便保证从首帧开始播放 - */ - LogUtil.info(`${this._getLogTag()} first play.`); - this.isFirstLoaded = false; - this.lastTimestamp = 0; - this.advanceTime(0); // 播放当前帧 - return; - } - - if (this.lastTimestamp === 0) { - LogUtil.info(`${this._getLogTag()} start for drawing.`); - this.advanceTime(0); // 播放当前帧 - } else { - let elapsedTime = timeStamp - this.lastTimestamp; // displaySync.onframe回调处理会保证timeStamp单调性,不受设备时间调整的影响 - - this.advanceTime(elapsedTime); - } - this.lastTimestamp = timeStamp; -} - -AnimationItem.prototype.advanceTime = function (elapsedTime) { - let nextFrame = this.absoluteFrameToRelative(this.absoluteFrameToPlay) + elapsedTime * this.frameModifier; - if (nextFrame >= this.totalFrames || nextFrame < 0) { - let frames = nextFrame; - if(nextFrame < 0) { - frames = -nextFrame + this.totalFrames; - } - - let loop = true; - while (frames >= this.totalFrames && loop) { - frames -= this.totalFrames; - loop = this.checkLoop(); - } - - if(!loop) { - frames = this.totalFrames - 1; - } - nextFrame = this.getNextFrameToPlay(frames); - } - - this.gotoRelativeFrame(nextFrame); -}; - -/* - * 在前后台切换场景下,会出现时间戳跳变的情况。 - * 此时需要计算出正确的下一帧,并更新playCount次数 - */ -AnimationItem.prototype.checkLoop = function () { - if ( this.checkSegments() !== -1 ) { - return true; - } - - this.playCount += 1; - - // total playing 1 times when this.loop = 0, 2 times when loop = 1, 3 times when loop = 2, and so on. - if (this.loop === true || this.playCount <= this.loop) { - this.trigger('loopComplete'); - let currentTimestamp = Date.now(); - if ((currentTimestamp - this._firstTime) > this._loopCompleteTime) { - this._firstTime = currentTimestamp; - LogUtil.info(`${this._getLogTag()} loopComplete name: ${this.name} from ${this.source}, canvas uniqueId is: ${this.wrapper?.canvas?.getUniqueId()}`); - this.renderer?.updateContainerSize(undefined, undefined, true); - } - return true; - } else { - //达到预期参数, 正常播放完成. 停留在最后一个segment上。TODO 可考虑从第1个segment重新开始。这需要不从segments序列中清除segment,并把segmentPos变量利用起来, - setTimeout(() => { - this._complete(); - }, 0); - } - - return false; -}; - -AnimationItem.prototype.adjustSegment = function (arr) { - let nextFrame = -1; - if(arr[0] === arr[1]) { - // 区间为左闭右开,因此相同左右值意味着没有可用帧,直接返回无效帧 - return nextFrame; - } - - if (arr[1] < arr[0]) { - this.totalFrames = arr[0] - arr[1]; - this.offsetFrame = arr[1] + 1; // 从大到小播放时,小值作为目的帧需要被排除, 而大值需被包含,整体偏移1帧保证"左闭右开"区间 - } else { - this.totalFrames = arr[1] - arr[0]; - this.offsetFrame = arr[0]; - } - - this.timeCompleted = this.totalFrames; - this.firstFrame = arr[0]; - this.endFrame = arr[1]; - this.updateFrameModifier(); - - nextFrame = this.getNextFrameToPlay(0); - - this.trigger('segmentStart'); - return nextFrame; -}; - -AnimationItem.prototype.setSegment = function (init, end) { - LogUtil.info(`${this._getLogTag()} setSegment: ${init} ~ ${end}`); - let nextFrame = this.adjustSegment([init, end]); - this.gotoRelativeFrame(nextFrame); -}; - -AnimationItem.prototype.playSegments = function (arr, forceFlag) { - LogUtil.info(`${this._getLogTag()} playSegments: ${arr}, ${forceFlag ? 'immediate' : 'deferred'}`); - - if (forceFlag) { - this.segments.length = 0; - } - let segmentAvailable = false; - if (typeof arr[0] === 'object') { // [ [x,x], [x,x], ...] - for (let i = 0; i < arr.length; i += 1) { - if (arr[i].length >= 2) { - this.segments.push(arr[i]); - segmentAvailable = true; - } - } - } else { // [x,x] - if (arr.length >= 2) { - this.segments.push(arr); - segmentAvailable = true; - } - } - - if(!segmentAvailable) { - return; - } - - if (forceFlag) { - this.playCount = 0; //replay - let nextFrame = this.checkSegments(); - this.gotoRelativeFrame(nextFrame); - } - - if (this.isPaused) { - this.play(); - } -}; - -AnimationItem.prototype.resetSegments = function (forceFlag) { - LogUtil.info(`${this._getLogTag()} resetSegments: ${forceFlag ? 'immediate' : 'deferred'}`); - - this.segments.length = 0; - this.segments.push([this.animationData.ip, this.animationData.op]); - if (forceFlag) { - this.playCount = 0; //replay - let nextFrame = this.checkSegments(); - this.gotoRelativeFrame(nextFrame); - } -}; - -AnimationItem.prototype.checkSegments = function () { - let nextFrame = -1; - while (this.segments.length) { - nextFrame = this.adjustSegment(this.segments.shift()) - if(nextFrame !== -1) { - break; - } - // 跳过空片段 - } - return nextFrame; -}; - -AnimationItem.prototype.destroy = function (name) { - if (name && this.name !== name) { - return; - } - LogUtil.info(`${this._getLogTag()} destroy${name ? name : - ''}, canvas uniqueId: ${this.wrapper?.canvas?.getUniqueId()}`); - LogUtil.version(); - this.stop() // stop the animation because it is dying - if (this.renderer) { - this.renderer.destroy(); - this.renderer = null; - } - if (this.imagePreloader) { - this.imagePreloader.destroy(); - this.imagePreloader = null; - } - this.trigger('destroy'); - this._cbs = null; - this.onEnterFrame = null; - this.onLoopComplete = null; - this.onComplete = null; - this.onSegmentStart = null; - this.onDestroy = null; - this.projectInterface = null; -}; - -AnimationItem.prototype.relativeFrameToAbsolute = function (relativeFrame) { - return relativeFrame + this.offsetFrame; -}; - -AnimationItem.prototype.absoluteFrameToRelative = function (absoluteFrame) { - return absoluteFrame - this.offsetFrame; -}; - -AnimationItem.prototype.gotoRelativeFrame = function (nextValue) { - let nextFrame; - if (this.totalFrames === nextValue) { - nextFrame = nextValue; - } else { - nextFrame = nextValue % this.totalFrames; - } - - if (nextFrame < 0) { - nextFrame += this.totalFrames; - } - - this.absoluteFrameToPlay = this.relativeFrameToAbsolute(nextFrame); - this.gotoCurrentFrame(true); -}; - -AnimationItem.prototype.goToFrame = function (nextValue) { - let nextFrame = nextValue; - if (nextFrame < 0) { - nextFrame += this.totalFrames; - } - - this.absoluteFrameToPlay = this.relativeFrameToAbsolute(nextFrame); - this.gotoCurrentFrame(true); -}; - -AnimationItem.prototype.setSpeed = function (val) { - LogUtil.info(`${this._getLogTag()} setSpeed: ${val}`); - if (val === 0) { - this.pause(); // 参考 index.d.ts setSpeed的对外声明:speed>0正向播放, speed<0反向播放, speed=0暂停播放, speed=1.0/-1.0正常速度播放 - return; - } - - if (val > 0) { - this.setDirection(1); - } else { - this.setDirection(-1); - } - - let speed = Math.abs(val); // 参考 index.d.ts playSpeed的对外声明:播放速率 - if (this._speed !== speed) { - this._speed = speed; - this.updateFrameModifier(); - } -}; - -AnimationItem.prototype.setDirection = function (val) { - let direction = val < 0 ? -1 : 1; - if(this._direction !== direction) { - LogUtil.info(`${this._getLogTag()} setDirection: ${val}`); - - this._direction = direction; - this.updateFrameModifier(); - } -}; - -AnimationItem.prototype.toggleDirection = function () { - LogUtil.info(`${this._getLogTag()} toggleDirection. current is ${this._direction}`); - this._direction = -this._direction; - this.updateFrameModifier(); -}; - -AnimationItem.prototype.setLoop = function (isLooping) { - this.loop = isLooping; -}; - -AnimationItem.prototype.setVolume = function (val, name) { - if (name && this.name !== name) { - return; - } - this.audioController.setVolume(val); -}; - -AnimationItem.prototype.getVolume = function () { - return this.audioController.getVolume(); -}; - -AnimationItem.prototype.mute = function (name) { - if (name && this.name !== name) { - return; - } - LogUtil.info(`${this._getLogTag()} mute: ${name ? name : ''}`); - - this.audioController.mute(); -}; - -AnimationItem.prototype.unmute = function (name) { - if (name && this.name !== name) { - return; - } - LogUtil.info(`${this._getLogTag()} unmute: ${name ? name : ''}`); - - this.audioController.unmute(); -}; - -AnimationItem.prototype.updateFrameModifier = function () { - let direction = 1; - if (this.firstFrame > this.endFrame) { - direction = this._direction > 0 ? -1 : 1; //由大到小播放时,正向需要用负值,反向需要正值 - } else { - direction = this._direction > 0 ? 1 : -1; - } - - let modifier = this._speed * direction; - this.frameModifier = this.frameMult * modifier; - this.audioController.setRate(modifier); -}; - -AnimationItem.prototype.getPath = function () { - return this.path; -}; - -AnimationItem.prototype.getAssetsPath = function (assetData) { - var path = ''; - if (assetData.e) { - path = assetData.p; - } else if (this.assetsPath) { - var imagePath = assetData.p; - if (imagePath.indexOf('images/') !== -1) { - imagePath = imagePath.split('/')[1]; - } - path = this.assetsPath + imagePath; - } else { - path = this.path; - path += assetData.u ? assetData.u : ''; - path += assetData.p; - } - return path; -}; - -AnimationItem.prototype.getAssetData = function (id) { - var i = 0; - var len = this.assets.length; - while (i < len) { - if (id === this.assets[i].id) { - return this.assets[i]; - } - i += 1; - } - return null; -}; - -AnimationItem.prototype.hide = function () { - LogUtil.info(`${this._getLogTag()} hide.`); - if (!this.renderer) { - return; - } - this.renderer.hide(); -}; - -AnimationItem.prototype.show = function () { - LogUtil.info(`${this._getLogTag()} show.`); - if (!this.renderer) { - return; - } - this.renderer.show(); -}; - -AnimationItem.prototype.getDuration = function (isFrame) { - let duration = isFrame ? this.totalFrames : this.totalFrames / this.frameRate; - LogUtil.info(`${this._getLogTag()} getDuration: total ${duration} ${isFrame ? 'frames' : 's'}`); - return duration; -}; - -AnimationItem.prototype.updateDocumentData = function (path, documentData, index) { - if (!this.renderer) { - return; - } - try { - var element = this.renderer.getElementByPath(path); - element.updateDocumentData(documentData, index); - } catch (error) { - LogUtil.warn(`${this._getLogTag()} exception in updateDocumentData: ${error.message}`); - // TODO: decide how to handle catch case - } -}; - -AnimationItem.prototype.trigger = function (name, args) { - if (this._cbs && this._cbs[name]) { - switch (name) { - case 'enterFrame': - this.triggerEvent(name, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameModifier)); - break; - case 'drawnFrame': - this.drawnFrameEvent.currentTime = this.currentFrame; - this.drawnFrameEvent.totalTime = this.totalFrames; - this.drawnFrameEvent.direction = this.frameModifier; - this.triggerEvent(name, this.drawnFrameEvent); - break; - case 'loopComplete': - this.triggerEvent(name, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult)); - break; - case 'complete': - this.triggerEvent(name, new BMCompleteEvent(name, this.frameMult)); - break; - case 'segmentStart': - this.triggerEvent(name, new BMSegmentStartEvent(name, this.offsetFrame, this.totalFrames)); - break; - case 'destroy': - this.triggerEvent(name, new BMDestroyEvent(name, this)); - break; - default: - this.triggerEvent(name, args); - } - } - if (name === 'enterFrame' && this.onEnterFrame) { - this.onEnterFrame.call(this, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameMult)); - } - if (name === 'loopComplete' && this.onLoopComplete) { - this.onLoopComplete.call(this, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult)); - } - if (name === 'complete' && this.onComplete) { - this.onComplete.call(this, new BMCompleteEvent(name, this.frameMult)); - } - if (name === 'segmentStart' && this.onSegmentStart) { - this.onSegmentStart.call(this, new BMSegmentStartEvent(name, this.offsetFrame, this.totalFrames)); - } - if (name === 'destroy' && this.onDestroy) { - this.onDestroy.call(this, new BMDestroyEvent(name, this)); - } -}; - -AnimationItem.prototype.triggerRenderFrameError = function (nativeError) { - var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame); - this.triggerEvent('error', error); - - if (this.onError) { - this.onError.call(this, error); - } - LogUtil.error(`${this._getLogTag()} triggerRenderFrameError: ${JSON.stringify(error)}`); -}; - -AnimationItem.prototype.triggerConfigError = function (nativeError) { - var error = new BMConfigErrorEvent(nativeError, this.currentFrame); - this.triggerEvent('error', error); - - if (this.onError) { - this.onError.call(this, error); - } - LogUtil.error(`${this._getLogTag()} triggerConfigError: ${JSON.stringify(error)}`); -}; - -export default AnimationItem; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/animation/AnimationManager.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/animation/AnimationManager.js deleted file mode 100644 index ddbef4188af614bc2922ff59b879a85e7ff1b9f5..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/animation/AnimationManager.js +++ /dev/null @@ -1,1486 +0,0 @@ -import createTag from '../utils/helpers/html_elements'; -import AnimationItem from './AnimationItem'; -import displaySync from '@ohos.graphics.displaySync' -import animator from '@ohos.animator'; -import fs from '@ohos.file.fs'; -import bez from '../utils/bez'; -import { LogUtil } from '../utils/LogUtil' -import deviceInfo from '@ohos.deviceInfo'; -import { isExistNetworkAssets } from '../utils/DataUtil'; -import { unlinkSync, unlink, rmdirSync, listFileSyncs } from '../utils/FileUtil' - -let _nextIdInCoordinator = 0; -const Coordinator = function() { - this._context2dShadows = new WeakMap(); - this._context2dCallbacks = new WeakMap(); - this._canvasShadows = new WeakMap(); -}; - -Coordinator.prototype._getLogTag = function() { - return ''; -}; - -Coordinator.prototype._getOrCreateCanvasShadow = function(canvas) { - if (!canvas) { - return {}; - } - let canvasShadow = this._canvasShadows.get(canvas); - if (canvasShadow) { - return canvasShadow; - } - canvasShadow = { - canvas, // G.OBJ.03 推荐在对象字面量中使用方法简写和属性简写 - status: { - hasArea: undefined, - }, - context2dShadow: undefined, - }; - this._canvasShadows.set(canvas, canvasShadow); - - // 以下2个接口未支持链式调用, 此处注册有可能会覆盖此前其它处理逻辑所注册的处理逻辑. 当然其它处理逻辑也可能影响coordinator的行为. - // 应避免不同的处理逻辑同时针对同一个canvas节点进行注册. 此处输出日志便于维测. - LogUtil.warn(`${this._getLogTag()} coordinator register canvas(${canvas.getUniqueId()}) callbacks.`); - canvas.commonEvent.setOnVisibleAreaApproximateChange( - { ratios: [0], expectedUpdateInterval: 500 }, - this._onVisibleAreaApproximateChange.bind(this, canvas)); - - return canvasShadow; -}; - -Coordinator.prototype._isNodeAndAncestorVisible = function (node) { - if (!node) { - return false; - } - - let isVisible = node.isVisible(); - let parent = node.getParent(); - while (parent && isVisible) { - isVisible = parent.isVisible(); - parent = parent.getParent(); - } - return isVisible; -}; - -Coordinator.prototype._notifyAnimationCanvasHasArea = function (animation, hasArea, context2dShadow) { - /* - * 影子数据的构建是依赖各种回调被依次调用,才能逐步完成. 在被构建出来之前, 存在 canvas 状态未知的情形 - */ - if (!animation) { - return; - } - - let canvas = context2dShadow.canvasShadow?.canvas; - let canvasUniqueId = canvas?.getUniqueId(); - let _hasArea = hasArea; - if (_hasArea !== true && _hasArea !== false) { - // canvas节点可见性状态未知, 此时canvas可能早已创建过, 也可能刚刚开始创建, 通过获取一次当前状态进行辅助判断 - let isAttached = canvas?.isAttached(); - let isVisible = this._isNodeAndAncestorVisible(canvas); - LogUtil.warn(`${this._getLogTag()} canvas(${canvasUniqueId}) is ${isAttached ? 'attached to' : - 'detached from'} UItree and ${isVisible ? 'visible' : 'invisible'}`); - if (!isAttached || !isVisible) { - _hasArea = false; - } else if (context2dShadow.option.preferredNoArea) { - LogUtil.info(`${this._getLogTag()} regard canvas(${canvasUniqueId}) as no visible area.`); - _hasArea = false; - } - } - - if (_hasArea === true || _hasArea === false) { - animation.onCanvasHasVisibleArea(canvasUniqueId, _hasArea); - } else { - // 即便canvas是在树上且visible, 也不意味着节点是具备可见面积的, 为保持前向兼容, 此时不对animation做主动通知 - LogUtil.warn(`${this._getLogTag()} do NOT notify animation(${animation.animationID}) for indeterminate canvas(${canvasUniqueId}) status.`); - } -}; - -Coordinator.prototype._onVisibleAreaApproximateChange = function(canvas, isVisible) { - let uniqueId = canvas?.getUniqueId(); - LogUtil.info(`${this._getLogTag()} canvas(${uniqueId}) visible area changed to ${isVisible}.`); - if (!canvas) { - return; - } - let canvasShadow = this._getOrCreateCanvasShadow(canvas); - canvasShadow.status.hasArea = isVisible; - - this._notifyAnimationCanvasHasArea(canvasShadow.context2dShadow?.animation, isVisible, - canvasShadow.context2dShadow); -}; - -Coordinator.prototype._onContext2dAttachedToCanvas = function (context2d) { - if (!context2d) { - return; - } - let { canvas } = context2d; - let canvasUniqueId = canvas?.getUniqueId(); - let context2dShadow = this._context2dShadows.get(context2d); - LogUtil.info(`${this._getLogTag()} context2d(${context2dShadow?._id}) attached to canvas(${canvasUniqueId})`); - if (!canvas) { - return; - } - let canvasShadow = this._getOrCreateCanvasShadow(canvas); - canvasShadow.context2dShadow = context2dShadow; - - if (context2dShadow?.canvasShadow !== canvasShadow) { - context2dShadow.canvasShadow = canvasShadow; - } else { - LogUtil.warn(`${this._getLogTag()} context2d(${context2dShadow?._id}) already attached to the same canvas(${canvasUniqueId}).`); - } - - this._onVisibleAreaApproximateChange(canvasShadow.canvas, canvasShadow.status.hasArea); -}; - -Coordinator.prototype._onContext2dDetachedFromCanvas = function (context2d) { - if (!context2d) { - return; - } - let context2dShadow = this._context2dShadows.get(context2d); - let canvas = context2dShadow?.canvasShadow?.canvas; - let canvasUniqueId = canvas?.getUniqueId(); - LogUtil.info(`${this._getLogTag()} context2d(${context2dShadow?._id}) detached from canvas(${canvasUniqueId})`); - - this._notifyAnimationCanvasHasArea(context2dShadow?.animation, false, context2dShadow); - - if (canvas) { - let canvasShadow = this._getOrCreateCanvasShadow(canvas); - if (canvasShadow) { - canvasShadow.context2dShadow = null; - } - } - - if (context2dShadow) { - context2dShadow.canvasShadow = null; // null:确定解绑, undefined:不确定是否绑定 - } -}; - -Coordinator.prototype._getOrCreateContext2dCallback = function (context2d) { - if (!context2d) { - return {}; - } - let callbacks = this._context2dCallbacks.get(context2d); - if (!callbacks) { - // _onContext2dAttachedToCanvas 需要一个额外的context2d作为参数, 需通过bind传递进去 - callbacks = { - onContext2dAttachedToCanvas: this._onContext2dAttachedToCanvas.bind(this, context2d), - onContext2dDetachedFromCanvas: this._onContext2dDetachedFromCanvas.bind(this, context2d), - }; - this._context2dCallbacks.set(context2d, callbacks); - } - return callbacks; -}; - -Coordinator.prototype.setAttachedCanvasHasVisibleArea = function(context2d, hasArea) { - if (!context2d) { - return; - } - let context2dShadow = this._context2dShadows.get(context2d); - if (!context2dShadow) { - LogUtil.warn(`${this._getLogTag()} context2d has not yet bound to coordinator.`); - return; - } - - let canvas = context2dShadow.canvasShadow?.canvas; - if (canvas) { - LogUtil.info(`${this._getLogTag()} fix visible area of canvas(${canvas.getUniqueId()})` + - ` attached to context2d(${context2dShadow._id}) to ${hasArea}`); - this._onVisibleAreaApproximateChange(canvas, hasArea); - } else { - LogUtil.warn(`${this._getLogTag()} context2d(${context2dShadow._id}) has no canvas attached.`); - } -}; - -Coordinator.prototype.isContext2dBoundToCoordinator = function (context2d) { - if (!context2d) { - return false; - } - return this._context2dShadows.has(context2d); -}; - -Coordinator.prototype.bindContext2dToCoordinator = function(context2d) { - if (!context2d) { - return; - } - let context2dShadow = this._context2dShadows.get(context2d); - if (context2dShadow) { - LogUtil.info(`${this._getLogTag()} context2d(${context2dShadow._id}) already attached to coordinator.`); - context2dShadow.option.preferredNoArea = true; - return; - } - this.internalBindContext2dToCoordinator(context2d, true); -}; - -Coordinator.prototype.internalBindContext2dToCoordinator = function (context2d, preferredNoArea) { - if (deviceInfo.sdkApiVersion < 13 || !context2d?.on) { - // 影子数据强依赖context2d的on接口, 只有API 13+才具备. - LogUtil.error(`${this._getLogTag()} API level(${deviceInfo.sdkApiVersion}) is too low.`); - return; - } - - let context2dShadow = { - _id: _nextIdInCoordinator++, - context2d, - option: { - preferredNoArea, // G.OBJ.03 推荐在对象字面量中使用方法简写和属性简写 - }, - animation: undefined, // undefined:不确定是否绑定 - canvasShadow: undefined, // undefined:不确定是否绑定 - }; - this._context2dShadows.set(context2d, context2dShadow); - LogUtil.info(`${this._getLogTag()} bind context2d(${context2dShadow._id}) to coordinator${preferredNoArea ? - ' with no area preferred' : ''}.`); - - let callbacks = this._getOrCreateContext2dCallback(context2d); - context2d.on('onAttach', callbacks.onContext2dAttachedToCanvas); - context2d.on('onDetach', callbacks.onContext2dDetachedFromCanvas); - - let { canvas } = context2d; // G.MET.11 建议使用参数的解构 - if (canvas) { - /* 此时context2d有一个关联到的canvas. 它与context2d有可能是attached的, 也有可能是曾经attached过但又被detached了. - * 为避免误判造成本该活动而未活动, 此处视其为attached的canvas来处理, 并做一次必要的"补调" - */ - LogUtil.warn(`${this._getLogTag()} canvas(${canvas.getUniqueId()}) indeterminate attached or not, treat it as attached.`); - callbacks.onContext2dAttachedToCanvas(); - } else { - context2dShadow.canvasShadow = null; - } -}; - -Coordinator.prototype.unbindContext2dFromCoordinator = function (context2d) { - if (!context2d) { - return; - } - if (deviceInfo.sdkApiVersion < 13) { - // 影子数据强依赖context2d的on接口, 只有API 13+才具备. - LogUtil.error(`${this._getLogTag()} API level(${deviceInfo.sdkApiVersion}) is too low.`); - return; - } - - let context2dShadow = this._context2dShadows.get(context2d); - LogUtil.info(`${this._getLogTag()} unbind context2d(${context2dShadow?._id}) from coordinator`); - - if (!context2dShadow) { - return; - } - - let canvas = context2dShadow.canvasShadow?.canvas; - if (canvas) { - // 这里应该去解注册canvas上的回调, 但解注册接口存在bug, 再次注册时接口会失效. - // 考虑到canvas节点销毁时回调自然会被解掉, 故这里忽略相关的解注册处理, 直接清理cache. - this._canvasShadows.delete(canvas); - } - - let callbacks = this._context2dCallbacks.get(context2d); - if (callbacks && context2d?.off) { - context2d.off('onAttach', callbacks.onContext2dAttachedToCanvas); - context2d.off('onDetach', callbacks.onContext2dDetachedFromCanvas); - } - - this._context2dShadows.delete(context2d); -}; - -Coordinator.prototype.attachAnimationToContext2d = function (context2d, animation) { - if (!context2d) { - return; - } - let context2dShadow = this._context2dShadows.get(context2d); - if (!context2dShadow) { - LogUtil.warn(`${this._getLogTag()} context2d must be bound to coordinator firstly. `); - return; - } - - if (context2dShadow.animation === animation) { - LogUtil.warn(`${this._getLogTag()} animation(${animation?.animationID}) already attached to context2d(${context2dShadow._id}).`); - return; - } - - context2dShadow.animation = animation; - - let { canvasShadow } = context2dShadow; - if (canvasShadow) { - this._onVisibleAreaApproximateChange(canvasShadow.canvas, canvasShadow.status.hasArea); - } -}; - -Coordinator.prototype.detachAnimationFromContext2d = function (context2d) { - if (!context2d) { - return null; - } - let context2dShadow = this._context2dShadows.get(context2d); - if (!context2dShadow) { - return null; - } - - let { animation } = context2dShadow; // G.MET.11 建议使用参数的解构 - context2dShadow.animation = null; // null:确定解绑, undefined:不确定是否绑定 - - return animation; -}; - -/** - * isSkipFrameByOwn需要在初始化时给出, 不能在运行时动态改变. - * 若要支持动态改变, 需要做到动态去除displaysync的投票, 暂无合适接口. - * 销毁后重建displaysync是个可选项, 但涉及到各种状态管理过于复杂. - * 该场景并不常见, 故暂不实现. - **/ -const _DURATION_BY_MS_ = 20000; -const _ALLOWABLE_ERROR_BY_MS_ = 1.5; // timestamp的时间精度为1个ms, 故让容许误差稍大于该值 -const _LEAD_BY_MS_ = 5; // 提前post frameCallback 的时间, 该值不能太小以至于错过vsync, 也不宜太大导致帧率过高. -let _nextIdInLooper = 0; -const Looper = function(uiContext, animations, playFrameCallback, isSkipFrameByOwn) { - this._id = _nextIdInLooper++; - this._uiContext = uiContext; - this._animations = animations; - this._playingAnimationsNum = 0; - this._looperStopped = true; - this._playingFrameRate = 0; - this._looperType = null; - this._displaySync = null; - this._frameCallback = undefined; - this._frameCallbackPosted = 0; - this._animator = null; - this._monotonicTimeStampInMs = 0; - this._lastAnimatorProgress = 0; - this._lastOnFrameTs = 0; - this._lastPlayedFrameTs = 0; - this._expectedFrameTs = 0; - this._periodByMs = 0; - this._playFrameCallback = playFrameCallback; - this._setExpectedFrameRateRangeWrapper = null; - this._isSkipFrameByOwn = isSkipFrameByOwn; - this.__performance = { - lastTimestamp: 0, - frames: 0, - janks: 0, - maxPeriod: 0, - }; - - if (isSkipFrameByOwn) { - if (this._initFrameCallbackLooper()) { - // 主动跳帧时优选frameCallback - return; - } - } - - if (this._initDisplaySyncLooper()) { - return; - } - - // fallback to animator - this._initAnimatorLooper(); -}; - -Looper.prototype._getLogTag = function() { - if (this._uiContext?.getHostContext()?.abilityInfo?.name) { - return ``; - } else { - return ``; - } -}; - -Looper.prototype._skippingFrame = function (timestamp) { - if (this._periodByMs === 0) { - return false; - } - - let supplyingPeriod = 0; - if (this._lastOnFrameTs !== 0) { - supplyingPeriod = timestamp - this._lastOnFrameTs; - } - - let phaseOffset = this._expectedFrameTs - timestamp; - if ((phaseOffset < 0 && phaseOffset > -_ALLOWABLE_ERROR_BY_MS_) || - (phaseOffset > 0 && phaseOffset < _ALLOWABLE_ERROR_BY_MS_)) { - phaseOffset = 0; // 在容许误差范围内则忽略偏差 - } - - let halfPeriod = supplyingPeriod >> 1; - if (phaseOffset > (halfPeriod + _ALLOWABLE_ERROR_BY_MS_)) { - return true; // 偏差离当前vsync过大, 主动跳过本帧 - } - - // 计算下一帧时间戳. 注意js的取模运算与其它语言不同, 会出现负的余数 - this._expectedFrameTs = timestamp + phaseOffset % this._periodByMs + this._periodByMs; - - return false; -}; - -Looper.prototype._baseOnframe = function (timestamp, displaySynced) { - if (this._isSkipFrameByOwn && this._skippingFrame(timestamp)) { - return; - } - - this._playFrameCallback(this._uiContext, timestamp, displaySynced); - - this._performancePeriodically(timestamp); - - this._lastPlayedFrameTs = timestamp; -}; - -Looper.prototype._performancePeriodically = function (timestamp) { - let _DURATION_ = 2_000; // heartbeat every <_DURATION_>ms elapsed - - try { - this.__performance.frames++; - - let supplyingPeriod = timestamp - this._lastPlayedFrameTs; - if (supplyingPeriod > this._periodByMs + _ALLOWABLE_ERROR_BY_MS_ + _ALLOWABLE_ERROR_BY_MS_) { - this.__performance.janks++; - } - - if (supplyingPeriod > this.__performance.maxPeriod) { - this.__performance.maxPeriod = supplyingPeriod; - } - - let elapsedMs = timestamp - this.__performance.lastTimestamp; - if (elapsedMs > _DURATION_) { - this.__performance.frames = 0; - this.__performance.janks = 0; - this.__performance.maxPeriod = 0; - this.__performance.lastTimestamp = timestamp; - } - } catch (e) { - // do nothing. performing does NOT matter - } -}; - -Looper.prototype._baseFirst = function () { - this._monotonicTimeStampInMs = 0; - this._lastPlayedFrameTs = 0; - this._expectedFrameTs = 0; -}; - -Looper.prototype._baseSetExpectedFrameRateRange = function (playingFrameRate) { - LogUtil.info(`${this._getLogTag()} ${this._looperType} running at ${playingFrameRate} HZ`); - this._periodByMs = 1000 / playingFrameRate; - - if (!this._isSkipFrameByOwn) { - if (this._setExpectedFrameRateRangeWrapper) { - this._setExpectedFrameRateRangeWrapper({ min: 0, max: 120, expected: playingFrameRate }); - } else { - LogUtil.warn(`${this._getLogTag()} ${this._looperType} has no displaySync. no frame rate set.`); - } - } else { - // 不做投票, 避免拉低ui帧率 - } -}; - -Looper.prototype._initFrameCallbackLooper = function () { - let apiVersion = deviceInfo?.sdkApiVersion; - if (apiVersion >= 13 && this._uiContext) { - /* 尽管FrameCallback机制在API 12已支持, 但由于它所依赖的uiContext需要从context2d所关联的canvas节点中获取, - * 而API 13及以上才支持从context2d中获取canvas节点, 故只能在API 13及以上才可以使能frameCallback - */ - this._frameCallback = { - onFrame: (timestamp) => { - this._frameCallbackPosted--; // 每次进入回调均意味着消费掉1次frameCallback - - if (this._looperStopped) { - return; - } - - // 确保有且仅有1个frameCallback被post到管线上, 避免frameCallback堆积 - if (this._uiContext && this._frameCallbackPosted <= 0) { - this._uiContext.postDelayedFrameCallback(this._frameCallback, this._periodByMs - _LEAD_BY_MS_); - this._frameCallbackPosted++; - } - - this._lastOnFrameTs = this._monotonicTimeStampInMs; - this._monotonicTimeStampInMs = Math.floor(timestamp / 1000_000); - - this._baseOnframe(this._monotonicTimeStampInMs, true); - }, - }; - LogUtil.info(`${this._getLogTag()} frameCallback created.`); - - this._exportApiByFrameCallback(); - - return true; - } else { - LogUtil.warn(`${this._getLogTag()} api version(${apiVersion}) is too low. frameCallback is disabled.`); - } - - return false; -}; - -Looper.prototype._exportApiByFrameCallback = function() { - // 导出外部可调用方法(内部方法以"_"开头) - this._looperType = 'frameCallback'; - - this.first = function () { - this._baseFirst(); - LogUtil.info(`${this._getLogTag()} ${this._looperType} first`); - }; - - this.start = function () { - LogUtil.info(`${this._getLogTag()} ${this._looperType} start`); - if (this._uiContext) { - if (this._frameCallbackPosted <= 0) { - // 不能无条件post. 如果已有callback被posted, 再次post会造成frameCallback堆积导致高帧率 - this._uiContext.postFrameCallback(this._frameCallback); - this._frameCallbackPosted++; - } - this._looperStopped = false; - } else { - LogUtil.warn(`${this._getLogTag()} ${this._looperType} no uicontext, frameCallback could not work.`); - } - }; - - this.stop = function () { - LogUtil.info(`${this._getLogTag()} ${this._looperType} stop`); - this._looperStopped = true; - }; - - this.setExpectedFrameRateRange = function (playingFrameRate) { - this._baseSetExpectedFrameRateRange(playingFrameRate); - }; -}; - -Looper.prototype._initDisplaySyncLooper = function () { - try { - this._displaySync = displaySync.create(); - this._displaySync.on('frame', (frameInfo) => { - if (this._looperStopped) { - return; - } - - this._lastOnFrameTs = this._monotonicTimeStampInMs; - this._monotonicTimeStampInMs = Math.floor(frameInfo.timestamp / 1000_000); - - this._baseOnframe(this._monotonicTimeStampInMs, true); - }); - LogUtil.info(`${this._getLogTag()} displaySync created.`); - - this._exportApiByDisplaySync(); - - return true; - } catch (e) { - LogUtil.info(`${this._getLogTag()} no displaySync. API version(${deviceInfo?.sdkApiVersion}) may be too low: ${e.message}`); - } - - return false; -}; - -Looper.prototype._exportApiByDisplaySync = function() { - // 导出外部可调用方法(内部方法以"_"开头) - this._looperType = 'displaySync'; - - this.first = function () { - this._baseFirst(); - LogUtil.info(`${this._getLogTag()} ${this._looperType} first`); - }; - - this.start = function () { - if (this._uiContext.getHostContext() !== getContext()) { - LogUtil.warn(`${this._getLogTag()} ${this._looperType} could NOT start cause context not matched`); - return; - } - LogUtil.info(`${this._getLogTag()} ${this._looperType} start`); - this._displaySync.start(); - this._looperStopped = false; - }; - - this.stop = function () { - if (this._uiContext.getHostContext() !== getContext()) { - LogUtil.warn(`${this._getLogTag()} ${this._looperType} could NOT stop cause context not matched`); - return; - } - LogUtil.info(`${this._getLogTag()} ${this._looperType} stop`); - this._looperStopped = true; - this._displaySync.stop(); - }; - - this._setExpectedFrameRateRangeWrapper = this._displaySync.setExpectedFrameRateRange.bind(this._displaySync); - this.setExpectedFrameRateRange = function (playingFrameRate) { - this._baseSetExpectedFrameRateRange(playingFrameRate); - }; -}; - -Looper.prototype._initAnimatorLooper = function () { - let options = { - duration: _DURATION_BY_MS_, - easing: 'linear', - delay: 0, - fill: 'forwards', - direction: 'normal', - iterations: -1, - begin: 0, - end: 1 - }; - this._animator = animator.create(options); - this._registerCallbackForAnimator(); - LogUtil.info(`${this._getLogTag()} animator created.`); - - this._exportApiByAnimator(); - - return true; -}; - -Looper.prototype._registerCallbackForAnimator = function() { - let sdkApiVersion = deviceInfo?.sdkApiVersion; - - let oncancel = () => { - this._lastAnimatorProgress = 0; - LogUtil.info(`${this._getLogTag()} ${this._looperType} oncancel.`); - }; - if (sdkApiVersion >= 12) { - this._animator.onCancel = oncancel; - } else { - this._animator.oncancel = oncancel; - } - - let onfinish = () => { - this._lastAnimatorProgress = 0; - LogUtil.info(`${this._getLogTag()} ${this._looperType} onfinish.`); - }; - if (sdkApiVersion >= 12) { - this._animator.onFinish = onfinish; - } else { - this._animator.onfinish = onfinish; - } - - let onframe = (progress) => { - if (this._looperStopped) { - // animator.cancel -> onframe -> animator.oncancel - return; - } - // 在每一次帧动画回调时,忽略系统时间,仅以动画步进来计算下一次时间戳,避免时间调整引起的跳变 - let positiveProgress = progress - this._lastAnimatorProgress + 1; - let modularProgress = positiveProgress - (positiveProgress >>> 0); // 高效地取出小数部分, 相当于对1取模 - let step = (_DURATION_BY_MS_ * modularProgress) >>> 0; // Zero-fill right shift for truncation to integer - if (step > 0) { - if (step > this._periodByMs + _ALLOWABLE_ERROR_BY_MS_ + _ALLOWABLE_ERROR_BY_MS_) { - let logInfo = - `step(${step}) is too significant. progress(${progress - }), last progress(${this._lastAnimatorProgress - }), modular progress(${modularProgress - })`; - LogUtil.warn(`${this._getLogTag()} ${this._looperType} ${logInfo}`); - } - - this._lastOnFrameTs = this._monotonicTimeStampInMs; - this._monotonicTimeStampInMs += step; - this._lastAnimatorProgress = progress; - - this._baseOnframe(this._monotonicTimeStampInMs, false); - } - }; - if (sdkApiVersion >= 12) { - this._animator.onFrame = onframe; - } else { - this._animator.onframe = onframe; - } -}; - -Looper.prototype._exportApiByAnimator = function() { - this._looperType = 'animator'; - - this.first = function () { - this._baseFirst(); - this._lastAnimatorProgress = 0; - this._monotonicTimeStampInMs = Math.floor(Date.now()); - LogUtil.info(`${this._getLogTag()} ${this._looperType} first: ${this._monotonicTimeStampInMs}`); - }; - - this.start = function () { - if (this._uiContext.getHostContext() !== getContext()) { - LogUtil.warn(`${this._getLogTag()} ${this._looperType} could NOT start cause context not matched`); - return; - } - LogUtil.info(`${this._getLogTag()} ${this._looperType} play`); - this._animator.play(); - this._looperStopped = false; - }; - - this.stop = function () { - if (this._uiContext.getHostContext() !== getContext()) { - LogUtil.warn(`${this._getLogTag()} ${this._looperType} could NOT stop cause context not matched`); - return; - } - LogUtil.info(`${this._getLogTag()} ${this._looperType} cancel`); - this._looperStopped = true; - // do not call '_animator.finish' function which will further call animator.onframe causing stack overflow. - this._animator.cancel(); - }; - - this._setExpectedFrameRateRangeWrapper = this._animator.setExpectedFrameRateRange?.bind(this._animator); - this.setExpectedFrameRateRange = function (playingFrameRate) { - this._baseSetExpectedFrameRateRange(playingFrameRate); - }; -}; - -Looper.prototype.onAnimationActive = function(animItem) { - if (animItem?.getFrameRate() > this._playingFrameRate) { - // 有更高帧率的动画活动,需要刷新帧率 - this.changeFrameRateIfNeeded(); - } - - this.addPlayingCount(); -}; - -Looper.prototype.onAnimationIdle = function(animItem) { - this.subtractPlayingCount(); - - if (animItem?.getFrameRate() >= this._playingFrameRate) { - // 最高帧率的动画暂停,需要刷新为第二高的帧率值 - this.changeFrameRateIfNeeded(); - } -}; - -Looper.prototype.pickMaxFrameRate = function() { - let maxUserFr = animationManager?.getFrameRate(); - if (maxUserFr > 0 && maxUserFr <= 120) { - return maxUserFr; // user already set frame rate. so ignore content fr for better performance - } - - let maxFrameRate = 0; - let len = this._animations?.length; - for (let i = 0; i < len; i++) { - let animItem = this._animations[i]?.animation; - let uiContext = animItem?.getUiContext(); - if ((!uiContext || (uiContext === this._uiContext)) && !animItem?._idle) { - let fr = animItem?.getFrameRate(); - LogUtil.info(`${this._getLogTag()} check fr from '${animItem?.name}(${animItem?.animationID})' with ${fr} fps.`); - if (fr > maxFrameRate) { - maxFrameRate = fr; - } - } - } - return maxFrameRate; -}; - -Looper.prototype.addPlayingCount = function() { - this._playingAnimationsNum += 1; - if (this._playingAnimationsNum > 0) { - this.activate(); - } -}; - -Looper.prototype.subtractPlayingCount = function() { - this._playingAnimationsNum -= 1; - if (this._playingAnimationsNum <= 0) { - this._playingAnimationsNum = 0; - this.deactivate(); - } -}; - -Looper.prototype.activate = function() { - if (this._playingAnimationsNum > 0 && this._looperStopped) { - LogUtil.info(`${this._getLogTag()} activate.`); - this.first(); - this.start(); - } -}; - -Looper.prototype.deactivate = function() { - if (!this._looperStopped) { - LogUtil.info(`${this._getLogTag()} deactivate`); - this._playingFrameRate = 0; - this.stop(); - } -}; - -Looper.prototype.changeFrameRateIfNeeded = function() { - let maxFr = this.pickMaxFrameRate(); - if (maxFr === 0) { - this.deactivate(); - return; - } - - if (maxFr !== this._playingFrameRate) { - if (maxFr > 0 && maxFr <= 120) { - this._playingFrameRate = maxFr; - this.setExpectedFrameRateRange(this._playingFrameRate); - } - } -}; - -const animationManager = (function(){ - let moduleOb = {}; - let registeredAnimations = []; - let _packageName = ''; - let _userPlayingFrameRate = 0; - let _contextLoopers = new WeakMap(); - let _coordinator = new Coordinator(); - - function _getLogTag() { - let abilityName = getContext()?.abilityInfo?.name; - if (abilityName && _packageName !== '') { - return ``; - } else if (abilityName) { - return ``; - } else if (_packageName !== '') { - return ``; - } else { - return ''; - } - } - - function _logFunc(funcName, name, onlyCurrentAbility, value) { - let valueDesc = ''; - if (value) { - valueDesc = ` with (${value})`; - } - let nameDesc = 'all animations'; - if (name) { - nameDesc = `animation named by '${name}'`; - } - - let abilityDesc = 'in all abilities'; - if (onlyCurrentAbility) { - abilityDesc = 'in current ability'; - } - - LogUtil.info(`${_getLogTag()} ${funcName}${valueDesc} for ${nameDesc} ${abilityDesc}`); - } - - function _isNameMatched(animation, nameTarget) { - if (!nameTarget || animation?.name === nameTarget) { - return true; - } - return false; - } - - function _isAbilityMatched(animation, onlyCurrentAbility) { - let context = getContext(); - if (!onlyCurrentAbility || animation?.getUiContext()?.getHostContext() === context) { - return true; - } - - return false; - } - - function _getAnimationUiContext(animation) { - /* 多abilities的支持需要依赖于在准确的context上启停Looper, 但displaysync无法完成这个使命. - * 每次启动displaysync时, start均会将displaysync挂载到当前执行上下文的管线中, 这会导致可能挂错. - * 为此引入frameCallback, 它能够支持向特定的管线上post回调, 从而确保上下文正确. - * 但frameCallback需要一个准确的uicontext, 当前并无接口支持. - * 此处直接借助了animation所关联canvas节点的uiContext_, 这有点类似java中的反射, 属于不规范的做法. - * FIXME:待后续有正式接口时需做下调整. - * (引入frameCallback的另一个好处是可以降低负载, ui线程只在必要时才被唤醒) - */ - return animation?.wrapper?.canvas?.uiContext_; - } - - function _getAllLooperFromAnimations() { - let allLooper = new Map(); - let len = registeredAnimations?.length; - for (let i = len - 1; i >= 0; i--) { - let context = _getAnimationUiContext(registeredAnimations[i]?.animation)?.getHostContext(); - if (context) { - let looper = _contextLoopers.get(context); - if (looper) { - allLooper.set(looper, looper); - } - } - } - - return allLooper; - } - - function _getLooperFromAnimation(animation) { - let uiContext = _getAnimationUiContext(animation); - if (!uiContext) { - LogUtil.warn(`${_getLogTag()} could NOT get current uiContext. no looper created.`); - return null; - } - - return _getOrCreateLooper(uiContext); - } - - function _getOrCreateLooper(uiContext) { - let looper = _contextLoopers.get(uiContext); - if (!!looper) { - return looper; - } - - looper = new Looper(uiContext, registeredAnimations, resume, true); - _contextLoopers.set(uiContext, looper); - return looper; - } - - // web only - function registerAnimation(element, animationData) { - if (!element) { - return null; - } - - let len = registeredAnimations?.length - for (let i = 0; i < len; i++) { - if (registeredAnimations[i]?.elem !== null && registeredAnimations[i]?.elem === element) { - return registeredAnimations[i]?.animation; - } - } - - var animItem = new AnimationItem(); - setupAnimation(animItem, element); - animItem.setData(element, animationData); - return animItem; - } - - // web only - function getRegisteredAnimations() { - var animations = []; - let len = registeredAnimations?.length; - for (let i = 0; i < len; i += 1) { - animations.push(registeredAnimations[i]?.animation); - } - return animations; - } - - function onAnimationItemLoaded(animItem) { - if (!!animItem.getUiContext()) { - LogUtil.info(`${animItem._getLogTag()} created with ${animItem.frameRate} fps.`); - } else { - LogUtil.warn(`${animItem._getLogTag()} created with ${animItem.frameRate} fps. no UIContext.`); - } - } - - function onAnimationItemDestroy(ev) { - let animItem = ev.target; - let len = registeredAnimations?.length - for (let i = len - 1; i >= 0; i--) { - if (registeredAnimations[i]?.animation === animItem) { - registeredAnimations[i].animation = null; - registeredAnimations.splice(i, 1); - _coordinator.detachAnimationFromContext2d(animItem?.wrapper); - LogUtil.info(`${animItem._getLogTag()} destroyed with ${animItem.frameRate} fps`); - } - } - } - - function onAnimationItemActive(animItem) { - if (!!animItem?.getUiContext()) { - LogUtil.info(`${animItem?._getLogTag()} activated with ${animItem?.getFrameRate()} fps.`); - } else { - LogUtil.warn(`${animItem?._getLogTag()} activated with ${animItem?.getFrameRate()} fps. no UiContext.`); - } - - _getLooperFromAnimation(animItem)?.onAnimationActive(animItem); - } - - function onAnimationItemIdle(animItem) { - if (!!animItem?.getUiContext()) { - LogUtil.info(`${animItem?._getLogTag()} deactivated with ${animItem?.getFrameRate()} fps`); - } else { - LogUtil.warn(`${animItem?._getLogTag()} deactivated with ${animItem?.getFrameRate()} fps. no UiContext.`); - } - - _getLooperFromAnimation(animItem)?.onAnimationIdle(animItem); - } - - function _destroyAnimationWithSameContext2d(context2d) { - let len = registeredAnimations?.length; - for (let i = len - 1; i >= 0; i--) { - let animation = registeredAnimations[i]?.animation; - if (animation?.wrapper === context2d) { - LogUtil.warn(`${_getLogTag()} destroy animation '${animation.name}(${animation?.animationID})' from ${animation?.source}, - because animation using the same context2D. `); - registeredAnimations.splice(i, 1); - animation?.destroy(); - } - } - } - - function setupAnimation(animItem, element) { - animItem.addEventListener('destroy', onAnimationItemDestroy); - animItem.addEventListener('_active', onAnimationItemActive); - animItem.addEventListener('_idle', onAnimationItemIdle); - animItem.addEventListener('DOMLoaded', onAnimationItemLoaded); - registeredAnimations.push({ elem: element, animation: animItem }); - } - - function loadAnimation(params) { - LogUtil.info(`${_getLogTag()} load animation named '${params.name ? params.name : ''}'` + - `${params.uri ? ' from ' + params.uri : (params.path ? ' from ' + params.path : '')}` + - `, canvas uniqueId is: ${params.container?.canvas?.getUniqueId()}`); - LogUtil.version(); - let context2d = params.wrapper || params.container; - if (!context2d) { - LogUtil.warn(`${_getLogTag()} loadAnimation failed because no container`); - return null; - } - - let animItem = _coordinator.detachAnimationFromContext2d(context2d); - if (animItem) { - LogUtil.warn(`${_getLogTag()} destroy animation '${animItem.name}(${animItem.animationID})' in the context2d. from ${animItem.source}`); - animItem.destroy(); - } else { - _destroyAnimationWithSameContext2d(context2d); - } - - animItem = new AnimationItem(); - if (!_coordinator.isContext2dBoundToCoordinator(context2d)) { - /* 执行 loadAnimation 时还未将 context2d 绑定到 coordinator 上, 即用户尚未显式调用bindContext2dToCoordinator - * 说明用户还处在旧的处理逻辑中, 需要帮用户做一次调用 - * 出于兼容性考虑, 此时需保持 preferredNoArea 为 false, 即默认 canvas 有可见面积 - */ - _coordinator.internalBindContext2dToCoordinator(context2d, false); - } - _coordinator.attachAnimationToContext2d(context2d, animItem); - - setupAnimation(animItem, null); - animItem.setParams(params); - return animItem; - } - - function setSpeed(val, animationName, onlyCurrentAbility) { - _logFunc('setSpeed', animationName, onlyCurrentAbility, val); - - let len = registeredAnimations.length; - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i]?.animation.setSpeed(val); - } - } - } - - function setDirection(val, animationName, onlyCurrentAbility) { - _logFunc('setDirection', animationName, onlyCurrentAbility, val); - - let len = registeredAnimations.length; - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i]?.animation.setDirection(val); - } - } - } - - function play(animationName, onlyCurrentAbility) { - _logFunc('play', animationName, onlyCurrentAbility); - - let len = registeredAnimations.length; - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i]?.animation.play(); - } - } - } - - function resume(uiContext, timestamp, displaySynced) { - let len = registeredAnimations.length; - - for (let i = 0; i < len; i += 1) { - if (!uiContext || registeredAnimations[i]?.animation.getUiContext() === uiContext) { - registeredAnimations[i]?.animation.resume(timestamp, displaySynced); - } - } - } - - function pause(animationName, onlyCurrentAbility) { - _logFunc('pause', animationName, onlyCurrentAbility); - - let len = registeredAnimations.length; - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i]?.animation.pause(); - } - } - } - - function goToAndStop(value, isFrame, animationName, onlyCurrentAbility) { - _logFunc('goToAndStop', animationName, onlyCurrentAbility, `${value},${isFrame}`); - - let len = registeredAnimations.length; - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i]?.animation.goToAndStop(value, isFrame); - } - } - } - - function goToAndPlay(value, isFrame, animationName, onlyCurrentAbility) { - _logFunc('goToAndPlay', animationName, onlyCurrentAbility, `${value},${isFrame}`); - - let len = registeredAnimations.length; - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i]?.animation.goToAndPlay(value, isFrame); - } - } - } - - function stop(animationName, onlyCurrentAbility) { - _logFunc('stop', animationName, onlyCurrentAbility); - - let len = registeredAnimations.length; - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i]?.animation.stop(); - } - } - } - - function togglePause(animationName, onlyCurrentAbility) { - _logFunc('togglePause', animationName, onlyCurrentAbility); - - let len = registeredAnimations.length; - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i]?.animation.togglePause(); - } - } - } - - /** - * 设置packageName - * @param name 应用的包名 - */ - function setPackageName(name) { - LogUtil.info(`${_getLogTag()} setPackageName: ${name}`); - _packageName = name; - } - - /** - * 设置所有动画的播放帧率 - * @param frameRate 帧率 - */ - function setFrameRate(frameRate) { - LogUtil.info(`${_getLogTag()} setFrameRate: ${frameRate}`); - _userPlayingFrameRate = frameRate; - - _getAllLooperFromAnimations()?.forEach((looper) => { - looper.changeFrameRateIfNeeded(); - }); - } - - /** - * 获取当前所有动画的播放帧率 - * @returns 帧率 - */ - function getFrameRate() { - return _userPlayingFrameRate; - } - - function destroy(animationName, onlyCurrentAbility) { - _logFunc('destroy', animationName, onlyCurrentAbility); - LogUtil.version(); - - let len = registeredAnimations.length; - for (let i = (len - 1); i >= 0; i -= 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - // 找到即将要被destroy的动画,销毁之。会触发回调,在回调中进行状态清理 - registeredAnimations[i]?.animation.destroy(); - } - } - if (registeredAnimations.length === 0) { - bez.storedData = {}; - } - } - - // html only - function searchAnimations(animationData, standalone, renderer) { - if (!document) { - return; - } - let animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')), - [].slice.call(document.getElementsByClassName('bodymovin'))); - let lenAnims = animElements.length; - for (let i = 0; i < lenAnims; i += 1) { - if (renderer && !!animElements[i]) { - animElements[i].setAttribute('data-bm-type', renderer); - } - registerAnimation(animElements[i], animationData); - } - if (standalone && lenAnims === 0) { - if (!renderer) { - renderer = 'svg'; - } - var body = document.getElementsByTagName('body')[0]; - body.innerText = ''; - var div = createTag('div'); - div.style.width = '100%'; - div.style.height = '100%'; - div.setAttribute('data-bm-type', renderer); - body.appendChild(div); - registerAnimation(div, animationData); - } - } - - function setContentMode(contentMode, animationName, onlyCurrentAbility) { - _logFunc('setContentMode', animationName, onlyCurrentAbility, contentMode); - - let len = registeredAnimations.length - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i]?.animation.setContentMode(contentMode); - } - } - } - - function resize(width, height, animationName, onlyCurrentAbility) { - _logFunc('resize', animationName, onlyCurrentAbility, `${width} x ${height}`); - - let len = registeredAnimations.length - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i]?.animation.resize(width, height); - } - } - } - - function freeze(animationName, onlyCurrentAbility) { - _logFunc('freeze', animationName, onlyCurrentAbility); - - let len = registeredAnimations.length; - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i].animation.pause(); - } - } - } - - function unfreeze(animationName, onlyCurrentAbility) { - _logFunc('unfreeze', animationName, onlyCurrentAbility); - - let len = registeredAnimations.length; - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i].animation.play(); - } - } - } - - function setVolume(val, animationName, onlyCurrentAbility) { - _logFunc('setVolume', animationName, onlyCurrentAbility, val); - - let len = registeredAnimations.length - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i]?.animation.setVolume(val); - } - } - } - - function mute(animationName, onlyCurrentAbility) { - _logFunc('mute', animationName, onlyCurrentAbility); - - let len = registeredAnimations.length - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i]?.animation.mute(); - } - } - } - - function unmute(animationName, onlyCurrentAbility) { - _logFunc('unmute', animationName, onlyCurrentAbility); - - let len = registeredAnimations.length - for (let i = 0; i < len; i += 1) { - if (_isNameMatched(registeredAnimations[i]?.animation, animationName) && - _isAbilityMatched(registeredAnimations[i]?.animation, onlyCurrentAbility)) { - registeredAnimations[i]?.animation.unmute(); - } - } - } - - /** - * 清除单个文件缓存(支持同步/异步模式) - * @param {string} path - 文件路径(支持HTTP URL格式) - * @param {Object} container - 包含JSON数据的容器对象 - * @param {boolean} isSync - 是否使用同步模式操作 - */ - function clearSingleFileCache(path, container, isSync) { - // 安全校验:确保上下文存在 - let context = getContext(); - if (!context) { - return; - } - - // 处理HTTP资源路径 - if (path.startsWith('http')) { - let pathSegments = path.split('/'); - let parentDirName = pathSegments[pathSegments.length - 2]; // 父级目录名 - let originalFileName = pathSegments[pathSegments.length - 1]; // 原始文件名(含扩展名) - let cleanFileName = originalFileName.replace(/\.(?:zip|json)$/i, ''); // 清理后文件名(去除扩展名) - - let lottieBaseDir = `${context.filesDir}/lottie/${parentDirName}`; // 基础存储目录 - let targetDirectory = `${lottieBaseDir}/${cleanFileName}`; // 目标目录 - - // 执行目录清理 - rmdir(targetDirectory, isSync); - } - - // 处理图片资源 - if (container) { - try { - // 解析资源中的JSON数据 - let jsonString = container.getJsonData(path); - let jsonObj = JSON.parse(jsonString); - - // 构建图片加载目录路径 - let loadPath = `${context.filesDir}/lottie/loadImages/`; - - // 检查是否存在网络资源 - if (isExistNetworkAssets(jsonObj?.assets)) { - rmdir(loadPath, isSync, jsonObj); - } - } catch (error) { - LogUtil.error(`JSON解析失败: ${error.message}`); - } - } - } - - /** - * 异步清除文件缓存 - * @param {string} url - 要清除缓存的文件URL或本地路径 - * @param {Object|string} container - 缓存容器对象或目录路径 - */ - function clearFileCache(url, container) { - clearFile(url, container, false); - } - - /** - * 同步清除文件缓存 - * @param {string} url - 要清除缓存的文件URL或本地路径 - * @param {Object|string} container - 缓存容器对象或目录路径 - */ - function clearFileCacheSync(url, container) { - clearFile(url, container, true); - } - - /** - * 清理文件缓存(支持单文件或全局清理) - * @param {string} [url] - 可选的文件URL路径,存在时清理指定文件缓存 - * @param {Object} container - 包含JSON数据的容器对象,用于解析关联资源 - * @param {boolean} isSync - 是否使用同步模式执行清理操作 - */ - function clearFile(url, container, isSync) { - // 安全校验:确保上下文存在 - let context = getContext(); - if (!context) { - return; - } - - if (url) { - // 单文件清理模式:精确清理指定URL对应的缓存 - clearSingleFileCache(url, container, isSync); - return; - } - let fileDir = `${context.filesDir}/lottie`; // 应用私有文件目录 - let cacheDir = `${context.cacheDir}/lottie`; // 系统缓存目录 - - // 执行清理操作(同步/异步模式) - rmdir(fileDir, isSync); - rmdir(cacheDir, isSync); - } - - /** - * 删除指定资源文件 - * @param {string} path - 基础目录路径 - * @param {Object} assets - 资源对象,包含id和p(路径)属性 - * @param {Array} filenames - 文件名数组 - * @param {boolean} isSync - 是否同步删除标志 - */ - function rmAssetsDir(path, assets, filenames, isSync) { - // 判断是否为HTTP资源(通过检查路径是否以http开头) - let isHttp = assets?.p?.startsWith('http'); - - if (isHttp) { - // 构造目标文件名(assets.id + '.png') - const targetFilename = `${assets.id}.png`; - const fileIndex = filenames.indexOf(targetFilename); - - // 找到匹配文件时执行删除 - if (fileIndex !== -1) { - if (isSync) { - unlinkSync(path + filenames[fileIndex]); - } else { - unlink(path + filenames[fileIndex]); - } - } - } - } - - /** - * 根据路径删除文件或目录 - * @param {string} path - 基础目录路径 - * @param {string} filename - 文件/目录名 - * @param {boolean} isSync - 是否同步操作标志 - */ - function rmDirByPath(path, filename, isSync) { - let dirPath = path + '/' + filename; - // 判断是否文件夹 - try { - let isDirectory = fs.statSync(dirPath).isDirectory(); - if (isDirectory) { - rmdirSync(dirPath); - } else { - if (isSync) { - unlinkSync(dirPath); - } else { - unlink(dirPath); - } - } - } catch (err) { - LogUtil.error('Method rmDirByPath execute error: ' + JSON.stringify(err)); - } - } - - /** - * 删除目录 - * @param path - 目标根目录路径 - * @param isSync - 是否同步操作标志 - * @param jsonObj - 资源描述对象(可选) - */ - function rmdir(path, isSync, jsonObj) { - let filenames = listFileSyncs(path); - if (jsonObj) { - for (let i = 0; i < jsonObj.assets.length; i++) { - rmAssetsDir(path, jsonObj.assets[i], filenames, isSync); - } - } else { - for (let i = 0; i < filenames.length; i++) { - rmDirByPath(path, filenames[i], isSync); - } - } - } - - moduleOb.registerAnimation = registerAnimation; - moduleOb.loadAnimation = loadAnimation; - moduleOb.setSpeed = setSpeed; - moduleOb.setDirection = setDirection; - moduleOb.play = play; - moduleOb.pause = pause; - moduleOb.stop = stop; - moduleOb.togglePause = togglePause; - moduleOb.searchAnimations = searchAnimations; - moduleOb.resize = resize; - moduleOb.clearFileCache = clearFileCache; - moduleOb.clearFileCacheSync = clearFileCacheSync; - moduleOb.goToAndStop = goToAndStop; - moduleOb.goToAndPlay = goToAndPlay; - moduleOb.destroy = destroy; - moduleOb.freeze = freeze; - moduleOb.unfreeze = unfreeze; - moduleOb.setVolume = setVolume; - moduleOb.mute = mute; - moduleOb.unmute = unmute; - moduleOb.getRegisteredAnimations = getRegisteredAnimations; - moduleOb.setPackageName = setPackageName; - moduleOb.setContentMode = setContentMode; - moduleOb.setFrameRate = setFrameRate; - moduleOb.getFrameRate = getFrameRate; - moduleOb.bindContext2dToCoordinator = _coordinator.bindContext2dToCoordinator.bind(_coordinator); - moduleOb.unbindContext2dFromCoordinator = _coordinator.unbindContext2dFromCoordinator.bind(_coordinator); - moduleOb.setAttachedCanvasHasVisibleArea = _coordinator.setAttachedCanvasHasVisibleArea.bind(_coordinator); - - return moduleOb; -}()); - -export default animationManager; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/effects/SliderEffect.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/effects/SliderEffect.js deleted file mode 100644 index f49a459e46af08ed824444109080e6114ccc80ca..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/effects/SliderEffect.js +++ /dev/null @@ -1,37 +0,0 @@ -import PropertyFactory from '../utils/PropertyFactory'; - -function SliderEffect(data, elem, container) { - this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container); -} -function AngleEffect(data, elem, container) { - this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container); -} -function ColorEffect(data, elem, container) { - this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container); -} -function PointEffect(data, elem, container) { - this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container); -} -function LayerIndexEffect(data, elem, container) { - this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container); -} -function MaskIndexEffect(data, elem, container) { - this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container); -} -function CheckboxEffect(data, elem, container) { - this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container); -} -function NoValueEffect() { - this.p = {}; -} - -export { - SliderEffect, - AngleEffect, - ColorEffect, - PointEffect, - LayerIndexEffect, - MaskIndexEffect, - CheckboxEffect, - NoValueEffect, -}; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/AudioElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/AudioElement.js deleted file mode 100644 index 608f17bfa85c4c9ae3d80d766d364520fc605f0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/AudioElement.js +++ /dev/null @@ -1,106 +0,0 @@ -import { - extendPrototype, -} from '../utils/functionExtensions'; -import PropertyFactory from '../utils/PropertyFactory'; -import RenderableElement from './helpers/RenderableElement'; -import BaseElement from './BaseElement'; -import FrameElement from './helpers/FrameElement'; - -function AudioElement(data, globalData, comp) { - this.initFrame(); - this.initRenderable(); - this.assetData = globalData.getAssetData(data.refId); - this.initBaseData(data, globalData, comp); - this._isPlaying = false; - this._canPlay = false; - var assetPath = this.globalData.getAssetsPath(this.assetData); - this.audio = this.globalData.audioController.createAudio(assetPath); - this._currentTime = 0; - this.globalData.audioController.addAudio(this); - this._volumeMultiplier = 1; - this._volume = 1; - this._previousVolume = null; - this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true }; - this.lv = PropertyFactory.getProp(this, data.au && data.au.lv ? data.au.lv : { k: [100] }, 1, 0.01, this); -} - -AudioElement.prototype.prepareFrame = function (num) { - this.prepareRenderableFrame(num, true); - this.prepareProperties(num, true); - if (!this.tm._placeholder) { - var timeRemapped = this.tm.v; - this._currentTime = timeRemapped; - } else { - this._currentTime = num / this.data.sr; - } - this._volume = this.lv.v[0]; - var totalVolume = this._volume * this._volumeMultiplier; - if (this._previousVolume !== totalVolume) { - this._previousVolume = totalVolume; - this.audio.volume(totalVolume); - } -}; - -extendPrototype([RenderableElement, BaseElement, FrameElement], AudioElement); - -AudioElement.prototype.renderFrame = function () { - if (this.isInRange && this._canPlay) { - if (!this._isPlaying) { - this.audio.play(); - this.audio.seek(this._currentTime / this.globalData.frameRate); - this._isPlaying = true; - } else if (!this.audio.playing() - || Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1 - ) { - this.audio.seek(this._currentTime / this.globalData.frameRate); - } - } -}; - -AudioElement.prototype.show = function () { - // this.audio.play() -}; - -AudioElement.prototype.hide = function () { - this.audio.pause(); - this._isPlaying = false; -}; - -AudioElement.prototype.pause = function () { - try{ - this.audio.pause(); - } catch (err) { - return; - } - this._isPlaying = false; - this._canPlay = false; -}; - -AudioElement.prototype.resume = function () { - this._canPlay = true; -}; - -AudioElement.prototype.setRate = function (rateValue) { - this.audio.rate(rateValue); -}; - -AudioElement.prototype.volume = function (volumeValue) { - this._volumeMultiplier = volumeValue; - this._previousVolume = volumeValue * this._volume; - this.audio.volume(this._previousVolume); -}; - -AudioElement.prototype.getBaseElement = function () { - return null; -}; - -AudioElement.prototype.destroy = function () { -}; - -AudioElement.prototype.sourceRectAtTime = function () { -}; - -AudioElement.prototype.initExpressions = function () { -}; - -export default AudioElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/BaseElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/BaseElement.js deleted file mode 100644 index 031cc810d70aaecab55c515c39af907d7d9d34bd..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/BaseElement.js +++ /dev/null @@ -1,78 +0,0 @@ -import { - createElementID, - getExpressionInterfaces, -} from '../utils/common'; -import getBlendMode from '../utils/helpers/blendModes'; -import EffectsManager from '../EffectsManager'; - -function BaseElement() { -} - -BaseElement.prototype = { - checkMasks: function () { - if (!this.data.hasMask) { - return false; - } - var i = 0; - var len = this.data.masksProperties.length; - while (i < len) { - if ((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) { - return true; - } - i += 1; - } - return false; - }, - initExpressions: function () { - const expressionsInterfaces = getExpressionInterfaces(); - if (!expressionsInterfaces) { - return; - } - const LayerExpressionInterface = expressionsInterfaces('layer'); - const EffectsExpressionInterface = expressionsInterfaces('effects'); - const ShapeExpressionInterface = expressionsInterfaces('shape'); - const TextExpressionInterface = expressionsInterfaces('text'); - const CompExpressionInterface = expressionsInterfaces('comp'); - this.layerInterface = LayerExpressionInterface(this); - if (this.data.hasMask && this.maskManager) { - this.layerInterface.registerMaskInterface(this.maskManager); - } - var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this, this.layerInterface); - this.layerInterface.registerEffectsInterface(effectsInterface); - - if (this.data.ty === 0 || this.data.xt) { - this.compInterface = CompExpressionInterface(this); - } else if (this.data.ty === 4) { - this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData, this.itemsData, this.layerInterface); - this.layerInterface.content = this.layerInterface.shapeInterface; - } else if (this.data.ty === 5) { - this.layerInterface.textInterface = TextExpressionInterface(this); - this.layerInterface.text = this.layerInterface.textInterface; - } - }, - setBlendMode: function () { - var blendModeValue = getBlendMode(this.data.bm); - var elem = this.baseElement || this.layerElement; - - elem.style['mix-blend-mode'] = blendModeValue; - }, - initBaseData: function (data, globalData, comp) { - this.globalData = globalData; - this.comp = comp; - this.data = data; - this.layerId = createElementID(); - - // Stretch factor for old animations missing this property. - if (!this.data.sr) { - this.data.sr = 1; - } - // effects manager - this.effectsManager = new EffectsManager(this.data, this, this.dynamicProperties); - }, - getType: function () { - return this.type; - }, - sourceRectAtTime: function () {}, -}; - -export default BaseElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/BaseTextElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/BaseTextElement.js deleted file mode 100644 index 34d52ccba45982e17befe63628ef23faa5e8d43b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/BaseTextElement.js +++ /dev/null @@ -1,4 +0,0 @@ -const BaseTextElement = function () { -}; - -export default BaseTextElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/CompElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/CompElement.js deleted file mode 100644 index f1abe7382888fad026b0d69dd9f3f6ebc903b1f8..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/CompElement.js +++ /dev/null @@ -1,149 +0,0 @@ -import { - extendPrototype, -} from '../utils/functionExtensions'; -import BaseElement from './BaseElement'; -import TransformElement from './helpers/TransformElement'; -import HierarchyElement from './helpers/HierarchyElement'; -import FrameElement from './helpers/FrameElement'; -import RenderableDOMElement from './helpers/RenderableDOMElement'; - -function ICompElement() {} - -extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement); - -ICompElement.prototype.initElement = function (data, globalData, comp) { - this.initFrame(); - this.initBaseData(data, globalData, comp); - this.initTransform(data, globalData, comp); - this.initRenderable(); - this.initHierarchy(); - this.initRendererElement(); - this.createContainerElements(); - this.createRenderableComponents(); - if (this.data.xt || !globalData.progressiveLoad) { - this.buildAllItems(); - } - this.hide(); -}; - -/* ICompElement.prototype.hide = function(){ - if(!this.hidden){ - this.hideElement(); - var i,len = this.elements.length; - for( i = 0; i < len; i+=1 ){ - if(this.elements[i]){ - this.elements[i].hide(); - } - } - } -}; */ - -ICompElement.prototype.prepareFrame = function (num) { - this._mdf = false; - this.prepareRenderableFrame(num); - this.prepareProperties(num, this.isInRange); - if (!this.isInRange && !this.data.xt) { - return; - } - - if (!this.tm._placeholder) { - var timeRemapped = this.tm.v; - if (timeRemapped === this.data.op) { - timeRemapped = this.data.op - 1; - } - this.renderedFrame = timeRemapped; - } else { - this.renderedFrame = num / this.data.sr; - } - var i; - var len = this.elements.length; - if (!this.completeLayers) { - this.checkLayers(this.renderedFrame); - } - // This iteration needs to be backwards because of how expressions connect between each other - for (i = len - 1; i >= 0; i -= 1) { - if (this.completeLayers || this.elements[i]) { - this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st); - if (this.elements[i]._mdf) { - this._mdf = true; - } - } - } -}; - -ICompElement.prototype.renderInnerContent = function () { - var i; - var len = this.layers.length; - for (i = 0; i < len; i += 1) { - if (this.completeLayers || this.elements[i]) { - this.elements[i].renderFrame(); - } - } -}; - -ICompElement.prototype.renderShapeColor = function (color, endColor, index) { - if (typeof endColor == 'object') { - if (Array.isArray(endColor)) { - if (!index) { - var i; - var len = this.layers.length; - for (i = 0; i < len; i += 1) { - if (this.completeLayers || this.elements[i]) { - this.elements[i].changeColor(color, endColor); - } - } - } else { - if (this.completeLayers || this.elements[index-1]) { - this.elements[index-1].changeColor(color, endColor); - } - } - } - } else if (typeof endColor == 'number') { - if (!endColor) { - var i; - var len = this.layers.length; - for (i = 0; i < len; i += 1) { - if (this.completeLayers || this.elements[i]) { - this.elements[i].changeColor(color, undefined); - } - } - } else { - if (this.completeLayers || this.elements[endColor-1]) { - this.elements[endColor-1].changeColor(color, undefined); - } - } - } else { - var i; - var len = this.layers.length; - for (i = 0; i < len; i += 1) { - if (this.completeLayers || this.elements[i]) { - this.elements[i].changeColor(color, undefined); - } - } - } -}; - -ICompElement.prototype.setElements = function (elems) { - this.elements = elems; -}; - -ICompElement.prototype.getElements = function () { - return this.elements; -}; - -ICompElement.prototype.destroyElements = function () { - var i; - var len = this.layers.length; - for (i = 0; i < len; i += 1) { - if (this.elements[i]) { - this.elements[i].destroy(); - } - } -}; - -ICompElement.prototype.destroy = function () { - this.destroyElements(); - this.destroyBaseElement(); -}; - -export default ICompElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/FootageElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/FootageElement.js deleted file mode 100644 index 8b85987fee4270514ae705cf0e929940c8bf54fb..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/FootageElement.js +++ /dev/null @@ -1,47 +0,0 @@ -import { - extendPrototype, -} from '../utils/functionExtensions'; -import { - getExpressionInterfaces, -} from '../utils/common'; -import RenderableElement from './helpers/RenderableElement'; -import BaseElement from './BaseElement'; -import FrameElement from './helpers/FrameElement'; - -function FootageElement(data, globalData, comp) { - this.initFrame(); - this.initRenderable(); - this.assetData = globalData.getAssetData(data.refId); - this.footageData = globalData.imageLoader.getAsset(this.assetData); - this.initBaseData(data, globalData, comp); -} - -FootageElement.prototype.prepareFrame = function () { -}; - -extendPrototype([RenderableElement, BaseElement, FrameElement], FootageElement); - -FootageElement.prototype.getBaseElement = function () { - return null; -}; - -FootageElement.prototype.renderFrame = function () { -}; - -FootageElement.prototype.destroy = function () { -}; - -FootageElement.prototype.initExpressions = function () { - const expressionsInterfaces = getExpressionInterfaces(); - if (!expressionsInterfaces) { - return; - } - const FootageInterface = expressionsInterfaces('footage'); - this.layerInterface = FootageInterface(this); -}; - -FootageElement.prototype.getFootageData = function () { - return this.footageData; -}; - -export default FootageElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/ImageElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/ImageElement.js deleted file mode 100644 index 5bee39af214408cc44013e44980aa4330769b14f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/ImageElement.js +++ /dev/null @@ -1,42 +0,0 @@ -import { - extendPrototype, -} from '../utils/functionExtensions'; - -import createNS from '../utils/helpers/svg_elements'; -import BaseElement from './BaseElement'; -import TransformElement from './helpers/TransformElement'; -import SVGBaseElement from './svgElements/SVGBaseElement'; -import HierarchyElement from './helpers/HierarchyElement'; -import FrameElement from './helpers/FrameElement'; -import RenderableDOMElement from './helpers/RenderableDOMElement'; - -function IImageElement(data, globalData, comp) { - this.assetData = globalData.getAssetData(data.refId); - if (this.assetData && this.assetData.sid) { - this.assetData = globalData.slotManager.getProp(this.assetData); - } - this.initElement(data, globalData, comp); - this.sourceRect = { - top: 0, left: 0, width: this.assetData.w, height: this.assetData.h, - }; -} - -extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], IImageElement); - -IImageElement.prototype.createContent = function () { - var assetPath = this.globalData.getAssetsPath(this.assetData); - - this.innerElem = createNS('image'); - this.innerElem.setAttribute('width', this.assetData.w + 'px'); - this.innerElem.setAttribute('height', this.assetData.h + 'px'); - this.innerElem.setAttribute('preserveAspectRatio', this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio); - this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath); - - this.layerElement.appendChild(this.innerElem); -}; - -IImageElement.prototype.sourceRectAtTime = function () { - return this.sourceRect; -}; - -export default IImageElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/NullElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/NullElement.js deleted file mode 100644 index f3bb129b45e7e2aea77ac28a3ba31159c3f0f7fa..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/NullElement.js +++ /dev/null @@ -1,42 +0,0 @@ -import { - extendPrototype, -} from '../utils/functionExtensions'; -import BaseElement from './BaseElement'; -import TransformElement from './helpers/TransformElement'; -import HierarchyElement from './helpers/HierarchyElement'; -import FrameElement from './helpers/FrameElement'; - -function NullElement(data, globalData, comp) { - this.initFrame(); - this.initBaseData(data, globalData, comp); - this.initFrame(); - this.initTransform(data, globalData, comp); - this.initHierarchy(); -} - -NullElement.prototype.prepareFrame = function (num) { - this.prepareProperties(num, true); -}; - -NullElement.prototype.renderFrame = function () { -}; - -NullElement.prototype.changeColor = function () { -}; - -NullElement.prototype.getBaseElement = function () { - return null; -}; - -NullElement.prototype.destroy = function () { -}; - -NullElement.prototype.sourceRectAtTime = function () { -}; - -NullElement.prototype.hide = function () { -}; - -extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement], NullElement); - -export default NullElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/ShapeElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/ShapeElement.js deleted file mode 100644 index 4e50b4910829b5df97a843cf5bd671747ba414f4..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/ShapeElement.js +++ /dev/null @@ -1,76 +0,0 @@ -import ProcessedElement from './helpers/shapes/ProcessedElement'; - -function IShapeElement() { -} - -IShapeElement.prototype = { - addShapeToModifiers: function (data) { - var i; - var len = this.shapeModifiers.length; - for (i = 0; i < len; i += 1) { - this.shapeModifiers[i].addShape(data); - } - }, - isShapeInAnimatedModifiers: function (data) { - var i = 0; - var len = this.shapeModifiers.length; - while (i < len) { - if (this.shapeModifiers[i].isAnimatedWithShape(data)) { - return true; - } - } - return false; - }, - renderModifiers: function () { - if (!this.shapeModifiers.length) { - return; - } - var i; - var len = this.shapes.length; - for (i = 0; i < len; i += 1) { - this.shapes[i].sh.reset(); - } - - len = this.shapeModifiers.length; - var shouldBreakProcess; - for (i = len - 1; i >= 0; i -= 1) { - shouldBreakProcess = this.shapeModifiers[i].processShapes(this._isFirstFrame); - // workaround to fix cases where a repeater resets the shape so the following processes get called twice - // TODO: find a better solution for this - if (shouldBreakProcess) { - break; - } - } - }, - - searchProcessedElement: function (elem) { - var elements = this.processedElements; - var i = 0; - var len = elements.length; - while (i < len) { - if (elements[i].elem === elem) { - return elements[i].pos; - } - i += 1; - } - return 0; - }, - addProcessedElement: function (elem, pos) { - var elements = this.processedElements; - var i = elements.length; - while (i) { - i -= 1; - if (elements[i].elem === elem) { - elements[i].pos = pos; - return; - } - } - elements.push(new ProcessedElement(elem, pos)); - }, - prepareFrame: function (num) { - this.prepareRenderableFrame(num); - this.prepareProperties(num, this.isInRange); - }, -}; - -export default IShapeElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/SolidElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/SolidElement.js deleted file mode 100644 index 0c5594a5237a055d5b3951eee68660039c3ed92d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/SolidElement.js +++ /dev/null @@ -1,23 +0,0 @@ -import { - extendPrototype, -} from '../utils/functionExtensions'; -import createNS from '../utils/helpers/svg_elements'; -import IImageElement from './ImageElement'; - -function ISolidElement(data, globalData, comp) { - this.initElement(data, globalData, comp); -} -extendPrototype([IImageElement], ISolidElement); - -ISolidElement.prototype.createContent = function () { - var rect = createNS('rect'); - /// /rect.style.width = this.data.sw; - /// /rect.style.height = this.data.sh; - /// /rect.style.fill = this.data.sc; - rect.setAttribute('width', this.data.sw); - rect.setAttribute('height', this.data.sh); - rect.setAttribute('fill', this.data.sc); - this.layerElement.appendChild(rect); -}; - -export default ISolidElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/TextElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/TextElement.js deleted file mode 100644 index 18adf1f334fc4c514b8324d73f3fa7c9852d13d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/TextElement.js +++ /dev/null @@ -1,91 +0,0 @@ -import LetterProps from '../utils/text/LetterProps'; -import TextProperty from '../utils/text/TextProperty'; -import TextAnimatorProperty from '../utils/text/TextAnimatorProperty'; -import buildShapeString from '../utils/shapes/shapePathBuilder'; - -function ITextElement() { -} - -ITextElement.prototype.initElement = function (data, globalData, comp) { - this.lettersChangedFlag = true; - this.initFrame(); - this.initBaseData(data, globalData, comp); - this.textProperty = new TextProperty(this, data.t, this.dynamicProperties); - this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this); - this.initTransform(data, globalData, comp); - this.initHierarchy(); - this.initRenderable(); - this.initRendererElement(); - this.createContainerElements(); - this.createRenderableComponents(); - this.createContent(); - this.hide(); - this.textAnimator.searchProperties(this.dynamicProperties); -}; - -ITextElement.prototype.prepareFrame = function (num) { - this._mdf = false; - this.prepareRenderableFrame(num); - this.prepareProperties(num, this.isInRange); - if (this.textProperty._mdf || this.textProperty._isFirstFrame) { - this.buildNewText(); - this.textProperty._isFirstFrame = false; - this.textProperty._mdf = false; - } -}; - -ITextElement.prototype.createPathShape = function (matrixHelper, shapes) { - var j; - var jLen = shapes.length; - var pathNodes; - var shapeStr = ''; - for (j = 0; j < jLen; j += 1) { - if (shapes[j].ty === 'sh') { - pathNodes = shapes[j].ks.k; - shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper); - } - } - return shapeStr; -}; - -ITextElement.prototype.updateDocumentData = function (newData, index) { - this.textProperty.updateDocumentData(newData, index); -}; - -ITextElement.prototype.canResizeFont = function (_canResize) { - this.textProperty.canResizeFont(_canResize); -}; - -ITextElement.prototype.setMinimumFontSize = function (_fontSize) { - this.textProperty.setMinimumFontSize(_fontSize); -}; - -ITextElement.prototype.applyTextPropertiesToMatrix = function (documentData, matrixHelper, lineNumber, xPos, yPos) { - if (documentData.ps) { - matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0); - } - matrixHelper.translate(0, -documentData.ls, 0); - switch (documentData.j) { - case 1: - matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]), 0, 0); - break; - case 2: - matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]) / 2, 0, 0); - break; - default: - break; - } - matrixHelper.translate(xPos, yPos, 0); -}; - -ITextElement.prototype.buildColor = function (colorData) { - return 'rgb(' + Math.round(colorData[0] * 255) + ',' + Math.round(colorData[1] * 255) + ',' + Math.round(colorData[2] * 255) + ')'; -}; - -ITextElement.prototype.emptyProp = new LetterProps(); - -ITextElement.prototype.destroy = function () { - -}; - -export default ITextElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVBaseElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVBaseElement.js deleted file mode 100644 index b2f0a8f968338319728907c4e01b2574ce3ce334..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVBaseElement.js +++ /dev/null @@ -1,144 +0,0 @@ -import assetManager from '../../utils/helpers/assetManager'; -import getBlendMode from '../../utils/helpers/blendModes'; -import Matrix from '../../3rd_party/transformation-matrix'; -import CVEffects from './CVEffects'; -import CVMaskElement from './CVMaskElement'; - -function CVBaseElement() { -} - -var operationsMap = { - 1: 'destination-in', - 2: 'destination-out', - 3: 'destination-in', - 4: 'destination-out', -}; - -CVBaseElement.prototype = { - createElements: function () {}, - initRendererElement: function () {}, - createContainerElements: function () { - // If the layer is masked we will use two buffers to store each different states of the drawing - // This solution is not ideal for several reason. But unfortunately, because of the recursive - // nature of the render tree, it's the only simple way to make sure one inner mask doesn't override an outer mask. - // TODO: try to reduce the size of these buffers to the size of the composition containing the layer - // It might be challenging because the layer most likely is transformed in some way - this.canvasContext = this.globalData.canvasContext; - this.transformCanvas = this.globalData.transformCanvas; - this.renderableEffectsManager = new CVEffects(this); - }, - createContent: function () {}, - setBlendMode: function () { - var globalData = this.globalData; - if (globalData.blendMode !== this.data.bm) { - globalData.blendMode = this.data.bm; - var blendModeValue = getBlendMode(this.data.bm); - globalData.canvasContext.globalCompositeOperation = blendModeValue; - } - }, - createRenderableComponents: function () { - this.maskManager = new CVMaskElement(this.data, this); - }, - hideElement: function () { - if (!this.hidden && (!this.isInRange || this.isTransparent)) { - this.hidden = true; - } - }, - showElement: function () { - if (this.isInRange && !this.isTransparent) { - this.hidden = false; - this._isFirstFrame = true; - this.maskManager._isFirstFrame = true; - } - }, - clearCanvas: function (canvasContext) { - canvasContext.clearRect( - this.transformCanvas.tx, - this.transformCanvas.ty, - this.transformCanvas.w * this.transformCanvas.sx, - this.transformCanvas.h * this.transformCanvas.sy - ); - }, - prepareLayer: function () { - if (this.data.tt >= 1) { - if (!this.canvasContext.saveLayer) { - return; - } - this.canvasContext.globalCompositeOperation = 'source-over'; - this.canvasContext.saveLayer(); - //保存递归图层 - this.canvasContext.saveLayer(); - //对之前的混合模式还原成默认模式 - this.canvasContext.globalCompositeOperation = 'source-over'; - - } - }, - exitLayer: function () { - if (this.data.tt >= 1) { - if (!this.canvasContext.saveLayer || !this.canvasContext.restoreLayer) { - return; - } - //恢复图层 - this.canvasContext.restoreLayer(); - //将递归图层和mask动效图层进行指定混合 - this.canvasContext.globalCompositeOperation = operationsMap[this.data.tt]; - //保存mask动效层 - this.canvasContext.saveLayer(); - //对之前的混合模式还原成默认模式 - this.canvasContext.globalCompositeOperation = 'source-over'; - // We draw the mask - const mask = this.comp.getElementById('tp' in this.data ? this.data.tp : this.data.ind - 1); - mask?.renderFrame(true); - //恢复图层 - this.canvasContext.restoreLayer(); - this.canvasContext.restoreLayer(); - this.canvasContext.globalCompositeOperation = 'source-over'; - } - }, - renderFrame: function (forceRender) { - if (this.hidden || this.data.hd) { - return; - } - if (this.data.td === 1 && !forceRender) { - return; - } - this.renderTransform && this.renderTransform(); - this.renderRenderable && this.renderRenderable(); - this.setBlendMode(); - var forceRealStack = this.data.ty === 0; - //开始处理mask数据:包含两层layer数据,需要创建两个离屏绘制上下文 - this.prepareLayer(); - this.globalData.renderer.save(forceRealStack); - this.globalData.renderer.ctxTransform(this.finalTransform.mat.props); - this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v); - this.renderInnerContent && this.renderInnerContent(); - this.globalData.renderer.restore(forceRealStack); - //将两个layer数据分别绘制到两个离屏画布上,通过将离屏绘制数据结合混合模式绘制到当前显示画布上,实现mask效果 - this.exitLayer(); - - //恢复高斯模糊的默认值,防止非高斯模糊图层也高斯模糊 - this.canvasContext.filter = 'blur(0px)' - - if (this.maskManager.hasMasks) { - this.globalData.renderer.restore(true); - } - if (this._isFirstFrame) { - this._isFirstFrame = false; - } - }, - changeColor: function (color, endColor, index) { - this._isFirstFrame = true; - this.renderShapeColor && this.renderShapeColor(color, endColor, index); - }, - destroy: function () { - this.canvasContext = null; - this.data = null; - this.globalData = null; - this.maskManager.destroy(); - }, - mHelper: new Matrix(), -}; -CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement; -CVBaseElement.prototype.show = CVBaseElement.prototype.showElement; - -export default CVBaseElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVCompElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVCompElement.js deleted file mode 100644 index b4078bbe840cef6e02876f4b43d172b6edf6c187..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVCompElement.js +++ /dev/null @@ -1,111 +0,0 @@ -import { - extendPrototype, -} from '../../utils/functionExtensions'; -import { - createSizedArray, -} from '../../utils/helpers/arrays'; -import PropertyFactory from '../../utils/PropertyFactory'; -import CanvasRendererBase from '../../renderers/CanvasRendererBase'; -import CVBaseElement from './CVBaseElement'; -import ICompElement from '../CompElement'; - -function CVCompElement(data, globalData, comp) { - this.completeLayers = false; - this.layers = data.layers; - this.pendingElements = []; - this.elements = createSizedArray(this.layers?.length); - this.initElement(data, globalData, comp); - this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true }; -} - -extendPrototype([CanvasRendererBase, ICompElement, CVBaseElement], CVCompElement); - -CVCompElement.prototype.renderInnerContent = function () { - var ctx = this.canvasContext; - ctx.beginPath(); - ctx.moveTo(0, 0); - ctx.lineTo(this.data.w, 0); - ctx.lineTo(this.data.w, this.data.h); - ctx.lineTo(0, this.data.h); - ctx.lineTo(0, 0); - ctx.clip(); - var i; - var len = this.layers.length; - for (i = len - 1; i >= 0; i -= 1) { - if (this.completeLayers || this.elements[i]) { - this.elements[i].renderFrame(); - } - } -}; - -CVCompElement.prototype.renderShapeColor = function (color, endColor, index) { - if (typeof endColor == 'object') { - if (Array.isArray(endColor)) { - if (!index) { - var i; - var len = this.layers.length; - for (i = len - 1; i >= 0; i -= 1) { - let tag = true; - if (this.layers[i] && this.layers[i].td) { - tag = false; - } - if (tag && (this.completeLayers || this.elements[i])) { - this.elements[i].changeColor(color, endColor); - } - } - } else { - if (this.completeLayers || this.elements[index-1]) { - this.elements[index-1].changeColor(color, endColor); - } - } - } - } else if (typeof endColor == 'number') { - if (!endColor) { - var i; - var len = this.layers.length; - for (i = 0; i < len; i += 1) { - let tag = true; - if (this.layers[i] && this.layers[i].td) { - tag = false; - } - if (tag && (this.completeLayers || this.elements[i])) { - this.elements[i].changeColor(color, undefined); - } - } - } else { - if (this.completeLayers || this.elements[endColor-1]) { - this.elements[endColor-1].changeColor(color, undefined); - } - } - } else { - var i; - var len = this.layers.length; - for (i = 0; i < len; i += 1) { - let tag = true; - if (this.layers[i] && this.layers[i].td) { - tag = false; - } - if (tag && (this.completeLayers || this.elements[i])) { - this.elements[i].changeColor(color, undefined); - } - } - } -} - -CVCompElement.prototype.destroy = function () { - var i; - var len = this.layers.length; - for (i = len - 1; i >= 0; i -= 1) { - if (this.elements[i]) { - this.elements[i].destroy(); - } - } - this.layers = null; - this.elements = null; -}; - -CVCompElement.prototype.createComp = function (data) { - return new CVCompElement(data, this.globalData, this); -}; - -export default CVCompElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVContextData.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVContextData.js deleted file mode 100644 index f5d8b93d02faa73bed4b6fb0c881fa3edb9210fb..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVContextData.js +++ /dev/null @@ -1,90 +0,0 @@ -import { - createTypedArray, -} from '../../utils/helpers/arrays'; -import Matrix from '../../3rd_party/transformation-matrix'; - -function CVContextData() { - this.saved = []; - this.cArrPos = 0; - this.cTr = new Matrix(); - this.cO = 1; - var i; - var len = 15; - this.savedOp = createTypedArray('float32', len); - for (i = 0; i < len; i += 1) { - this.saved[i] = createTypedArray('float32', 16); - } - this._length = len; -} - -CVContextData.prototype.duplicate = function () { - var newLength = this._length * 2; - var currentSavedOp = this.savedOp; - this.savedOp = createTypedArray('float32', newLength); - this.savedOp.set(currentSavedOp); - var i = 0; - for (i = this._length; i < newLength; i += 1) { - this.saved[i] = createTypedArray('float32', 16); - } - this._length = newLength; -}; - -CVContextData.prototype.reset = function () { - this.cArrPos = 0; - this.cTr.reset(); - this.cO = 1; -}; - -CVContextData.prototype.popTransform = function () { - var popped = this.saved[this.cArrPos]; - var i; - var arr = this.cTr.props; - for (i = 0; i < 16; i += 1) { - arr[i] = popped[i]; - } - return popped; -}; - -CVContextData.prototype.popOpacity = function () { - var popped = this.savedOp[this.cArrPos]; - this.cO = popped; - return popped; -}; - -CVContextData.prototype.pop = function () { - this.cArrPos -= 1; - var transform = this.popTransform(); - var opacity = this.popOpacity(); - return { - transform: transform, - opacity: opacity, - }; -}; - -CVContextData.prototype.push = function () { - var props = this.cTr.props; - if (this._length <= this.cArrPos) { - this.duplicate(); - } - var i; - var arr = this.saved[this.cArrPos]; - for (i = 0; i < 16; i += 1) { - arr[i] = props[i]; - } - this.savedOp[this.cArrPos] = this.cO; - this.cArrPos += 1; -}; - -CVContextData.prototype.getTransform = function () { - return this.cTr; -}; - -CVContextData.prototype.getOpacity = function () { - return this.cO; -}; - -CVContextData.prototype.setOpacity = function (value) { - this.cO = value; -}; - -export default CVContextData; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVEffects.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVEffects.js deleted file mode 100644 index b36e7c637ec413b6002e6f2a708cf763e6891191..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVEffects.js +++ /dev/null @@ -1,44 +0,0 @@ -import CVGaussianBlurEffect from './effects/CVGaussianBlurEffect' - -var registeredEffects = {}; - -function CVEffects(elem) { - var i; - var len = elem.data.ef ? elem.data.ef.length : 0; - this.filters = []; - var filterManager; - for (i = 0; i < len; i += 1) { - filterManager = null; - var type = elem.data.ef[i].ty; - //创建高斯模糊效果对象,type为29才是高斯模糊 - if (registeredEffects[type]) { - filterManager = new CVGaussianBlurEffect(elem.effectsManager.effectElements[i], elem); - } - //存储高斯模糊效果对象 - if (filterManager) { - this.filters.push(filterManager); - } - } - //将高斯模糊效果添加到指定对象 - if (this.filters.length) { - elem.addRenderableComponent(this); - } -} - -CVEffects.prototype.renderFrame = function (_isFirstFrame) { - var i; - var len = this.filters.length; - for (i = 0; i < len; i += 1) { - this.filters[i].renderFrame(_isFirstFrame); - } -}; - -export function registerCVEffect(id, effect, countsAsEffect) { - //注册高斯模糊效果监听 - registeredEffects[id] = { - effect, - countsAsEffect, - }; -} - -export default CVEffects; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVImageElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVImageElement.js deleted file mode 100644 index 153417b5de3931bc0e8752f5372cdf168c3ca5aa..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVImageElement.js +++ /dev/null @@ -1,62 +0,0 @@ -import { - extendPrototype, -} from '../../utils/functionExtensions'; -import createTag from '../../utils/helpers/html_elements'; -import RenderableElement from '../helpers/RenderableElement'; -import BaseElement from '../BaseElement'; -import TransformElement from '../helpers/TransformElement'; -import HierarchyElement from '../helpers/HierarchyElement'; -import FrameElement from '../helpers/FrameElement'; -import CVBaseElement from './CVBaseElement'; -import IImageElement from '../ImageElement'; -import SVGShapeElement from '../svgElements/SVGShapeElement'; - -function CVImageElement(data, globalData, comp) { - this.assetData = globalData.getAssetData(data.refId); - this.img = globalData.imageLoader.getAsset(this.assetData); - this.initElement(data, globalData, comp); -} -extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVImageElement); - -CVImageElement.prototype.initElement = SVGShapeElement.prototype.initElement; -CVImageElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame; - -CVImageElement.prototype.createContent = function () { - if (this.img && this.img.width && (this.assetData.w !== this.img.width || this.assetData.h !== this.img.height)) { - var imgW = this.img.width; - var imgH = this.img.height; - var imgRel = imgW / imgH; - var canvasRel = this.assetData.w / this.assetData.h; - var widthCrop; - var heightCrop; - var par = this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio; - if ((imgRel > canvasRel && par === 'xMidYMid slice') || (imgRel < canvasRel && par !== 'xMidYMid slice')) { - heightCrop = imgH; - widthCrop = heightCrop * canvasRel; - } else { - widthCrop = imgW; - heightCrop = widthCrop / canvasRel; - } - this.canvasContext.drawImage(this.img.pixel_map, (imgW - widthCrop) / 2, (imgH - heightCrop) / 2, widthCrop, heightCrop, 0, 0, this.assetData.w, this.assetData.h); - } -}; - -CVImageElement.prototype.renderInnerContent = function () { - if (this.img.pixel_map) { - //传入base64资源与rawfile资源解析出的pixelMap进行绘制 - this.canvasContext.drawImage(this.img.pixel_map, 0, 0, this.img.width, this.img.height); - } else { - this.canvasContext.drawImage(this.img, 0, 0); - } -}; - -CVImageElement.prototype.destroy = function () { - //释放pixel_map,防止内存泄漏 - if (this.img?.pixel_map) { - this.img.pixel_map.release(() => { - }); - } - this.img = null; -}; - -export default CVImageElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVMaskElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVMaskElement.js deleted file mode 100644 index 2b2c3a1fcae517dddcb7cf1bdf19f5ad317a8806..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVMaskElement.js +++ /dev/null @@ -1,116 +0,0 @@ -import { - createSizedArray, -} from '../../utils/helpers/arrays'; - -import ShapePropertyFactory from '../../utils/shapes/ShapeProperty'; -import MaskElement from '../../mask'; -import ArrayList from '@ohos.util.ArrayList'; - -function CVMaskElement(data, element) { - this.data = data; - this.element = element; - this.masksProperties = this.data.masksProperties || []; - this.viewData = createSizedArray(this.masksProperties.length); - this.list = new ArrayList(); - this.ptsds = undefined; - var i; - var len = this.masksProperties.length; - var hasMasks = false; - for (i = 0; i < len; i += 1) { - if (this.masksProperties[i].mode !== 'n') { - hasMasks = true; - } - this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element, this.masksProperties[i], 3); - } - this.hasMasks = hasMasks; - if (hasMasks) { - this.element.addRenderableComponent(this); - } -} - -CVMaskElement.prototype.renderFrame = function () { - if (!this.hasMasks) { - return; - } - var transform = this.element.finalTransform.mat; - var ctx = this.element.canvasContext; - var i; - var len = this.masksProperties.length; - var pt; - var pts; - var data; - ctx.beginPath(); - for (i = 0; i < len; i += 1) { - if (this.masksProperties[i].mode !== 'n') { - if (this.masksProperties[i].mode == 's' && !this.masksProperties[i].inv) { - if (i == 0) { - ctx.moveTo(0, 0); - ctx.lineTo(this.element.globalData.compSize.w, 0); - ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h); - ctx.lineTo(0, this.element.globalData.compSize.h); - ctx.lineTo(0, 0); - } else { - if (this.ptsds && this.ptsds.length > 1) { - ctx.moveTo(this.ptsds[0], this.ptsds[1]); - } - this.list.forEach(value => { - ctx.lineTo(value[4], value[5]); - ctx.bezierCurveTo(value[0], value[1], value[2], value[3], value[4], value[5]); - }) - } - data = this.viewData[i].v; - pt = transform.applyToPointArray(data.v[0][0], data.v[0][1], 0); - ctx.moveTo(pt[0], pt[1]); - var j; - var jLen = data._length; - for (j = 1; j < jLen; j += 1) { - pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]); - ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]); - } - pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]); - ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]); - - } else { - if (this.masksProperties[i].inv) { - ctx.moveTo(0, 0); - ctx.lineTo(this.element.globalData.compSize.w, 0); - ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h); - ctx.lineTo(0, this.element.globalData.compSize.h); - ctx.lineTo(0, 0); - } - data = this.viewData[i].v; - pt = transform.applyToPointArray(data.v[0][0], data.v[0][1], 0); - ctx.moveTo(pt[0], pt[1]); - var j; - var jLen = data._length; - if (i == 0) { - this.list.clear(); - var ptsd; - this.ptsds = pt; - for (j = jLen - 1; j > 0; j--) { - ptsd = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]); - this.list.add(ptsd); - } - - } - for (j = 1; j < jLen; j += 1) { - pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]); - ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]); - } - pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]); - ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]); - } - } - } - this.element.globalData.renderer.save(true); - ctx.clip(); -}; - -CVMaskElement.prototype.getMaskProperty = MaskElement.prototype.getMaskProperty; - -CVMaskElement.prototype.destroy = function () { - this.element = null; - this.list = null; -}; - -export default CVMaskElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVShapeElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVShapeElement.js deleted file mode 100644 index 3096b487641bd353be24f446a433281dd75bf29b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVShapeElement.js +++ /dev/null @@ -1,655 +0,0 @@ -import { - degToRads, - bmFloor, -} from '../../utils/common'; - -import { - extendPrototype, -} from '../../utils/functionExtensions'; -import PropertyFactory from '../../utils/PropertyFactory'; -import RenderableElement from '../helpers/RenderableElement'; -import BaseElement from '../BaseElement'; -import TransformElement from '../helpers/TransformElement'; -import HierarchyElement from '../helpers/HierarchyElement'; -import FrameElement from '../helpers/FrameElement'; -import RenderableDOMElement from '../helpers/RenderableDOMElement'; -import ShapeTransformManager from '../helpers/shapes/ShapeTransformManager'; -import CVBaseElement from './CVBaseElement'; -import IShapeElement from '../ShapeElement'; -import GradientProperty from '../../utils/shapes/GradientProperty'; -import DashProperty from '../../utils/shapes/DashProperty'; -import TransformPropertyFactory from '../../utils/TransformProperty'; -import CVShapeData from '../helpers/shapes/CVShapeData'; -import { ShapeModifiers } from '../../utils/shapes/ShapeModifiers'; -import { - lineCapEnum, - lineJoinEnum, -} from '../../utils/helpers/shapeEnums'; -import { LogUtil } from '../../utils/LogUtil'; - -function CVShapeElement(data, globalData, comp) { - this.shapes = []; - this.shapesData = data.shapes; - this.stylesList = []; - this.itemsData = []; - this.prevViewData = []; - this.shapeModifiers = []; - this.processedElements = []; - this.transformsManager = new ShapeTransformManager(); - this.initElement(data, globalData, comp); -} - -extendPrototype([BaseElement, TransformElement, CVBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableElement], CVShapeElement); - -CVShapeElement.prototype.initElement = RenderableDOMElement.prototype.initElement; - -CVShapeElement.prototype.transformHelper = { opacity: 1, _opMdf: false }; - -CVShapeElement.prototype.dashResetter = []; - -CVShapeElement.prototype.createContent = function () { - this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []); -}; - -CVShapeElement.prototype.createStyleElement = function (data, transforms) { - var styleElem = { - data: data, - type: data.ty, - preTransforms: this.transformsManager.addTransformSequence(transforms), - transforms: [], - elements: [], - closed: data.hd === true, - }; - var elementData = {}; - if (data.ty === 'fl' || data.ty === 'st') { - elementData.c = PropertyFactory.getProp(this, data.c, 1, 255, this); - if (!elementData.c.k) { - styleElem.co = 'rgb(' + bmFloor(elementData.c.v[0]) + ',' + bmFloor(elementData.c.v[1]) + ',' + bmFloor(elementData.c.v[2]) + ')'; - } - } else if (data.ty === 'gf' || data.ty === 'gs') { - elementData.s = PropertyFactory.getProp(this, data.s, 1, null, this); - elementData.e = PropertyFactory.getProp(this, data.e, 1, null, this); - elementData.h = PropertyFactory.getProp(this, data.h || { k: 0 }, 0, 0.01, this); - elementData.a = PropertyFactory.getProp(this, data.a || { k: 0 }, 0, degToRads, this); - elementData.g = new GradientProperty(this, data.g, this); - } - elementData.o = PropertyFactory.getProp(this, data.o, 0, 0.01, this); - if (data.ty === 'st' || data.ty === 'gs') { - styleElem.lc = lineCapEnum[data.lc || 2]; - styleElem.lj = lineJoinEnum[data.lj || 2]; - if (data.lj == 1) { // eslint-disable-line eqeqeq - styleElem.ml = data.ml; - } - elementData.w = PropertyFactory.getProp(this, data.w, 0, null, this); - if (!elementData.w.k) { - styleElem.wi = elementData.w.v; - } - if (data.d) { - var d = new DashProperty(this, data.d, 'canvas', this); - elementData.d = d; - if (!elementData.d.k) { - styleElem.da = elementData.d.dashArray; - styleElem.do = elementData.d.dashoffset[0]; - } - } - } else { - styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero'; - } - this.stylesList.push(styleElem); - elementData.style = styleElem; - return elementData; -}; - -CVShapeElement.prototype.createGroupElement = function () { - var elementData = { - it: [], - prevViewData: [], - }; - return elementData; -}; - -CVShapeElement.prototype.createTransformElement = function (data) { - var elementData = { - transform: { - opacity: 1, - _opMdf: false, - key: this.transformsManager.getNewKey(), - op: PropertyFactory.getProp(this, data.o, 0, 0.01, this), - mProps: TransformPropertyFactory.getTransformProperty(this, data, this), - }, - }; - return elementData; -}; - -CVShapeElement.prototype.createShapeElement = function (data) { - var elementData = new CVShapeData(this, data, this.stylesList, this.transformsManager); - - this.shapes.push(elementData); - this.addShapeToModifiers(elementData); - return elementData; -}; - -CVShapeElement.prototype.reloadShapes = function () { - this._isFirstFrame = true; - var i; - var len = this.itemsData.length; - for (i = 0; i < len; i += 1) { - this.prevViewData[i] = this.itemsData[i]; - } - this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []); - len = this.dynamicProperties.length; - for (i = 0; i < len; i += 1) { - this.dynamicProperties[i].getValue(); - } - this.renderModifiers(); - this.transformsManager.processSequences(this._isFirstFrame); -}; - -CVShapeElement.prototype.addTransformToStyleList = function (transform) { - var i; - var len = this.stylesList.length; - for (i = 0; i < len; i += 1) { - if (!this.stylesList[i].closed) { - this.stylesList[i].transforms.push(transform); - } - } -}; - -CVShapeElement.prototype.removeTransformFromStyleList = function () { - var i; - var len = this.stylesList.length; - for (i = 0; i < len; i += 1) { - if (!this.stylesList[i].closed) { - this.stylesList[i].transforms.pop(); - } - } -}; - -CVShapeElement.prototype.closeStyles = function (styles) { - var i; - var len = styles.length; - for (i = 0; i < len; i += 1) { - styles[i].closed = true; - } -}; - -CVShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, shouldRender, transforms) { - var i; - var len = arr.length - 1; - var j; - var jLen; - var ownStyles = []; - var ownModifiers = []; - var processedPos; - var modifier; - var currentTransform; - var ownTransforms = [].concat(transforms); - for (i = len; i >= 0; i -= 1) { - processedPos = this.searchProcessedElement(arr[i]); - if (!processedPos) { - arr[i]._shouldRender = shouldRender; - } else { - itemsData[i] = prevViewData[processedPos - 1]; - } - if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') { - if (!processedPos) { - itemsData[i] = this.createStyleElement(arr[i], ownTransforms); - } else { - itemsData[i].style.closed = false; - } - - ownStyles.push(itemsData[i].style); - } else if (arr[i].ty === 'gr') { - if (!processedPos) { - itemsData[i] = this.createGroupElement(arr[i]); - } else { - jLen = itemsData[i].it.length; - for (j = 0; j < jLen; j += 1) { - itemsData[i].prevViewData[j] = itemsData[i].it[j]; - } - } - this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, shouldRender, ownTransforms); - } else if (arr[i].ty === 'tr') { - if (!processedPos) { - currentTransform = this.createTransformElement(arr[i]); - itemsData[i] = currentTransform; - } - ownTransforms.push(itemsData[i]); - this.addTransformToStyleList(itemsData[i]); - } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') { - if (!processedPos) { - itemsData[i] = this.createShapeElement(arr[i]); - } - } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'pb' || arr[i].ty === 'zz' || arr[i].ty === 'op') { - if (!processedPos) { - modifier = ShapeModifiers.getModifier(arr[i].ty); - modifier.init(this, arr[i]); - itemsData[i] = modifier; - this.shapeModifiers.push(modifier); - } else { - modifier = itemsData[i]; - modifier.closed = false; - } - ownModifiers.push(modifier); - } else if (arr[i].ty === 'rp') { - if (!processedPos) { - modifier = ShapeModifiers.getModifier(arr[i].ty); - itemsData[i] = modifier; - modifier.init(this, arr, i, itemsData); - this.shapeModifiers.push(modifier); - shouldRender = false; - } else { - modifier = itemsData[i]; - modifier.closed = true; - } - ownModifiers.push(modifier); - } - this.addProcessedElement(arr[i], i + 1); - } - this.removeTransformFromStyleList(); - this.closeStyles(ownStyles); - len = ownModifiers.length; - for (i = 0; i < len; i += 1) { - ownModifiers[i].closed = true; - } -}; - -CVShapeElement.prototype.renderInnerContent = function () { - this.transformHelper.opacity = 1; - this.transformHelper._opMdf = false; - this.renderModifiers(); - this.transformsManager.processSequences(this._isFirstFrame); - this.renderShape(this.transformHelper, this.shapesData, this.itemsData, true); -}; - -CVShapeElement.prototype.renderShapeTransform = function (parentTransform, groupTransform) { - if (parentTransform._opMdf || groupTransform.op._mdf || this._isFirstFrame) { - groupTransform.opacity = parentTransform.opacity; - groupTransform.opacity *= groupTransform.op.v; - groupTransform._opMdf = true; - } -}; - -CVShapeElement.prototype.drawLayer = function () { - var i; - var len = this.stylesList.length; - var j; - var jLen; - var k; - var kLen; - var elems; - var nodes; - var renderer = this.globalData.renderer; - var ctx = this.globalData.canvasContext; - var type; - var currentStyle; - for (i = 0; i < len; i += 1) { - currentStyle = this.stylesList[i]; - type = currentStyle.type; - - // Skipping style when - // Stroke width equals 0 - // style should not be rendered (extra unused repeaters) - // current opacity equals 0 - // global opacity equals 0 - if (!(((type === 'st' || type === 'gs') && currentStyle.wi === 0) || !currentStyle.data._shouldRender || currentStyle.coOp === 0 || this.globalData.currentGlobalAlpha === 0)) { - renderer.save(); - elems = currentStyle.elements; - if (type === 'st' || type === 'gs') { - ctx.strokeStyle = type === 'st' ? currentStyle.co : currentStyle.grd; - ctx.lineWidth = currentStyle.wi; - ctx.lineCap = currentStyle.lc; - ctx.lineJoin = currentStyle.lj; - ctx.miterLimit = currentStyle.ml || 0; - } else { - ctx.fillStyle = type === 'fl' ? currentStyle.co : currentStyle.grd; - } - renderer.ctxOpacity(currentStyle.coOp); - if (type !== 'st' && type !== 'gs') { - ctx.beginPath(); - } - renderer.ctxTransform(currentStyle.preTransforms.finalTransform.props); - jLen = elems.length; - for (j = 0; j < jLen; j += 1) { - if (type === 'st' || type === 'gs') { - ctx.beginPath(); - if (currentStyle.da) { - //ctx.setLineDash()无法自动将currentStyle.da拆分为两个参数,导致传入接口参数个数不正确,所以这里需要手动拆分 - //判断currentStyle.da数组长度是否大于等于2,如果是则把数组的值取出来,传给ctx.setLineDash()方法 - if (currentStyle.da.length >= 2) { - var s1 = currentStyle.da[0]; - var s2 = currentStyle.da[1]; - ctx.setLineDash([s1, s2]); - } else { - var s1 = currentStyle.da[0]; - ctx.setLineDash([s1]); - } - ctx.lineDashOffset = currentStyle.do; - } - } - nodes = elems[j].trNodes; - kLen = nodes.length; - - for (k = 0; k < kLen; k += 1) { - if (nodes[k].t === 'm') { - ctx.moveTo(nodes[k].p[0], nodes[k].p[1]); - } else if (nodes[k].t === 'c') { - ctx.bezierCurveTo(nodes[k].pts[0], nodes[k].pts[1], nodes[k].pts[2], nodes[k].pts[3], nodes[k].pts[4], nodes[k].pts[5]); - } else { - ctx.closePath(); - } - } - if (type === 'st' || type === 'gs') { - ctx.stroke(); - if (currentStyle.da) { - ctx.setLineDash(this.dashResetter); - } - } - } - if (type !== 'st' && type !== 'gs') { - ctx.fill(currentStyle.r); - } - renderer.restore(); - } - } -}; - -CVShapeElement.prototype.applyColorToArray = function (targetArray, colorArray, maxChannels) { - if (targetArray) { - const channerlsToProcess = Math.min(maxChannels, targetArray.length); - for (let i = 0; i < channerlsToProcess; i++) { - targetArray[i] = colorArray[i] / 255.0; - } - } -}; - -CVShapeElement.prototype.keyframeColor = function (keyframe, color, endColor, number, isKeyframer) { - if (!keyframe) { - return; - } - if (number >= 1 && number <= 3) { - const channels = number; // 根据 number 确定需要处理通道 - - // 处理 keyframe.s - if (keyframe.s) { - this.applyColorToArray(keyframe.s, color, channels); - } - - // 处理 keyframe.e - if (keyframe.e) { - if (isKeyframer) { - this.applyColorToArray(keyframe.e, endColor, channels); - } else { - this.applyColorToArray(keyframe.e, color, channels); - } - } - } -}; - -CVShapeElement.prototype.changeColors = function (color, frame) { - if (color.length > 2) { // 修改图层颜色 - [frame[0], frame[1], frame[2]] = color; - } else if (color.length === 2) { - [frame[0], frame[1]] = color; - } else if (color.length === 1) { - [frame[0]] = color; - } else { - LogUtil.info('--lottie_ohos animation changecolor the input color parameter is not in RGB format.'); - } -}; - -CVShapeElement.prototype.flColor = function (index, data, color, endColor) { - try { - let lens = data[index].c.data.k.length; - let ii; - let keyframe = data[index].c.data.k[0]; - let frame = data[index].c.v; - if (!!endColor && endColor.length > 0) { - for (ii = 0; ii < lens; ii++) { // 修改关键帧颜色 - if (color.length > 2 && endColor.length > 2) { - this.keyframeColor(keyframe, color, endColor, 3, true); - } else if (color.length === 2 && endColor.length > 1) { - this.keyframeColor(keyframe, color, endColor, 2, true); - } else if (color.length === 1 && endColor.length > 0) { - this.keyframeColor(keyframe, color, endColor, 1, true); - } else { - } - if (color.length > 2 && endColor.length > 2 && ii > 0) { - let keyframe1 = data[index].c.data.k[ii]; - this.keyframeColor(keyframe1, color, endColor, 3, true); - } else if (color.length === 2 && endColor.length > 1 && ii > 0) { - let keyframe1 = data[index].c.data.k[ii]; - this.keyframeColor(keyframe1, color, endColor, 2, true); - } else if (color.length === 1 && endColor.length > 0 && ii > 0) { - let keyframe1 = data[index].c.data.k[ii]; - this.keyframeColor(keyframe1, color, endColor, 1, true); - } else { - } - } - this.changeColors(endColor, frame); - } else { - for (ii = 0; ii < lens; ii++) { // 修改关键帧颜色 - let keyframe2 = data[index].c.data.k[ii]; - if (color.length > 2) { - this.keyframeColor(keyframe2, color, endColor, 3, false); - } else if (color.length === 2) { - this.keyframeColor(keyframe2, color, endColor, 2, false); - } else if (color.length === 1) { - this.keyframeColor(keyframe2, color, endColor, 1, false); - } else { - LogUtil.info('--lottie_ohos animation changecolor the input color parameter is not in RGB format.'); - } - } - this.changeColors(color, frame); - } - if (color.length === 4) { - data[index].o.v = color[3]; - } - } catch (error) { - LogUtil.info('--lottie_ohos animation changecolor the input color parameter is not in RGB format.'); - } -}; - -CVShapeElement.prototype.renderShapeColor = function (color, endColor, items, data) { - if (!items || items.length === 0) { - items = this.shapesData; - data = this.itemsData; - } - var i; - var len = items.length - 1; - for (i = len; i >= 0; i -= 1) { - if (items[i].ty === 'fl' || items[i].ty === 'st') { - this.flColor(i, data, color, endColor); - } else if (items[i].ty === 'gr') { - this.renderShapeColor(color, endColor, items[i].it, data[i].it) - } else if (items[i].ty === 'gf' || items[i].ty === 'gs') { - try { - data[i].style.grd = undefined; - var j; - var lenss = 3; - for (j = 0; j < lenss; j += 1) { - if (color.length >= 3) { - data[i].g.c[j * 4 + 1] = color[0]; - data[i].g.c[j * 4 + 2] = color[1]; - data[i].g.c[j * 4 + 3] = color[2]; - } else if (color.length === 2) { - data[i].g.c[j * 4 + 1] = color[0]; - data[i].g.c[j * 4 + 2] = color[1]; - } else if (color.length === 1) { - data[i].g.c[j * 4 + 1] = color[0]; - } - } - } catch (error) { - } - } - } -} - -CVShapeElement.prototype.renderShape = function (parentTransform, items, data, isMain) { - var i; - var len = items.length - 1; - var groupTransform; - groupTransform = parentTransform; - for (i = len; i >= 0; i -= 1) { - if (items[i].ty === 'tr') { - groupTransform = data[i].transform; - this.renderShapeTransform(parentTransform, groupTransform); - } else if (items[i].ty === 'sh' || items[i].ty === 'el' || items[i].ty === 'rc' || items[i].ty === 'sr') { - this.renderPath(items[i], data[i]); - } else if (items[i].ty === 'fl') { - this.renderFill(items[i], data[i], groupTransform); - } else if (items[i].ty === 'st') { - this.renderStroke(items[i], data[i], groupTransform); - } else if (items[i].ty === 'gf' || items[i].ty === 'gs') { - this.renderGradientFill(items[i], data[i], groupTransform); - } else if (items[i].ty === 'gr') { - this.renderShape(groupTransform, items[i].it, data[i].it); - } else if (items[i].ty === 'tm') { - // - } - } - if (isMain) { - this.drawLayer(); - } -}; - -CVShapeElement.prototype.renderStyledShape = function (styledShape, shape) { - if (this._isFirstFrame || shape._mdf || styledShape.transforms._mdf) { - var shapeNodes = styledShape.trNodes; - var paths = shape.paths; - var i; - var len; - var j; - var jLen = paths._length; - shapeNodes.length = 0; - var groupTransformMat = styledShape.transforms.finalTransform; - for (j = 0; j < jLen; j += 1) { - var pathNodes = paths.shapes[j]; - if (pathNodes && pathNodes.v) { - len = pathNodes._length; - for (i = 1; i < len; i += 1) { - if (i === 1) { - shapeNodes.push({ - t: 'm', - p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0), - }); - } - shapeNodes.push({ - t: 'c', - pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i]), - }); - } - if (len === 1) { - shapeNodes.push({ - t: 'm', - p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0), - }); - } - if (pathNodes.c && len) { - shapeNodes.push({ - t: 'c', - pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0]), - }); - shapeNodes.push({ - t: 'z', - }); - } - } - } - styledShape.trNodes = shapeNodes; - } -}; - -CVShapeElement.prototype.renderPath = function (pathData, itemData) { - if (pathData.hd !== true && pathData._shouldRender) { - var i; - var len = itemData.styledShapes.length; - for (i = 0; i < len; i += 1) { - this.renderStyledShape(itemData.styledShapes[i], itemData.sh); - } - } -}; - -CVShapeElement.prototype.renderFill = function (styleData, itemData, groupTransform) { - var styleElem = itemData.style; - - if (itemData.c._mdf || this._isFirstFrame) { - styleElem.co = 'rgb(' - + bmFloor(itemData.c.v[0]) + ',' - + bmFloor(itemData.c.v[1]) + ',' - + bmFloor(itemData.c.v[2]) + ')'; - } - if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) { - styleElem.coOp = itemData.o.v * groupTransform.opacity; - } -}; - -CVShapeElement.prototype.renderGradientFill = function (styleData, itemData, groupTransform) { - var styleElem = itemData.style; - var grd; - if (!styleElem.grd || itemData.g._mdf || itemData.s._mdf || itemData.e._mdf || (styleData.t !== 1 && (itemData.h._mdf || itemData.a._mdf))) { - var ctx = this.globalData.canvasContext; - var pt1 = itemData.s.v; - var pt2 = itemData.e.v; - if (styleData.t === 1) { - grd = ctx.createLinearGradient(pt1[0], pt1[1], pt2[0], pt2[1]); - } else { - var rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2)); - var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]); - - var percent = itemData.h.v; - if (percent >= 1) { - percent = 0.99; - } else if (percent <= -1) { - percent = -0.99; - } - var dist = rad * percent; - var x = Math.cos(ang + itemData.a.v) * dist + pt1[0]; - var y = Math.sin(ang + itemData.a.v) * dist + pt1[1]; - grd = ctx.createRadialGradient(x, y, 0, pt1[0], pt1[1], rad); - } - - var i; - var len = styleData.g.p; - var cValues = itemData.g.c; - var opacity = 1; - let len1 = itemData.g.o.length; - for (i = 0; i < len; i += 1) { - let index = i * 2 + 1; - if (itemData.g._hasOpacity && len1 > index) { - opacity = itemData.g.o[index]; - } - grd.addColorStop(cValues[i * 4] / 100, 'rgba(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ',' + opacity + ')'); - } - styleElem.grd = grd; - } - styleElem.coOp = itemData.o.v * groupTransform.opacity; -}; - -CVShapeElement.prototype.renderStroke = function (styleData, itemData, groupTransform) { - var styleElem = itemData.style; - var d = itemData.d; - if (d && (d._mdf || this._isFirstFrame)) { - styleElem.da = d.dashArray; - styleElem.do = d.dashoffset[0]; - } - if (itemData.c._mdf || this._isFirstFrame) { - styleElem.co = 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')'; - } - if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) { - styleElem.coOp = itemData.o.v * groupTransform.opacity; - } - if (itemData.w._mdf || this._isFirstFrame) { - styleElem.wi = itemData.w.v; - } -}; - -CVShapeElement.prototype.destroy = function () { - this.shapesData = null; - this.globalData = null; - this.canvasContext = null; - this.stylesList.length = 0; - this.itemsData.length = 0; -}; - -export default CVShapeElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVSolidElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVSolidElement.js deleted file mode 100644 index 61eadd805387c07f9ad308a16bac4f59336b9820..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVSolidElement.js +++ /dev/null @@ -1,28 +0,0 @@ -import { - extendPrototype, -} from '../../utils/functionExtensions'; -import RenderableElement from '../helpers/RenderableElement'; -import BaseElement from '../BaseElement'; -import TransformElement from '../helpers/TransformElement'; -import HierarchyElement from '../helpers/HierarchyElement'; -import FrameElement from '../helpers/FrameElement'; -import CVBaseElement from './CVBaseElement'; -import IImageElement from '../ImageElement'; -import SVGShapeElement from '../svgElements/SVGShapeElement'; - -function CVSolidElement(data, globalData, comp) { - this.initElement(data, globalData, comp); -} -extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVSolidElement); - -CVSolidElement.prototype.initElement = SVGShapeElement.prototype.initElement; -CVSolidElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame; - -CVSolidElement.prototype.renderInnerContent = function () { - var ctx = this.canvasContext; - ctx.fillStyle = this.data.sc; - ctx.fillRect(0, 0, this.data.sw, this.data.sh); - // -}; - -export default CVSolidElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVTextElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVTextElement.js deleted file mode 100644 index eacbd2aced0b2666ff627f661f1fd9026b1e2764..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/CVTextElement.js +++ /dev/null @@ -1,234 +0,0 @@ -import { - extendPrototype, -} from '../../utils/functionExtensions'; -import { - createSizedArray, -} from '../../utils/helpers/arrays'; -import createTag from '../../utils/helpers/html_elements'; -import RenderableElement from '../helpers/RenderableElement'; -import BaseElement from '../BaseElement'; -import TransformElement from '../helpers/TransformElement'; -import HierarchyElement from '../helpers/HierarchyElement'; -import FrameElement from '../helpers/FrameElement'; -import ITextElement from '../TextElement'; -import CVBaseElement from './CVBaseElement'; - -function CVTextElement(data, globalData, comp) { - this.textSpans = []; - this.yOffset = 0; - this.fillColorAnim = false; - this.strokeColorAnim = false; - this.strokeWidthAnim = false; - this.stroke = false; - this.fill = false; - this.justifyOffset = 0; - this.currentRender = null; - this.renderType = 'canvas'; - this.values = { - fill: 'rgba(0,0,0,0)', - stroke: 'rgba(0,0,0,0)', - sWidth: 0, - fValue: '', - }; - this.initElement(data, globalData, comp); -} -extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement, ITextElement], CVTextElement); - -// 不支持动态创建Canvas,使用空对象替换 -CVTextElement.prototype.tHelper = {}; - -CVTextElement.prototype.buildNewText = function () { - var documentData = this.textProperty.currentData; - this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0); - - var hasFill = false; - if (documentData.fc) { - hasFill = true; - this.values.fill = this.buildColor(documentData.fc); - } else { - this.values.fill = 'rgba(0,0,0,0)'; - } - this.fill = hasFill; - var hasStroke = false; - if (documentData.sc) { - hasStroke = true; - this.values.stroke = this.buildColor(documentData.sc); - this.values.sWidth = documentData.sw; - } - var fontData = this.globalData.fontManager.getFontByName(documentData.f); - var i; - var len; - var letters = documentData.l; - var matrixHelper = this.mHelper; - this.stroke = hasStroke; - this.values.fValue = documentData.finalSize + 'px ' + this.globalData.fontManager.getFontByName(documentData.f).fFamily; - len = documentData.finalText.length; - // this.tHelper.font = this.values.fValue; - var charData; - var shapeData; - var k; - var kLen; - var shapes; - var j; - var jLen; - var pathNodes; - var commands; - var pathArr; - var singleShape = this.data.singleShape; - var trackingOffset = documentData.tr * 0.001 * documentData.finalSize; - var xPos = 0; - var yPos = 0; - var firstLine = true; - var cnt = 0; - for (i = 0; i < len; i += 1) { - charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily); - shapeData = (charData && charData.data) || {}; - matrixHelper.reset(); - if (singleShape && letters[i].n) { - xPos = -trackingOffset; - yPos += documentData.yOffset; - yPos += firstLine ? 1 : 0; - firstLine = false; - } - shapes = shapeData.shapes && shapeData.shapes.length > 0 ? shapeData.shapes[0].it : []; - jLen = shapes.length; - matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100); - if (singleShape) { - this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos); - } - commands = createSizedArray(jLen - 1); - var commandsCounter = 0; - for (j = 0; j < jLen; j += 1) { - if (shapes[j].ty === 'sh') { - kLen = shapes[j].ks.k.i.length; - pathNodes = shapes[j].ks.k; - pathArr = []; - for (k = 1; k < kLen; k += 1) { - if (k === 1) { - pathArr.push(matrixHelper.applyToX(pathNodes.v[0][0], pathNodes.v[0][1], 0), matrixHelper.applyToY(pathNodes.v[0][0], pathNodes.v[0][1], 0)); - } - pathArr.push(matrixHelper.applyToX(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToY(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToX(pathNodes.i[k][0], pathNodes.i[k][1], 0), matrixHelper.applyToY(pathNodes.i[k][0], pathNodes.i[k][1], 0), matrixHelper.applyToX(pathNodes.v[k][0], pathNodes.v[k][1], 0), matrixHelper.applyToY(pathNodes.v[k][0], pathNodes.v[k][1], 0)); - } - pathArr.push(matrixHelper.applyToX(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToY(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToX(pathNodes.i[0][0], pathNodes.i[0][1], 0), matrixHelper.applyToY(pathNodes.i[0][0], pathNodes.i[0][1], 0), matrixHelper.applyToX(pathNodes.v[0][0], pathNodes.v[0][1], 0), matrixHelper.applyToY(pathNodes.v[0][0], pathNodes.v[0][1], 0)); - commands[commandsCounter] = pathArr; - commandsCounter += 1; - } - } - if (singleShape) { - xPos += letters[i].l; - xPos += trackingOffset; - } - if (this.textSpans[cnt]) { - this.textSpans[cnt].elem = commands; - } else { - this.textSpans[cnt] = { elem: commands }; - } - cnt += 1; - } -}; - -CVTextElement.prototype.renderInnerContent = function () { - var ctx = this.canvasContext; - ctx.font = this.values.fValue; - ctx.lineCap = 'butt'; - ctx.lineJoin = 'miter'; - ctx.miterLimit = 4; - - if (!this.data.singleShape) { - this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag); - } - - var i; - var len; - var j; - var jLen; - var k; - var kLen; - var renderedLetters = this.textAnimator.renderedLetters; - - var letters = this.textProperty.currentData.l; - - len = letters.length; - var renderedLetter; - var lastFill = null; - var lastStroke = null; - var lastStrokeW = null; - var commands; - var pathArr; - for (i = 0; i < len; i += 1) { - if (!letters[i].n) { - renderedLetter = renderedLetters[i]; - if (renderedLetter) { - this.globalData.renderer.save(); - this.globalData.renderer.ctxTransform(renderedLetter.p); - this.globalData.renderer.ctxOpacity(renderedLetter.o); - } - if (this.fill) { - if (renderedLetter && renderedLetter.fc) { - if (lastFill !== renderedLetter.fc) { - lastFill = renderedLetter.fc; - ctx.fillStyle = renderedLetter.fc; - } - } else if (lastFill !== this.values.fill) { - lastFill = this.values.fill; - ctx.fillStyle = this.values.fill; - } - commands = this.textSpans[i].elem; - jLen = commands.length; - this.globalData.canvasContext.beginPath(); - for (j = 0; j < jLen; j += 1) { - pathArr = commands[j]?.map((item) => { - return px2vp(item); - }); - kLen = pathArr.length; - this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]); - for (k = 2; k < kLen; k += 6) { - this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]); - } - } - this.globalData.canvasContext.closePath(); - this.globalData.canvasContext.fill(); - ctx.fillText(letters[i].val,0,0); - } - if (this.stroke) { - if (renderedLetter && renderedLetter.sw) { - if (lastStrokeW !== renderedLetter.sw) { - lastStrokeW = renderedLetter.sw; - ctx.lineWidth = renderedLetter.sw; - } - } else if (lastStrokeW !== this.values.sWidth) { - lastStrokeW = this.values.sWidth; - ctx.lineWidth = this.values.sWidth; - } - if (renderedLetter && renderedLetter.sc) { - if (lastStroke !== renderedLetter.sc) { - lastStroke = renderedLetter.sc; - ctx.strokeStyle = renderedLetter.sc; - } - } else if (lastStroke !== this.values.stroke) { - lastStroke = this.values.stroke; - ctx.strokeStyle = this.values.stroke; - } - commands = this.textSpans[i].elem; - jLen = commands.length; - this.globalData.canvasContext.beginPath(); - for (j = 0; j < jLen; j += 1) { - pathArr = commands[j]; - kLen = pathArr.length; - this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]); - for (k = 2; k < kLen; k += 6) { - this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]); - } - } - this.globalData.canvasContext.closePath(); - this.globalData.canvasContext.stroke(); - ctx.strokeText(letters[i].val,0,0); - } - if (renderedLetter) { - this.globalData.renderer.restore(); - } - } - } -}; - -export default CVTextElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/effects/CVGaussianBlurEffect.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/effects/CVGaussianBlurEffect.js deleted file mode 100644 index d5f4871f9f1389fe9a58c7be99873641cb3f5264..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/canvasElements/effects/CVGaussianBlurEffect.js +++ /dev/null @@ -1,14 +0,0 @@ -function CVGaussianBlurEffect(filterManager, elem) { - this.filterManager = filterManager; - this.canvasContext = elem.canvasContext; -} - -CVGaussianBlurEffect.prototype.renderFrame = function (forceRender) { - //获取图层高斯模糊值 - var sigma = this.filterManager.effectElements[0].p.v; - //给图层设置高斯模糊效果 - this.canvasContext.filter = 'blur(' + sigma + 'px)'; - -}; - -export default CVGaussianBlurEffect; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/FrameElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/FrameElement.js deleted file mode 100644 index cb37450a8d1f0806d82305e4b865b3bc930fe5fa..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/FrameElement.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file - * Handles element's layer frame update. - * Checks layer in point and out point - * - */ - -function FrameElement() {} - -FrameElement.prototype = { - /** - * @function - * Initializes frame related properties. - * - */ - initFrame: function () { - // set to true when inpoint is rendered - this._isFirstFrame = false; - // list of animated properties - this.dynamicProperties = []; - // If layer has been modified in current tick this will be true - this._mdf = false; - }, - /** - * @function - * Calculates all dynamic values - * - * @param {number} num - * current frame number in Layer's time - * @param {boolean} isVisible - * if layers is currently in range - * - */ - prepareProperties: function (num, isVisible) { - var i; - var len = this.dynamicProperties.length; - for (i = 0; i < len; i += 1) { - if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) { - this.dynamicProperties[i].getValue(); - if (this.dynamicProperties[i]._mdf) { - this.globalData._mdf = true; - this._mdf = true; - } - } - } - }, - addDynamicProperty: function (prop) { - if (this.dynamicProperties.indexOf(prop) === -1) { - this.dynamicProperties.push(prop); - } - }, -}; - -export default FrameElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/HierarchyElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/HierarchyElement.js deleted file mode 100644 index 6d44896a819597c832dad2143efe5c83834361f0..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/HierarchyElement.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file - * Handles AE's layer parenting property. - * - */ - -function HierarchyElement() {} - -HierarchyElement.prototype = { - /** - * @function - * Initializes hierarchy properties - * - */ - initHierarchy: function () { - // element's parent list - this.hierarchy = []; - // if element is parent of another layer _isParent will be true - this._isParent = false; - this.checkParenting(); - }, - /** - * @function - * Sets layer's hierarchy. - * @param {array} hierarch - * layer's parent list - * - */ - setHierarchy: function (hierarchy) { - this.hierarchy = hierarchy; - }, - /** - * @function - * Sets layer as parent. - * - */ - setAsParent: function () { - this._isParent = true; - }, - /** - * @function - * Searches layer's parenting chain - * - */ - checkParenting: function () { - if (this.data.parent !== undefined) { - this.comp.buildElementParenting(this, this.data.parent, []); - } - }, -}; - -export default HierarchyElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/RenderableDOMElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/RenderableDOMElement.js deleted file mode 100644 index 2ad657fd6b85b7c9f5c13d370e0c106accdb2709..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/RenderableDOMElement.js +++ /dev/null @@ -1,77 +0,0 @@ -import { - extendPrototype, - createProxyFunction, -} from '../../utils/functionExtensions'; -import RenderableElement from './RenderableElement'; - -function RenderableDOMElement() {} - -(function () { - var _prototype = { - initElement: function (data, globalData, comp) { - this.initFrame(); - this.initBaseData(data, globalData, comp); - this.initTransform(data, globalData, comp); - this.initHierarchy(); - this.initRenderable(); - this.initRendererElement(); - this.createContainerElements(); - this.createRenderableComponents(); - this.createContent(); - this.hide(); - }, - hide: function () { - // console.log('HIDE', this); - if (!this.hidden && (!this.isInRange || this.isTransparent)) { - var elem = this.baseElement || this.layerElement; - elem.style.display = 'none'; - this.hidden = true; - } - }, - show: function () { - // console.log('SHOW', this); - if (this.isInRange && !this.isTransparent) { - if (!this.data.hd) { - var elem = this.baseElement || this.layerElement; - elem.style.display = 'block'; - } - this.hidden = false; - this._isFirstFrame = true; - } - }, - renderFrame: function () { - // If it is exported as hidden (data.hd === true) no need to render - // If it is not visible no need to render - if (this.data.hd || this.hidden) { - return; - } - this.renderTransform(); - this.renderRenderable(); - this.renderElement(); - this.renderInnerContent(); - if (this._isFirstFrame) { - this._isFirstFrame = false; - } - }, - changeColor: function (color, endColor, index) { - this._isFirstFrame = true; - this.renderShapeColor(color, endColor, index); - this.isInRange = false; - }, - renderInnerContent: function () {}, - renderShapeColor: function () {}, - prepareFrame: function (num) { - this._mdf = false; - this.prepareRenderableFrame(num); - this.prepareProperties(num, this.isInRange); - this.checkTransparency(); - }, - destroy: function () { - this.innerElem = null; - this.destroyBaseElement(); - }, - }; - extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement); -}()); - -export default RenderableDOMElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/RenderableElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/RenderableElement.js deleted file mode 100644 index 876bb0c416a1c4ad68412b6c24626b646bd5cd02..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/RenderableElement.js +++ /dev/null @@ -1,87 +0,0 @@ -function RenderableElement() { - -} - -RenderableElement.prototype = { - initRenderable: function () { - // layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange - this.isInRange = false; - // layer's display state - this.hidden = false; - // If layer's transparency equals 0, it can be hidden - this.isTransparent = false; - // list of animated components - this.renderableComponents = []; - }, - addRenderableComponent: function (component) { - if (this.renderableComponents.indexOf(component) === -1) { - this.renderableComponents.push(component); - } - }, - removeRenderableComponent: function (component) { - if (this.renderableComponents.indexOf(component) !== -1) { - this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1); - } - }, - prepareRenderableFrame: function (num) { - this.checkLayerLimits(num); - }, - checkTransparency: function () { - if (this.finalTransform.mProp.o.v <= 0) { - if (!this.isTransparent && this.globalData.renderConfig.hideOnTransparent) { - this.isTransparent = true; - this.hide(); - } - } else if (this.isTransparent) { - this.isTransparent = false; - this.show(); - } - }, - /** - * @function - * Initializes frame related properties. - * - * @param {number} num - * current frame number in Layer's time - * - */ - checkLayerLimits: function (num) { - if (this.data.ip - this.data.st <= num && this.data.op - this.data.st > num) { - if (this.isInRange !== true) { - this.globalData._mdf = true; - this._mdf = true; - this.isInRange = true; - this.show(); - } - } else if (this.isInRange !== false) { - this.globalData._mdf = true; - this.isInRange = false; - this.hide(); - } - }, - renderRenderable: function () { - var i; - var len = this.renderableComponents.length; - for (i = 0; i < len; i += 1) { - this.renderableComponents[i].renderFrame(this._isFirstFrame); - } - /* this.maskManager.renderFrame(this.finalTransform.mat); - this.renderableEffectsManager.renderFrame(this._isFirstFrame); */ - }, - sourceRectAtTime: function () { - return { - top: 0, - left: 0, - width: 100, - height: 100, - }; - }, - getLayerSize: function () { - if (this.data.ty === 5) { - return { w: this.data.textData.width, h: this.data.textData.height }; - } - return { w: this.data.width, h: this.data.height }; - }, -}; - -export default RenderableElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/TransformElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/TransformElement.js deleted file mode 100644 index c0050ca4c771663bb8e908de219fab1a8ba8d85e..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/TransformElement.js +++ /dev/null @@ -1,81 +0,0 @@ -import Matrix from '../../3rd_party/transformation-matrix'; -import TransformPropertyFactory from '../../utils/TransformProperty'; - -function TransformElement() {} - -TransformElement.prototype = { - initTransform: function () { - this.finalTransform = { - mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : { o: 0 }, - _matMdf: false, - _opMdf: false, - mat: new Matrix(), - }; - if (this.data.ao) { - this.finalTransform.mProp.autoOriented = true; - } - - // TODO: check TYPE 11: Guided elements - if (this.data.ty !== 11) { - // this.createElements(); - } - }, - renderTransform: function () { - this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame; - this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame; - - if (this.hierarchy) { - var mat; - var finalMat = this.finalTransform.mat; - var i = 0; - var len = this.hierarchy.length; - // Checking if any of the transformation matrices in the hierarchy chain has changed. - if (!this.finalTransform._matMdf) { - while (i < len) { - if (this.hierarchy[i].finalTransform.mProp._mdf) { - this.finalTransform._matMdf = true; - break; - } - i += 1; - } - } - - if (this.finalTransform._matMdf) { - mat = this.finalTransform.mProp.v.props; - finalMat.cloneFromProps(mat); - for (i = 0; i < len; i += 1) { - mat = this.hierarchy[i].finalTransform.mProp.v.props; - finalMat.transform(mat[0], mat[1], mat[2], mat[3], mat[4], mat[5], mat[6], mat[7], mat[8], mat[9], mat[10], mat[11], mat[12], mat[13], mat[14], mat[15]); - } - } - } - }, - globalToLocal: function (pt) { - var transforms = []; - transforms.push(this.finalTransform); - var flag = true; - var comp = this.comp; - while (flag) { - if (comp.finalTransform) { - if (comp.data.hasMask) { - transforms.splice(0, 0, comp.finalTransform); - } - comp = comp.comp; - } else { - flag = false; - } - } - var i; - var len = transforms.length; - var ptNew; - for (i = 0; i < len; i += 1) { - ptNew = transforms[i].mat.applyToPointArray(0, 0, 0); - // ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]); - pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0]; - } - return pt; - }, - mHelper: new Matrix(), -}; - -export default TransformElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/CVShapeData.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/CVShapeData.js deleted file mode 100644 index 93401593c815347b6af678ae7545b0c3534c1800..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/CVShapeData.js +++ /dev/null @@ -1,33 +0,0 @@ -import ShapePropertyFactory from '../../../utils/shapes/ShapeProperty'; -import SVGShapeData from './SVGShapeData'; - -function CVShapeData(element, data, styles, transformsManager) { - this.styledShapes = []; - this.tr = [0, 0, 0, 0, 0, 0]; - var ty = 4; - if (data.ty === 'rc') { - ty = 5; - } else if (data.ty === 'el') { - ty = 6; - } else if (data.ty === 'sr') { - ty = 7; - } - this.sh = ShapePropertyFactory.getShapeProp(element, data, ty, element); - var i; - var len = styles.length; - var styledShape; - for (i = 0; i < len; i += 1) { - if (!styles[i].closed) { - styledShape = { - transforms: transformsManager.addTransformSequence(styles[i].transforms), - trNodes: [], - }; - this.styledShapes.push(styledShape); - styles[i].elements.push(styledShape); - } - } -} - -CVShapeData.prototype.setAsAnimated = SVGShapeData.prototype.setAsAnimated; - -export default CVShapeData; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/ProcessedElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/ProcessedElement.js deleted file mode 100644 index 6cad9b3d684dae4dd0323df28bcaf5253691702b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/ProcessedElement.js +++ /dev/null @@ -1,6 +0,0 @@ -function ProcessedElement(element, position) { - this.elem = element; - this.pos = position; -} - -export default ProcessedElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGElementsRenderer.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGElementsRenderer.js deleted file mode 100644 index 5638f558d39084ce994886b3d360ba5c271b62b2..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGElementsRenderer.js +++ /dev/null @@ -1,241 +0,0 @@ -import Matrix from '../../../3rd_party/transformation-matrix'; -import buildShapeString from '../../../utils/shapes/shapePathBuilder'; -import { bmFloor } from '../../../utils/common'; - -const SVGElementsRenderer = (function () { - var _identityMatrix = new Matrix(); - var _matrixHelper = new Matrix(); - - var ob = { - createRenderFunction: createRenderFunction, - }; - - function createRenderFunction(data) { - switch (data.ty) { - case 'fl': - return renderFill; - case 'gf': - return renderGradient; - case 'gs': - return renderGradientStroke; - case 'st': - return renderStroke; - case 'sh': - case 'el': - case 'rc': - case 'sr': - return renderPath; - case 'tr': - return renderContentTransform; - case 'no': - return renderNoop; - default: - return null; - } - } - - function renderContentTransform(styleData, itemData, isFirstFrame) { - if (isFirstFrame || itemData.transform.op._mdf) { - itemData.transform.container.setAttribute('opacity', itemData.transform.op.v); - } - if (isFirstFrame || itemData.transform.mProps._mdf) { - itemData.transform.container.setAttribute('transform', itemData.transform.mProps.v.to2dCSS()); - } - } - - function renderNoop() { - - } - - function renderPath(styleData, itemData, isFirstFrame) { - var j; - var jLen; - var pathStringTransformed; - var redraw; - var pathNodes; - var l; - var lLen = itemData.styles.length; - var lvl = itemData.lvl; - var paths; - var mat; - var props; - var iterations; - var k; - for (l = 0; l < lLen; l += 1) { - redraw = itemData.sh._mdf || isFirstFrame; - if (itemData.styles[l].lvl < lvl) { - mat = _matrixHelper.reset(); - iterations = lvl - itemData.styles[l].lvl; - k = itemData.transformers.length - 1; - while (!redraw && iterations > 0) { - redraw = itemData.transformers[k].mProps._mdf || redraw; - iterations -= 1; - k -= 1; - } - if (redraw) { - iterations = lvl - itemData.styles[l].lvl; - k = itemData.transformers.length - 1; - while (iterations > 0) { - props = itemData.transformers[k].mProps.v.props; - mat.transform(props[0], props[1], props[2], props[3], props[4], props[5], props[6], props[7], props[8], props[9], props[10], props[11], props[12], props[13], props[14], props[15]); - iterations -= 1; - k -= 1; - } - } - } else { - mat = _identityMatrix; - } - paths = itemData.sh.paths; - jLen = paths._length; - if (redraw) { - pathStringTransformed = ''; - for (j = 0; j < jLen; j += 1) { - pathNodes = paths.shapes[j]; - if (pathNodes && pathNodes._length) { - pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat); - } - } - itemData.caches[l] = pathStringTransformed; - } else { - pathStringTransformed = itemData.caches[l]; - } - itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed; - itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf; - } - } - - function renderFill(styleData, itemData, isFirstFrame) { - var styleElem = itemData.style; - - if (itemData.c._mdf || isFirstFrame) { - styleElem.pElem.setAttribute('fill', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')'); - } - if (itemData.o._mdf || isFirstFrame) { - styleElem.pElem.setAttribute('fill-opacity', itemData.o.v); - } - } - - function renderGradientStroke(styleData, itemData, isFirstFrame) { - renderGradient(styleData, itemData, isFirstFrame); - renderStroke(styleData, itemData, isFirstFrame); - } - - function renderGradient(styleData, itemData, isFirstFrame) { - var gfill = itemData.gf; - var hasOpacity = itemData.g._hasOpacity; - var pt1 = itemData.s.v; - var pt2 = itemData.e.v; - - if (itemData.o._mdf || isFirstFrame) { - var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity'; - itemData.style.pElem.setAttribute(attr, itemData.o.v); - } - if (itemData.s._mdf || isFirstFrame) { - var attr1 = styleData.t === 1 ? 'x1' : 'cx'; - var attr2 = attr1 === 'x1' ? 'y1' : 'cy'; - gfill.setAttribute(attr1, pt1[0]); - gfill.setAttribute(attr2, pt1[1]); - if (hasOpacity && !itemData.g._collapsable) { - itemData.of.setAttribute(attr1, pt1[0]); - itemData.of.setAttribute(attr2, pt1[1]); - } - } - var stops; - var i; - var len; - var stop; - if (itemData.g._cmdf || isFirstFrame) { - stops = itemData.cst; - var cValues = itemData.g.c; - len = stops.length; - for (i = 0; i < len; i += 1) { - stop = stops[i]; - stop.setAttribute('offset', cValues[i * 4] + '%'); - stop.setAttribute('stop-color', 'rgb(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ')'); - } - } - if (hasOpacity && (itemData.g._omdf || isFirstFrame)) { - var oValues = itemData.g.o; - if (itemData.g._collapsable) { - stops = itemData.cst; - } else { - stops = itemData.ost; - } - len = stops.length; - for (i = 0; i < len; i += 1) { - stop = stops[i]; - if (!itemData.g._collapsable) { - stop.setAttribute('offset', oValues[i * 2] + '%'); - } - stop.setAttribute('stop-opacity', oValues[i * 2 + 1]); - } - } - if (styleData.t === 1) { - if (itemData.e._mdf || isFirstFrame) { - gfill.setAttribute('x2', pt2[0]); - gfill.setAttribute('y2', pt2[1]); - if (hasOpacity && !itemData.g._collapsable) { - itemData.of.setAttribute('x2', pt2[0]); - itemData.of.setAttribute('y2', pt2[1]); - } - } - } else { - var rad; - if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) { - rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2)); - gfill.setAttribute('r', rad); - if (hasOpacity && !itemData.g._collapsable) { - itemData.of.setAttribute('r', rad); - } - } - if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) { - if (!rad) { - rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2)); - } - var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]); - - var percent = itemData.h.v; - if (percent >= 1) { - percent = 0.99; - } else if (percent <= -1) { - percent = -0.99; - } - var dist = rad * percent; - var x = Math.cos(ang + itemData.a.v) * dist + pt1[0]; - var y = Math.sin(ang + itemData.a.v) * dist + pt1[1]; - gfill.setAttribute('fx', x); - gfill.setAttribute('fy', y); - if (hasOpacity && !itemData.g._collapsable) { - itemData.of.setAttribute('fx', x); - itemData.of.setAttribute('fy', y); - } - } - // gfill.setAttribute('fy','200'); - } - } - - function renderStroke(styleData, itemData, isFirstFrame) { - var styleElem = itemData.style; - var d = itemData.d; - if (d && (d._mdf || isFirstFrame) && d.dashStr) { - styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr); - styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]); - } - if (itemData.c && (itemData.c._mdf || isFirstFrame)) { - styleElem.pElem.setAttribute('stroke', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')'); - } - if (itemData.o._mdf || isFirstFrame) { - styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v); - } - if (itemData.w._mdf || isFirstFrame) { - styleElem.pElem.setAttribute('stroke-width', itemData.w.v); - if (styleElem.msElem) { - styleElem.msElem.setAttribute('stroke-width', itemData.w.v); - } - } - } - - return ob; -}()); - -export default SVGElementsRenderer; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGFillStyleData.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGFillStyleData.js deleted file mode 100644 index 26ab798b25734429ccc15d7e8e271a9caabe03f6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGFillStyleData.js +++ /dev/null @@ -1,18 +0,0 @@ -import DynamicPropertyContainer from '../../../utils/helpers/dynamicProperties'; - -import { - extendPrototype, -} from '../../../utils/functionExtensions'; -import PropertyFactory from '../../../utils/PropertyFactory'; - -function SVGFillStyleData(elem, data, styleOb) { - this.initDynamicPropertyContainer(elem); - this.getValue = this.iterateDynamicProperties; - this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this); - this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this); - this.style = styleOb; -} - -extendPrototype([DynamicPropertyContainer], SVGFillStyleData); - -export default SVGFillStyleData; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGGradientFillStyleData.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGGradientFillStyleData.js deleted file mode 100644 index 4ae0ab632ec6715b5bc157fe05f43102af0bf2d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGGradientFillStyleData.js +++ /dev/null @@ -1,100 +0,0 @@ -import { - degToRads, - createElementID, -} from '../../../utils/common'; -import { getLocationHref } from '../../../main'; -import { - extendPrototype, -} from '../../../utils/functionExtensions'; -import DynamicPropertyContainer from '../../../utils/helpers/dynamicProperties'; -import PropertyFactory from '../../../utils/PropertyFactory'; -import createNS from '../../../utils/helpers/svg_elements'; -import GradientProperty from '../../../utils/shapes/GradientProperty'; -import { - lineCapEnum, - lineJoinEnum, -} from '../../../utils/helpers/shapeEnums'; - -function SVGGradientFillStyleData(elem, data, styleOb) { - this.initDynamicPropertyContainer(elem); - this.getValue = this.iterateDynamicProperties; - this.initGradientData(elem, data, styleOb); -} - -SVGGradientFillStyleData.prototype.initGradientData = function (elem, data, styleOb) { - this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this); - this.s = PropertyFactory.getProp(elem, data.s, 1, null, this); - this.e = PropertyFactory.getProp(elem, data.e, 1, null, this); - this.h = PropertyFactory.getProp(elem, data.h || { k: 0 }, 0, 0.01, this); - this.a = PropertyFactory.getProp(elem, data.a || { k: 0 }, 0, degToRads, this); - this.g = new GradientProperty(elem, data.g, this); - this.style = styleOb; - this.stops = []; - this.setGradientData(styleOb.pElem, data); - this.setGradientOpacity(data, styleOb); - this._isAnimated = !!this._isAnimated; -}; - -SVGGradientFillStyleData.prototype.setGradientData = function (pathElement, data) { - var gradientId = createElementID(); - var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient'); - gfill.setAttribute('id', gradientId); - gfill.setAttribute('spreadMethod', 'pad'); - gfill.setAttribute('gradientUnits', 'userSpaceOnUse'); - var stops = []; - var stop; - var j; - var jLen; - jLen = data.g.p * 4; - for (j = 0; j < jLen; j += 4) { - stop = createNS('stop'); - gfill.appendChild(stop); - stops.push(stop); - } - pathElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + getLocationHref() + '#' + gradientId + ')'); - this.gf = gfill; - this.cst = stops; -}; - -SVGGradientFillStyleData.prototype.setGradientOpacity = function (data, styleOb) { - if (this.g._hasOpacity && !this.g._collapsable) { - var stop; - var j; - var jLen; - var mask = createNS('mask'); - var maskElement = createNS('path'); - mask.appendChild(maskElement); - var opacityId = createElementID(); - var maskId = createElementID(); - mask.setAttribute('id', maskId); - var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient'); - opFill.setAttribute('id', opacityId); - opFill.setAttribute('spreadMethod', 'pad'); - opFill.setAttribute('gradientUnits', 'userSpaceOnUse'); - jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length; - var stops = this.stops; - for (j = data.g.p * 4; j < jLen; j += 2) { - stop = createNS('stop'); - stop.setAttribute('stop-color', 'rgb(255,255,255)'); - opFill.appendChild(stop); - stops.push(stop); - } - maskElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + getLocationHref() + '#' + opacityId + ')'); - if (data.ty === 'gs') { - maskElement.setAttribute('stroke-linecap', lineCapEnum[data.lc || 2]); - maskElement.setAttribute('stroke-linejoin', lineJoinEnum[data.lj || 2]); - if (data.lj === 1) { - maskElement.setAttribute('stroke-miterlimit', data.ml); - } - } - this.of = opFill; - this.ms = mask; - this.ost = stops; - this.maskId = maskId; - styleOb.msElem = maskElement; - } -}; - -extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData); - -export default SVGGradientFillStyleData; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGGradientStrokeStyleData.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGGradientStrokeStyleData.js deleted file mode 100644 index 22adf24a531f71dc0e77d6c095a55075e2474c08..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGGradientStrokeStyleData.js +++ /dev/null @@ -1,20 +0,0 @@ -import { - extendPrototype, -} from '../../../utils/functionExtensions'; -import DynamicPropertyContainer from '../../../utils/helpers/dynamicProperties'; -import PropertyFactory from '../../../utils/PropertyFactory'; -import DashProperty from '../../../utils/shapes/DashProperty'; -import SVGGradientFillStyleData from './SVGGradientFillStyleData'; - -function SVGGradientStrokeStyleData(elem, data, styleOb) { - this.initDynamicPropertyContainer(elem); - this.getValue = this.iterateDynamicProperties; - this.w = PropertyFactory.getProp(elem, data.w, 0, null, this); - this.d = new DashProperty(elem, data.d || {}, 'svg', this); - this.initGradientData(elem, data, styleOb); - this._isAnimated = !!this._isAnimated; -} - -extendPrototype([SVGGradientFillStyleData, DynamicPropertyContainer], SVGGradientStrokeStyleData); - -export default SVGGradientStrokeStyleData; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGNoStyleData.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGNoStyleData.js deleted file mode 100644 index 7b7d06c10454e851a73b05b08c59bd9ce08dfe8d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGNoStyleData.js +++ /dev/null @@ -1,15 +0,0 @@ -import DynamicPropertyContainer from '../../../utils/helpers/dynamicProperties'; - -import { - extendPrototype, -} from '../../../utils/functionExtensions'; - -function SVGNoStyleData(elem, data, styleOb) { - this.initDynamicPropertyContainer(elem); - this.getValue = this.iterateDynamicProperties; - this.style = styleOb; -} - -extendPrototype([DynamicPropertyContainer], SVGNoStyleData); - -export default SVGNoStyleData; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGShapeData.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGShapeData.js deleted file mode 100644 index f4e13206bc7bb6a5b353451bf901ad1a16a275b9..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGShapeData.js +++ /dev/null @@ -1,28 +0,0 @@ -function SVGShapeData(transformers, level, shape) { - this.caches = []; - this.styles = []; - this.transformers = transformers; - this.lStr = ''; - this.sh = shape; - this.lvl = level; - // TODO find if there are some cases where _isAnimated can be false. - // For now, since shapes add up with other shapes. They have to be calculated every time. - // One way of finding out is checking if all styles associated to this shape depend only of this shape - this._isAnimated = !!shape.k; - // TODO: commenting this for now since all shapes are animated - var i = 0; - var len = transformers.length; - while (i < len) { - if (transformers[i].mProps.dynamicProperties.length) { - this._isAnimated = true; - break; - } - i += 1; - } -} - -SVGShapeData.prototype.setAsAnimated = function () { - this._isAnimated = true; -}; - -export default SVGShapeData; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGStrokeStyleData.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGStrokeStyleData.js deleted file mode 100644 index fa2435964dac66cbde14a99f6ea34c4252c51056..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGStrokeStyleData.js +++ /dev/null @@ -1,21 +0,0 @@ -import { - extendPrototype, -} from '../../../utils/functionExtensions'; -import DynamicPropertyContainer from '../../../utils/helpers/dynamicProperties'; -import PropertyFactory from '../../../utils/PropertyFactory'; -import DashProperty from '../../../utils/shapes/DashProperty'; - -function SVGStrokeStyleData(elem, data, styleOb) { - this.initDynamicPropertyContainer(elem); - this.getValue = this.iterateDynamicProperties; - this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this); - this.w = PropertyFactory.getProp(elem, data.w, 0, null, this); - this.d = new DashProperty(elem, data.d || {}, 'svg', this); - this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this); - this.style = styleOb; - this._isAnimated = !!this._isAnimated; -} - -extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData); - -export default SVGStrokeStyleData; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGStyleData.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGStyleData.js deleted file mode 100644 index 08267c7e86e9d0cad8c05559789a4f321f3eee3b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGStyleData.js +++ /dev/null @@ -1,19 +0,0 @@ -import createNS from '../../../utils/helpers/svg_elements'; - -function SVGStyleData(data, level) { - this.data = data; - this.type = data.ty; - this.d = ''; - this.lvl = level; - this._mdf = false; - this.closed = data.hd === true; - this.pElem = createNS('path'); - this.msElem = null; -} - -SVGStyleData.prototype.reset = function () { - this.d = ''; - this._mdf = false; -}; - -export default SVGStyleData; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGTransformData.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGTransformData.js deleted file mode 100644 index f032012c968b3d1a54aae9776fe842f9858997c6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/SVGTransformData.js +++ /dev/null @@ -1,11 +0,0 @@ -function SVGTransformData(mProps, op, container) { - this.transform = { - mProps: mProps, - op: op, - container: container, - }; - this.elements = []; - this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length; -} - -export default SVGTransformData; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/ShapeElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/ShapeElement.js deleted file mode 100644 index 7f0e7ef18779384f03cb23f501b408dfed7fae89..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/ShapeElement.js +++ /dev/null @@ -1,5 +0,0 @@ -function ShapeElementData() { - -} - -export default ShapeElementData; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/ShapeGroupData.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/ShapeGroupData.js deleted file mode 100644 index 46a0c8391f1d8528785e6ba2f98f855cb1226e9a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/ShapeGroupData.js +++ /dev/null @@ -1,9 +0,0 @@ -import createNS from '../../../utils/helpers/svg_elements'; - -function ShapeGroupData() { - this.it = []; - this.prevViewData = []; - this.gr = createNS('g'); -} - -export default ShapeGroupData; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/ShapeTransformManager.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/ShapeTransformManager.js deleted file mode 100644 index 421eea427f1b6e28f8f52cb17bd2459bb488592f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/helpers/shapes/ShapeTransformManager.js +++ /dev/null @@ -1,63 +0,0 @@ -import Matrix from '../../../3rd_party/transformation-matrix'; - -function ShapeTransformManager() { - this.sequences = {}; - this.sequenceList = []; - this.transform_key_count = 0; -} - -ShapeTransformManager.prototype = { - addTransformSequence: function (transforms) { - var i; - var len = transforms.length; - var key = '_'; - for (i = 0; i < len; i += 1) { - key += transforms[i].transform.key + '_'; - } - var sequence = this.sequences[key]; - if (!sequence) { - sequence = { - transforms: [].concat(transforms), - finalTransform: new Matrix(), - _mdf: false, - }; - this.sequences[key] = sequence; - this.sequenceList.push(sequence); - } - return sequence; - }, - processSequence: function (sequence, isFirstFrame) { - var i = 0; - var len = sequence.transforms.length; - var _mdf = isFirstFrame; - while (i < len && !isFirstFrame) { - if (sequence.transforms[i].transform.mProps._mdf) { - _mdf = true; - break; - } - i += 1; - } - if (_mdf) { - var props; - sequence.finalTransform.reset(); - for (i = len - 1; i >= 0; i -= 1) { - props = sequence.transforms[i].transform.mProps.v.props; - sequence.finalTransform.transform(props[0], props[1], props[2], props[3], props[4], props[5], props[6], props[7], props[8], props[9], props[10], props[11], props[12], props[13], props[14], props[15]); - } - } - sequence._mdf = _mdf; - }, - processSequences: function (isFirstFrame) { - var i; - var len = this.sequenceList.length; - for (i = 0; i < len; i += 1) { - this.processSequence(this.sequenceList[i], isFirstFrame); - } - }, - getNewKey: function () { - this.transform_key_count += 1; - return '_' + this.transform_key_count; - }, -}; - -export default ShapeTransformManager; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HBaseElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HBaseElement.js deleted file mode 100644 index 1e4e2df75be09da8d58fd364ce31e2a169e4134b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HBaseElement.js +++ /dev/null @@ -1,88 +0,0 @@ -import { - styleDiv, -} from '../../utils/common'; -import createNS from '../../utils/helpers/svg_elements'; -import createTag from '../../utils/helpers/html_elements'; -import BaseRenderer from '../../renderers/BaseRenderer'; -import SVGBaseElement from '../svgElements/SVGBaseElement'; -import CVEffects from '../canvasElements/CVEffects'; -import MaskElement from '../../mask'; - -function HBaseElement() {} -HBaseElement.prototype = { - checkBlendMode: function () {}, - initRendererElement: function () { - this.baseElement = createTag(this.data.tg || 'div'); - if (this.data.hasMask) { - this.svgElement = createNS('svg'); - this.layerElement = createNS('g'); - this.maskedElement = this.layerElement; - this.svgElement.appendChild(this.layerElement); - this.baseElement.appendChild(this.svgElement); - } else { - this.layerElement = this.baseElement; - } - styleDiv(this.baseElement); - }, - createContainerElements: function () { - this.renderableEffectsManager = new CVEffects(this); - this.transformedElement = this.baseElement; - this.maskedElement = this.layerElement; - if (this.data.ln) { - this.layerElement.setAttribute('id', this.data.ln); - } - if (this.data.cl) { - this.layerElement.setAttribute('class', this.data.cl); - } - if (this.data.bm !== 0) { - this.setBlendMode(); - } - }, - renderElement: function () { - var transformedElementStyle = this.transformedElement ? this.transformedElement.style : {}; - if (this.finalTransform._matMdf) { - var matrixValue = this.finalTransform.mat.toCSS(); - transformedElementStyle.transform = matrixValue; - transformedElementStyle.webkitTransform = matrixValue; - } - if (this.finalTransform._opMdf) { - transformedElementStyle.opacity = this.finalTransform.mProp.o.v; - } - }, - renderFrame: function () { - // If it is exported as hidden (data.hd === true) no need to render - // If it is not visible no need to render - if (this.data.hd || this.hidden) { - return; - } - this.renderTransform(); - this.renderRenderable(); - this.renderElement(); - this.renderInnerContent(); - if (this._isFirstFrame) { - this._isFirstFrame = false; - } - }, - destroy: function () { - this.layerElement = null; - this.transformedElement = null; - if (this.matteElement) { - this.matteElement = null; - } - if (this.maskManager) { - this.maskManager.destroy(); - this.maskManager = null; - } - }, - createRenderableComponents: function () { - this.maskManager = new MaskElement(this.data, this, this.globalData); - }, - addEffects: function () { - }, - setMatte: function () {}, -}; -HBaseElement.prototype.getBaseElement = SVGBaseElement.prototype.getBaseElement; -HBaseElement.prototype.destroyBaseElement = HBaseElement.prototype.destroy; -HBaseElement.prototype.buildElementParenting = BaseRenderer.prototype.buildElementParenting; - -export default HBaseElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HCameraElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HCameraElement.js deleted file mode 100644 index cd3d3459ac46820ec8877291902809640912b6db..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HCameraElement.js +++ /dev/null @@ -1,170 +0,0 @@ -import { - degToRads, -} from '../../utils/common'; -import { - extendPrototype, -} from '../../utils/functionExtensions'; -import PropertyFactory from '../../utils/PropertyFactory'; -import BaseElement from '../BaseElement'; -import HierarchyElement from '../helpers/HierarchyElement'; -import FrameElement from '../helpers/FrameElement'; -import Matrix from '../../3rd_party/transformation-matrix'; - -function HCameraElement(data, globalData, comp) { - this.initFrame(); - this.initBaseData(data, globalData, comp); - this.initHierarchy(); - var getProp = PropertyFactory.getProp; - this.pe = getProp(this, data.pe, 0, 0, this); - if (data.ks.p.s) { - this.px = getProp(this, data.ks.p.x, 1, 0, this); - this.py = getProp(this, data.ks.p.y, 1, 0, this); - this.pz = getProp(this, data.ks.p.z, 1, 0, this); - } else { - this.p = getProp(this, data.ks.p, 1, 0, this); - } - if (data.ks.a) { - this.a = getProp(this, data.ks.a, 1, 0, this); - } - if (data.ks.or.k.length && data.ks.or.k[0].to) { - var i; - var len = data.ks.or.k.length; - for (i = 0; i < len; i += 1) { - data.ks.or.k[i].to = null; - data.ks.or.k[i].ti = null; - } - } - this.or = getProp(this, data.ks.or, 1, degToRads, this); - this.or.sh = true; - this.rx = getProp(this, data.ks.rx, 0, degToRads, this); - this.ry = getProp(this, data.ks.ry, 0, degToRads, this); - this.rz = getProp(this, data.ks.rz, 0, degToRads, this); - this.mat = new Matrix(); - this._prevMat = new Matrix(); - this._isFirstFrame = true; - - // TODO: find a better way to make the HCamera element to be compatible with the LayerInterface and TransformInterface. - this.finalTransform = { - mProp: this, - }; -} -extendPrototype([BaseElement, FrameElement, HierarchyElement], HCameraElement); - -HCameraElement.prototype.setup = function () { - var i; - var len = this.comp.threeDElements.length; - var comp; - var perspectiveStyle; - var containerStyle; - for (i = 0; i < len; i += 1) { - // [perspectiveElem,container] - comp = this.comp.threeDElements[i]; - if (comp.type === '3d') { - perspectiveStyle = comp.perspectiveElem.style; - containerStyle = comp.container.style; - var perspective = this.pe.v + 'px'; - var origin = '0px 0px 0px'; - var matrix = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)'; - perspectiveStyle.perspective = perspective; - perspectiveStyle.webkitPerspective = perspective; - containerStyle.transformOrigin = origin; - containerStyle.mozTransformOrigin = origin; - containerStyle.webkitTransformOrigin = origin; - perspectiveStyle.transform = matrix; - perspectiveStyle.webkitTransform = matrix; - } - } -}; - -HCameraElement.prototype.createElements = function () { -}; - -HCameraElement.prototype.hide = function () { -}; - -HCameraElement.prototype.renderFrame = function () { - var _mdf = this._isFirstFrame; - var i; - var len; - if (this.hierarchy) { - len = this.hierarchy.length; - for (i = 0; i < len; i += 1) { - _mdf = this.hierarchy[i].finalTransform.mProp._mdf || _mdf; - } - } - if (_mdf || this.pe._mdf || (this.p && this.p._mdf) || (this.px && (this.px._mdf || this.py._mdf || this.pz._mdf)) || this.rx._mdf || this.ry._mdf || this.rz._mdf || this.or._mdf || (this.a && this.a._mdf)) { - this.mat.reset(); - - if (this.hierarchy) { - len = this.hierarchy.length - 1; - for (i = len; i >= 0; i -= 1) { - var mTransf = this.hierarchy[i].finalTransform.mProp; - this.mat.translate(-mTransf.p.v[0], -mTransf.p.v[1], mTransf.p.v[2]); - this.mat.rotateX(-mTransf.or.v[0]).rotateY(-mTransf.or.v[1]).rotateZ(mTransf.or.v[2]); - this.mat.rotateX(-mTransf.rx.v).rotateY(-mTransf.ry.v).rotateZ(mTransf.rz.v); - this.mat.scale(1 / mTransf.s.v[0], 1 / mTransf.s.v[1], 1 / mTransf.s.v[2]); - this.mat.translate(mTransf.a.v[0], mTransf.a.v[1], mTransf.a.v[2]); - } - } - if (this.p) { - this.mat.translate(-this.p.v[0], -this.p.v[1], this.p.v[2]); - } else { - this.mat.translate(-this.px.v, -this.py.v, this.pz.v); - } - if (this.a) { - var diffVector; - if (this.p) { - diffVector = [this.p.v[0] - this.a.v[0], this.p.v[1] - this.a.v[1], this.p.v[2] - this.a.v[2]]; - } else { - diffVector = [this.px.v - this.a.v[0], this.py.v - this.a.v[1], this.pz.v - this.a.v[2]]; - } - var mag = Math.sqrt(Math.pow(diffVector[0], 2) + Math.pow(diffVector[1], 2) + Math.pow(diffVector[2], 2)); - // var lookDir = getNormalizedPoint(getDiffVector(this.a.v,this.p.v)); - var lookDir = [diffVector[0] / mag, diffVector[1] / mag, diffVector[2] / mag]; - var lookLengthOnXZ = Math.sqrt(lookDir[2] * lookDir[2] + lookDir[0] * lookDir[0]); - var mRotationX = (Math.atan2(lookDir[1], lookLengthOnXZ)); - var mRotationY = (Math.atan2(lookDir[0], -lookDir[2])); - this.mat.rotateY(mRotationY).rotateX(-mRotationX); - } - this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v); - this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]); - this.mat.translate(this.globalData.compSize.w / 2, this.globalData.compSize.h / 2, 0); - this.mat.translate(0, 0, this.pe.v); - - var hasMatrixChanged = !this._prevMat.equals(this.mat); - if ((hasMatrixChanged || this.pe._mdf) && this.comp.threeDElements) { - len = this.comp.threeDElements.length; - var comp; - var perspectiveStyle; - var containerStyle; - for (i = 0; i < len; i += 1) { - comp = this.comp.threeDElements[i]; - if (comp.type === '3d') { - if (hasMatrixChanged) { - var matValue = this.mat.toCSS(); - containerStyle = comp.container.style; - containerStyle.transform = matValue; - containerStyle.webkitTransform = matValue; - } - if (this.pe._mdf) { - perspectiveStyle = comp.perspectiveElem.style; - perspectiveStyle.perspective = this.pe.v + 'px'; - perspectiveStyle.webkitPerspective = this.pe.v + 'px'; - } - } - } - this.mat.clone(this._prevMat); - } - } - this._isFirstFrame = false; -}; - -HCameraElement.prototype.prepareFrame = function (num) { - this.prepareProperties(num, true); -}; - -HCameraElement.prototype.destroy = function () { -}; -HCameraElement.prototype.getBaseElement = function () { return null; }; - -export default HCameraElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HCompElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HCompElement.js deleted file mode 100644 index bac6856f415f1869c9193b6e2aa65158a2088905..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HCompElement.js +++ /dev/null @@ -1,61 +0,0 @@ -import { - extendPrototype, -} from '../../utils/functionExtensions'; -import { - createSizedArray, -} from '../../utils/helpers/arrays'; -import PropertyFactory from '../../utils/PropertyFactory'; -import HybridRendererBase from '../../renderers/HybridRendererBase'; -import HBaseElement from './HBaseElement'; -import ICompElement from '../CompElement'; -import SVGCompElement from '../svgElements/SVGCompElement'; - -function HCompElement(data, globalData, comp) { - this.layers = data.layers; - this.supports3d = !data.hasMask; - this.completeLayers = false; - this.pendingElements = []; - this.elements = this.layers ? createSizedArray(this.layers.length) : []; - this.initElement(data, globalData, comp); - this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true }; -} - -extendPrototype([HybridRendererBase, ICompElement, HBaseElement], HCompElement); -HCompElement.prototype._createBaseContainerElements = HCompElement.prototype.createContainerElements; - -HCompElement.prototype.createContainerElements = function () { - this._createBaseContainerElements(); - // divElement.style.clip = 'rect(0px, '+this.data.w+'px, '+this.data.h+'px, 0px)'; - if (this.data.hasMask) { - this.svgElement.setAttribute('width', this.data.w); - this.svgElement.setAttribute('height', this.data.h); - this.transformedElement = this.baseElement; - } else { - this.transformedElement = this.layerElement; - } -}; - -HCompElement.prototype.addTo3dContainer = function (elem, pos) { - var j = 0; - var nextElement; - while (j < pos) { - if (this.elements[j] && this.elements[j].getBaseElement) { - nextElement = this.elements[j].getBaseElement(); - } - j += 1; - } - if (nextElement) { - this.layerElement.insertBefore(elem, nextElement); - } else { - this.layerElement.appendChild(elem); - } -}; - -HCompElement.prototype.createComp = function (data) { - if (!this.supports3d) { - return new SVGCompElement(data, this.globalData, this); - } - return new HCompElement(data, this.globalData, this); -}; - -export default HCompElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HImageElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HImageElement.js deleted file mode 100644 index 445e26b881289cbe45fe984785ae26a2c14865cb..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HImageElement.js +++ /dev/null @@ -1,42 +0,0 @@ -import { - extendPrototype, -} from '../../utils/functionExtensions'; -import createNS from '../../utils/helpers/svg_elements'; -import RenderableElement from '../helpers/RenderableElement'; -import BaseElement from '../BaseElement'; -import TransformElement from '../helpers/TransformElement'; -import HierarchyElement from '../helpers/HierarchyElement'; -import FrameElement from '../helpers/FrameElement'; -import HBaseElement from './HBaseElement'; -import HSolidElement from './HSolidElement'; - -function HImageElement(data, globalData, comp) { - this.assetData = globalData.getAssetData(data.refId); - this.initElement(data, globalData, comp); -} - -extendPrototype([BaseElement, TransformElement, HBaseElement, HSolidElement, HierarchyElement, FrameElement, RenderableElement], HImageElement); - -HImageElement.prototype.createContent = function () { - var assetPath = this.globalData.getAssetsPath(this.assetData); - var img = new Image(); - - if (this.data.hasMask) { - this.imageElem = createNS('image'); - this.imageElem.setAttribute('width', this.assetData.w + 'px'); - this.imageElem.setAttribute('height', this.assetData.h + 'px'); - this.imageElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath); - this.layerElement.appendChild(this.imageElem); - this.baseElement.setAttribute('width', this.assetData.w); - this.baseElement.setAttribute('height', this.assetData.h); - } else { - this.layerElement.appendChild(img); - } - img.crossOrigin = 'anonymous'; - img.src = assetPath; - if (this.data.ln) { - this.baseElement.setAttribute('id', this.data.ln); - } -}; - -export default HImageElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HShapeElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HShapeElement.js deleted file mode 100644 index 2777162fd1ba1a319b8d8b9d9404a9d9aceec805..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HShapeElement.js +++ /dev/null @@ -1,261 +0,0 @@ -import { - bmPow, - bmMax, - bmMin, - bmSqrt, -} from '../../utils/common'; -import { - extendPrototype, -} from '../../utils/functionExtensions'; -import createNS from '../../utils/helpers/svg_elements'; -import RenderableElement from '../helpers/RenderableElement'; -import BaseElement from '../BaseElement'; -import TransformElement from '../helpers/TransformElement'; -import HierarchyElement from '../helpers/HierarchyElement'; -import FrameElement from '../helpers/FrameElement'; -import HBaseElement from './HBaseElement'; -import HSolidElement from './HSolidElement'; -import SVGShapeElement from '../svgElements/SVGShapeElement'; - -function HShapeElement(data, globalData, comp) { - // List of drawable elements - this.shapes = []; - // Full shape data - this.shapesData = data.shapes; - // List of styles that will be applied to shapes - this.stylesList = []; - // List of modifiers that will be applied to shapes - this.shapeModifiers = []; - // List of items in shape tree - this.itemsData = []; - // List of items in previous shape tree - this.processedElements = []; - // List of animated components - this.animatedContents = []; - this.shapesContainer = createNS('g'); - this.initElement(data, globalData, comp); - // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties. - // List of elements that have been created - this.prevViewData = []; - this.currentBBox = { - x: 999999, - y: -999999, - h: 0, - w: 0, - }; -} -extendPrototype([BaseElement, TransformElement, HSolidElement, SVGShapeElement, HBaseElement, HierarchyElement, FrameElement, RenderableElement], HShapeElement); -HShapeElement.prototype._renderShapeFrame = HShapeElement.prototype.renderInnerContent; - -HShapeElement.prototype.createContent = function () { - var cont; - this.baseElement.style.fontSize = 0; - if (this.data.hasMask) { - this.layerElement.appendChild(this.shapesContainer); - cont = this.svgElement; - } else { - cont = createNS('svg'); - var size = this.comp.data ? this.comp.data : this.globalData.compSize; - cont.setAttribute('width', size.w); - cont.setAttribute('height', size.h); - cont.appendChild(this.shapesContainer); - this.layerElement.appendChild(cont); - } - - this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.shapesContainer, 0, [], true); - this.filterUniqueShapes(); - this.shapeCont = cont; -}; - -HShapeElement.prototype.getTransformedPoint = function (transformers, point) { - var i; - var len = transformers.length; - for (i = 0; i < len; i += 1) { - point = transformers[i].mProps.v.applyToPointArray(point[0], point[1], 0); - } - return point; -}; - -HShapeElement.prototype.calculateShapeBoundingBox = function (item, boundingBox) { - var shape = item.sh.v; - var transformers = item.transformers; - var i; - var len = shape._length; - var vPoint; - var oPoint; - var nextIPoint; - var nextVPoint; - if (len <= 1) { - return; - } - for (i = 0; i < len - 1; i += 1) { - vPoint = this.getTransformedPoint(transformers, shape.v[i]); - oPoint = this.getTransformedPoint(transformers, shape.o[i]); - nextIPoint = this.getTransformedPoint(transformers, shape.i[i + 1]); - nextVPoint = this.getTransformedPoint(transformers, shape.v[i + 1]); - this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox); - } - if (shape.c) { - vPoint = this.getTransformedPoint(transformers, shape.v[i]); - oPoint = this.getTransformedPoint(transformers, shape.o[i]); - nextIPoint = this.getTransformedPoint(transformers, shape.i[0]); - nextVPoint = this.getTransformedPoint(transformers, shape.v[0]); - this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox); - } -}; - -HShapeElement.prototype.checkBounds = function (vPoint, oPoint, nextIPoint, nextVPoint, boundingBox) { - this.getBoundsOfCurve(vPoint, oPoint, nextIPoint, nextVPoint); - var bounds = this.shapeBoundingBox; - boundingBox.x = bmMin(bounds.left, boundingBox.x); - boundingBox.xMax = bmMax(bounds.right, boundingBox.xMax); - boundingBox.y = bmMin(bounds.top, boundingBox.y); - boundingBox.yMax = bmMax(bounds.bottom, boundingBox.yMax); -}; - -HShapeElement.prototype.shapeBoundingBox = { - left: 0, - right: 0, - top: 0, - bottom: 0, -}; - -HShapeElement.prototype.tempBoundingBox = { - x: 0, - xMax: 0, - y: 0, - yMax: 0, - width: 0, - height: 0, -}; - -HShapeElement.prototype.getBoundsOfCurve = function (p0, p1, p2, p3) { - var bounds = [[p0[0], p3[0]], [p0[1], p3[1]]]; - - for (var a, b, c, t, b2ac, t1, t2, i = 0; i < 2; ++i) { // eslint-disable-line no-plusplus - b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i]; - a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i]; - c = 3 * p1[i] - 3 * p0[i]; - - b |= 0; // eslint-disable-line no-bitwise - a |= 0; // eslint-disable-line no-bitwise - c |= 0; // eslint-disable-line no-bitwise - - if (a === 0 && b === 0) { - // - } else if (a === 0) { - t = -c / b; - - if (t > 0 && t < 1) { - bounds[i].push(this.calculateF(t, p0, p1, p2, p3, i)); - } - } else { - b2ac = b * b - 4 * c * a; - - if (b2ac >= 0) { - t1 = (-b + bmSqrt(b2ac)) / (2 * a); - if (t1 > 0 && t1 < 1) bounds[i].push(this.calculateF(t1, p0, p1, p2, p3, i)); - t2 = (-b - bmSqrt(b2ac)) / (2 * a); - if (t2 > 0 && t2 < 1) bounds[i].push(this.calculateF(t2, p0, p1, p2, p3, i)); - } - } - } - - this.shapeBoundingBox.left = bmMin.apply(null, bounds[0]); - this.shapeBoundingBox.top = bmMin.apply(null, bounds[1]); - this.shapeBoundingBox.right = bmMax.apply(null, bounds[0]); - this.shapeBoundingBox.bottom = bmMax.apply(null, bounds[1]); -}; - -HShapeElement.prototype.calculateF = function (t, p0, p1, p2, p3, i) { - return bmPow(1 - t, 3) * p0[i] - + 3 * bmPow(1 - t, 2) * t * p1[i] - + 3 * (1 - t) * bmPow(t, 2) * p2[i] - + bmPow(t, 3) * p3[i]; -}; - -HShapeElement.prototype.calculateBoundingBox = function (itemsData, boundingBox) { - var i; - var len = itemsData.length; - for (i = 0; i < len; i += 1) { - if (itemsData[i] && itemsData[i].sh) { - this.calculateShapeBoundingBox(itemsData[i], boundingBox); - } else if (itemsData[i] && itemsData[i].it) { - this.calculateBoundingBox(itemsData[i].it, boundingBox); - } else if (itemsData[i] && itemsData[i].style && itemsData[i].w) { - this.expandStrokeBoundingBox(itemsData[i].w, boundingBox); - } - } -}; - -HShapeElement.prototype.expandStrokeBoundingBox = function (widthProperty, boundingBox) { - var width = 0; - if (widthProperty.keyframes) { - for (var i = 0; i < widthProperty.keyframes.length; i += 1) { - var kfw = widthProperty.keyframes[i].s; - if (kfw > width) { - width = kfw; - } - } - width *= widthProperty.mult; - } else { - width = widthProperty.v * widthProperty.mult; - } - - boundingBox.x -= width; - boundingBox.xMax += width; - boundingBox.y -= width; - boundingBox.yMax += width; -}; - -HShapeElement.prototype.currentBoxContains = function (box) { - return this.currentBBox.x <= box.x - && this.currentBBox.y <= box.y - && this.currentBBox.width + this.currentBBox.x >= box.x + box.width - && this.currentBBox.height + this.currentBBox.y >= box.y + box.height; -}; - -HShapeElement.prototype.renderInnerContent = function () { - this._renderShapeFrame(); - - if (!this.hidden && (this._isFirstFrame || this._mdf)) { - var tempBoundingBox = this.tempBoundingBox; - var max = 999999; - tempBoundingBox.x = max; - tempBoundingBox.xMax = -max; - tempBoundingBox.y = max; - tempBoundingBox.yMax = -max; - this.calculateBoundingBox(this.itemsData, tempBoundingBox); - tempBoundingBox.width = tempBoundingBox.xMax < tempBoundingBox.x ? 0 : tempBoundingBox.xMax - tempBoundingBox.x; - tempBoundingBox.height = tempBoundingBox.yMax < tempBoundingBox.y ? 0 : tempBoundingBox.yMax - tempBoundingBox.y; - // var tempBoundingBox = this.shapeCont.getBBox(); - if (this.currentBoxContains(tempBoundingBox)) { - return; - } - var changed = false; - if (this.currentBBox.w !== tempBoundingBox.width) { - this.currentBBox.w = tempBoundingBox.width; - this.shapeCont.setAttribute('width', tempBoundingBox.width); - changed = true; - } - if (this.currentBBox.h !== tempBoundingBox.height) { - this.currentBBox.h = tempBoundingBox.height; - this.shapeCont.setAttribute('height', tempBoundingBox.height); - changed = true; - } - if (changed || this.currentBBox.x !== tempBoundingBox.x || this.currentBBox.y !== tempBoundingBox.y) { - this.currentBBox.w = tempBoundingBox.width; - this.currentBBox.h = tempBoundingBox.height; - this.currentBBox.x = tempBoundingBox.x; - this.currentBBox.y = tempBoundingBox.y; - - this.shapeCont.setAttribute('viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h); - var shapeStyle = this.shapeCont.style; - var shapeTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)'; - shapeStyle.transform = shapeTransform; - shapeStyle.webkitTransform = shapeTransform; - } - } -}; - -export default HShapeElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HSolidElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HSolidElement.js deleted file mode 100644 index 9d8a021f773bd538c86767ea834e641730636fdd..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HSolidElement.js +++ /dev/null @@ -1,36 +0,0 @@ -import { - extendPrototype, -} from '../../utils/functionExtensions'; -import createNS from '../../utils/helpers/svg_elements'; -import createTag from '../../utils/helpers/html_elements'; -import BaseElement from '../BaseElement'; -import TransformElement from '../helpers/TransformElement'; -import HierarchyElement from '../helpers/HierarchyElement'; -import FrameElement from '../helpers/FrameElement'; -import RenderableDOMElement from '../helpers/RenderableDOMElement'; -import HBaseElement from './HBaseElement'; - -function HSolidElement(data, globalData, comp) { - this.initElement(data, globalData, comp); -} -extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], HSolidElement); - -HSolidElement.prototype.createContent = function () { - var rect; - if (this.data.hasMask) { - rect = createNS('rect'); - rect.setAttribute('width', this.data.sw); - rect.setAttribute('height', this.data.sh); - rect.setAttribute('fill', this.data.sc); - this.svgElement.setAttribute('width', this.data.sw); - this.svgElement.setAttribute('height', this.data.sh); - } else { - rect = createTag('div'); - rect.style.width = this.data.sw + 'px'; - rect.style.height = this.data.sh + 'px'; - rect.style.backgroundColor = this.data.sc; - } - this.layerElement.appendChild(rect); -}; - -export default HSolidElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HTextElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HTextElement.js deleted file mode 100644 index 040a4ea936a8e2093b40455307df8065c867f4d2..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/htmlElements/HTextElement.js +++ /dev/null @@ -1,289 +0,0 @@ -import { - extendPrototype, -} from '../../utils/functionExtensions'; -import { - createSizedArray, -} from '../../utils/helpers/arrays'; -import createNS from '../../utils/helpers/svg_elements'; -import createTag from '../../utils/helpers/html_elements'; -import BaseElement from '../BaseElement'; -import TransformElement from '../helpers/TransformElement'; -import HierarchyElement from '../helpers/HierarchyElement'; -import FrameElement from '../helpers/FrameElement'; -import RenderableDOMElement from '../helpers/RenderableDOMElement'; -import ITextElement from '../TextElement'; -import HBaseElement from './HBaseElement'; -import { - lineCapEnum, - lineJoinEnum, -} from '../../utils/helpers/shapeEnums'; -import { - styleDiv, -} from '../../utils/common'; - -function HTextElement(data, globalData, comp) { - this.textSpans = []; - this.textPaths = []; - this.currentBBox = { - x: 999999, - y: -999999, - h: 0, - w: 0, - }; - this.renderType = 'svg'; - this.isMasked = false; - this.initElement(data, globalData, comp); -} -extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], HTextElement); - -HTextElement.prototype.createContent = function () { - this.isMasked = this.checkMasks(); - if (this.isMasked) { - this.renderType = 'svg'; - this.compW = this.comp.data.w; - this.compH = this.comp.data.h; - this.svgElement.setAttribute('width', this.compW); - this.svgElement.setAttribute('height', this.compH); - var g = createNS('g'); - this.maskedElement.appendChild(g); - this.innerElem = g; - } else { - this.renderType = 'html'; - this.innerElem = this.layerElement; - } - - this.checkParenting(); -}; - -HTextElement.prototype.buildNewText = function () { - var documentData = this.textProperty.currentData; - this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0); - var innerElemStyle = this.innerElem.style; - var textColor = documentData.fc ? this.buildColor(documentData.fc) : 'rgba(0,0,0,0)'; - innerElemStyle.fill = textColor; - innerElemStyle.color = textColor; - if (documentData.sc) { - innerElemStyle.stroke = this.buildColor(documentData.sc); - innerElemStyle.strokeWidth = documentData.sw + 'px'; - } - var fontData = this.globalData.fontManager.getFontByName(documentData.f); - if (!this.globalData.fontManager.chars) { - innerElemStyle.fontSize = documentData.finalSize + 'px'; - innerElemStyle.lineHeight = documentData.finalSize + 'px'; - if (fontData.fClass) { - this.innerElem.className = fontData.fClass; - } else { - innerElemStyle.fontFamily = fontData.fFamily; - var fWeight = documentData.fWeight; - var fStyle = documentData.fStyle; - innerElemStyle.fontStyle = fStyle; - innerElemStyle.fontWeight = fWeight; - } - } - var i; - var len; - - var letters = documentData.l; - len = letters.length; - var tSpan; - var tParent; - var tCont; - var matrixHelper = this.mHelper; - var shapes; - var shapeStr = ''; - var cnt = 0; - for (i = 0; i < len; i += 1) { - if (this.globalData.fontManager.chars) { - if (!this.textPaths[cnt]) { - tSpan = createNS('path'); - tSpan.setAttribute('stroke-linecap', lineCapEnum[1]); - tSpan.setAttribute('stroke-linejoin', lineJoinEnum[2]); - tSpan.setAttribute('stroke-miterlimit', '4'); - } else { - tSpan = this.textPaths[cnt]; - } - if (!this.isMasked) { - if (this.textSpans[cnt]) { - tParent = this.textSpans[cnt]; - tCont = tParent.children[0]; - } else { - tParent = createTag('div'); - tParent.style.lineHeight = 0; - tCont = createNS('svg'); - tCont.appendChild(tSpan); - styleDiv(tParent); - } - } - } else if (!this.isMasked) { - if (this.textSpans[cnt]) { - tParent = this.textSpans[cnt]; - tSpan = this.textPaths[cnt]; - } else { - tParent = createTag('span'); - styleDiv(tParent); - tSpan = createTag('span'); - styleDiv(tSpan); - tParent.appendChild(tSpan); - } - } else { - tSpan = this.textPaths[cnt] ? this.textPaths[cnt] : createNS('text'); - } - // tSpan.setAttribute('visibility', 'hidden'); - if (this.globalData.fontManager.chars) { - var charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily); - var shapeData; - if (charData) { - shapeData = charData.data; - } else { - shapeData = null; - } - matrixHelper.reset(); - if (shapeData && shapeData.shapes && shapeData.shapes.length) { - shapes = shapeData.shapes[0].it; - matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100); - shapeStr = this.createPathShape(matrixHelper, shapes); - tSpan.setAttribute('d', shapeStr); - } - if (!this.isMasked) { - this.innerElem.appendChild(tParent); - if (shapeData && shapeData.shapes) { - // document.body.appendChild is needed to get exact measure of shape - document.body.appendChild(tCont); - var boundingBox = tCont.getBBox(); - tCont.setAttribute('width', boundingBox.width + 2); - tCont.setAttribute('height', boundingBox.height + 2); - tCont.setAttribute('viewBox', (boundingBox.x - 1) + ' ' + (boundingBox.y - 1) + ' ' + (boundingBox.width + 2) + ' ' + (boundingBox.height + 2)); - var tContStyle = tCont.style; - var tContTranslation = 'translate(' + (boundingBox.x - 1) + 'px,' + (boundingBox.y - 1) + 'px)'; - tContStyle.transform = tContTranslation; - tContStyle.webkitTransform = tContTranslation; - - letters[i].yOffset = boundingBox.y - 1; - } else { - tCont.setAttribute('width', 1); - tCont.setAttribute('height', 1); - } - tParent.appendChild(tCont); - } else { - this.innerElem.appendChild(tSpan); - } - } else { - tSpan.textContent = letters[i].val; - tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve'); - if (!this.isMasked) { - this.innerElem.appendChild(tParent); - // - var tStyle = tSpan.style; - var tSpanTranslation = 'translate3d(0,' + -documentData.finalSize / 1.2 + 'px,0)'; - tStyle.transform = tSpanTranslation; - tStyle.webkitTransform = tSpanTranslation; - } else { - this.innerElem.appendChild(tSpan); - } - } - // - if (!this.isMasked) { - this.textSpans[cnt] = tParent; - } else { - this.textSpans[cnt] = tSpan; - } - this.textSpans[cnt].style.display = 'block'; - this.textPaths[cnt] = tSpan; - cnt += 1; - } - while (cnt < this.textSpans.length) { - this.textSpans[cnt].style.display = 'none'; - cnt += 1; - } -}; - -HTextElement.prototype.renderInnerContent = function () { - var svgStyle; - if (this.data.singleShape) { - if (!this._isFirstFrame && !this.lettersChangedFlag) { - return; - } if (this.isMasked && this.finalTransform._matMdf) { - // Todo Benchmark if using this is better than getBBox - this.svgElement.setAttribute('viewBox', -this.finalTransform.mProp.p.v[0] + ' ' + -this.finalTransform.mProp.p.v[1] + ' ' + this.compW + ' ' + this.compH); - svgStyle = this.svgElement.style; - var translation = 'translate(' + -this.finalTransform.mProp.p.v[0] + 'px,' + -this.finalTransform.mProp.p.v[1] + 'px)'; - svgStyle.transform = translation; - svgStyle.webkitTransform = translation; - } - } - - this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag); - if (!this.lettersChangedFlag && !this.textAnimator.lettersChangedFlag) { - return; - } - var i; - var len; - var count = 0; - var renderedLetters = this.textAnimator.renderedLetters; - - var letters = this.textProperty.currentData.l; - - len = letters.length; - var renderedLetter; - var textSpan; - var textPath; - for (i = 0; i < len; i += 1) { - if (letters[i].n) { - count += 1; - } else { - textSpan = this.textSpans[i]; - textPath = this.textPaths[i]; - renderedLetter = renderedLetters[count]; - count += 1; - if (renderedLetter._mdf.m) { - if (!this.isMasked) { - textSpan.style.webkitTransform = renderedLetter.m; - textSpan.style.transform = renderedLetter.m; - } else { - textSpan.setAttribute('transform', renderedLetter.m); - } - } - /// /textSpan.setAttribute('opacity',renderedLetter.o); - textSpan.style.opacity = renderedLetter.o; - if (renderedLetter.sw && renderedLetter._mdf.sw) { - textPath.setAttribute('stroke-width', renderedLetter.sw); - } - if (renderedLetter.sc && renderedLetter._mdf.sc) { - textPath.setAttribute('stroke', renderedLetter.sc); - } - if (renderedLetter.fc && renderedLetter._mdf.fc) { - textPath.setAttribute('fill', renderedLetter.fc); - textPath.style.color = renderedLetter.fc; - } - } - } - - if (this.innerElem.getBBox && !this.hidden && (this._isFirstFrame || this._mdf)) { - var boundingBox = this.innerElem.getBBox(); - - if (this.currentBBox.w !== boundingBox.width) { - this.currentBBox.w = boundingBox.width; - this.svgElement.setAttribute('width', boundingBox.width); - } - if (this.currentBBox.h !== boundingBox.height) { - this.currentBBox.h = boundingBox.height; - this.svgElement.setAttribute('height', boundingBox.height); - } - - var margin = 1; - if (this.currentBBox.w !== (boundingBox.width + margin * 2) || this.currentBBox.h !== (boundingBox.height + margin * 2) || this.currentBBox.x !== (boundingBox.x - margin) || this.currentBBox.y !== (boundingBox.y - margin)) { - this.currentBBox.w = boundingBox.width + margin * 2; - this.currentBBox.h = boundingBox.height + margin * 2; - this.currentBBox.x = boundingBox.x - margin; - this.currentBBox.y = boundingBox.y - margin; - - this.svgElement.setAttribute('viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h); - svgStyle = this.svgElement.style; - var svgTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)'; - svgStyle.transform = svgTransform; - svgStyle.webkitTransform = svgTransform; - } - } -}; - -export default HTextElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGBaseElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGBaseElement.js deleted file mode 100644 index dfda964dea35b29e08d7eafcd8c9242630ddb7f4..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGBaseElement.js +++ /dev/null @@ -1,180 +0,0 @@ -import { getLocationHref } from '../../main'; -import { - createElementID, -} from '../../utils/common'; -import createNS from '../../utils/helpers/svg_elements'; -import MaskElement from '../../mask'; -import filtersFactory from '../../utils/filters'; -import featureSupport from '../../utils/featureSupport'; -import SVGEffects from './SVGEffects'; - -function SVGBaseElement() { -} - -SVGBaseElement.prototype = { - initRendererElement: function () { - this.layerElement = createNS('g'); - }, - createContainerElements: function () { - this.matteElement = createNS('g'); - this.transformedElement = this.layerElement; - this.maskedElement = this.layerElement; - this._sizeChanged = false; - var layerElementParent = null; - // If this layer acts as a mask for the following layer - if (this.data.td) { - this.matteMasks = {}; - var gg = createNS('g'); - gg.setAttribute('id', this.layerId); - gg.appendChild(this.layerElement); - layerElementParent = gg; - this.globalData.defs.appendChild(gg); - } else if (this.data.tt) { - this.matteElement.appendChild(this.layerElement); - layerElementParent = this.matteElement; - this.baseElement = this.matteElement; - } else { - this.baseElement = this.layerElement; - } - if (this.data.ln) { - this.layerElement.setAttribute('id', this.data.ln); - } - if (this.data.cl) { - this.layerElement.setAttribute('class', this.data.cl); - } - // Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped - if (this.data.ty === 0 && !this.data.hd) { - var cp = createNS('clipPath'); - var pt = createNS('path'); - pt.setAttribute('d', 'M0,0 L' + this.data.w + ',0 L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z'); - var clipId = createElementID(); - cp.setAttribute('id', clipId); - cp.appendChild(pt); - this.globalData.defs.appendChild(cp); - - if (this.checkMasks()) { - var cpGroup = createNS('g'); - cpGroup.setAttribute('clip-path', 'url(' + getLocationHref() + '#' + clipId + ')'); - cpGroup.appendChild(this.layerElement); - this.transformedElement = cpGroup; - if (layerElementParent) { - layerElementParent.appendChild(this.transformedElement); - } else { - this.baseElement = this.transformedElement; - } - } else { - this.layerElement.setAttribute('clip-path', 'url(' + getLocationHref() + '#' + clipId + ')'); - } - } - if (this.data.bm !== 0) { - this.setBlendMode(); - } - }, - renderElement: function () { - if (this.finalTransform._matMdf) { - this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS()); - } - if (this.finalTransform._opMdf) { - this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v); - } - }, - destroyBaseElement: function () { - this.layerElement = null; - this.matteElement = null; - this.maskManager.destroy(); - }, - getBaseElement: function () { - if (this.data.hd) { - return null; - } - return this.baseElement; - }, - createRenderableComponents: function () { - this.maskManager = new MaskElement(this.data, this, this.globalData); - this.renderableEffectsManager = new SVGEffects(this); - }, - getMatte: function (matteType) { - // This should not be a common case. But for backward compatibility, we'll create the matte object. - // It solves animations that have two consecutive layers marked as matte masks. - // Which is an undefined behavior in AE. - if (!this.matteMasks) { - this.matteMasks = {}; - } - if (!this.matteMasks[matteType]) { - var id = this.layerId + '_' + matteType; - var filId; - var fil; - var useElement; - var gg; - if (matteType === 1 || matteType === 3) { - var masker = createNS('mask'); - masker.setAttribute('id', id); - masker.setAttribute('mask-type', matteType === 3 ? 'luminance' : 'alpha'); - useElement = createNS('use'); - useElement.setAttributeNS('http://www.w3.org/1999/xlink', 'href', '#' + this.layerId); - masker.appendChild(useElement); - this.globalData.defs.appendChild(masker); - if (!featureSupport.maskType && matteType === 1) { - masker.setAttribute('mask-type', 'luminance'); - filId = createElementID(); - fil = filtersFactory.createFilter(filId); - this.globalData.defs.appendChild(fil); - fil.appendChild(filtersFactory.createAlphaToLuminanceFilter()); - gg = createNS('g'); - gg.appendChild(useElement); - masker.appendChild(gg); - gg.setAttribute('filter', 'url(' + getLocationHref() + '#' + filId + ')'); - } - } else if (matteType === 2) { - var maskGroup = createNS('mask'); - maskGroup.setAttribute('id', id); - maskGroup.setAttribute('mask-type', 'alpha'); - var maskGrouper = createNS('g'); - maskGroup.appendChild(maskGrouper); - filId = createElementID(); - fil = filtersFactory.createFilter(filId); - /// / - var feCTr = createNS('feComponentTransfer'); - feCTr.setAttribute('in', 'SourceGraphic'); - fil.appendChild(feCTr); - var feFunc = createNS('feFuncA'); - feFunc.setAttribute('type', 'table'); - feFunc.setAttribute('tableValues', '1.0 0.0'); - feCTr.appendChild(feFunc); - /// / - this.globalData.defs.appendChild(fil); - var alphaRect = createNS('rect'); - alphaRect.setAttribute('width', this.comp.data.w); - alphaRect.setAttribute('height', this.comp.data.h); - alphaRect.setAttribute('x', '0'); - alphaRect.setAttribute('y', '0'); - alphaRect.setAttribute('fill', '#ffffff'); - alphaRect.setAttribute('opacity', '0'); - maskGrouper.setAttribute('filter', 'url(' + getLocationHref() + '#' + filId + ')'); - maskGrouper.appendChild(alphaRect); - useElement = createNS('use'); - useElement.setAttributeNS('http://www.w3.org/1999/xlink', 'href', '#' + this.layerId); - maskGrouper.appendChild(useElement); - if (!featureSupport.maskType) { - maskGroup.setAttribute('mask-type', 'luminance'); - fil.appendChild(filtersFactory.createAlphaToLuminanceFilter()); - gg = createNS('g'); - maskGrouper.appendChild(alphaRect); - gg.appendChild(this.layerElement); - maskGrouper.appendChild(gg); - } - this.globalData.defs.appendChild(maskGroup); - } - this.matteMasks[matteType] = id; - } - return this.matteMasks[matteType]; - }, - setMatte: function (id) { - if (!this.matteElement) { - return; - } - this.matteElement.setAttribute('mask', 'url(' + getLocationHref() + '#' + id + ')'); - }, -}; - -export default SVGBaseElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGCompElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGCompElement.js deleted file mode 100644 index fb31ea1eee2ee2696d4cba679b1cbf7fc7b1f627..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGCompElement.js +++ /dev/null @@ -1,28 +0,0 @@ -import { - extendPrototype, -} from '../../utils/functionExtensions'; -import { - createSizedArray, -} from '../../utils/helpers/arrays'; -import PropertyFactory from '../../utils/PropertyFactory'; -import SVGRendererBase from '../../renderers/SVGRendererBase'; // eslint-disable-line -import SVGBaseElement from './SVGBaseElement'; -import ICompElement from '../CompElement'; - -function SVGCompElement(data, globalData, comp) { - this.layers = data.layers; - this.supports3d = true; - this.completeLayers = false; - this.pendingElements = []; - this.elements = this.layers ? createSizedArray(this.layers.length) : []; - this.initElement(data, globalData, comp); - this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true }; -} - -extendPrototype([SVGRendererBase, ICompElement, SVGBaseElement], SVGCompElement); - -SVGCompElement.prototype.createComp = function (data) { - return new SVGCompElement(data, this.globalData, this); -}; - -export default SVGCompElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGEffects.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGEffects.js deleted file mode 100644 index ef22f3a9ac36aa4f86913ceb68f38af49fad1c0c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGEffects.js +++ /dev/null @@ -1,58 +0,0 @@ -import { getLocationHref } from '../../main'; -import { - createElementID, -} from '../../utils/common'; -import filtersFactory from '../../utils/filters'; - -var registeredEffects = {}; -var idPrefix = 'filter_result_'; - -function SVGEffects(elem) { - var i; - var source = 'SourceGraphic'; - var len = elem.data.ef ? elem.data.ef.length : 0; - var filId = createElementID(); - var fil = filtersFactory.createFilter(filId, true); - var count = 0; - this.filters = []; - var filterManager; - for (i = 0; i < len; i += 1) { - filterManager = null; - var type = elem.data.ef[i].ty; - if (registeredEffects[type]) { - var Effect = registeredEffects[type].effect; - filterManager = new Effect(fil, elem.effectsManager.effectElements[i], elem, idPrefix + count, source); - source = idPrefix + count; - if (registeredEffects[type].countsAsEffect) { - count += 1; - } - } - if (filterManager) { - this.filters.push(filterManager); - } - } - if (count) { - elem.globalData.defs.appendChild(fil); - elem.layerElement.setAttribute('filter', 'url(' + getLocationHref() + '#' + filId + ')'); - } - if (this.filters.length) { - elem.addRenderableComponent(this); - } -} - -SVGEffects.prototype.renderFrame = function (_isFirstFrame) { - var i; - var len = this.filters.length; - for (i = 0; i < len; i += 1) { - this.filters[i].renderFrame(_isFirstFrame); - } -}; - -export function registerEffect(id, effect, countsAsEffect) { - registeredEffects[id] = { - effect, - countsAsEffect, - }; -} - -export default SVGEffects; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGShapeElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGShapeElement.js deleted file mode 100644 index 690a6976e534e7f9153c0d99021ca2e965839e0b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGShapeElement.js +++ /dev/null @@ -1,450 +0,0 @@ -import { - extendPrototype, -} from '../../utils/functionExtensions'; -import { getLocationHref } from '../../main'; -import ShapePropertyFactory from '../../utils/shapes/ShapeProperty'; -import BaseElement from '../BaseElement'; -import TransformElement from '../helpers/TransformElement'; -import SVGBaseElement from './SVGBaseElement'; -import HierarchyElement from '../helpers/HierarchyElement'; -import FrameElement from '../helpers/FrameElement'; -import RenderableDOMElement from '../helpers/RenderableDOMElement'; -import getBlendMode from '../../utils/helpers/blendModes'; -import Matrix from '../../3rd_party/transformation-matrix'; -import IShapeElement from '../ShapeElement'; -import TransformPropertyFactory from '../../utils/TransformProperty'; -import { ShapeModifiers } from '../../utils/shapes/ShapeModifiers'; -import { - lineCapEnum, - lineJoinEnum, -} from '../../utils/helpers/shapeEnums'; -import SVGShapeData from '../helpers/shapes/SVGShapeData'; -import SVGStyleData from '../helpers/shapes/SVGStyleData'; -import SVGStrokeStyleData from '../helpers/shapes/SVGStrokeStyleData'; -import SVGFillStyleData from '../helpers/shapes/SVGFillStyleData'; -import SVGNoStyleData from '../helpers/shapes/SVGNoStyleData'; -import SVGGradientFillStyleData from '../helpers/shapes/SVGGradientFillStyleData'; -import SVGGradientStrokeStyleData from '../helpers/shapes/SVGGradientStrokeStyleData'; -import ShapeGroupData from '../helpers/shapes/ShapeGroupData'; -import SVGTransformData from '../helpers/shapes/SVGTransformData'; -import SVGElementsRenderer from '../helpers/shapes/SVGElementsRenderer'; - -function SVGShapeElement(data, globalData, comp) { - // List of drawable elements - this.shapes = []; - // Full shape data - this.shapesData = data.shapes; - // List of styles that will be applied to shapes - this.stylesList = []; - // List of modifiers that will be applied to shapes - this.shapeModifiers = []; - // List of items in shape tree - this.itemsData = []; - // List of items in previous shape tree - this.processedElements = []; - // List of animated components - this.animatedContents = []; - this.initElement(data, globalData, comp); - // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties. - // List of elements that have been created - this.prevViewData = []; - // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties. -} - -extendPrototype([BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement], SVGShapeElement); - -SVGShapeElement.prototype.initSecondaryElement = function () { -}; - -SVGShapeElement.prototype.identityMatrix = new Matrix(); - -SVGShapeElement.prototype.buildExpressionInterface = function () {}; - -SVGShapeElement.prototype.createContent = function () { - this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true); - this.filterUniqueShapes(); -}; - -/* -This method searches for multiple shapes that affect a single element and one of them is animated -*/ -SVGShapeElement.prototype.filterUniqueShapes = function () { - var i; - var len = this.shapes.length; - var shape; - var j; - var jLen = this.stylesList.length; - var style; - var tempShapes = []; - var areAnimated = false; - for (j = 0; j < jLen; j += 1) { - style = this.stylesList[j]; - areAnimated = false; - tempShapes.length = 0; - for (i = 0; i < len; i += 1) { - shape = this.shapes[i]; - if (shape.styles.indexOf(style) !== -1) { - tempShapes.push(shape); - areAnimated = shape._isAnimated || areAnimated; - } - } - if (tempShapes.length > 1 && areAnimated) { - this.setShapesAsAnimated(tempShapes); - } - } -}; - -SVGShapeElement.prototype.setShapesAsAnimated = function (shapes) { - var i; - var len = shapes.length; - for (i = 0; i < len; i += 1) { - shapes[i].setAsAnimated(); - } -}; - -SVGShapeElement.prototype.createStyleElement = function (data, level) { - // TODO: prevent drawing of hidden styles - var elementData; - var styleOb = new SVGStyleData(data, level); - - var pathElement = styleOb.pElem; - if (data.ty === 'st') { - elementData = new SVGStrokeStyleData(this, data, styleOb); - } else if (data.ty === 'fl') { - elementData = new SVGFillStyleData(this, data, styleOb); - } else if (data.ty === 'gf' || data.ty === 'gs') { - var GradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData; - elementData = new GradientConstructor(this, data, styleOb); - this.globalData.defs.appendChild(elementData.gf); - if (elementData.maskId) { - this.globalData.defs.appendChild(elementData.ms); - this.globalData.defs.appendChild(elementData.of); - pathElement.setAttribute('mask', 'url(' + getLocationHref() + '#' + elementData.maskId + ')'); - } - } else if (data.ty === 'no') { - elementData = new SVGNoStyleData(this, data, styleOb); - } - - if (data.ty === 'st' || data.ty === 'gs') { - pathElement.setAttribute('stroke-linecap', lineCapEnum[data.lc || 2]); - pathElement.setAttribute('stroke-linejoin', lineJoinEnum[data.lj || 2]); - pathElement.setAttribute('fill-opacity', '0'); - if (data.lj === 1) { - pathElement.setAttribute('stroke-miterlimit', data.ml); - } - } - - if (data.r === 2) { - pathElement.setAttribute('fill-rule', 'evenodd'); - } - - if (data.ln) { - pathElement.setAttribute('id', data.ln); - } - if (data.cl) { - pathElement.setAttribute('class', data.cl); - } - if (data.bm) { - pathElement.style['mix-blend-mode'] = getBlendMode(data.bm); - } - this.stylesList.push(styleOb); - this.addToAnimatedContents(data, elementData); - return elementData; -}; - -SVGShapeElement.prototype.createGroupElement = function (data) { - var elementData = new ShapeGroupData(); - if (data.ln) { - elementData.gr.setAttribute('id', data.ln); - } - if (data.cl) { - elementData.gr.setAttribute('class', data.cl); - } - if (data.bm) { - elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm); - } - return elementData; -}; - -SVGShapeElement.prototype.createTransformElement = function (data, container) { - var transformProperty = TransformPropertyFactory.getTransformProperty(this, data, this); - var elementData = new SVGTransformData(transformProperty, transformProperty.o, container); - this.addToAnimatedContents(data, elementData); - return elementData; -}; - -SVGShapeElement.prototype.createShapeElement = function (data, ownTransformers, level) { - var ty = 4; - if (data.ty === 'rc') { - ty = 5; - } else if (data.ty === 'el') { - ty = 6; - } else if (data.ty === 'sr') { - ty = 7; - } - var shapeProperty = ShapePropertyFactory.getShapeProp(this, data, ty, this); - var elementData = new SVGShapeData(ownTransformers, level, shapeProperty); - this.shapes.push(elementData); - this.addShapeToModifiers(elementData); - this.addToAnimatedContents(data, elementData); - return elementData; -}; - -SVGShapeElement.prototype.addToAnimatedContents = function (data, element) { - var i = 0; - var len = this.animatedContents.length; - while (i < len) { - if (this.animatedContents[i].element === element) { - return; - } - i += 1; - } - this.animatedContents.push({ - fn: SVGElementsRenderer.createRenderFunction(data), - element: element, - data: data, - }); -}; - -SVGShapeElement.prototype.setElementStyles = function (elementData) { - var arr = elementData.styles; - var j; - var jLen = this.stylesList.length; - for (j = 0; j < jLen; j += 1) { - if (!this.stylesList[j].closed) { - arr.push(this.stylesList[j]); - } - } -}; - -SVGShapeElement.prototype.reloadShapes = function () { - this._isFirstFrame = true; - var i; - var len = this.itemsData.length; - for (i = 0; i < len; i += 1) { - this.prevViewData[i] = this.itemsData[i]; - } - this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true); - this.filterUniqueShapes(); - len = this.dynamicProperties.length; - for (i = 0; i < len; i += 1) { - this.dynamicProperties[i].getValue(); - } - this.renderModifiers(); -}; - -SVGShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, container, level, transformers, render) { - var ownTransformers = [].concat(transformers); - var i; - var len = arr.length - 1; - var j; - var jLen; - var ownStyles = []; - var ownModifiers = []; - var currentTransform; - var modifier; - var processedPos; - for (i = len; i >= 0; i -= 1) { - processedPos = this.searchProcessedElement(arr[i]); - if (!processedPos) { - arr[i]._render = render; - } else { - itemsData[i] = prevViewData[processedPos - 1]; - } - if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs' || arr[i].ty === 'no') { - if (!processedPos) { - itemsData[i] = this.createStyleElement(arr[i], level); - } else { - itemsData[i].style.closed = false; - } - if (arr[i]._render) { - if (itemsData[i].style.pElem.parentNode !== container) { - container.appendChild(itemsData[i].style.pElem); - } - } - ownStyles.push(itemsData[i].style); - } else if (arr[i].ty === 'gr') { - if (!processedPos) { - itemsData[i] = this.createGroupElement(arr[i]); - } else { - jLen = itemsData[i].it.length; - for (j = 0; j < jLen; j += 1) { - itemsData[i].prevViewData[j] = itemsData[i].it[j]; - } - } - this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, itemsData[i].gr, level + 1, ownTransformers, render); - if (arr[i]._render) { - if (itemsData[i].gr.parentNode !== container) { - container.appendChild(itemsData[i].gr); - } - } - } else if (arr[i].ty === 'tr') { - if (!processedPos) { - itemsData[i] = this.createTransformElement(arr[i], container); - } - currentTransform = itemsData[i].transform; - ownTransformers.push(currentTransform); - } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') { - if (!processedPos) { - itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level); - } - this.setElementStyles(itemsData[i]); - } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'ms' || arr[i].ty === 'pb' || arr[i].ty === 'zz' || arr[i].ty === 'op') { - if (!processedPos) { - modifier = ShapeModifiers.getModifier(arr[i].ty); - modifier.init(this, arr[i]); - itemsData[i] = modifier; - this.shapeModifiers.push(modifier); - } else { - modifier = itemsData[i]; - modifier.closed = false; - } - ownModifiers.push(modifier); - } else if (arr[i].ty === 'rp') { - if (!processedPos) { - modifier = ShapeModifiers.getModifier(arr[i].ty); - itemsData[i] = modifier; - modifier.init(this, arr, i, itemsData); - this.shapeModifiers.push(modifier); - render = false; - } else { - modifier = itemsData[i]; - modifier.closed = true; - } - ownModifiers.push(modifier); - } - this.addProcessedElement(arr[i], i + 1); - } - len = ownStyles.length; - for (i = 0; i < len; i += 1) { - ownStyles[i].closed = true; - } - len = ownModifiers.length; - for (i = 0; i < len; i += 1) { - ownModifiers[i].closed = true; - } -}; - -SVGShapeElement.prototype.renderInnerContent = function () { - this.renderModifiers(); - var i; - var len = this.stylesList.length; - for (i = 0; i < len; i += 1) { - this.stylesList[i].reset(); - } - this.renderShape(); - for (i = 0; i < len; i += 1) { - if (this.stylesList[i]._mdf || this._isFirstFrame) { - if (this.stylesList[i].msElem) { - this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d); - // Adding M0 0 fixes same mask bug on all browsers - this.stylesList[i].d = 'M0 0' + this.stylesList[i].d; - } - this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0'); - } - } -}; - -SVGShapeElement.prototype.renderShape = function () { - var i; - var len = this.animatedContents.length; - var animatedContent; - for (i = 0; i < len; i += 1) { - animatedContent = this.animatedContents[i]; - if ((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) { - animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame); - } - } -}; -SVGShapeElement.prototype.renderShapeColor = function (color, endColor) { - var i; - var len = this.animatedContents.length; - var animatedContent; - for (i = 0; i < len; i += 1) { - animatedContent = this.animatedContents[i]; - if ((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) { - if (animatedContent.element.c && (animatedContent.element.c._mdf || this._isFirstFrame)) { - try { - if (!!endColor && endColor.length > 0) { - if (color.length == 4) { - animatedContent.element.c.data.k[0].s[0] = color[0] / 255.0; - animatedContent.element.c.data.k[0].s[1] = color[1] / 255.0; - animatedContent.element.c.data.k[0].s[2] = color[2] / 255.0; - - animatedContent.element.c.data.k[0].e[0] = endColor[0] / 255.0; - animatedContent.element.c.data.k[0].e[1] = endColor[1] / 255.0; - animatedContent.element.c.data.k[0].e[2] = endColor[2] / 255.0; - - animatedContent.element.o.v = color[3]; - } else if (color.length == 3) { - animatedContent.element.c.data.k[0].s[0] = color[0] / 255.0; - animatedContent.element.c.data.k[0].s[1] = color[1] / 255.0; - animatedContent.element.c.data.k[0].s[2] = color[2] / 255.0; - - animatedContent.element.c.data.k[0].e[0] = endColor[0] / 255.0; - animatedContent.element.c.data.k[0].e[1] = endColor[1] / 255.0; - animatedContent.element.c.data.k[0].e[2] = endColor[2] / 255.0; - } else if (color.length == 2) { - animatedContent.element.c.data.k[0].s[0] = color[0] / 255.0; - animatedContent.element.c.data.k[0].s[2] = color[1] / 255.0; - - animatedContent.element.c.data.k[0].e[0] = endColor[0] / 255.0; - animatedContent.element.c.data.k[0].e[2] = endColor[1] / 255.0; - } else if (color.length == 1) { - animatedContent.element.c.data.k[0].s[0] = color[0] / 255.0; - animatedContent.element.c.data.k[0].e[0] = endColor[0] / 255.0; - } - } else { - if (color.length == 4) { - animatedContent.element.c.v[0] = color[0]; - animatedContent.element.c.v[1] = color[1]; - animatedContent.element.c.v[2] = color[2]; - animatedContent.element.o.v = color[3]; - } else if (color.length == 3) { - animatedContent.element.c.v[0] = color[0]; - animatedContent.element.c.v[1] = color[1]; - animatedContent.element.c.v[2] = color[2]; - } else if (color.length == 2) { - animatedContent.element.c.v[0] = color[0]; - animatedContent.element.c.v[2] = color[1]; - } else if (color.length == 1) { - animatedContent.element.c.v[0] = color[0]; - } - } - } catch (error) { - } - } else { - try { - if (animatedContent.element.g && (animatedContent.element.g._cmdf || this._isFirstFrame)) { - var lens = 3; - var j; - for (j = 0; j < lens; j += 1) { - if (color.length >= 3) { - animatedContent.element.g.c[j * 4] = color[0]; - animatedContent.element.g.c[j * 4 + 1] = color[0]; - animatedContent.element.g.c[j * 4 + 2] = color[1]; - animatedContent.element.g.c[j * 4 + 3] = color[2]; - } else if (color.length == 2) { - animatedContent.element.g.c[j * 4] = color[0]; - animatedContent.element.g.c[j * 4 + 1] = color[0]; - animatedContent.element.g.c[j * 4 + 2] = color[1]; - } else if (color.length == 1) { - animatedContent.element.g.c[j * 4] = color[0]; - animatedContent.element.g.c[j * 4 + 1] = color[0]; - } - } - } - } catch (error) { - } - } - } - } -}; - -SVGShapeElement.prototype.destroy = function () { - this.destroyBaseElement(); - this.shapesData = null; - this.itemsData = null; -}; - -export default SVGShapeElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGTextElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGTextElement.js deleted file mode 100644 index d92f5f0dd36c279d2fd2cecafbdd29557be2e3cf..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/SVGTextElement.js +++ /dev/null @@ -1,321 +0,0 @@ -import { - extendPrototype, -} from '../../utils/functionExtensions'; -import { - createSizedArray, -} from '../../utils/helpers/arrays'; -import createNS from '../../utils/helpers/svg_elements'; -import BaseElement from '../BaseElement'; -import TransformElement from '../helpers/TransformElement'; -import SVGBaseElement from './SVGBaseElement'; -import HierarchyElement from '../helpers/HierarchyElement'; -import FrameElement from '../helpers/FrameElement'; -import RenderableDOMElement from '../helpers/RenderableDOMElement'; -import ITextElement from '../TextElement'; -import SVGCompElement from './SVGCompElement'; // eslint-disable-line -import SVGShapeElement from './SVGShapeElement'; - -var emptyShapeData = { - shapes: [], -}; - -function SVGTextLottieElement(data, globalData, comp) { - this.textSpans = []; - this.renderType = 'svg'; - this.initElement(data, globalData, comp); -} - -extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], SVGTextLottieElement); - -SVGTextLottieElement.prototype.createContent = function () { - if (this.data.singleShape && !this.globalData.fontManager.chars) { - this.textContainer = createNS('text'); - } -}; - -SVGTextLottieElement.prototype.buildTextContents = function (textArray) { - var i = 0; - var len = textArray.length; - var textContents = []; - var currentTextContent = ''; - while (i < len) { - if (textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) { - textContents.push(currentTextContent); - currentTextContent = ''; - } else { - currentTextContent += textArray[i]; - } - i += 1; - } - textContents.push(currentTextContent); - return textContents; -}; - -SVGTextLottieElement.prototype.buildShapeData = function (data, scale) { - // data should probably be cloned to apply scale separately to each instance of a text on different layers - // but since text internal content gets only rendered once and then it's never rerendered, - // it's probably safe not to clone data and reuse always the same instance even if the object is mutated. - // Avoiding cloning is preferred since cloning each character shape data is expensive - if (data.shapes && data.shapes.length) { - var shape = data.shapes[0]; - if (shape.it) { - var shapeItem = shape.it[shape.it.length - 1]; - if (shapeItem.s) { - shapeItem.s.k[0] = scale; - shapeItem.s.k[1] = scale; - } - } - } - return data; -}; - -SVGTextLottieElement.prototype.buildNewText = function () { - this.addDynamicProperty(this); - var i; - var len; - - var documentData = this.textProperty.currentData; - this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0); - if (documentData.fc) { - this.layerElement.setAttribute('fill', this.buildColor(documentData.fc)); - } else { - this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)'); - } - if (documentData.sc) { - this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc)); - this.layerElement.setAttribute('stroke-width', documentData.sw); - } - this.layerElement.setAttribute('font-size', documentData.finalSize); - var fontData = this.globalData.fontManager.getFontByName(documentData.f); - if (fontData.fClass) { - this.layerElement.setAttribute('class', fontData.fClass); - } else { - this.layerElement.setAttribute('font-family', fontData.fFamily); - var fWeight = documentData.fWeight; - var fStyle = documentData.fStyle; - this.layerElement.setAttribute('font-style', fStyle); - this.layerElement.setAttribute('font-weight', fWeight); - } - this.layerElement.setAttribute('aria-label', documentData.t); - - var letters = documentData.l || []; - var usesGlyphs = !!this.globalData.fontManager.chars; - len = letters.length; - - var tSpan; - var matrixHelper = this.mHelper; - var shapeStr = ''; - var singleShape = this.data.singleShape; - var xPos = 0; - var yPos = 0; - var firstLine = true; - var trackingOffset = documentData.tr * 0.001 * documentData.finalSize; - if (singleShape && !usesGlyphs && !documentData.sz) { - var tElement = this.textContainer; - var justify = 'start'; - switch (documentData.j) { - case 1: - justify = 'end'; - break; - case 2: - justify = 'middle'; - break; - default: - justify = 'start'; - break; - } - tElement.setAttribute('text-anchor', justify); - tElement.setAttribute('letter-spacing', trackingOffset); - var textContent = this.buildTextContents(documentData.finalText); - len = textContent.length; - yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0; - for (i = 0; i < len; i += 1) { - tSpan = this.textSpans[i].span || createNS('tspan'); - tSpan.textContent = textContent[i]; - tSpan.setAttribute('x', 0); - tSpan.setAttribute('y', yPos); - tSpan.style.display = 'inherit'; - tElement.appendChild(tSpan); - if (!this.textSpans[i]) { - this.textSpans[i] = { - span: null, - glyph: null, - }; - } - this.textSpans[i].span = tSpan; - yPos += documentData.finalLineHeight; - } - - this.layerElement.appendChild(tElement); - } else { - var cachedSpansLength = this.textSpans.length; - var charData; - for (i = 0; i < len; i += 1) { - if (!this.textSpans[i]) { - this.textSpans[i] = { - span: null, - childSpan: null, - glyph: null, - }; - } - if (!usesGlyphs || !singleShape || i === 0) { - tSpan = cachedSpansLength > i ? this.textSpans[i].span : createNS(usesGlyphs ? 'g' : 'text'); - if (cachedSpansLength <= i) { - tSpan.setAttribute('stroke-linecap', 'butt'); - tSpan.setAttribute('stroke-linejoin', 'round'); - tSpan.setAttribute('stroke-miterlimit', '4'); - this.textSpans[i].span = tSpan; - if (usesGlyphs) { - var childSpan = createNS('g'); - tSpan.appendChild(childSpan); - this.textSpans[i].childSpan = childSpan; - } - this.textSpans[i].span = tSpan; - this.layerElement.appendChild(tSpan); - } - tSpan.style.display = 'inherit'; - } - - matrixHelper.reset(); - if (singleShape) { - if (letters[i].n) { - xPos = -trackingOffset; - yPos += documentData.yOffset; - yPos += firstLine ? 1 : 0; - firstLine = false; - } - this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos); - xPos += letters[i].l || 0; - // xPos += letters[i].val === ' ' ? 0 : trackingOffset; - xPos += trackingOffset; - } - if (usesGlyphs) { - charData = this.globalData.fontManager.getCharData( - documentData.finalText[i], - fontData.fStyle, - this.globalData.fontManager.getFontByName(documentData.f).fFamily - ); - var glyphElement; - // t === 1 means the character has been replaced with an animated shaped - if (charData.t === 1) { - glyphElement = new SVGCompElement(charData.data, this.globalData, this); - } else { - var data = emptyShapeData; - if (charData.data && charData.data.shapes) { - data = this.buildShapeData(charData.data, documentData.finalSize); - } - glyphElement = new SVGShapeElement(data, this.globalData, this); - } - if (this.textSpans[i].glyph) { - var glyph = this.textSpans[i].glyph; - this.textSpans[i].childSpan.removeChild(glyph.layerElement); - glyph.destroy(); - } - this.textSpans[i].glyph = glyphElement; - glyphElement._debug = true; - glyphElement.prepareFrame(0); - glyphElement.renderFrame(); - this.textSpans[i].childSpan.appendChild(glyphElement.layerElement); - // when using animated shapes, the layer will be scaled instead of replacing the internal scale - // this might have issues with strokes and might need a different solution - if (charData.t === 1) { - this.textSpans[i].childSpan.setAttribute('transform', 'scale(' + documentData.finalSize / 100 + ',' + documentData.finalSize / 100 + ')'); - } - } else { - if (singleShape) { - tSpan.setAttribute('transform', 'translate(' + matrixHelper.props[12] + ',' + matrixHelper.props[13] + ')'); - } - tSpan.textContent = letters[i].val; - tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve'); - } - // - } - if (singleShape && tSpan) { - tSpan.setAttribute('d', shapeStr); - } - } - while (i < this.textSpans.length) { - this.textSpans[i].span.style.display = 'none'; - i += 1; - } - - this._sizeChanged = true; -}; - -SVGTextLottieElement.prototype.sourceRectAtTime = function () { - this.prepareFrame(this.comp.renderedFrame - this.data.st); - this.renderInnerContent(); - if (this._sizeChanged) { - this._sizeChanged = false; - var textBox = this.layerElement.getBBox(); - this.bbox = { - top: textBox.y, - left: textBox.x, - width: textBox.width, - height: textBox.height, - }; - } - return this.bbox; -}; - -SVGTextLottieElement.prototype.getValue = function () { - var i; - var len = this.textSpans.length; - var glyphElement; - this.renderedFrame = this.comp.renderedFrame; - for (i = 0; i < len; i += 1) { - glyphElement = this.textSpans[i].glyph; - if (glyphElement) { - glyphElement.prepareFrame(this.comp.renderedFrame - this.data.st); - if (glyphElement._mdf) { - this._mdf = true; - } - } - } -}; - -SVGTextLottieElement.prototype.renderInnerContent = function () { - if (!this.data.singleShape || this._mdf) { - this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag); - if (this.lettersChangedFlag || this.textAnimator.lettersChangedFlag) { - this._sizeChanged = true; - var i; - var len; - var renderedLetters = this.textAnimator.renderedLetters; - - var letters = this.textProperty.currentData.l; - - len = letters.length; - var renderedLetter; - var textSpan; - var glyphElement; - for (i = 0; i < len; i += 1) { - if (!letters[i].n) { - renderedLetter = renderedLetters[i]; - textSpan = this.textSpans[i].span; - glyphElement = this.textSpans[i].glyph; - if (glyphElement) { - glyphElement.renderFrame(); - } - if (renderedLetter._mdf.m) { - textSpan.setAttribute('transform', renderedLetter.m); - } - if (renderedLetter._mdf.o) { - textSpan.setAttribute('opacity', renderedLetter.o); - } - if (renderedLetter._mdf.sw) { - textSpan.setAttribute('stroke-width', renderedLetter.sw); - } - if (renderedLetter._mdf.sc) { - textSpan.setAttribute('stroke', renderedLetter.sc); - } - if (renderedLetter._mdf.fc) { - textSpan.setAttribute('fill', renderedLetter.fc); - } - } - } - } - } -}; - -export default SVGTextLottieElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGComposableEffect.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGComposableEffect.js deleted file mode 100644 index 689b378eea7bfd3a169997b1a4b2449819eafd27..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGComposableEffect.js +++ /dev/null @@ -1,22 +0,0 @@ -import createNS from '../../../utils/helpers/svg_elements'; - -function SVGComposableEffect() { - -} -SVGComposableEffect.prototype = { - createMergeNode: (resultId, ins) => { - var feMerge = createNS('feMerge'); - feMerge.setAttribute('result', resultId); - var feMergeNode; - var i; - for (i = 0; i < ins.length; i += 1) { - feMergeNode = createNS('feMergeNode'); - feMergeNode.setAttribute('in', ins[i]); - feMerge.appendChild(feMergeNode); - feMerge.appendChild(feMergeNode); - } - return feMerge; - }, -}; - -export default SVGComposableEffect; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGDropShadowEffect.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGDropShadowEffect.js deleted file mode 100644 index 835f800c91bc2819b719abadfd22ee4e8abdc80b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGDropShadowEffect.js +++ /dev/null @@ -1,83 +0,0 @@ -import { - degToRads, - rgbToHex, -} from '../../../utils/common'; -import createNS from '../../../utils/helpers/svg_elements'; -import SVGComposableEffect from './SVGComposableEffect'; -import { - extendPrototype, -} from '../../../utils/functionExtensions'; - -function SVGDropShadowEffect(filter, filterManager, elem, id, source) { - var globalFilterSize = filterManager.container.globalData.renderConfig.filterSize; - var filterSize = filterManager.data.fs || globalFilterSize; - filter.setAttribute('x', filterSize.x || globalFilterSize.x); - filter.setAttribute('y', filterSize.y || globalFilterSize.y); - filter.setAttribute('width', filterSize.width || globalFilterSize.width); - filter.setAttribute('height', filterSize.height || globalFilterSize.height); - this.filterManager = filterManager; - - var feGaussianBlur = createNS('feGaussianBlur'); - feGaussianBlur.setAttribute('in', 'SourceAlpha'); - feGaussianBlur.setAttribute('result', id + '_drop_shadow_1'); - feGaussianBlur.setAttribute('stdDeviation', '0'); - this.feGaussianBlur = feGaussianBlur; - filter.appendChild(feGaussianBlur); - - var feOffset = createNS('feOffset'); - feOffset.setAttribute('dx', '25'); - feOffset.setAttribute('dy', '0'); - feOffset.setAttribute('in', id + '_drop_shadow_1'); - feOffset.setAttribute('result', id + '_drop_shadow_2'); - this.feOffset = feOffset; - filter.appendChild(feOffset); - var feFlood = createNS('feFlood'); - feFlood.setAttribute('flood-color', '#00ff00'); - feFlood.setAttribute('flood-opacity', '1'); - feFlood.setAttribute('result', id + '_drop_shadow_3'); - this.feFlood = feFlood; - filter.appendChild(feFlood); - - var feComposite = createNS('feComposite'); - feComposite.setAttribute('in', id + '_drop_shadow_3'); - feComposite.setAttribute('in2', id + '_drop_shadow_2'); - feComposite.setAttribute('operator', 'in'); - feComposite.setAttribute('result', id + '_drop_shadow_4'); - filter.appendChild(feComposite); - - var feMerge = this.createMergeNode( - id, - [ - id + '_drop_shadow_4', - source, - ] - ); - filter.appendChild(feMerge); - // -} -extendPrototype([SVGComposableEffect], SVGDropShadowEffect); - -SVGDropShadowEffect.prototype.renderFrame = function (forceRender) { - if (forceRender || this.filterManager._mdf) { - if (forceRender || this.filterManager.effectElements[4].p._mdf) { - this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4); - } - if (forceRender || this.filterManager.effectElements[0].p._mdf) { - var col = this.filterManager.effectElements[0].p.v; - this.feFlood.setAttribute('flood-color', rgbToHex(Math.round(col[0] * 255), Math.round(col[1] * 255), Math.round(col[2] * 255))); - } - if (forceRender || this.filterManager.effectElements[1].p._mdf) { - this.feFlood.setAttribute('flood-opacity', this.filterManager.effectElements[1].p.v / 255); - } - if (forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf) { - var distance = this.filterManager.effectElements[3].p.v; - var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads; - var x = distance * Math.cos(angle); - var y = distance * Math.sin(angle); - this.feOffset.setAttribute('dx', x); - this.feOffset.setAttribute('dy', y); - } - } -}; - -export default SVGDropShadowEffect; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGFillFilter.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGFillFilter.js deleted file mode 100644 index 1d174e36f204c56fc50f7702432462eb71bf9481..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGFillFilter.js +++ /dev/null @@ -1,22 +0,0 @@ -import createNS from '../../../utils/helpers/svg_elements'; - -function SVGFillFilter(filter, filterManager, elem, id) { - this.filterManager = filterManager; - var feColorMatrix = createNS('feColorMatrix'); - feColorMatrix.setAttribute('type', 'matrix'); - feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB'); - feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0'); - feColorMatrix.setAttribute('result', id); - filter.appendChild(feColorMatrix); - this.matrixFilter = feColorMatrix; -} - -SVGFillFilter.prototype.renderFrame = function (forceRender) { - if (forceRender || this.filterManager._mdf) { - var color = this.filterManager.effectElements[2].p.v; - var opacity = this.filterManager.effectElements[6].p.v; - this.matrixFilter.setAttribute('values', '0 0 0 0 ' + color[0] + ' 0 0 0 0 ' + color[1] + ' 0 0 0 0 ' + color[2] + ' 0 0 0 ' + opacity + ' 0'); - } -}; - -export default SVGFillFilter; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGGaussianBlurEffect.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGGaussianBlurEffect.js deleted file mode 100644 index 599ace16078a654ff9eb59f78b1c4d8ff026d3b0..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGGaussianBlurEffect.js +++ /dev/null @@ -1,44 +0,0 @@ -import createNS from '../../../utils/helpers/svg_elements'; - -function SVGGaussianBlurEffect(filter, filterManager, elem, id) { - // Outset the filter region by 100% on all sides to accommodate blur expansion. - filter.setAttribute('x', '-100%'); - filter.setAttribute('y', '-100%'); - filter.setAttribute('width', '300%'); - filter.setAttribute('height', '300%'); - - this.filterManager = filterManager; - var feGaussianBlur = createNS('feGaussianBlur'); - feGaussianBlur.setAttribute('result', id); - filter.appendChild(feGaussianBlur); - this.feGaussianBlur = feGaussianBlur; -} - -SVGGaussianBlurEffect.prototype.renderFrame = function (forceRender) { - if (forceRender || this.filterManager._mdf) { - // Empirical value, matching AE's blur appearance. - var kBlurrinessToSigma = 0.3; - var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma; - - // Dimensions mapping: - // - // 1 -> horizontal & vertical - // 2 -> horizontal only - // 3 -> vertical only - // - var dimensions = this.filterManager.effectElements[1].p.v; - var sigmaX = (dimensions == 3) ? 0 : sigma; // eslint-disable-line eqeqeq - var sigmaY = (dimensions == 2) ? 0 : sigma; // eslint-disable-line eqeqeq - - this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + ' ' + sigmaY); - - // Repeat edges mapping: - // - // 0 -> off -> duplicate - // 1 -> on -> wrap - var edgeMode = (this.filterManager.effectElements[2].p.v == 1) ? 'wrap' : 'duplicate'; // eslint-disable-line eqeqeq - this.feGaussianBlur.setAttribute('edgeMode', edgeMode); - } -}; - -export default SVGGaussianBlurEffect; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGMatte3Effect.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGMatte3Effect.js deleted file mode 100644 index 1c331cd9e3c0d47048ad7f043d1115d837bef18c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGMatte3Effect.js +++ /dev/null @@ -1,101 +0,0 @@ -import { - createElementID, -} from '../../../utils/common'; -import createNS from '../../../utils/helpers/svg_elements'; - -var _svgMatteSymbols = []; - -function SVGMatte3Effect(filterElem, filterManager, elem) { - this.initialized = false; - this.filterManager = filterManager; - this.filterElem = filterElem; - this.elem = elem; - elem.matteElement = createNS('g'); - elem.matteElement.appendChild(elem.layerElement); - elem.matteElement.appendChild(elem.transformedElement); - elem.baseElement = elem.matteElement; -} - -SVGMatte3Effect.prototype.findSymbol = function (mask) { - var i = 0; - var len = _svgMatteSymbols.length; - while (i < len) { - if (_svgMatteSymbols[i] === mask) { - return _svgMatteSymbols[i]; - } - i += 1; - } - return null; -}; - -SVGMatte3Effect.prototype.replaceInParent = function (mask, symbolId) { - var parentNode = mask.layerElement.parentNode; - if (!parentNode) { - return; - } - var children = parentNode.children; - var i = 0; - var len = children.length; - while (i < len) { - if (children[i] === mask.layerElement) { - break; - } - i += 1; - } - var nextChild; - if (i <= len - 2) { - nextChild = children[i + 1]; - } - var useElem = createNS('use'); - useElem.setAttribute('href', '#' + symbolId); - if (nextChild) { - parentNode.insertBefore(useElem, nextChild); - } else { - parentNode.appendChild(useElem); - } -}; - -SVGMatte3Effect.prototype.setElementAsMask = function (elem, mask) { - if (!this.findSymbol(mask)) { - var symbolId = createElementID(); - var masker = createNS('mask'); - masker.setAttribute('id', mask.layerId); - masker.setAttribute('mask-type', 'alpha'); - _svgMatteSymbols.push(mask); - var defs = elem.globalData.defs; - defs.appendChild(masker); - var symbol = createNS('symbol'); - symbol.setAttribute('id', symbolId); - this.replaceInParent(mask, symbolId); - symbol.appendChild(mask.layerElement); - defs.appendChild(symbol); - var useElem = createNS('use'); - useElem.setAttribute('href', '#' + symbolId); - masker.appendChild(useElem); - mask.data.hd = false; - mask.show(); - } - elem.setMatte(mask.layerId); -}; - -SVGMatte3Effect.prototype.initialize = function () { - var ind = this.filterManager.effectElements[0].p.v; - var elements = this.elem.comp.elements; - var i = 0; - var len = elements.length; - while (i < len) { - if (elements[i] && elements[i].data.ind === ind) { - this.setElementAsMask(this.elem, elements[i]); - } - i += 1; - } - this.initialized = true; -}; - -SVGMatte3Effect.prototype.renderFrame = function () { - if (!this.initialized) { - this.initialize(); - } -}; - -export default SVGMatte3Effect; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGProLevelsFilter.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGProLevelsFilter.js deleted file mode 100644 index dad722e8878726c49c5b5cfcea961e7a59e5a715..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGProLevelsFilter.js +++ /dev/null @@ -1,108 +0,0 @@ -import createNS from '../../../utils/helpers/svg_elements'; - -function SVGProLevelsFilter(filter, filterManager, elem, id) { - this.filterManager = filterManager; - var effectElements = this.filterManager.effectElements; - var feComponentTransfer = createNS('feComponentTransfer'); - - // Red - if (effectElements[10].p.k || effectElements[10].p.v !== 0 || effectElements[11].p.k || effectElements[11].p.v !== 1 || effectElements[12].p.k || effectElements[12].p.v !== 1 || effectElements[13].p.k || effectElements[13].p.v !== 0 || effectElements[14].p.k || effectElements[14].p.v !== 1) { - this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer); - } - // Green - if (effectElements[17].p.k || effectElements[17].p.v !== 0 || effectElements[18].p.k || effectElements[18].p.v !== 1 || effectElements[19].p.k || effectElements[19].p.v !== 1 || effectElements[20].p.k || effectElements[20].p.v !== 0 || effectElements[21].p.k || effectElements[21].p.v !== 1) { - this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer); - } - // Blue - if (effectElements[24].p.k || effectElements[24].p.v !== 0 || effectElements[25].p.k || effectElements[25].p.v !== 1 || effectElements[26].p.k || effectElements[26].p.v !== 1 || effectElements[27].p.k || effectElements[27].p.v !== 0 || effectElements[28].p.k || effectElements[28].p.v !== 1) { - this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer); - } - // Alpha - if (effectElements[31].p.k || effectElements[31].p.v !== 0 || effectElements[32].p.k || effectElements[32].p.v !== 1 || effectElements[33].p.k || effectElements[33].p.v !== 1 || effectElements[34].p.k || effectElements[34].p.v !== 0 || effectElements[35].p.k || effectElements[35].p.v !== 1) { - this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer); - } - // RGB - if (this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA) { - feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB'); - filter.appendChild(feComponentTransfer); - } - - if (effectElements[3].p.k || effectElements[3].p.v !== 0 || effectElements[4].p.k || effectElements[4].p.v !== 1 || effectElements[5].p.k || effectElements[5].p.v !== 1 || effectElements[6].p.k || effectElements[6].p.v !== 0 || effectElements[7].p.k || effectElements[7].p.v !== 1) { - feComponentTransfer = createNS('feComponentTransfer'); - feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB'); - feComponentTransfer.setAttribute('result', id); - filter.appendChild(feComponentTransfer); - this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer); - this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer); - this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer); - } -} - -SVGProLevelsFilter.prototype.createFeFunc = function (type, feComponentTransfer) { - var feFunc = createNS(type); - feFunc.setAttribute('type', 'table'); - feComponentTransfer.appendChild(feFunc); - return feFunc; -}; - -SVGProLevelsFilter.prototype.getTableValue = function (inputBlack, inputWhite, gamma, outputBlack, outputWhite) { - var cnt = 0; - var segments = 256; - var perc; - var min = Math.min(inputBlack, inputWhite); - var max = Math.max(inputBlack, inputWhite); - var table = Array.call(null, { length: segments }); - var colorValue; - var pos = 0; - var outputDelta = outputWhite - outputBlack; - var inputDelta = inputWhite - inputBlack; - while (cnt <= 256) { - perc = cnt / 256; - if (perc <= min) { - colorValue = inputDelta < 0 ? outputWhite : outputBlack; - } else if (perc >= max) { - colorValue = inputDelta < 0 ? outputBlack : outputWhite; - } else { - colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma)); - } - table[pos] = colorValue; - pos += 1; - cnt += 256 / (segments - 1); - } - return table.join(' '); -}; - -SVGProLevelsFilter.prototype.renderFrame = function (forceRender) { - if (forceRender || this.filterManager._mdf) { - var val; - var effectElements = this.filterManager.effectElements; - if (this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)) { - val = this.getTableValue(effectElements[3].p.v, effectElements[4].p.v, effectElements[5].p.v, effectElements[6].p.v, effectElements[7].p.v); - this.feFuncRComposed.setAttribute('tableValues', val); - this.feFuncGComposed.setAttribute('tableValues', val); - this.feFuncBComposed.setAttribute('tableValues', val); - } - - if (this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)) { - val = this.getTableValue(effectElements[10].p.v, effectElements[11].p.v, effectElements[12].p.v, effectElements[13].p.v, effectElements[14].p.v); - this.feFuncR.setAttribute('tableValues', val); - } - - if (this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)) { - val = this.getTableValue(effectElements[17].p.v, effectElements[18].p.v, effectElements[19].p.v, effectElements[20].p.v, effectElements[21].p.v); - this.feFuncG.setAttribute('tableValues', val); - } - - if (this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)) { - val = this.getTableValue(effectElements[24].p.v, effectElements[25].p.v, effectElements[26].p.v, effectElements[27].p.v, effectElements[28].p.v); - this.feFuncB.setAttribute('tableValues', val); - } - - if (this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)) { - val = this.getTableValue(effectElements[31].p.v, effectElements[32].p.v, effectElements[33].p.v, effectElements[34].p.v, effectElements[35].p.v); - this.feFuncA.setAttribute('tableValues', val); - } - } -}; - -export default SVGProLevelsFilter; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGStrokeEffect.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGStrokeEffect.js deleted file mode 100644 index 452eaaf5a8637e50c6ab2f1b1fa906e8d1269323..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGStrokeEffect.js +++ /dev/null @@ -1,119 +0,0 @@ -import { getLocationHref } from '../../../main'; -import { - createElementID, - bmFloor, -} from '../../../utils/common'; -import createNS from '../../../utils/helpers/svg_elements'; - -function SVGStrokeEffect(fil, filterManager, elem) { - this.initialized = false; - this.filterManager = filterManager; - this.elem = elem; - this.paths = []; -} - -SVGStrokeEffect.prototype.initialize = function () { - var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes; - var path; - var groupPath; - var i; - var len; - if (this.filterManager.effectElements[1].p.v === 1) { - len = this.elem.maskManager.masksProperties.length; - i = 0; - } else { - i = this.filterManager.effectElements[0].p.v - 1; - len = i + 1; - } - groupPath = createNS('g'); - groupPath.setAttribute('fill', 'none'); - groupPath.setAttribute('stroke-linecap', 'round'); - groupPath.setAttribute('stroke-dashoffset', 1); - for (i; i < len; i += 1) { - path = createNS('path'); - groupPath.appendChild(path); - this.paths.push({ p: path, m: i }); - } - if (this.filterManager.effectElements[10].p.v === 3) { - var mask = createNS('mask'); - var id = createElementID(); - mask.setAttribute('id', id); - mask.setAttribute('mask-type', 'alpha'); - mask.appendChild(groupPath); - this.elem.globalData.defs.appendChild(mask); - var g = createNS('g'); - g.setAttribute('mask', 'url(' + getLocationHref() + '#' + id + ')'); - while (elemChildren[0]) { - g.appendChild(elemChildren[0]); - } - this.elem.layerElement.appendChild(g); - this.masker = mask; - groupPath.setAttribute('stroke', '#fff'); - } else if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) { - if (this.filterManager.effectElements[10].p.v === 2) { - elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes; - while (elemChildren.length) { - this.elem.layerElement.removeChild(elemChildren[0]); - } - } - this.elem.layerElement.appendChild(groupPath); - this.elem.layerElement.removeAttribute('mask'); - groupPath.setAttribute('stroke', '#fff'); - } - this.initialized = true; - this.pathMasker = groupPath; -}; - -SVGStrokeEffect.prototype.renderFrame = function (forceRender) { - if (!this.initialized) { - this.initialize(); - } - var i; - var len = this.paths.length; - var mask; - var path; - for (i = 0; i < len; i += 1) { - if (this.paths[i].m !== -1) { - mask = this.elem.maskManager.viewData[this.paths[i].m]; - path = this.paths[i].p; - if (forceRender || this.filterManager._mdf || mask.prop._mdf) { - path.setAttribute('d', mask.lastPath); - } - if (forceRender || this.filterManager.effectElements[9].p._mdf || this.filterManager.effectElements[4].p._mdf || this.filterManager.effectElements[7].p._mdf || this.filterManager.effectElements[8].p._mdf || mask.prop._mdf) { - var dasharrayValue; - if (this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100) { - var s = Math.min(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01; - var e = Math.max(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01; - var l = path.getTotalLength(); - dasharrayValue = '0 0 0 ' + l * s + ' '; - var lineLength = l * (e - s); - var segment = 1 + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01; - var units = Math.floor(lineLength / segment); - var j; - for (j = 0; j < units; j += 1) { - dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01 + ' '; - } - dasharrayValue += '0 ' + l * 10 + ' 0 0'; - } else { - dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01; - } - path.setAttribute('stroke-dasharray', dasharrayValue); - } - } - } - if (forceRender || this.filterManager.effectElements[4].p._mdf) { - this.pathMasker.setAttribute('stroke-width', this.filterManager.effectElements[4].p.v * 2); - } - - if (forceRender || this.filterManager.effectElements[6].p._mdf) { - this.pathMasker.setAttribute('opacity', this.filterManager.effectElements[6].p.v); - } - if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) { - if (forceRender || this.filterManager.effectElements[3].p._mdf) { - var color = this.filterManager.effectElements[3].p.v; - this.pathMasker.setAttribute('stroke', 'rgb(' + bmFloor(color[0] * 255) + ',' + bmFloor(color[1] * 255) + ',' + bmFloor(color[2] * 255) + ')'); - } - } -}; - -export default SVGStrokeEffect; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGTintEffect.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGTintEffect.js deleted file mode 100644 index 424e6ddd2d14a8480e41dc01723a56c7d149d8eb..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGTintEffect.js +++ /dev/null @@ -1,47 +0,0 @@ -import createNS from '../../../utils/helpers/svg_elements'; -import SVGComposableEffect from './SVGComposableEffect'; -import { - extendPrototype, -} from '../../../utils/functionExtensions'; - -var linearFilterValue = '0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0'; - -function SVGTintFilter(filter, filterManager, elem, id, source) { - this.filterManager = filterManager; - var feColorMatrix = createNS('feColorMatrix'); - feColorMatrix.setAttribute('type', 'matrix'); - feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB'); - feColorMatrix.setAttribute('values', linearFilterValue + ' 1 0'); - this.linearFilter = feColorMatrix; - feColorMatrix.setAttribute('result', id + '_tint_1'); - filter.appendChild(feColorMatrix); - feColorMatrix = createNS('feColorMatrix'); - feColorMatrix.setAttribute('type', 'matrix'); - feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB'); - feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0'); - feColorMatrix.setAttribute('result', id + '_tint_2'); - filter.appendChild(feColorMatrix); - this.matrixFilter = feColorMatrix; - var feMerge = this.createMergeNode( - id, - [ - source, - id + '_tint_1', - id + '_tint_2', - ] - ); - filter.appendChild(feMerge); -} -extendPrototype([SVGComposableEffect], SVGTintFilter); - -SVGTintFilter.prototype.renderFrame = function (forceRender) { - if (forceRender || this.filterManager._mdf) { - var colorBlack = this.filterManager.effectElements[0].p.v; - var colorWhite = this.filterManager.effectElements[1].p.v; - var opacity = this.filterManager.effectElements[2].p.v / 100; - this.linearFilter.setAttribute('values', linearFilterValue + ' ' + opacity + ' 0'); - this.matrixFilter.setAttribute('values', (colorWhite[0] - colorBlack[0]) + ' 0 0 0 ' + colorBlack[0] + ' ' + (colorWhite[1] - colorBlack[1]) + ' 0 0 0 ' + colorBlack[1] + ' ' + (colorWhite[2] - colorBlack[2]) + ' 0 0 0 ' + colorBlack[2] + ' 0 0 0 1 0'); - } -}; - -export default SVGTintFilter; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGTritoneFilter.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGTritoneFilter.js deleted file mode 100644 index 8c760010373251b6671fb7d8479b37cc80d3a814..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/elements/svgElements/effects/SVGTritoneFilter.js +++ /dev/null @@ -1,43 +0,0 @@ -import createNS from '../../../utils/helpers/svg_elements'; - -function SVGTritoneFilter(filter, filterManager, elem, id) { - this.filterManager = filterManager; - var feColorMatrix = createNS('feColorMatrix'); - feColorMatrix.setAttribute('type', 'matrix'); - feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB'); - feColorMatrix.setAttribute('values', '0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0'); - filter.appendChild(feColorMatrix); - var feComponentTransfer = createNS('feComponentTransfer'); - feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB'); - feComponentTransfer.setAttribute('result', id); - this.matrixFilter = feComponentTransfer; - var feFuncR = createNS('feFuncR'); - feFuncR.setAttribute('type', 'table'); - feComponentTransfer.appendChild(feFuncR); - this.feFuncR = feFuncR; - var feFuncG = createNS('feFuncG'); - feFuncG.setAttribute('type', 'table'); - feComponentTransfer.appendChild(feFuncG); - this.feFuncG = feFuncG; - var feFuncB = createNS('feFuncB'); - feFuncB.setAttribute('type', 'table'); - feComponentTransfer.appendChild(feFuncB); - this.feFuncB = feFuncB; - filter.appendChild(feComponentTransfer); -} - -SVGTritoneFilter.prototype.renderFrame = function (forceRender) { - if (forceRender || this.filterManager._mdf) { - var color1 = this.filterManager.effectElements[0].p.v; - var color2 = this.filterManager.effectElements[1].p.v; - var color3 = this.filterManager.effectElements[2].p.v; - var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0]; - var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1]; - var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2]; - this.feFuncR.setAttribute('tableValues', tableR); - this.feFuncG.setAttribute('tableValues', tableG); - this.feFuncB.setAttribute('tableValues', tableB); - } -}; - -export default SVGTritoneFilter; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/main.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/main.js deleted file mode 100644 index 0fa5531e7d2debd6def94decf11fbd8a7ef4963f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/main.js +++ /dev/null @@ -1,21 +0,0 @@ -const svgNS = 'http://www.w3.org/2000/svg'; - -let locationHref = ''; -let _useWebWorker = false; - -const initialDefaultFrame = -999999; - -const setWebWorker = (flag) => { _useWebWorker = !!flag; }; -const getWebWorker = () => _useWebWorker; - -const setLocationHref = (value) => { locationHref = value; }; -const getLocationHref = () => locationHref; - -export { - svgNS, - initialDefaultFrame, - setWebWorker, - getWebWorker, - setLocationHref, - getLocationHref, -}; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/mask.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/mask.js deleted file mode 100644 index ab11b80dd8bc7f543fc002a948e0eb5beb4c8b0c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/mask.js +++ /dev/null @@ -1,239 +0,0 @@ -import { getLocationHref } from './main'; -import { - createElementID, -} from './utils/common'; -import { - createSizedArray, -} from './utils/helpers/arrays'; -import PropertyFactory from './utils/PropertyFactory'; -import ShapePropertyFactory from './utils/shapes/ShapeProperty'; -import createNS from './utils/helpers/svg_elements'; - -function MaskElement(data, element, globalData) { - this.data = data; - this.element = element; - this.globalData = globalData; - this.storedData = []; - this.masksProperties = this.data.masksProperties || []; - this.maskElement = null; - var defs = this.globalData.defs; - var i; - var len = this.masksProperties ? this.masksProperties.length : 0; - this.viewData = createSizedArray(len); - this.solidPath = ''; - - var path; - var properties = this.masksProperties; - var count = 0; - var currentMasks = []; - var j; - var jLen; - var layerId = createElementID(); - var rect; - var expansor; - var feMorph; - var x; - var maskType = 'clipPath'; - var maskRef = 'clip-path'; - for (i = 0; i < len; i += 1) { - if ((properties[i].mode !== 'a' && properties[i].mode !== 'n') || properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x) { - maskType = 'mask'; - maskRef = 'mask'; - } - - if ((properties[i].mode === 's' || properties[i].mode === 'i') && count === 0) { - rect = createNS('rect'); - rect.setAttribute('fill', '#ffffff'); - rect.setAttribute('width', this.element.comp.data.w || 0); - rect.setAttribute('height', this.element.comp.data.h || 0); - currentMasks.push(rect); - } else { - rect = null; - } - - path = createNS('path'); - if (properties[i].mode === 'n') { - // TODO move this to a factory or to a constructor - this.viewData[i] = { - op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element), - prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3), - elem: path, - lastPath: '', - }; - defs.appendChild(path); - } else { - count += 1; - - path.setAttribute('fill', properties[i].mode === 's' ? '#000000' : '#ffffff'); - path.setAttribute('clip-rule', 'nonzero'); - var filterID; - - if (properties[i].x.k !== 0) { - maskType = 'mask'; - maskRef = 'mask'; - x = PropertyFactory.getProp(this.element, properties[i].x, 0, null, this.element); - filterID = createElementID(); - expansor = createNS('filter'); - expansor.setAttribute('id', filterID); - feMorph = createNS('feMorphology'); - feMorph.setAttribute('operator', 'erode'); - feMorph.setAttribute('in', 'SourceGraphic'); - feMorph.setAttribute('radius', '0'); - expansor.appendChild(feMorph); - defs.appendChild(expansor); - path.setAttribute('stroke', properties[i].mode === 's' ? '#000000' : '#ffffff'); - } else { - feMorph = null; - x = null; - } - - // TODO move this to a factory or to a constructor - this.storedData[i] = { - elem: path, - x: x, - expan: feMorph, - lastPath: '', - lastOperator: '', - filterId: filterID, - lastRadius: 0, - }; - if (properties[i].mode === 'i') { - jLen = currentMasks.length; - var g = createNS('g'); - for (j = 0; j < jLen; j += 1) { - g.appendChild(currentMasks[j]); - } - var mask = createNS('mask'); - mask.setAttribute('mask-type', 'alpha'); - mask.setAttribute('id', layerId + '_' + count); - mask.appendChild(path); - defs.appendChild(mask); - g.setAttribute('mask', 'url(' + getLocationHref() + '#' + layerId + '_' + count + ')'); - - currentMasks.length = 0; - currentMasks.push(g); - } else { - currentMasks.push(path); - } - if (properties[i].inv && !this.solidPath) { - this.solidPath = this.createLayerSolidPath(); - } - // TODO move this to a factory or to a constructor - this.viewData[i] = { - elem: path, - lastPath: '', - op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element), - prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3), - invRect: rect, - }; - if (!this.viewData[i].prop.k) { - this.drawPath(properties[i], this.viewData[i].prop.v, this.viewData[i]); - } - } - } - - this.maskElement = createNS(maskType); - - len = currentMasks.length; - for (i = 0; i < len; i += 1) { - this.maskElement.appendChild(currentMasks[i]); - } - - if (count > 0) { - this.maskElement.setAttribute('id', layerId); - this.element.maskedElement.setAttribute(maskRef, 'url(' + getLocationHref() + '#' + layerId + ')'); - defs.appendChild(this.maskElement); - } - if (this.viewData.length) { - this.element.addRenderableComponent(this); - } -} - -MaskElement.prototype.getMaskProperty = function (pos) { - return this.viewData[pos].prop; -}; - -MaskElement.prototype.renderFrame = function (isFirstFrame) { - var finalMat = this.element.finalTransform.mat; - var i; - var len = this.masksProperties.length; - for (i = 0; i < len; i += 1) { - if (this.viewData[i].prop._mdf || isFirstFrame) { - this.drawPath(this.masksProperties[i], this.viewData[i].prop.v, this.viewData[i]); - } - if (this.viewData[i].op._mdf || isFirstFrame) { - this.viewData[i].elem.setAttribute('fill-opacity', this.viewData[i].op.v); - } - if (this.masksProperties[i].mode !== 'n') { - if (this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)) { - this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS()); - } - if (this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)) { - var feMorph = this.storedData[i].expan; - if (this.storedData[i].x.v < 0) { - if (this.storedData[i].lastOperator !== 'erode') { - this.storedData[i].lastOperator = 'erode'; - this.storedData[i].elem.setAttribute('filter', 'url(' + getLocationHref() + '#' + this.storedData[i].filterId + ')'); - } - feMorph.setAttribute('radius', -this.storedData[i].x.v); - } else { - if (this.storedData[i].lastOperator !== 'dilate') { - this.storedData[i].lastOperator = 'dilate'; - this.storedData[i].elem.setAttribute('filter', null); - } - this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v * 2); - } - } - } - } -}; - -MaskElement.prototype.getMaskelement = function () { - return this.maskElement; -}; - -MaskElement.prototype.createLayerSolidPath = function () { - var path = 'M0,0 '; - path += ' h' + this.globalData.compSize.w; - path += ' v' + this.globalData.compSize.h; - path += ' h-' + this.globalData.compSize.w; - path += ' v-' + this.globalData.compSize.h + ' '; - return path; -}; - -MaskElement.prototype.drawPath = function (pathData, pathNodes, viewData) { - var pathString = ' M' + pathNodes.v[0][0] + ',' + pathNodes.v[0][1]; - var i; - var len; - len = pathNodes._length; - for (i = 1; i < len; i += 1) { - // pathString += " C"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + " "+pathNodes.i[i][0]+','+pathNodes.i[i][1] + " "+pathNodes.v[i][0]+','+pathNodes.v[i][1]; - pathString += ' C' + pathNodes.o[i - 1][0] + ',' + pathNodes.o[i - 1][1] + ' ' + pathNodes.i[i][0] + ',' + pathNodes.i[i][1] + ' ' + pathNodes.v[i][0] + ',' + pathNodes.v[i][1]; - } - // pathString += " C"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + " "+pathNodes.i[0][0]+','+pathNodes.i[0][1] + " "+pathNodes.v[0][0]+','+pathNodes.v[0][1]; - if (pathNodes.c && len > 1) { - pathString += ' C' + pathNodes.o[i - 1][0] + ',' + pathNodes.o[i - 1][1] + ' ' + pathNodes.i[0][0] + ',' + pathNodes.i[0][1] + ' ' + pathNodes.v[0][0] + ',' + pathNodes.v[0][1]; - } - // pathNodes.__renderedString = pathString; - - if (viewData.lastPath !== pathString) { - var pathShapeValue = ''; - if (viewData.elem) { - if (pathNodes.c) { - pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString; - } - viewData.elem.setAttribute('d', pathShapeValue); - } - viewData.lastPath = pathString; - } -}; - -MaskElement.prototype.destroy = function () { - this.element = null; - this.globalData = null; - this.maskElement = null; - this.data = null; - this.masksProperties = null; -}; - -export default MaskElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/canvas.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/canvas.js deleted file mode 100644 index 6d0a5967bc215289f4393f94553b8c9115614484..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/canvas.js +++ /dev/null @@ -1,24 +0,0 @@ -import lottie from './canvas_light'; -import { - setExpressionsPlugin, - setExpressionInterfaces, -} from '../utils/common'; -import Expressions from '../utils/expressions/Expressions'; -import interfacesProvider from '../utils/expressions/InterfacesProvider'; -import expressionPropertyDecorator from '../utils/expressions/ExpressionPropertyDecorator'; -import expressionTextPropertyDecorator from '../utils/expressions/ExpressionTextPropertyDecorator'; - -// Canvas effects -import { registerCVEffect } from '../elements/canvasElements/CVEffects'; -import CVGaussianBlurEffect from '../elements/canvasElements/effects/CVGaussianBlurEffect'; - -// Registering expression plugin -setExpressionsPlugin(Expressions); -setExpressionInterfaces(interfacesProvider); -expressionPropertyDecorator(); -expressionTextPropertyDecorator(); - -// Registering canvas effects -registerCVEffect(29, CVGaussianBlurEffect, true); - -export default lottie; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/canvas_light.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/canvas_light.js deleted file mode 100644 index 0af0510b10af79f05c615d0aa8385db4f22604c6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/canvas_light.js +++ /dev/null @@ -1,25 +0,0 @@ -import lottie from './main'; -import { ShapeModifiers } from '../utils/shapes/ShapeModifiers'; -import TrimModifier from '../utils/shapes/TrimModifier'; -import PuckerAndBloatModifier from '../utils/shapes/PuckerAndBloatModifier'; -import RepeaterModifier from '../utils/shapes/RepeaterModifier'; -import RoundCornersModifier from '../utils/shapes/RoundCornersModifier'; -import ZigZagModifier from '../utils/shapes/ZigZagModifier'; -import OffsetPathModifier from '../utils/shapes/OffsetPathModifier'; -import CanvasRenderer from '../renderers/CanvasRenderer'; -import { - registerRenderer, -} from '../renderers/renderersManager'; - -// Registering renderers -registerRenderer('canvas', CanvasRenderer); - -// Registering shape modifiers -ShapeModifiers.registerModifier('tm', TrimModifier); -ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier); -ShapeModifiers.registerModifier('rp', RepeaterModifier); -ShapeModifiers.registerModifier('rd', RoundCornersModifier); -ShapeModifiers.registerModifier('zz', ZigZagModifier); -ShapeModifiers.registerModifier('op', OffsetPathModifier); - -export default lottie; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/full.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/full.js deleted file mode 100644 index f2640cf351e9d91506e753ba0c452e1be8d91ff8..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/full.js +++ /dev/null @@ -1,74 +0,0 @@ -import lottie from './main'; -import { - setExpressionsPlugin, - setExpressionInterfaces, -} from '../utils/common'; -import { ShapeModifiers } from '../utils/shapes/ShapeModifiers'; -import TrimModifier from '../utils/shapes/TrimModifier'; -import PuckerAndBloatModifier from '../utils/shapes/PuckerAndBloatModifier'; -import RepeaterModifier from '../utils/shapes/RepeaterModifier'; -import RoundCornersModifier from '../utils/shapes/RoundCornersModifier'; -import ZigZagModifier from '../utils/shapes/ZigZagModifier'; -import OffsetPathModifier from '../utils/shapes/OffsetPathModifier'; -import CanvasRenderer from '../renderers/CanvasRenderer'; -import HybridRenderer from '../renderers/HybridRenderer'; -import SVGRenderer from '../renderers/SVGRenderer'; -import { - registerRenderer, -} from '../renderers/renderersManager'; -import Expressions from '../utils/expressions/Expressions'; -import interfacesProvider from '../utils/expressions/InterfacesProvider'; -import expressionPropertyDecorator from '../utils/expressions/ExpressionPropertyDecorator'; -import expressionTextPropertyDecorator from '../utils/expressions/ExpressionTextPropertyDecorator'; -// SVG effects -import { registerEffect } from '../elements/svgElements/SVGEffects'; -import SVGTintFilter from '../elements/svgElements/effects/SVGTintEffect'; -import SVGFillFilter from '../elements/svgElements/effects/SVGFillFilter'; -import SVGStrokeEffect from '../elements/svgElements/effects/SVGStrokeEffect'; -import SVGTritoneFilter from '../elements/svgElements/effects/SVGTritoneFilter'; -import SVGProLevelsFilter from '../elements/svgElements/effects/SVGProLevelsFilter'; -import SVGDropShadowEffect from '../elements/svgElements/effects/SVGDropShadowEffect'; -import SVGMatte3Effect from '../elements/svgElements/effects/SVGMatte3Effect'; -import SVGGaussianBlurEffect from '../elements/svgElements/effects/SVGGaussianBlurEffect'; - -// Canvas effects -import { registerCVEffect } from '../elements/canvasElements/CVEffects'; -import CVGaussianBlurEffect from '../elements/canvasElements/effects/CVGaussianBlurEffect'; - -import { LogUtil } from '../utils/LogUtil'; - -// Registering renderers -registerRenderer('canvas', CanvasRenderer); -registerRenderer('html', HybridRenderer); -registerRenderer('svg', SVGRenderer); - -// Registering shape modifiers -ShapeModifiers.registerModifier('tm', TrimModifier); -ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier); -ShapeModifiers.registerModifier('rp', RepeaterModifier); -ShapeModifiers.registerModifier('rd', RoundCornersModifier); -ShapeModifiers.registerModifier('zz', ZigZagModifier); -ShapeModifiers.registerModifier('op', OffsetPathModifier); - -// Registering expression plugin -setExpressionsPlugin(Expressions); -setExpressionInterfaces(interfacesProvider); -expressionPropertyDecorator(); -expressionTextPropertyDecorator(); - -// Registering svg effects -registerEffect(20, SVGTintFilter, true); -registerEffect(21, SVGFillFilter, true); -registerEffect(22, SVGStrokeEffect, false); -registerEffect(23, SVGTritoneFilter, true); -registerEffect(24, SVGProLevelsFilter, true); -registerEffect(25, SVGDropShadowEffect, true); -registerEffect(28, SVGMatte3Effect, false); -registerEffect(29, SVGGaussianBlurEffect, true); - -// Registering canvas effects -registerCVEffect(29, CVGaussianBlurEffect, true); - -export { LogUtil }; - -export default lottie; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/full_worker.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/full_worker.js deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/html.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/html.js deleted file mode 100644 index 3e65186394b7ff259629d0ee9b7470ea3848359e..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/html.js +++ /dev/null @@ -1,35 +0,0 @@ -import lottie from './html_light'; -import { - setExpressionsPlugin, - setExpressionInterfaces, -} from '../utils/common'; -import Expressions from '../utils/expressions/Expressions'; -import interfacesProvider from '../utils/expressions/InterfacesProvider'; -import expressionPropertyDecorator from '../utils/expressions/ExpressionPropertyDecorator'; -import expressionTextPropertyDecorator from '../utils/expressions/ExpressionTextPropertyDecorator'; -// SVG effects -import { registerEffect } from '../elements/svgElements/SVGEffects'; -import SVGTintFilter from '../elements/svgElements/effects/SVGTintEffect'; -import SVGFillFilter from '../elements/svgElements/effects/SVGFillFilter'; -import SVGStrokeEffect from '../elements/svgElements/effects/SVGStrokeEffect'; -import SVGTritoneFilter from '../elements/svgElements/effects/SVGTritoneFilter'; -import SVGProLevelsFilter from '../elements/svgElements/effects/SVGProLevelsFilter'; -import SVGDropShadowEffect from '../elements/svgElements/effects/SVGDropShadowEffect'; -import SVGMatte3Effect from '../elements/svgElements/effects/SVGMatte3Effect'; -import SVGGaussianBlurEffect from '../elements/svgElements/effects/SVGGaussianBlurEffect'; - -// Registering expression plugin -setExpressionsPlugin(Expressions); -setExpressionInterfaces(interfacesProvider); -expressionPropertyDecorator(); -expressionTextPropertyDecorator(); -registerEffect(20, SVGTintFilter, true); -registerEffect(21, SVGFillFilter, true); -registerEffect(22, SVGStrokeEffect, false); -registerEffect(23, SVGTritoneFilter, true); -registerEffect(24, SVGProLevelsFilter, true); -registerEffect(25, SVGDropShadowEffect, true); -registerEffect(28, SVGMatte3Effect, false); -registerEffect(29, SVGGaussianBlurEffect, true); - -export default lottie; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/html_light.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/html_light.js deleted file mode 100644 index 185a7959a074ea98ef4816edc8af0807182613bb..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/html_light.js +++ /dev/null @@ -1,25 +0,0 @@ -import lottie from './main'; -import { ShapeModifiers } from '../utils/shapes/ShapeModifiers'; -import TrimModifier from '../utils/shapes/TrimModifier'; -import PuckerAndBloatModifier from '../utils/shapes/PuckerAndBloatModifier'; -import RepeaterModifier from '../utils/shapes/RepeaterModifier'; -import RoundCornersModifier from '../utils/shapes/RoundCornersModifier'; -import ZigZagModifier from '../utils/shapes/ZigZagModifier'; -import OffsetPathModifier from '../utils/shapes/OffsetPathModifier'; -import HybridRenderer from '../renderers/HybridRenderer'; -import { - registerRenderer, -} from '../renderers/renderersManager'; - -// Registering renderers -registerRenderer('html', HybridRenderer); - -// Registering shape modifiers -ShapeModifiers.registerModifier('tm', TrimModifier); -ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier); -ShapeModifiers.registerModifier('rp', RepeaterModifier); -ShapeModifiers.registerModifier('rd', RoundCornersModifier); -ShapeModifiers.registerModifier('zz', ZigZagModifier); -ShapeModifiers.registerModifier('op', OffsetPathModifier); - -export default lottie; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/main.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/main.js deleted file mode 100644 index 7eac88c8a5f967d37d28eee1d79a77a6937690eb..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/main.js +++ /dev/null @@ -1,148 +0,0 @@ -import { setLocationHref, setWebWorker } from '../main'; -import animationManager from '../animation/AnimationManager'; -import { - setDefaultCurveSegments, - getDefaultCurveSegments, - roundValues, - setIdPrefix, - setSubframeEnabled, - setExpressionsPlugin, -} from '../utils/common'; -import PropertyFactory from '../utils/PropertyFactory'; -import ShapePropertyFactory from '../utils/shapes/ShapeProperty'; -import Matrix from '../3rd_party/transformation-matrix'; - -const lottie = {}; -var standalone = '__[STANDALONE]__'; -var animationData = '__[ANIMATIONDATA]__'; -var renderer = ''; - -function setLocation(href) { - setLocationHref(href); -} - -function searchAnimations() { - if (standalone === true) { - animationManager.searchAnimations(animationData, standalone, renderer); - } else { - animationManager.searchAnimations(); - } -} - -function setSubframeRendering(flag) { - setSubframeEnabled(flag); -} - -function setPrefix(prefix) { - setIdPrefix(prefix); -} - -function loadAnimation(params) { - if (standalone === true) { - params.animationData = JSON.parse(animationData); - } - return animationManager.loadAnimation(params); -} - -function setQuality(value) { - if (typeof value === 'string') { - switch (value) { - case 'high': - setDefaultCurveSegments(200); - break; - default: - case 'medium': - setDefaultCurveSegments(50); - break; - case 'low': - setDefaultCurveSegments(10); - break; - } - } else if (!isNaN(value) && value > 1) { - setDefaultCurveSegments(value); - } - if (getDefaultCurveSegments() >= 50) { - roundValues(false); - } else { - roundValues(true); - } -} - -function inBrowser() { - return false; -} - -function installPlugin(type, plugin) { - if (type === 'expressions') { - setExpressionsPlugin(plugin); - } -} - -function getFactory(name) { - switch (name) { - case 'propertyFactory': - return PropertyFactory; - case 'shapePropertyFactory': - return ShapePropertyFactory; - case 'matrix': - return Matrix; - default: - return null; - } -} - - -lottie.play = animationManager.play; -lottie.pause = animationManager.pause; -lottie.setLocationHref = setLocation; -lottie.togglePause = animationManager.togglePause; -lottie.setSpeed = animationManager.setSpeed; -lottie.setDirection = animationManager.setDirection; -lottie.stop = animationManager.stop; -lottie.searchAnimations = searchAnimations; -lottie.registerAnimation = animationManager.registerAnimation; -lottie.loadAnimation = loadAnimation; -lottie.setSubframeRendering = setSubframeRendering; -lottie.resize = animationManager.resize; -lottie.setContentMode = animationManager.setContentMode; -lottie.clearFileCache = animationManager.clearFileCache; -lottie.clearFileCacheSync = animationManager.clearFileCacheSync; -// lottie.start = start; -lottie.goToAndStop = animationManager.goToAndStop; -lottie.goToAndPlay = animationManager.goToAndPlay; -lottie.destroy = animationManager.destroy; -lottie.setFrameRate = animationManager.setFrameRate; -lottie.setQuality = setQuality; -lottie.inBrowser = inBrowser; -lottie.installPlugin = installPlugin; -lottie.freeze = animationManager.freeze; -lottie.unfreeze = animationManager.unfreeze; -lottie.setVolume = animationManager.setVolume; -lottie.mute = animationManager.mute; -lottie.unmute = animationManager.unmute; -lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations; -lottie.bindContext2dToCoordinator = animationManager.bindContext2dToCoordinator; -lottie.unbindContext2dFromCoordinator = animationManager.unbindContext2dFromCoordinator; -lottie.setAttachedCanvasHasVisibleArea = animationManager.setAttachedCanvasHasVisibleArea; -lottie.useWebWorker = setWebWorker; -lottie.setIDPrefix = setPrefix; -lottie.__getFactory = getFactory; -lottie.version = '[[BM_VERSION]]'; - - -function getQueryVariable(variable) { - var vars = queryString.split('&'); - for (var i = 0; i < vars.length; i += 1) { - var pair = vars[i].split('='); - if (decodeURIComponent(pair[0]) == variable) { // eslint-disable-line eqeqeq - return decodeURIComponent(pair[1]); - } - } - return null; -} -var queryString = ''; -if (standalone) { - renderer = getQueryVariable('renderer'); -} - -export default lottie; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/svg.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/svg.js deleted file mode 100644 index 4c7f5dfb43bd5832a3dfab13f25070dcba3ee51c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/svg.js +++ /dev/null @@ -1,35 +0,0 @@ -import lottie from './svg_light'; -import { - setExpressionsPlugin, - setExpressionInterfaces, -} from '../utils/common'; -import Expressions from '../utils/expressions/Expressions'; -import interfacesProvider from '../utils/expressions/InterfacesProvider'; -import expressionPropertyDecorator from '../utils/expressions/ExpressionPropertyDecorator'; -import expressionTextPropertyDecorator from '../utils/expressions/ExpressionTextPropertyDecorator'; -// SVG effects -import { registerEffect } from '../elements/svgElements/SVGEffects'; -import SVGTintFilter from '../elements/svgElements/effects/SVGTintEffect'; -import SVGFillFilter from '../elements/svgElements/effects/SVGFillFilter'; -import SVGStrokeEffect from '../elements/svgElements/effects/SVGStrokeEffect'; -import SVGTritoneFilter from '../elements/svgElements/effects/SVGTritoneFilter'; -import SVGProLevelsFilter from '../elements/svgElements/effects/SVGProLevelsFilter'; -import SVGDropShadowEffect from '../elements/svgElements/effects/SVGDropShadowEffect'; -import SVGMatte3Effect from '../elements/svgElements/effects/SVGMatte3Effect'; -import SVGGaussianBlurEffect from '../elements/svgElements/effects/SVGGaussianBlurEffect'; - -// Registering expression plugin -setExpressionsPlugin(Expressions); -setExpressionInterfaces(interfacesProvider); -expressionPropertyDecorator(); -expressionTextPropertyDecorator(); -registerEffect(20, SVGTintFilter, true); -registerEffect(21, SVGFillFilter, true); -registerEffect(22, SVGStrokeEffect, false); -registerEffect(23, SVGTritoneFilter, true); -registerEffect(24, SVGProLevelsFilter, true); -registerEffect(25, SVGDropShadowEffect, true); -registerEffect(28, SVGMatte3Effect, false); -registerEffect(29, SVGGaussianBlurEffect, true); - -export default lottie; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/svg_light.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/svg_light.js deleted file mode 100644 index 8df0ebae172bc0ade9ab4a751363f3bfae700e2f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/modules/svg_light.js +++ /dev/null @@ -1,25 +0,0 @@ -import lottie from './main'; -import { ShapeModifiers } from '../utils/shapes/ShapeModifiers'; -import TrimModifier from '../utils/shapes/TrimModifier'; -import PuckerAndBloatModifier from '../utils/shapes/PuckerAndBloatModifier'; -import RepeaterModifier from '../utils/shapes/RepeaterModifier'; -import RoundCornersModifier from '../utils/shapes/RoundCornersModifier'; -import ZigZagModifier from '../utils/shapes/ZigZagModifier'; -import OffsetPathModifier from '../utils/shapes/OffsetPathModifier'; -import SVGRenderer from '../renderers/SVGRenderer'; -import { - registerRenderer, -} from '../renderers/renderersManager'; - -// Registering renderers -registerRenderer('svg', SVGRenderer); - -// Registering shape modifiers -ShapeModifiers.registerModifier('tm', TrimModifier); -ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier); -ShapeModifiers.registerModifier('rp', RepeaterModifier); -ShapeModifiers.registerModifier('rd', RoundCornersModifier); -ShapeModifiers.registerModifier('zz', ZigZagModifier); -ShapeModifiers.registerModifier('op', OffsetPathModifier); - -export default lottie; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/BaseRenderer.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/BaseRenderer.js deleted file mode 100644 index 58a09e639a7b6a3b79215fac7aea6a1a648141c4..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/BaseRenderer.js +++ /dev/null @@ -1,187 +0,0 @@ -import FontManager from '../utils/FontManager'; -import slotFactory from '../utils/SlotManager'; -import FootageElement from '../elements/FootageElement'; -import AudioElement from '../elements/AudioElement'; - -function BaseRenderer() {} -BaseRenderer.prototype.checkLayers = function (num) { - var i; - var len = this.layers?.length; - var data; - this.completeLayers = true; - for (i = len - 1; i >= 0; i -= 1) { - if (!this.elements[i]) { - data = this.layers[i]; - if (data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st)) { - this.buildItem(i); - } - } - this.completeLayers = this.elements[i] ? this.completeLayers : false; - } - this.checkPendingElements(); -}; - -BaseRenderer.prototype.createItem = function (layer) { - switch (layer.ty) { - case 2: - return this.createImage(layer); - case 0: - return this.createComp(layer); - case 1: - return this.createSolid(layer); - case 3: - return this.createNull(layer); - case 4: - return this.createShape(layer); - case 5: - return this.createText(layer); - case 6: - return this.createAudio(layer); - case 13: - return this.createCamera(layer); - case 15: - return this.createFootage(layer); - default: - return this.createNull(layer); - } -}; - -BaseRenderer.prototype.createCamera = function () { - throw new Error('You\'re using a 3d camera. Try the html renderer.'); -}; - -BaseRenderer.prototype.createAudio = function (data) { - return new AudioElement(data, this.globalData, this); -}; - -BaseRenderer.prototype.createFootage = function (data) { - return new FootageElement(data, this.globalData, this); -}; - -BaseRenderer.prototype.buildAllItems = function () { - var i; - var len = this.layers?.length; - for (i = 0; i < len; i += 1) { - this.buildItem(i); - } - this.checkPendingElements(); -}; - -BaseRenderer.prototype.includeLayers = function (newLayers) { - this.completeLayers = false; - var i; - var len = newLayers?.length; - var j; - var jLen = this.layers?.length; - for (i = 0; i < len; i += 1) { - j = 0; - while (j < jLen) { - if (this.layers[j].id === newLayers[i].id) { - this.layers[j] = newLayers[i]; - break; - } - j += 1; - } - } -}; - -BaseRenderer.prototype.setProjectInterface = function (pInterface) { - this.globalData.projectInterface = pInterface; -}; - -BaseRenderer.prototype.initItems = function () { - if (!this.globalData.progressiveLoad) { - this.buildAllItems(); - } -}; -BaseRenderer.prototype.buildElementParenting = function (element, parentName, hierarchy) { - var elements = this.elements; - var layers = this.layers; - var i = 0; - var len = layers?.length; - while (i < len) { - if (layers[i].ind == parentName) { // eslint-disable-line eqeqeq - if (!elements[i] || elements[i] === true) { - this.buildItem(i); - this.addPendingElement(element); - } else { - hierarchy.push(elements[i]); - elements[i].setAsParent(); - if (layers[i].parent !== undefined) { - this.buildElementParenting(element, layers[i].parent, hierarchy); - } else { - element.setHierarchy(hierarchy); - } - } - } - i += 1; - } -}; - -BaseRenderer.prototype.addPendingElement = function (element) { - this.pendingElements.push(element); -}; - -BaseRenderer.prototype.searchExtraCompositions = function (assets) { - var i; - var len = assets?.length; - for (i = 0; i < len; i += 1) { - if (assets[i].xt) { - var comp = this.createComp(assets[i]); - comp.initExpressions(); - this.globalData.projectInterface.registerComposition(comp); - } - } -}; - -BaseRenderer.prototype.getElementById = function (ind) { - var i; - var len = this.elements?.length; - for (i = 0; i < len; i += 1) { - if (this.elements[i].data.ind === ind) { - return this.elements[i]; - } - } - return null; -}; - -BaseRenderer.prototype.getElementByPath = function (path) { - var pathValue = path.shift(); - var element; - if (typeof pathValue === 'number') { - element = this.elements[pathValue]; - } else { - var i; - var len = this.elements?.length; - for (i = 0; i < len; i += 1) { - if (this.elements[i].data.nm === pathValue) { - element = this.elements[i]; - break; - } - } - } - if (path.length === 0) { - return element; - } - return element.getElementByPath(path); -}; - -BaseRenderer.prototype.setupGlobalData = function (animData, fontsContainer) { - this.globalData.fontManager = new FontManager(); - this.globalData.slotManager = slotFactory(animData); - this.globalData.fontManager.addChars(animData.chars); - this.globalData.fontManager.addFonts(animData.fonts, fontsContainer); - this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem); - this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem); - this.globalData.imageLoader = this.animationItem.imagePreloader; - this.globalData.audioController = this.animationItem.audioController; - this.globalData.frameId = 0; - this.globalData.frameRate = animData.fr; - this.globalData.nm = animData.nm; - this.globalData.compSize = { - w: animData.w, - h: animData.h, - }; -}; - -export default BaseRenderer; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/CanvasRenderer.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/CanvasRenderer.js deleted file mode 100644 index 15f6dfb464a26124e00caa42bb90701f15c9d968..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/CanvasRenderer.js +++ /dev/null @@ -1,46 +0,0 @@ -import { - extendPrototype, -} from '../utils/functionExtensions'; -import Matrix from '../3rd_party/transformation-matrix'; -import CanvasRendererBase from './CanvasRendererBase'; -import CVContextData from '../elements/canvasElements/CVContextData'; -import CVCompElement from '../elements/canvasElements/CVCompElement'; - -function CanvasRenderer(animationItem, config) { - this.animationItem = animationItem; - this.renderConfig = { - clearCanvas: (config && config.clearCanvas !== undefined) ? config.clearCanvas : true, - context: (config && config.context) || null, - progressiveLoad: (config && config.progressiveLoad) || false, - preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet', - imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice', - contentVisibility: (config && config.contentVisibility) || 'visible', - className: (config && config.className) || '', - id: (config && config.id) || '', - runExpressions: !config || config.runExpressions === undefined || config.runExpressions, - }; - this.renderConfig.dpr = (config && config.dpr) || 1; - if (this.animationItem.wrapper) { - this.renderConfig.dpr = (config && config.dpr) || 1; - } - this.renderedFrame = -1; - this.globalData = { - frameNum: -1, - _mdf: false, - renderConfig: this.renderConfig, - currentGlobalAlpha: -1, - }; - this.contextData = new CVContextData(); - this.elements = []; - this.pendingElements = []; - this.transformMat = new Matrix(); - this.completeLayers = false; - this.rendererType = 'canvas'; -} -extendPrototype([CanvasRendererBase], CanvasRenderer); - -CanvasRenderer.prototype.createComp = function (data) { - return new CVCompElement(data, this.globalData, this); -}; - -export default CanvasRenderer; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/CanvasRendererBase.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/CanvasRendererBase.js deleted file mode 100644 index 4564432ff46448fe50dd6c51765e34a47f5e5b43..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/CanvasRendererBase.js +++ /dev/null @@ -1,445 +0,0 @@ -import { - extendPrototype, -} from '../utils/functionExtensions'; -import { - createSizedArray, -} from '../utils/helpers/arrays'; -import createTag from '../utils/helpers/html_elements'; -import SVGRenderer from './SVGRenderer'; -import Matrix from '../3rd_party/transformation-matrix'; -import BaseRenderer from './BaseRenderer'; -import CVContextData from '../elements/canvasElements/CVContextData'; -import CVShapeElement from '../elements/canvasElements/CVShapeElement'; -import CVTextElement from '../elements/canvasElements/CVTextElement'; -import CVImageElement from '../elements/canvasElements/CVImageElement'; -import CVSolidElement from '../elements/canvasElements/CVSolidElement'; -import {LogUtil} from '../utils/LogUtil' - -function CanvasRendererBase(animationItem, config) { - this.animationItem = animationItem; - this.renderConfig = { - clearCanvas: (config && config.clearCanvas !== undefined) ? config.clearCanvas : true, - context: (config && config.context) || null, - progressiveLoad: (config && config.progressiveLoad) || false, - preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet', - imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice', - contentVisibility: (config && config.contentVisibility) || 'visible', - className: (config && config.className) || '', - id: (config && config.id) || '', - }; - this.renderConfig.dpr = (config && config.dpr) || 1; - if (this.animationItem.wrapper) { - this.renderConfig.dpr = (config && config.dpr) || 1; - } - this.renderedFrame = -1; - this.globalData = { - frameNum: -1, - _mdf: false, - renderConfig: this.renderConfig, - currentGlobalAlpha: -1, - }; - this.contextData = new CVContextData(); - this.elements = []; - this.pendingElements = []; - this.transformMat = new Matrix(); - this.completeLayers = false; - this.rendererType = 'canvas'; -} -extendPrototype([BaseRenderer], CanvasRendererBase); - -CanvasRendererBase.prototype.createShape = function (data) { - return new CVShapeElement(data, this.globalData, this); -}; - -CanvasRendererBase.prototype.createText = function (data) { - return new CVTextElement(data, this.globalData, this); -}; - -CanvasRendererBase.prototype.createImage = function (data) { - return new CVImageElement(data, this.globalData, this); -}; - -CanvasRendererBase.prototype.createSolid = function (data) { - return new CVSolidElement(data, this.globalData, this); -}; - -CanvasRendererBase.prototype.createNull = SVGRenderer.prototype.createNull; - -CanvasRendererBase.prototype.ctxTransform = function (props) { - if (props[0] === 1 && props[1] === 0 && props[4] === 0 && props[5] === 1 && props[12] === 0 && props[13] === 0) { - return; - } - if (!this.renderConfig.clearCanvas) { - this.canvasContext.transform(props[0], props[1], props[4], props[5], props[12], props[13]); - return; - } - // Resetting the canvas transform matrix to the new transform - this.transformMat.cloneFromProps(props); - // Taking the last transform value from the stored stack of transforms - var currentTransform = this.contextData.getTransform(); - var cProps = currentTransform.props; - // Applying the last transform value after the new transform to respect the order of transformations - this.transformMat.transform(cProps[0], cProps[1], cProps[2], cProps[3], cProps[4], cProps[5], cProps[6], cProps[7], cProps[8], cProps[9], cProps[10], cProps[11], cProps[12], cProps[13], cProps[14], cProps[15]); - // Storing the new transformed value in the stored transform - currentTransform.cloneFromProps(this.transformMat.props); - var trProps = currentTransform.props; - // Applying the new transform to the canvas - this.canvasContext.setTransform(trProps[0], trProps[1], trProps[4], trProps[5], trProps[12], trProps[13]); -}; - -CanvasRendererBase.prototype.ctxOpacity = function (op) { - /* if(op === 1){ - return; - } */ - var currentOpacity = this.contextData.getOpacity(); - if (!this.renderConfig.clearCanvas) { - this.canvasContext.globalAlpha *= op < 0 ? 0 : op; - this.globalData.currentGlobalAlpha = currentOpacity; - return; - } - currentOpacity *= op < 0 ? 0 : op; - this.contextData.setOpacity(currentOpacity); - //设置当前画布的透明度,防止this.globalData.currentGlobalAlpha不为1时画布被隐藏 - this.canvasContext.globalAlpha = currentOpacity; - if (this.globalData.currentGlobalAlpha !== currentOpacity) { - this.globalData.currentGlobalAlpha = currentOpacity; - } -}; - -CanvasRendererBase.prototype.reset = function () { - if (!this.renderConfig.clearCanvas) { - this.canvasContext.restore(); - return; - } - this.contextData.reset(); -}; - -CanvasRendererBase.prototype.save = function (actionFlag) { - if (!this.renderConfig.clearCanvas) { - this.canvasContext.save(); - return; - } - if (actionFlag) { - this.canvasContext.save(); - } - this.contextData.push(); -}; - -CanvasRendererBase.prototype.restore = function (actionFlag) { - if (!this.renderConfig.clearCanvas) { - this.canvasContext.restore(); - return; - } - if (actionFlag) { - this.canvasContext.restore(); - this.globalData.blendMode = 'source-over'; - } - var popped = this.contextData.pop(); - var transform = popped.transform; - var opacity = popped.opacity; - this.canvasContext.setTransform(transform[0], transform[1], transform[4], transform[5], transform[12], transform[13]); - if (this.globalData.currentGlobalAlpha !== opacity) { - this.canvasContext.globalAlpha = opacity; - this.globalData.currentGlobalAlpha = opacity; - } -}; - -CanvasRendererBase.prototype.configAnimation = function (animData) { - if (this.animationItem.wrapper) { - this.canvasContext = this.animationItem.wrapper; - } else { - this.canvasContext = this.renderConfig.context; - } - - this.setContentMode(this.animationItem.contentMode); - - this.data = animData; - this.layers = animData.layers; - this.transformCanvas = { - w: animData.w, - h: animData.h, - sx: 0, - sy: 0, - tx: 0, - ty: 0, - }; - this.setupGlobalData(animData, {}); - this.globalData.canvasContext = this.canvasContext; - this.globalData.renderer = this; - this.globalData.isDashed = false; - this.globalData.progressiveLoad = this.renderConfig.progressiveLoad; - this.globalData.transformCanvas = this.transformCanvas; - this.elements = createSizedArray(animData.layers.length); - this.updateContainerSize(); -}; - -CanvasRendererBase.prototype.setContentMode = function (contentMode) { - if (contentMode && this.renderConfig) { - const mode = contentMode.toLowerCase(); - switch (mode) { - case 'fill': - this.renderConfig.preserveAspectRatio = 'none'; - break; - case 'top': - this.renderConfig.preserveAspectRatio = 'xMidYMin meet'; - break; - case 'cover': - this.renderConfig.preserveAspectRatio = 'xMidYMid slice'; - break; - case 'bottom': - this.renderConfig.preserveAspectRatio = 'xMidYMax meet'; - break; - case 'contain': - this.renderConfig.preserveAspectRatio = 'xMidYMid meet'; - break; - default: - this.renderConfig.preserveAspectRatio = 'xMidYMid meet'; - } - } -}; - -CanvasRendererBase.prototype.updateContentMode = function (contentMode) { - if (contentMode && this.renderConfig) { - this.setContentMode(contentMode); - this.updateContainerSize(); - } -} - -CanvasRendererBase.prototype.updateContainerSize = function (width, height, isPrint) { - if (!this.canvasContext) { - return; - } - this.canvasContext.restore(); - this.canvasContext.setTransform(1, 0, 0, 1, 0, 0);//resetting the transform - this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h); //清空之前画布 - this.canvasContext.clearRect(0, 0, this.canvasContext.width, this.canvasContext.height); //清空之前画布 - this.canvasContext.reset(); - this.canvasContext.save(); - this.reset(); - var elementWidth; - var elementHeight; - if (width) { - elementWidth = width; - elementHeight = height; - } else { - if (this.canvasContext) { - elementHeight = this.canvasContext.height; - elementWidth = this.canvasContext.width; - - if (!elementHeight) { - elementHeight = 360; - } - if (!elementWidth) { - elementWidth = 540; - } - } - } - if (!isPrint) { - LogUtil.info("Lottie canvas size:" + elementHeight + "," + elementWidth + " with fr:" + - this.animationItem?.animationData?.fr); - } - - var elementRel; - var animationRel; - if (this.renderConfig.preserveAspectRatio.indexOf('meet') !== -1 || this.renderConfig.preserveAspectRatio.indexOf('slice') !== -1) { - var par = this.renderConfig.preserveAspectRatio.split(' '); - var fillType = par[1] || 'meet'; - var pos = par[0] || 'xMidYMid'; - var xPos = pos.substr(0, 4); - var yPos = pos.substr(4); - elementRel = elementWidth / elementHeight; - animationRel = this.transformCanvas.w / this.transformCanvas.h; - if ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice')) { - this.transformCanvas.sx = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr); - this.transformCanvas.sy = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr); - } else { - this.transformCanvas.sx = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr); - this.transformCanvas.sy = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr); - } - - if (xPos === 'xMid' && ((animationRel < elementRel && fillType === 'meet') || (animationRel > elementRel && fillType === 'slice'))) { - this.transformCanvas.tx = ((elementWidth - this.transformCanvas.w * (elementHeight / this.transformCanvas.h)) / 2) * this.renderConfig.dpr; - } else if (xPos === 'xMax' && ((animationRel < elementRel && fillType === 'meet') || (animationRel > elementRel && fillType === 'slice'))) { - this.transformCanvas.tx = (elementWidth - this.transformCanvas.w * (elementHeight / this.transformCanvas.h)) * this.renderConfig.dpr; - } else { - this.transformCanvas.tx = 0; - } - if (yPos === 'YMid' && ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice'))) { - this.transformCanvas.ty = ((elementHeight - this.transformCanvas.h * (elementWidth / this.transformCanvas.w)) / 2) * this.renderConfig.dpr; - } else if (yPos === 'YMax' && ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice'))) { - this.transformCanvas.ty = ((elementHeight - this.transformCanvas.h * (elementWidth / this.transformCanvas.w))) * this.renderConfig.dpr; - } else { - this.transformCanvas.ty = 0; - } - } else if (this.renderConfig.preserveAspectRatio === 'none') { - this.transformCanvas.sx = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr); - this.transformCanvas.sy = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr); - this.transformCanvas.tx = 0; - this.transformCanvas.ty = 0; - } else { - this.transformCanvas.sx = this.renderConfig.dpr; - this.transformCanvas.sy = this.renderConfig.dpr; - this.transformCanvas.tx = 0; - this.transformCanvas.ty = 0; - } - this.transformCanvas.props = [this.transformCanvas.sx, 0, 0, 0, 0, this.transformCanvas.sy, 0, 0, 0, 0, 1, 0, this.transformCanvas.tx, this.transformCanvas.ty, 0, 1]; - /* var i, len = this.elements.length; - for(i=0;i= 0; i -= 1) { - if (this.elements[i] && this.elements[i].destroy) { - this.elements[i].destroy(); - } - } - this.elements.length = 0; - this.globalData.canvasContext = null; - this.animationItem.container = null; - this.destroyed = true; -}; - -CanvasRendererBase.prototype.changeColor = function (color, endColor, layer, index) { - if (typeof endColor == 'object') { - if (Array.isArray(endColor)) { - if (!layer) { - var len = this.layers.length; - var i; - for (i = 0; i < len; i += 1) { - let tag = true; - if (this.layers[i] && this.layers[i].td) { - tag = false; - } - if (tag && (this.completeLayers || this.elements[i])) { - this.elements[i].changeColor(color, endColor); - } - } - } else { - if (this.completeLayers || this.elements[layer-1]) { - this.elements[layer-1].changeColor(color, endColor, index); - } - } - } - } else if (typeof endColor == 'number') { - if (endColor == 0) { - var len = this.layers.length; - var i; - for (i = 0; i < len; i += 1) { - let tag = true; - if (this.layers[i] && this.layers[i].td) { - tag = false; - } - if (tag && (this.completeLayers || this.elements[i])) { - this.elements[i].changeColor(color, undefined); - } - } - } else { - if (this.completeLayers || this.elements[endColor-1]) { - this.elements[endColor-1].changeColor(color, layer, index); - } - } - } else { - var len = this.layers.length; - var i; - for (i = 0; i < len; i += 1) { - let tag = true; - if (this.layers[i] && this.layers[i].td) { - tag = false; - } - if (tag && (this.completeLayers || this.elements[i])) { - this.elements[i].changeColor(color, undefined); - } - } - } -} - -CanvasRendererBase.prototype.renderFrame = function (num, forceRender) { - if ((this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender) || this.destroyed || num === -1) { - return; - } - this.renderedFrame = num; - this.globalData.frameNum = num - this.animationItem._isFirstFrame; - this.globalData.frameId += 1; - this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender; - this.globalData.projectInterface.currentFrame = num; - - // LogUtil.log('--------'); - // LogUtil.log('NEW: ',num); - var i; - var len = this.layers.length; - if (!this.completeLayers) { - this.checkLayers(num); - } - - for (i = 0; i < len; i += 1) { - if (this.completeLayers || this.elements[i]) { - this.elements[i].prepareFrame(num - this.layers[i].st); - } - } - - if (this.renderConfig.clearCanvas === true) { - let currentTranform = this.canvasContext.getTransform(); - this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h); //清空之前画布 - this.canvasContext.setTransform(1, 0, 0, 1, 0, 0); - this.canvasContext.clearRect(0, 0, this.canvasContext.width, this.canvasContext.height); //清空之前画布 - this.canvasContext.setTransform(currentTranform); - } else { - this.save(); - } - for (i = len - 1; i >= 0; i -= 1) { - if (this.completeLayers || this.elements[i]) { - this.elements[i].renderFrame(); - } - } - if (this.renderConfig.clearCanvas !== true) { - this.restore(); - } -}; - -CanvasRendererBase.prototype.buildItem = function (pos) { - var elements = this.elements; - if (elements[pos] || this.layers[pos].ty === 99) { - return; - } - var element = this.createItem(this.layers[pos], this, this.globalData); - elements[pos] = element; - element.initExpressions(); - /* if(this.layers[pos].ty === 0){ - element.resize(this.globalData.transformCanvas); - } */ -}; - -CanvasRendererBase.prototype.checkPendingElements = function () { - while (this.pendingElements.length) { - var element = this.pendingElements.pop(); - element.checkParenting(); - } -}; - -CanvasRendererBase.prototype.hide = function () { - this.animationItem.container.style.display = 'none'; -}; - -CanvasRendererBase.prototype.show = function () { - this.animationItem.container.style.display = 'block'; -}; - -export default CanvasRendererBase; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/HybridRenderer.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/HybridRenderer.js deleted file mode 100644 index f5188d31bbbe3d6f292196051934fee68750ce6a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/HybridRenderer.js +++ /dev/null @@ -1,47 +0,0 @@ -import { - extendPrototype, -} from '../utils/functionExtensions'; -import HybridRendererBase from './HybridRendererBase'; -import HCompElement from '../elements/htmlElements/HCompElement'; -import SVGCompElement from '../elements/svgElements/SVGCompElement'; - -function HybridRenderer(animationItem, config) { - this.animationItem = animationItem; - this.layers = null; - this.renderedFrame = -1; - this.renderConfig = { - className: (config && config.className) || '', - imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice', - hideOnTransparent: !(config && config.hideOnTransparent === false), - filterSize: { - width: (config && config.filterSize && config.filterSize.width) || '400%', - height: (config && config.filterSize && config.filterSize.height) || '400%', - x: (config && config.filterSize && config.filterSize.x) || '-100%', - y: (config && config.filterSize && config.filterSize.y) || '-100%', - }, - runExpressions: !config || config.runExpressions === undefined || config.runExpressions, - }; - this.globalData = { - _mdf: false, - frameNum: -1, - renderConfig: this.renderConfig, - }; - this.pendingElements = []; - this.elements = []; - this.threeDElements = []; - this.destroyed = false; - this.camera = null; - this.supports3d = true; - this.rendererType = 'html'; -} - -extendPrototype([HybridRendererBase], HybridRenderer); - -HybridRenderer.prototype.createComp = function (data) { - if (!this.supports3d) { - return new SVGCompElement(data, this.globalData, this); - } - return new HCompElement(data, this.globalData, this); -}; - -export default HybridRenderer; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/HybridRendererBase.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/HybridRendererBase.js deleted file mode 100644 index 5f1e691ccd135e0486b14964f57e34d08288927f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/HybridRendererBase.js +++ /dev/null @@ -1,344 +0,0 @@ -import { - extendPrototype, -} from '../utils/functionExtensions'; -import createNS from '../utils/helpers/svg_elements'; -import createTag from '../utils/helpers/html_elements'; -import SVGRenderer from './SVGRenderer'; -import HSolidElement from '../elements/htmlElements/HSolidElement'; -import { - styleDiv, -} from '../utils/common'; -import BaseRenderer from './BaseRenderer'; -import IImageElement from '../elements/ImageElement'; -import SVGShapeElement from '../elements/svgElements/SVGShapeElement'; -import HShapeElement from '../elements/htmlElements/HShapeElement'; -import HTextElement from '../elements/htmlElements/HTextElement'; -import HCameraElement from '../elements/htmlElements/HCameraElement'; -import HImageElement from '../elements/htmlElements/HImageElement'; -import ISolidElement from '../elements/SolidElement'; -import SVGTextLottieElement from '../elements/svgElements/SVGTextElement'; - -function HybridRendererBase(animationItem, config) { - this.animationItem = animationItem; - this.layers = null; - this.renderedFrame = -1; - this.renderConfig = { - className: (config && config.className) || '', - imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice', - hideOnTransparent: !(config && config.hideOnTransparent === false), - filterSize: { - width: (config && config.filterSize && config.filterSize.width) || '400%', - height: (config && config.filterSize && config.filterSize.height) || '400%', - x: (config && config.filterSize && config.filterSize.x) || '-100%', - y: (config && config.filterSize && config.filterSize.y) || '-100%', - }, - }; - this.globalData = { - _mdf: false, - frameNum: -1, - renderConfig: this.renderConfig, - }; - this.pendingElements = []; - this.elements = []; - this.threeDElements = []; - this.destroyed = false; - this.camera = null; - this.supports3d = true; - this.rendererType = 'html'; -} - -extendPrototype([BaseRenderer], HybridRendererBase); - -HybridRendererBase.prototype.buildItem = SVGRenderer.prototype.buildItem; - -HybridRendererBase.prototype.checkPendingElements = function () { - while (this.pendingElements.length) { - var element = this.pendingElements.pop(); - element.checkParenting(); - } -}; - -HybridRendererBase.prototype.appendElementInPos = function (element, pos) { - var newDOMElement = element.getBaseElement(); - if (!newDOMElement) { - return; - } - var layer = this.layers[pos]; - if (!layer.ddd || !this.supports3d) { - if (this.threeDElements) { - this.addTo3dContainer(newDOMElement, pos); - } else { - var i = 0; - var nextDOMElement; - var nextLayer; - var tmpDOMElement; - while (i < pos) { - if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement) { - nextLayer = this.elements[i]; - tmpDOMElement = this.layers[i].ddd ? this.getThreeDContainerByPos(i) : nextLayer.getBaseElement(); - nextDOMElement = tmpDOMElement || nextDOMElement; - } - i += 1; - } - if (nextDOMElement) { - if (!layer.ddd || !this.supports3d) { - this.layerElement.insertBefore(newDOMElement, nextDOMElement); - } - } else if (!layer.ddd || !this.supports3d) { - this.layerElement.appendChild(newDOMElement); - } - } - } else { - this.addTo3dContainer(newDOMElement, pos); - } -}; - -HybridRendererBase.prototype.createShape = function (data) { - if (!this.supports3d) { - return new SVGShapeElement(data, this.globalData, this); - } - return new HShapeElement(data, this.globalData, this); -}; - -HybridRendererBase.prototype.createText = function (data) { - if (!this.supports3d) { - return new SVGTextLottieElement(data, this.globalData, this); - } - return new HTextElement(data, this.globalData, this); -}; - -HybridRendererBase.prototype.createCamera = function (data) { - this.camera = new HCameraElement(data, this.globalData, this); - return this.camera; -}; - -HybridRendererBase.prototype.createImage = function (data) { - if (!this.supports3d) { - return new IImageElement(data, this.globalData, this); - } - return new HImageElement(data, this.globalData, this); -}; - -HybridRendererBase.prototype.createSolid = function (data) { - if (!this.supports3d) { - return new ISolidElement(data, this.globalData, this); - } - return new HSolidElement(data, this.globalData, this); -}; - -HybridRendererBase.prototype.createNull = SVGRenderer.prototype.createNull; - -HybridRendererBase.prototype.getThreeDContainerByPos = function (pos) { - var i = 0; - var len = this.threeDElements.length; - while (i < len) { - if (this.threeDElements[i].startPos <= pos && this.threeDElements[i].endPos >= pos) { - return this.threeDElements[i].perspectiveElem; - } - i += 1; - } - return null; -}; - -HybridRendererBase.prototype.createThreeDContainer = function (pos, type) { - var perspectiveElem = createTag('div'); - var style; - var containerStyle; - styleDiv(perspectiveElem); - var container = createTag('div'); - styleDiv(container); - if (type === '3d') { - style = perspectiveElem.style; - style.width = this.globalData.compSize.w + 'px'; - style.height = this.globalData.compSize.h + 'px'; - var center = '50% 50%'; - style.webkitTransformOrigin = center; - style.mozTransformOrigin = center; - style.transformOrigin = center; - containerStyle = container.style; - var matrix = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)'; - containerStyle.transform = matrix; - containerStyle.webkitTransform = matrix; - } - - perspectiveElem.appendChild(container); - // this.resizerElem.appendChild(perspectiveElem); - var threeDContainerData = { - container: container, - perspectiveElem: perspectiveElem, - startPos: pos, - endPos: pos, - type: type, - }; - this.threeDElements.push(threeDContainerData); - return threeDContainerData; -}; - -HybridRendererBase.prototype.build3dContainers = function () { - var i; - var len = this.layers.length; - var lastThreeDContainerData; - var currentContainer = ''; - for (i = 0; i < len; i += 1) { - if (this.layers[i].ddd && this.layers[i].ty !== 3) { - if (currentContainer !== '3d') { - currentContainer = '3d'; - lastThreeDContainerData = this.createThreeDContainer(i, '3d'); - } - lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos, i); - } else { - if (currentContainer !== '2d') { - currentContainer = '2d'; - lastThreeDContainerData = this.createThreeDContainer(i, '2d'); - } - lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos, i); - } - } - len = this.threeDElements.length; - for (i = len - 1; i >= 0; i -= 1) { - this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem); - } -}; - -HybridRendererBase.prototype.addTo3dContainer = function (elem, pos) { - var i = 0; - var len = this.threeDElements.length; - while (i < len) { - if (pos <= this.threeDElements[i].endPos) { - var j = this.threeDElements[i].startPos; - var nextElement; - while (j < pos) { - if (this.elements[j] && this.elements[j].getBaseElement) { - nextElement = this.elements[j].getBaseElement(); - } - j += 1; - } - if (nextElement) { - this.threeDElements[i].container.insertBefore(elem, nextElement); - } else { - this.threeDElements[i].container.appendChild(elem); - } - break; - } - i += 1; - } -}; - -HybridRendererBase.prototype.configAnimation = function (animData) { - var resizerElem = createTag('div'); - var wrapper = this.animationItem.wrapper; - var style = resizerElem.style; - style.width = animData.w + 'px'; - style.height = animData.h + 'px'; - this.resizerElem = resizerElem; - styleDiv(resizerElem); - style.transformStyle = 'flat'; - style.mozTransformStyle = 'flat'; - style.webkitTransformStyle = 'flat'; - if (this.renderConfig.className) { - resizerElem.setAttribute('class', this.renderConfig.className); - } - wrapper.appendChild(resizerElem); - - style.overflow = 'hidden'; - var svg = createNS('svg'); - svg.setAttribute('width', '1'); - svg.setAttribute('height', '1'); - styleDiv(svg); - this.resizerElem.appendChild(svg); - var defs = createNS('defs'); - svg.appendChild(defs); - this.data = animData; - // Mask animation - this.setupGlobalData(animData, svg); - this.globalData.defs = defs; - this.layers = animData.layers; - this.layerElement = this.resizerElem; - this.build3dContainers(); - this.updateContainerSize(); -}; - -HybridRendererBase.prototype.destroy = function () { - if (this.animationItem.wrapper) { - this.animationItem.wrapper.innerText = ''; - } - this.animationItem.container = null; - this.globalData.defs = null; - var i; - var len = this.layers ? this.layers.length : 0; - for (i = 0; i < len; i += 1) { - if (this.elements[i] && this.elements[i].destroy) { - this.elements[i].destroy(); - } - } - this.elements.length = 0; - this.destroyed = true; - this.animationItem = null; -}; - -HybridRendererBase.prototype.updateContainerSize = function () { - var elementWidth = this.animationItem.wrapper.offsetWidth; - var elementHeight = this.animationItem.wrapper.offsetHeight; - var elementRel = elementWidth / elementHeight; - var animationRel = this.globalData.compSize.w / this.globalData.compSize.h; - var sx; - var sy; - var tx; - var ty; - if (animationRel > elementRel) { - sx = elementWidth / (this.globalData.compSize.w); - sy = elementWidth / (this.globalData.compSize.w); - tx = 0; - ty = ((elementHeight - this.globalData.compSize.h * (elementWidth / this.globalData.compSize.w)) / 2); - } else { - sx = elementHeight / (this.globalData.compSize.h); - sy = elementHeight / (this.globalData.compSize.h); - tx = (elementWidth - this.globalData.compSize.w * (elementHeight / this.globalData.compSize.h)) / 2; - ty = 0; - } - var style = this.resizerElem.style; - style.webkitTransform = 'matrix3d(' + sx + ',0,0,0,0,' + sy + ',0,0,0,0,1,0,' + tx + ',' + ty + ',0,1)'; - style.transform = style.webkitTransform; -}; - -HybridRendererBase.prototype.renderFrame = SVGRenderer.prototype.renderFrame; - -HybridRendererBase.prototype.hide = function () { - this.resizerElem.style.display = 'none'; -}; - -HybridRendererBase.prototype.show = function () { - this.resizerElem.style.display = 'block'; -}; - -HybridRendererBase.prototype.initItems = function () { - this.buildAllItems(); - if (this.camera) { - this.camera.setup(); - } else { - var cWidth = this.globalData.compSize.w; - var cHeight = this.globalData.compSize.h; - var i; - var len = this.threeDElements.length; - for (i = 0; i < len; i += 1) { - var style = this.threeDElements[i].perspectiveElem.style; - style.webkitPerspective = Math.sqrt(Math.pow(cWidth, 2) + Math.pow(cHeight, 2)) + 'px'; - style.perspective = style.webkitPerspective; - } - } -}; - -HybridRendererBase.prototype.searchExtraCompositions = function (assets) { - var i; - var len = assets.length; - var floatingContainer = createTag('div'); - for (i = 0; i < len; i += 1) { - if (assets[i].xt) { - var comp = this.createComp(assets[i], floatingContainer, this.globalData.comp, null); - comp.initExpressions(); - this.globalData.projectInterface.registerComposition(comp); - } - } -}; - -export default HybridRendererBase; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/SVGRenderer.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/SVGRenderer.js deleted file mode 100644 index c26c4e1d7b412583d0a5867a6bba2a98b8977ecc..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/SVGRenderer.js +++ /dev/null @@ -1,87 +0,0 @@ -import { - createElementID, -} from '../utils/common'; -import { - extendPrototype, -} from '../utils/functionExtensions'; -import createNS from '../utils/helpers/svg_elements'; - -import SVGCompElement from '../elements/svgElements/SVGCompElement'; -import SVGRendererBase from './SVGRendererBase'; - -function SVGRenderer(animationItem, config) { - this.animationItem = animationItem; - this.layers = null; - this.renderedFrame = -1; - this.svgElement = createNS('svg'); - var ariaLabel = ''; - if (config && config.title) { - var titleElement = createNS('title'); - var titleId = createElementID(); - titleElement.setAttribute('id', titleId); - titleElement.textContent = config.title; - this.svgElement.appendChild(titleElement); - ariaLabel += titleId; - } - if (config && config.description) { - var descElement = createNS('desc'); - var descId = createElementID(); - descElement.setAttribute('id', descId); - descElement.textContent = config.description; - this.svgElement.appendChild(descElement); - ariaLabel += ' ' + descId; - } - if (ariaLabel) { - this.svgElement.setAttribute('aria-labelledby', ariaLabel); - } - var defs = createNS('defs'); - this.svgElement.appendChild(defs); - var maskElement = createNS('g'); - this.svgElement.appendChild(maskElement); - this.layerElement = maskElement; - this.dp = 1; - this.startX = 0; - this.startY = 0; - this.matrix = []; - this.cLength = []; - this.renderConfig = { - preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet', - imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice', - contentVisibility: (config && config.contentVisibility) || 'visible', - progressiveLoad: (config && config.progressiveLoad) || false, - hideOnTransparent: !((config && config.hideOnTransparent === false)), - viewBoxOnly: (config && config.viewBoxOnly) || false, - viewBoxSize: (config && config.viewBoxSize) || false, - className: (config && config.className) || '', - id: (config && config.id) || '', - focusable: config && config.focusable, - filterSize: { - width: (config && config.filterSize && config.filterSize.width) || '100%', - height: (config && config.filterSize && config.filterSize.height) || '100%', - x: (config && config.filterSize && config.filterSize.x) || '0%', - y: (config && config.filterSize && config.filterSize.y) || '0%', - }, - width: (config && config.width), - height: (config && config.height), - runExpressions: !config || config.runExpressions === undefined || config.runExpressions, - }; - - this.globalData = { - _mdf: false, - frameNum: -1, - defs: defs, - renderConfig: this.renderConfig, - }; - this.elements = []; - this.pendingElements = []; - this.destroyed = false; - this.rendererType = 'svg'; -} - -extendPrototype([SVGRendererBase], SVGRenderer); - -SVGRenderer.prototype.createComp = function (data) { - return new SVGCompElement(data, this.globalData, this); -}; - -export default SVGRenderer; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/SVGRendererBase.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/SVGRendererBase.js deleted file mode 100644 index cb34bab9255820812f16ef788654abe9f446cf40..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/SVGRendererBase.js +++ /dev/null @@ -1,816 +0,0 @@ -import { getLocationHref } from '../main'; -import { - createElementID, - getExpressionsPlugin, -} from '../utils/common'; -import { - extendPrototype, -} from '../utils/functionExtensions'; -import { - createSizedArray, -} from '../utils/helpers/arrays'; -import createNS from '../utils/helpers/svg_elements'; -import BaseRenderer from './BaseRenderer'; -import IImageElement from '../elements/ImageElement'; -import SVGShapeElement from '../elements/svgElements/SVGShapeElement'; -import SVGTextLottieElement from '../elements/svgElements/SVGTextElement'; // eslint-disable-line import/no-cycle -import ISolidElement from '../elements/SolidElement'; -import NullElement from '../elements/NullElement'; - -function SVGRendererBase() { -} - -extendPrototype([BaseRenderer], SVGRendererBase); - -SVGRendererBase.prototype.createNull = function (data) { - return new NullElement(data, this.globalData, this); -}; - -SVGRendererBase.prototype.createShape = function (data) { - return new SVGShapeElement(data, this.globalData, this); -}; - -SVGRendererBase.prototype.createText = function (data) { - return new SVGTextLottieElement(data, this.globalData, this); -}; - -SVGRendererBase.prototype.createImage = function (data) { - return new IImageElement(data, this.globalData, this); -}; - -SVGRendererBase.prototype.createSolid = function (data) { - return new ISolidElement(data, this.globalData, this); -}; - -SVGRendererBase.prototype.configAnimation = function (animData) { - this.svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg'); - this.svgElement.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink'); - if (this.animationItem.wrapper != undefined) { - this.canvasContext = this.animationItem.wrapper; - } else { - this.canvasContext = this.renderConfig.context; - } - if (this.renderConfig.viewBoxSize) { - this.svgElement.setAttribute('viewBox', this.renderConfig.viewBoxSize); - } else { - this.svgElement.setAttribute('viewBox', '0 0 ' + animData.w + ' ' + animData.h); - } - - if (!this.renderConfig.viewBoxOnly) { - this.svgElement.setAttribute('width', animData.w); - this.svgElement.setAttribute('height', animData.h); - this.svgElement.style.width = '100%'; - this.svgElement.style.height = '100%'; - this.svgElement.style.transform = 'translate3d(0,0,0)'; - this.svgElement.style.contentVisibility = this.renderConfig.contentVisibility; - } - if (this.renderConfig.width) { - this.svgElement.setAttribute('width', this.renderConfig.width); - } - if (this.renderConfig.height) { - this.svgElement.setAttribute('height', this.renderConfig.height); - } - if (this.renderConfig.className) { - this.svgElement.setAttribute('class', this.renderConfig.className); - } - if (this.renderConfig.id) { - this.svgElement.setAttribute('id', this.renderConfig.id); - } - if (this.renderConfig.focusable !== undefined) { - this.svgElement.setAttribute('focusable', this.renderConfig.focusable); - } - this.svgElement.setAttribute('preserveAspectRatio', this.renderConfig.preserveAspectRatio); - // this.layerElement.style.transform = 'translate3d(0,0,0)'; - // this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px"; - // this.animationItem.wrapper.appendChild(this.svgElement); - // Mask animation - var defs = this.globalData.defs; - - this.setupGlobalData(animData, defs); - this.globalData.progressiveLoad = this.renderConfig.progressiveLoad; - this.data = animData; - - var maskElement = createNS('clipPath'); - var rect = createNS('rect'); - rect.setAttribute('width', animData.w); - rect.setAttribute('height', animData.h); - rect.setAttribute('x', 0); - rect.setAttribute('y', 0); - var maskId = createElementID(); - maskElement.setAttribute('id', maskId); - maskElement.appendChild(rect); - this.layerElement.setAttribute('clip-path', 'url(' + getLocationHref() + '#' + maskId + ')'); - - defs.appendChild(maskElement); - this.layers = animData.layers; - this.elements = createSizedArray(animData.layers.length); -}; - -SVGRendererBase.prototype.destroy = function () { - if (this.canvasContext) { - this.canvasContext.clearRect(0, 0, this.canvasContext.width, this.canvasContext.height) - } - this.layerElement = null; - this.globalData.defs = null; - var i; - var len = this.layers ? this.layers.length : 0; - for (i = 0; i < len; i += 1) { - if (this.elements[i]) { - if (this.elements[i] && this.elements[i].destroy) { - this.elements[i].destroy(); - } - } - } - this.elements.length = 0; - this.destroyed = true; - this.animationItem = null; -}; - -SVGRendererBase.prototype.updateContainerSize = function () { -}; - -SVGRendererBase.prototype.updateContentMode = function (contentMode) { -}; - -SVGRendererBase.prototype.findIndexByInd = function (ind) { - var i = 0; - var len = this.layers.length; - for (i = 0; i < len; i += 1) { - if (this.layers[i].ind === ind) { - return i; - } - } - return -1; -}; - -SVGRendererBase.prototype.buildItem = function (pos) { - var elements = this.elements; - if (elements[pos] || this.layers[pos].ty === 99) { - return; - } - elements[pos] = true; - var element = this.createItem(this.layers[pos]); - - elements[pos] = element; - if (getExpressionsPlugin()) { - if (this.layers[pos].ty === 0) { - this.globalData.projectInterface.registerComposition(element); - } - element.initExpressions(); - } - this.appendElementInPos(element, pos); - if (this.layers[pos].tt) { - var elementIndex = ('tp' in this.layers[pos]) - ? this.findIndexByInd(this.layers[pos].tp) - : pos - 1; - if (elementIndex === -1) { - return; - } - if (!this.elements[elementIndex] || this.elements[elementIndex] === true) { - this.buildItem(elementIndex); - this.addPendingElement(element); - } else { - var matteElement = elements[elementIndex]; - var matteMask = matteElement.getMatte(this.layers[pos].tt); - element.setMatte(matteMask); - } - } -}; - -SVGRendererBase.prototype.checkPendingElements = function () { - while (this.pendingElements.length) { - var element = this.pendingElements.pop(); - element.checkParenting(); - if (element.data.tt) { - var i = 0; - var len = this.elements.length; - while (i < len) { - if (this.elements[i] === element) { - var elementIndex = 'tp' in element.data - ? this.findIndexByInd(element.data.tp) - : i - 1; - var matteElement = this.elements[elementIndex]; - var matteMask = matteElement.getMatte(this.layers[i].tt); - element.setMatte(matteMask); - break; - } - i += 1; - } - } - } -}; - -SVGRendererBase.prototype.changeColor = function (color, endColor, layer, index) { - if (typeof endColor == 'object') { - if (Array.isArray(endColor)) { - if (!layer) { - var len = this.layers.length; - var i; - for (i = 0; i < len; i += 1) { - let tag = true; - if (this.layers[i] && this.layers[i].td) { - tag = false; - } - if (tag && (this.completeLayers || this.elements[i])) { - this.elements[i].changeColor(color, endColor); - } - } - } else { - if (this.completeLayers || this.elements[layer-1]) { - this.elements[layer-1].changeColor(color, endColor, index); - } - } - } - } else if (typeof endColor == 'number') { - if (endColor == 0) { - var len = this.layers.length; - var i; - for (i = 0; i < len; i += 1) { - let tag = true; - if (this.layers[i] && this.layers[i].td) { - tag = false; - } - if (tag && (this.completeLayers || this.elements[i])) { - this.elements[i].changeColor(color, undefined); - } - } - } else { - if (this.completeLayers || this.elements[endColor-1]) { - this.elements[endColor-1].changeColor(color, endColor, layer); - } - } - } else { - var len = this.layers.length; - var i; - for (i = 0; i < len; i += 1) { - let tag = true; - if (this.layers[i] && this.layers[i].td) { - tag = false; - } - if (tag && (this.completeLayers || this.elements[i])) { - this.elements[i].changeColor(color, undefined); - } - } - } -} - -SVGRendererBase.prototype.renderFrame = function (num,tag) { - if(tag){ - this.renderedFrame =-1; - } - if (this.renderedFrame === num || this.destroyed) { - return; - } - if (num === null) { - num = this.renderedFrame; - } else { - this.renderedFrame = num; - } - // console.log('-------'); - // console.log('FRAME ',num); - this.globalData.frameNum = num; - this.globalData.frameId += 1; - this.globalData.projectInterface.currentFrame = num; - this.globalData._mdf = false; - var i; - var len = this.layers.length; - if (!this.completeLayers) { - this.checkLayers(num); - } - for (i = len - 1; i >= 0; i -= 1) { - if (this.completeLayers || this.elements[i]) { - this.elements[i].prepareFrame(num - this.layers[i].st); - } - } - if (this.globalData._mdf) { - for (i = 0; i < len; i += 1) { - if (this.completeLayers || this.elements[i]) { - this.elements[i].renderFrame(); - } - } - } - let width = this.canvasContext.width - let height = this.canvasContext.height - - this.startX = 0 - this.startY = 0 - if (width > height) { - this.dp = width / this.svgElement['ks']['width'] - if (height > this.svgElement['ks']['height'] * this.dp) { - this.dp = width / this.svgElement['ks']['width'] - this.startY = (height - this.svgElement['ks']['height'] * this.dp) / 2 - - } else { - this.dp = height / this.svgElement['ks']['height'] - this.startX = (width - this.svgElement['ks']['width'] * this.dp) / 2 - - } - } else { - this.dp = height / this.svgElement['ks']['height'] - if (width > this.svgElement['ks']['width'] * this.dp) { - this.dp = height / this.svgElement['ks']['height'] - this.startX = (width - this.svgElement['ks']['width'] * this.dp) / 2 - } else { - this.dp = width / this.svgElement['ks']['width'] - this.startY = (height - this.svgElement['ks']['height'] * this.dp) / 2 - } - } - //清空上一帧 - this.canvasContext.clearRect(0, 0, width, height) - //渲染动画 this.svgElement为svg标签封装实体 - this.renderLabel(this.svgElement) -}; - -/* - * @param path path元素 - * @param color 传递色值 - * @param op 传递透明度 - * @param isMask 是否为mask子元素 - * */ -SVGRendererBase.prototype.renderPath = function (path, color, op=-1, isMask=false) { - let props = Object.keys(path['ks']); - if (props.indexOf('d') > -1) { - let d = path['ks']['d']; - let spaces = d.split(' '); - let xys = [] - var ft = '' - var ed = '' - var begins = false - for (let i = 0;i < spaces.length; i++) { - if (spaces[i] != '') { - let item = spaces[i] - let first = spaces[i].charAt(0) - let end = spaces[i].substr(-1) - let xy = [] - if (first == 'M' || first == 'L' || first == 'H' || first == 'V' || first == 'C' || first == 'S' || first == 'Q' || first == 'T' || first == 'A') { - ft = first - xys = [] - xy = spaces[i].split(',') - xy[0] = xy[0].slice(1) - - } else { - xy = item.split(',') - } - if (end == 'z' || end == 'Z') { - xy[1] = xy[1].slice(0, -1) - ed = 'z' - } - xys.push(xy) - if (ft == 'M' && xys.length == 1) { - if (!begins) { - this.canvasContext.beginPath() - begins = !begins - } - let x = Number(xys[0][0]) * this.dp - let y = Number(xys[0][1]) * this.dp - this.canvasContext.moveTo(x, y) - //moveto(M X,Y) :将画笔移动到指定的坐标位置 - } else if (ft == 'L' && xys.length == 1) { - let x = Number(xys[0][0]) * this.dp - let y = Number(xys[0][1]) * this.dp - this.canvasContext.lineTo(x, y) - //lineto(L X,Y) :画直线到指定的坐标位置 - } else if (ft == 'H') { - //horizontal lineto(H X):画水平线到指定的X坐标位置 - } else if (ft == 'V') { - break; //vertical lineto(V Y):画垂直线到指定的Y坐标位置 - } else if (ft == 'C' && xys.length == 3) { - let x1 = Number(xys[0][0]) * this.dp - let y1 = Number(xys[0][1]) * this.dp - let x2 = Number(xys[1][0]) * this.dp - let y2 = Number(xys[1][1]) * this.dp - let x3 = Number(xys[2][0]) * this.dp - let y3 = Number(xys[2][1]) * this.dp - this.canvasContext.bezierCurveTo(x1, y1, x2, y2, x3, y3) - //curveto(C X1,Y1,X2,Y2,ENDX,ENDY):三次贝赛曲线 - } else if (ft == 'S') { - //smooth curveto(S X2,Y2,ENDX,ENDY) - } else if (ft == 'Q' && xys.length == 2) { - let x1 = Number(xys[0][0]) * this.dp - let y1 = Number(xys[0][1]) * this.dp - let x2 = Number(xys[1][0]) * this.dp - let y2 = Number(xys[1][1]) * this.dp - this.canvasContext.quadraticCurveTo(x1, y1, x2, y2) - //quadratic Belzier curve(Q X,Y,ENDX,ENDY):二次贝赛曲线 - } else if (ft == 'T') { - //smooth quadratic Belzier curveto(T ENDX,ENDY):映射 - } else if (ft == 'A') { - - } //elliptical Arc(A RX,RY,XROTATION,FLAG1,FLAG2,X,Y):弧线 - if (ed == 'z') { - this.canvasContext.closePath() - ed = '' - } - } - } - } - - - if (props.indexOf('stroke-linecap') > -1) { - this.canvasContext.lineCap = path['ks']['stroke-linecap'] - } - if (props.indexOf('stroke-linejoin') > -1) { - this.canvasContext.lineJoin = path['ks']['stroke-linejoin'] - } - if (props.indexOf('stroke-miterlimit') > -1) { - this.canvasContext.miterLimit = path['ks']['stroke-miterlimit'] - } - if (props.indexOf('stroke-dasharray') > -1) { - this.canvasContext.setLineDash(path['ks']['stroke-dasharray']) - } - if (props.indexOf('stroke-dashoffset') > -1) { - this.canvasContext.lineDashOffset = path['ks']['stroke-dashoffset'] - } - - - if (props.indexOf('stroke-width') > -1) { - this.canvasContext.lineWidth = path['ks']['stroke-width'] * this.dp - } - if (props.indexOf('stroke') > -1) { - this.canvasContext.strokeStyle = path['ks']['stroke'] - this.canvasContext.stroke() - } - if (op != -1) { - this.canvasContext.globalAlpha = op - } - - if (props.indexOf('fill') > -1) { - let cl = '' - if (path['ks']['fill'].indexOf('url(#') > -1) { - let id = path['ks']['fill'] - id = id.substring(0, id.length - 1); - id = id.slice(5) - for (let i = 0;i < this.defs.length; i++) { - if (this.defs[i]['ks']['id'] == id) { - this.renderLabel(this.defs[i], color, isMask) - } - } - } else { - - if (path['ks']['fill'] == '#ffffff') { //mask中白色为可见,正常处理传入色值 - if (color != undefined) { - cl = color - } - if (isMask) { //mask目前用clip实现简单效果 - this.canvasContext.clip() - } - } else { - if (isMask) { - if (path['ks']['fill'] == '#000000' || path['ks']['fill'] == 'rgb(0,0,0)') { - //mask中黑色为不可见 - this.canvasContext.globalAlpha = 0 - } else { - cl = color - this.canvasContext.clip() - } - } else { - cl = path['ks']['fill'] - } - - } - if (props.indexOf('fill-opacity') > -1) { - let op = Number(path['ks']['fill-opacity']) - if (cl != undefined && op != undefined) { - this.canvasContext.fillStyle = this.colorOpt(cl, op) - } - } else { - this.canvasContext.fillStyle = cl - } - if (props.indexOf('clip-rule') > -1) { - this.canvasContext.fill(path['ks']['clip-rule']) - } else { - this.canvasContext.fill() - } - } - } else if (color != undefined) { - this.canvasContext.fillStyle = color - this.canvasContext.fill() - } - - -} - -/** - * 十六进制颜色值转为带透明度的颜色 - * @param thisColor 十六进制颜色 - * @param thisOpacity 透明度 - * @returns {string} rgba - */ -SVGRendererBase.prototype.colorOpt = function (thisColor, thisOpacity) { - var theColor = thisColor.toLowerCase(); - //十六进制颜色值的正则表达式 - var r = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; - // 如果是16进制颜色 - if (theColor && r.test(theColor)) { - - if (theColor.length === 4) { - var sColorNew = '#'; - for (var i = 1; i < 4; i += 1) { - sColorNew += theColor.slice(i, i + 1).concat(theColor.slice(i, i + 1)); - } - theColor = sColorNew; - } - //处理六位的颜色值 - var sColorChange = []; - for (var j = 1; j < 7; j += 2) { - sColorChange.push(parseInt('0x' + theColor.slice(j, j + 2))); - } - return 'rgba(' + sColorChange.join(',') + ',' + thisOpacity + ')'; - } - // 如果是rgba或者rgb - if (theColor.startsWith('rgb')) { - let numbers = theColor.match(/(\d(\.\d+)?)+/g); - numbers = numbers.slice(0, 3).concat(thisOpacity); - return 'rgba(' + numbers.join(',') + ')'; - } - - return theColor; -} - -/** - * 根据id查询全局defs中的元素并渲染 - * @param clipId 元素ID - * @param svg 当前元素 - * @param color 传递色值 - * */ -SVGRendererBase.prototype.renderClipPath = function (clipId, svg, color) { - clipId = clipId.substring(0, clipId.length - 1); - clipId = clipId.slice(5) - let isRender = true - let j = 0 - - while (isRender) { - if (this.defs[j]['ks']['id'] == clipId) { - let cl - if (svg['childs'].length > 0) { - for (let i = 0;i < svg['childs'].length; i++) { - //判断是否有色值可以传递 - let rectp = Object.keys(svg['childs'][i]['ks']); - if (svg['childs'][i]['label'] == 'rect' && rectp.indexOf('fill')) { - cl = svg['childs'][i]['ks']['fill'] - } - } - } - if (cl != undefined) { - this.renderLabel(this.defs[j], cl) - } else { - this.renderLabel(this.defs[j], color) - } - isRender = false - } - j++ - } -} -/** - * 渲染svg标签 - * @param svg label实体 - * @param color 传递色值 - * @param opacity 传递透明度 - * @param isMask 判断是否为Mask,并传递 - * */ -SVGRendererBase.prototype.renderLabel = function (svg, color, opacity=-1, isMask=false) { - //标签名 - let labelName = svg['label'] - //标签实体属性名集合 - let props = Object.keys(svg['ks']); - //标签实体style集合 - let styles = Object.keys(svg['style']); - //是否显示 - let isDis = false - switch (labelName) { - case 'svg': - this.canvasContext.fillStyle = '#00000000' //不设置填充色,默认渲染rect为黑色,这里设置为透明色 - this.canvasContext.fillRect(this.startX, this.startY, Number(svg['ks']['width']) * this.dp, Number(svg['ks']['height']) * this.dp) - if (labelName != 'defs' && svg['childs'] != undefined && !isDis) { - for (let i = 0;i < svg['childs'].length; i++) { - this.renderLabel(svg['childs'][i]) - } - } - break; - case 'clipPath': - for (let r = 0;r < svg['childs'].length; r++) { - if (color != undefined) { - this.renderLabel(svg['childs'][r], color) - } else { - this.renderLabel(svg['childs'][r]) - this.canvasContext.clip() - } - } - break - case 'radialGradient': - if (props.indexOf('cx') > -1 && props.indexOf('cy') > -1 && props.indexOf('r') > -1 && props.indexOf('fx') > -1 && props.indexOf('fy') > -1) { - var x0 = Number(svg['ks']['cx']) * this.dp - var y0 = Number(svg['ks']['cy']) * this.dp - var r = Number(svg['ks']['r']) * this.dp - var x1 = Number(svg['ks']['fx']) * this.dp - var y1 = Number(svg['ks']['fy']) * this.dp - var grad = this.canvasContext.createRadialGradient(x1, y1, 0, x0, y0, r) - for (let i = 0;i < svg['childs'].length; i++) { - let item = svg['childs'][i] - let op = item['ks']['offset'] - if (op.indexOf('%') > -1) { - op = Number(op.replace('%', '')) - } - grad.addColorStop(op / 100, item['ks']['stop-color']) - } - this.canvasContext.fillStyle = grad - this.canvasContext.fill() - } - break - case 'linearGradient': - if (props.indexOf('x1') > -1 && props.indexOf('y1') > -1 && props.indexOf('x2') > -1 && props.indexOf('y2') > -1) { - var x0 = Number(svg['ks']['x1']) * this.dp - var y0 = Number(svg['ks']['y1']) * this.dp - var x1 = Number(svg['ks']['x2']) * this.dp - var y1 = Number(svg['ks']['y2']) * this.dp - var grad = this.canvasContext.createLinearGradient(x0, y0, x1, y1) - for (let i = 0;i < svg['childs'].length; i++) { - let item = svg['childs'][i] - let op = item['ks']['offset'] - if (op.indexOf('%') > -1) { - op = Number(op.replace('%', '')) - } - grad.addColorStop(op / 100, item['ks']['stop-color']) - } - this.canvasContext.fillStyle = grad - this.canvasContext.fill() - } - break; - case 'symbol': - for (let i = 0;i < svg['childs'].length; i++) { - this.renderLabel(svg['childs'][i], color, opacity, isMask) - } - break; - case 'use': - if (props.indexOf('href') > -1) { - let useId = svg['ks']['href'] - useId = useId.slice(1) - //根据id在全局defs中查询并渲染 - for (let i = 0;i < this.defs.length; i++) { - if (this.defs[i]['ks']['id'] == useId) { - this.renderLabel(this.defs[i], color, opacity, isMask) - } - } - } - for (let i = 0;i < svg['childs'].length; i++) { - this.renderLabel(svg['childs'][i], color, opacity, isMask) - } - break; - case 'filter': - break; - case 'defs': - //将defs数据赋值给全局 - this.defs = svg['childs'] - break; - case 'rect': - this.canvasContext.rect(this.startX, this.startY, Number(svg['ks']['width']) * this.dp, Number(svg['ks']['height']) * this.dp) - break - case 'path': - //color和isMask是从mask子元素传来的 - this.renderPath(svg, color, opacity, isMask) - break; - case 'mask': - for (let i = 0;i < svg['childs'].length; i++) { - //向子元素传递color和isMask - this.renderLabel(svg['childs'][i], color, opacity, true) - } - break; - case 'g': - if (styles.length > 0) { - for (let k = 0;k < styles.length; k++) { - if (styles[k] == 'display') { - if (svg['style'][styles[k]] == 'none') { - isDis = true //隐藏 - } - if (svg['style'][styles[k]] == 'block') { - isDis = false //显示 - } - } - } - } - if (props.length > 0 && !isDis) { - if (props.indexOf('transform') > -1) { - if (svg['ks']['transform'].indexOf('matrix') > -1) { - let mat = svg['ks']['transform'] - mat = mat.substring(0, mat.length - 1); - mat = mat.slice(7) - let numbers = mat.split(',') - if (svg['childs'].length > 0) { - this.matrix.push(numbers) - this.cLength.push(svg['childs'].length) - } - for (let j = 0;j < this.matrix.length; j++) { - let mx = this.matrix[j] - //setTransform执行会重置matrix,所以第一条以外都用transform - if (j == 0) { - this.canvasContext.setTransform(Number(mx[0]), Number(mx[1]), Number(mx[2]), Number(mx[3]), (Number(mx[4]) * this.dp) + this.startX, (Number(mx[5]) * this.dp) + this.startY) - } else { - this.canvasContext.transform(Number(mx[0]), Number(mx[1]), Number(mx[2]), Number(mx[3]), (Number(mx[4]) * this.dp), (Number(mx[5]) * this.dp)) - } - } - } - if (svg['ks']['transform'].indexOf('translate') > -1) { - let tlt = svg['ks']['transform'] - tlt = tlt.substring(0, tlt.length - 1); - tlt = tlt.slice(9) - let xy = tlt.split(',') - this.canvasContext.translate(Number(xy[0]), Number(xy[1])) - } - if (svg['ks']['transform'].indexOf('scale') > -1) { - let scale = svg['ks']['transform'] - scale = scale.substring(0, scale.length - 1); - scale = scale.slice(5) - let xy = scale.split(',') - this.canvasContext.scale(Number(xy[0]), Number(xy[1])) - } - } - if (props.indexOf('opacity') > -1) { - if (Number(svg['ks']['opacity']) != 1) { - opacity = svg['ks']['opacity'] - } else { - this.canvasContext.globalAlpha = svg['ks']['opacity'] - } - } - if (props.indexOf('fill') > -1) { - color = svg['ks']['fill'] - } - if (props.indexOf('clip-path') > -1) { - let clipPathId = svg['ks']['clip-path'] - var isClip = false - let count = 0 - for (let i = 0;i < svg['childs'].length; i++) { - let it = svg['childs'][i] - let pp = Object.keys(it['ks']); - if (pp.indexOf('aria-label') > -1) { - count++ - if (i == svg['childs'].length - 1) { - isClip = (count == svg['childs'].length) - } - } - } - if (!isClip) { - this.renderClipPath(clipPathId, svg) - } - } - if (props.indexOf('mask') > -1) { - let maskId = svg['ks']['mask'] - this.renderClipPath(maskId, svg) - } - if (props.indexOf('filter') > -1) { - let filterId = svg['ks']['filter'] - this.renderClipPath(filterId, svg) - } - } - if (labelName != 'defs' && svg['childs'].length > 0 && !isDis) { - //渲染子元素,并清除当前元素的matrix - for (let n = 0;n < svg['childs'].length; n++) { - this.canvasContext.save() - let rect = Object.keys(svg['childs'][n]['ks']); - if (props.indexOf('clip-path') < 0 && props.indexOf('mask') < 0 && props.indexOf('filter') < 0 && svg['childs'][n]['label'] == 'rect' && rect.indexOf('fill') > -1) { - this.canvasContext.fillStyle = svg['childs'][n]['ks']['fill'] - this.canvasContext.fillRect(0, 0, Number(svg['childs'][n]['ks']['width']) * this.dp, Number(svg['childs'][n]['ks']['height']) * this.dp) - } else { - //向子元素传递color和isMask - this.renderLabel(svg['childs'][n], color, opacity, isMask) - let k = this.matrix.length - 1 - if (k != undefined && n == this.cLength[k] - 1) { - this.matrix.splice(-1) - this.cLength.splice(-1) - } - } - this.canvasContext.restore() - } - } - break; - } -} - -SVGRendererBase.prototype.appendElementInPos = function (element, pos) { - var newElement = element.getBaseElement(); - if (!newElement) { - return; - } - var i = 0; - var nextElement; - while (i < pos) { - if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement()) { - nextElement = this.elements[i].getBaseElement(); - } - i += 1; - } - if (nextElement) { - this.layerElement.insertBefore(newElement, nextElement); - } else { - this.layerElement.appendChild(newElement); - } -}; - -SVGRendererBase.prototype.hide = function () { - this.layerElement.style.display = 'none'; -}; - -SVGRendererBase.prototype.show = function () { - this.layerElement.style.display = 'block'; -}; - -export default SVGRendererBase; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/renderersManager.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/renderersManager.js deleted file mode 100644 index a3d6fb074925c531aeb17570dbe90c4e1cc100a6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/renderers/renderersManager.js +++ /dev/null @@ -1,29 +0,0 @@ -const renderers = {}; - -const registerRenderer = (key, value) => { - renderers[key] = value; -}; - -function getRenderer(key) { - return renderers[key]; -} - -function getRegisteredRenderer() { - // Returns canvas by default for compatibility - if (renderers.canvas) { - return 'canvas'; - } - // Returns any renderer that is registered - for (const key in renderers) { - if (renderers[key]) { - return key; - } - } - return ''; -} - -export { - getRegisteredRenderer, - registerRenderer, - getRenderer, -}; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/BaseEvent.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/BaseEvent.js deleted file mode 100644 index 3cf63d1e1eb515ee92123bfb41dee6079ef1fb44..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/BaseEvent.js +++ /dev/null @@ -1,55 +0,0 @@ -function BaseEvent() {} -BaseEvent.prototype = { - triggerEvent: function (eventName, args) { - if (!!this._cbs) { - if (this._cbs[eventName]) { - var callbacks = this._cbs[eventName]; - for (var i = 0; i < callbacks.length; i += 1) { - if (!!callbacks[i]) { - callbacks[i](args); - } - } - } - } - }, - addEventListener: function (eventName, callback) { - if (!!this._cbs) { - if (!this._cbs[eventName]) { - this._cbs[eventName] = []; - } - this._cbs[eventName].push(callback); - } - - return function () { - this.removeEventListener(eventName, callback); - }.bind(this); - }, - removeEventListener: function (eventName, callback) { - if (!!!this._cbs) { - return; - } - if (!callback) { - this._cbs[eventName] = null; - } else if (this._cbs[eventName]) { - if (this._cbs[eventName]) { - var i = 0; - if (!!this._cbs[eventName]) { - var len = this._cbs[eventName].length; - while (i < len) { - if (this._cbs[eventName][i] === callback) { - this._cbs[eventName].splice(i, 1); - i -= 1; - len -= 1; - } - i += 1; - } - if (!this._cbs[eventName].length) { - this._cbs[eventName] = null; - } - } - } - } - }, -}; - -export default BaseEvent; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/DataManager.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/DataManager.js deleted file mode 100644 index 80a30c09c82220d82297409818424ae06d04950d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/DataManager.js +++ /dev/null @@ -1,791 +0,0 @@ -import { handleAssets, isHaveImg, createImageFilesDir, decompressAndReadJson, createFilesDir, isCompressdFile, isExistNetworkAssets } from "./DataUtil"; -import { isRawFileExist, isSandboxFileExist, writeFileSync, readFileSync } from './FileUtil'; -import fs from '@ohos.file.fs'; -import util from '@ohos.util'; -import {LogUtil} from './LogUtil'; -import downloadManager from './DownloadManager'; - -const dataManager = (function () { - var _counterId = 1; - var processes = []; - var workerFn; - var workerInstance; - var workerProxy = { - onmessage: function () { - - }, - postMessage: function (path) { - workerFn({ - data: path, - }); - }, - }; - var _workerSelf = { - postMessage: function (data) { - workerProxy.onmessage({ - data: data, - }); - }, - }; - function createWorker(fn) { - workerFn = fn; - return workerProxy; - } - - function loadImage(isNetwork, jsonData, callback, errorCallback) { - // true 优先加载网络资源 - if (isNetwork) { - downloadManager.loadNetworkImage(jsonData).then((results) => { - let newJsonData = handleAssets(jsonData); - callback(newJsonData, true); - }) - .catch((err) => { - // 处理网络异常加载缓存 - let imgRouterFilesDir = createImageFilesDir(); - let isImg = isHaveImg(imgRouterFilesDir); // 沙箱中是否有下载的图片资源 - if (isImg) { - let cacheImagesData = handleAssets(jsonData); - callback(cacheImagesData, false); - } else { - // 缓存无资源,返回加载异常 - errorCallback('error', err); - } - }); - } else { - // false 优先加载缓存资源 - let imgRouterFilesDir = createImageFilesDir(); - let isImg = isHaveImg(imgRouterFilesDir); // 沙箱中是否有下载的图片资源 - if (isImg) { - let filesJsonData = handleAssets(jsonData); - callback(filesJsonData, false); - } else { - downloadManager.loadNetworkImage(jsonData).then((results) => { - let newJsonData = handleAssets(jsonData); - callback(newJsonData, true); - }) - .catch((err) => { - // 下载失败,返回加载异常 - errorCallBack('error', err); - }); - } - } - } - - function loadRawfileData(path, callback, errorCallback, isNetwork) { - if (isCompressdFile(path)) { - try { - let data = getContext()?.resourceManager?.getRawFileContentSync(path); - const lastIndex = path.lastIndexOf('/'); - let fileName = path.substring(lastIndex + 1); - let filePath = `${getContext().cacheDir}/${fileName}`; - let isSuccess = writeFileSync(filePath, data.buffer); - if (!isSuccess) { - errorCallback('Lottie: the path has no data'); - return; - } - let resultDir = createFilesDir(path); - decompressAndReadJson(path, `${getContext()?.cacheDir}`, resultDir.route).then((result) => { - try { - fs.unlink(filePath); - } catch (err) { - LogUtil.warn(`File removal failed: ${JSON.stringify(err)}`); - } - callback(result, false); - }).catch(() => { - errorCallback('Lottie: the path has no data'); - }); - } catch (err) { - errorCallback('Lottie: the path has no data'); - } - } else { - let data = getContext()?.resourceManager?.getRawFileContentSync(path); - let resStr = util.TextDecoder.create('utf-8', { ignoreBOM: true }); - let lottieStr = resStr.decodeToString(new Uint8Array(data.buffer)); - getJsonData(lottieStr, callback, errorCallback, isNetwork); - } - } - - function loadSandboxData(path, callback, errorCallback, isNetwork) { - try { - let filePath = `${getContext().filesDir}/${path}`; - if (isCompressdFile(path)) { - let resultDir = createFilesDir(path); - const lastIndex = filePath.lastIndexOf('/'); - const inFilePath = filePath.substring(0, lastIndex); - decompressAndReadJson(path, inFilePath, resultDir.route).then((result) => { - callback(result, false); - }).catch(() => { - errorCallback('Lottie: the path has no data'); - }); - } else { - let resStr = util.TextDecoder.create('utf-8', { ignoreBOM: true }); - let arrayBuffer = readFileSync(filePath); - if (arrayBuffer) { - let jsonString = resStr.decodeToString(new Uint8Array(arrayBuffer)); - getJsonData(jsonString, callback, errorCallback, isNetwork); - } - } - } catch (err) { - LogUtil.error(`Loading sandbox animation failed: ${JSON.stringify(err)}`); - } - } - - function getJsonData(jsonString, callback, errorCallback, isNetwork) { - let jsonData = JSON.parse(jsonString); - if (jsonData) { - if (jsonData.assets?.length && isExistNetworkAssets(jsonData.assets)) { - loadImage(isNetwork, jsonData, callback, errorCallback); - } else { - // 无网络图片 - callback(jsonData, false); - } - } else { - errorCallback('Lottie: the path has no data'); - } - } - - function setupWorker() { - if (!workerInstance) { - workerInstance = createWorker(function workerStart(e) { - function dataFunctionManager() { - function completeLayers(layers, comps) { - if (!layers) { - return; - } - var layerData; - var i; - var len = layers.length; - var j; - var jLen; - var k; - var kLen; - for (i = 0; i < len; i += 1) { - layerData = layers[i]; - if (('ks' in layerData) && !layerData.completed) { - layerData.completed = true; - if (layerData.hasMask) { - var maskProps = layerData.masksProperties; - jLen = maskProps.length; - for (j = 0; j < jLen; j += 1) { - if (maskProps[j].pt.k.i) { - convertPathsToAbsoluteValues(maskProps[j].pt.k); - } else { - kLen = maskProps[j].pt.k.length; - for (k = 0; k < kLen; k += 1) { - if (maskProps[j].pt.k[k].s) { - convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]); - } - if (maskProps[j].pt.k[k].e) { - convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]); - } - } - } - } - } - if (layerData.ty === 0) { - layerData.layers = findCompLayers(layerData.refId, comps); - completeLayers(layerData.layers, comps); - } else if (layerData.ty === 4) { - completeShapes(layerData.shapes); - } else if (layerData.ty === 5) { - completeText(layerData); - } - } - } - } - - function completeChars(chars, assets) { - if (chars) { - var i = 0; - var len = chars.length; - for (i = 0; i < len; i += 1) { - if (chars[i].t === 1) { - // var compData = findComp(chars[i].data.refId, assets); - chars[i].data.layers = findCompLayers(chars[i].data.refId, assets); - // chars[i].data.ip = 0; - // chars[i].data.op = 99999; - // chars[i].data.st = 0; - // chars[i].data.sr = 1; - // chars[i].w = compData.w; - // chars[i].data.ks = { - // a: { k: [0, 0, 0], a: 0 }, - // p: { k: [0, -compData.h, 0], a: 0 }, - // r: { k: 0, a: 0 }, - // s: { k: [100, 100], a: 0 }, - // o: { k: 100, a: 0 }, - // }; - completeLayers(chars[i].data.layers, assets); - } - } - } - } - - function findComp(id, comps) { - var i = 0; - var len = comps.length; - while (i < len) { - if (comps[i].id === id) { - return comps[i]; - } - i += 1; - } - return null; - } - - function findCompLayers(id, comps) { - var comp = findComp(id, comps); - if (comp) { - if (!comp.layers.__used) { - comp.layers.__used = true; - return comp.layers; - } - return JSON.parse(JSON.stringify(comp.layers)); - } - return null; - } - - function completeShapes(arr) { - var i; - var len = arr.length; - var j; - var jLen; - for (i = len - 1; i >= 0; i -= 1) { - if (arr[i].ty === 'sh') { - if (arr[i].ks.k.i) { - convertPathsToAbsoluteValues(arr[i].ks.k); - } else { - jLen = arr[i].ks.k.length; - for (j = 0; j < jLen; j += 1) { - if (arr[i].ks.k[j].s) { - convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]); - } - if (arr[i].ks.k[j].e) { - convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]); - } - } - } - } else if (arr[i].ty === 'gr') { - completeShapes(arr[i].it); - } - } - } - - function convertPathsToAbsoluteValues(path) { - var i; - var len = path.i.length; - for (i = 0; i < len; i += 1) { - path.i[i][0] += path.v[i][0]; - path.i[i][1] += path.v[i][1]; - path.o[i][0] += path.v[i][0]; - path.o[i][1] += path.v[i][1]; - } - } - - function checkVersion(minimum, animVersionString) { - var animVersion = animVersionString ? animVersionString.split('.') : [100, 100, 100]; - if (minimum[0] > animVersion[0]) { - return true; - } if (animVersion[0] > minimum[0]) { - return false; - } - if (minimum[1] > animVersion[1]) { - return true; - } if (animVersion[1] > minimum[1]) { - return false; - } - if (minimum[2] > animVersion[2]) { - return true; - } if (animVersion[2] > minimum[2]) { - return false; - } - return null; - } - - var checkText = (function () { - var minimumVersion = [4, 4, 14]; - - function updateTextLayer(textLayer) { - var documentData = textLayer.t.d; - textLayer.t.d = { - k: [ - { - s: documentData, - t: 0, - }, - ], - }; - } - - function iterateLayers(layers) { - var i; - var len = layers.length; - for (i = 0; i < len; i += 1) { - if (layers[i].ty === 5) { - updateTextLayer(layers[i]); - } - } - } - - return function (animationData) { - if (checkVersion(minimumVersion, animationData.v)) { - iterateLayers(animationData.layers); - if (animationData.assets) { - var i; - var len = animationData.assets.length; - for (i = 0; i < len; i += 1) { - if (animationData.assets[i].layers) { - iterateLayers(animationData.assets[i].layers); - } - } - } - } - }; - }()); - - var checkChars = (function () { - var minimumVersion = [4, 7, 99]; - return function (animationData) { - if (animationData.chars && !checkVersion(minimumVersion, animationData.v)) { - var i; - var len = animationData.chars.length; - for (i = 0; i < len; i += 1) { - var charData = animationData.chars[i]; - if (charData.data && charData.data.shapes) { - completeShapes(charData.data.shapes); - charData.data.ip = 0; - charData.data.op = 99999; - charData.data.st = 0; - charData.data.sr = 1; - charData.data.ks = { - p: { k: [0, 0], a: 0 }, - s: { k: [100, 100], a: 0 }, - a: { k: [0, 0], a: 0 }, - r: { k: 0, a: 0 }, - o: { k: 100, a: 0 }, - }; - if (!animationData.chars[i].t) { - charData.data.shapes.push( - { - ty: 'no', - } - ); - charData.data.shapes[0].it.push( - { - p: { k: [0, 0], a: 0 }, - s: { k: [100, 100], a: 0 }, - a: { k: [0, 0], a: 0 }, - r: { k: 0, a: 0 }, - o: { k: 100, a: 0 }, - sk: { k: 0, a: 0 }, - sa: { k: 0, a: 0 }, - ty: 'tr', - } - ); - } - } - } - } - }; - }()); - - var checkPathProperties = (function () { - var minimumVersion = [5, 7, 15]; - - function updateTextLayer(textLayer) { - var pathData = textLayer.t.p; - if (typeof pathData.a === 'number') { - pathData.a = { - a: 0, - k: pathData.a, - }; - } - if (typeof pathData.p === 'number') { - pathData.p = { - a: 0, - k: pathData.p, - }; - } - if (typeof pathData.r === 'number') { - pathData.r = { - a: 0, - k: pathData.r, - }; - } - } - - function iterateLayers(layers) { - var i; - var len = layers.length; - for (i = 0; i < len; i += 1) { - if (layers[i].ty === 5) { - updateTextLayer(layers[i]); - } - } - } - - return function (animationData) { - if (checkVersion(minimumVersion, animationData.v)) { - iterateLayers(animationData.layers); - if (animationData.assets) { - var i; - var len = animationData.assets.length; - for (i = 0; i < len; i += 1) { - if (animationData.assets[i].layers) { - iterateLayers(animationData.assets[i].layers); - } - } - } - } - }; - }()); - - var checkColors = (function () { - var minimumVersion = [4, 1, 9]; - - function iterateShapes(shapes) { - var i; - var len = shapes.length; - var j; - var jLen; - for (i = 0; i < len; i += 1) { - if (shapes[i].ty === 'gr') { - iterateShapes(shapes[i].it); - } else if (shapes[i].ty === 'fl' || shapes[i].ty === 'st') { - if (shapes[i].c.k && shapes[i].c.k[0].i) { - jLen = shapes[i].c.k.length; - for (j = 0; j < jLen; j += 1) { - if (shapes[i].c.k[j].s) { - shapes[i].c.k[j].s[0] /= 255; - shapes[i].c.k[j].s[1] /= 255; - shapes[i].c.k[j].s[2] /= 255; - shapes[i].c.k[j].s[3] /= 255; - } - if (shapes[i].c.k[j].e) { - shapes[i].c.k[j].e[0] /= 255; - shapes[i].c.k[j].e[1] /= 255; - shapes[i].c.k[j].e[2] /= 255; - shapes[i].c.k[j].e[3] /= 255; - } - } - } else { - shapes[i].c.k[0] /= 255; - shapes[i].c.k[1] /= 255; - shapes[i].c.k[2] /= 255; - shapes[i].c.k[3] /= 255; - } - } - } - } - - function iterateLayers(layers) { - var i; - var len = layers.length; - for (i = 0; i < len; i += 1) { - if (layers[i].ty === 4) { - iterateShapes(layers[i].shapes); - } - } - } - - return function (animationData) { - if (checkVersion(minimumVersion, animationData.v)) { - iterateLayers(animationData.layers); - if (animationData.assets) { - var i; - var len = animationData.assets.length; - for (i = 0; i < len; i += 1) { - if (animationData.assets[i].layers) { - iterateLayers(animationData.assets[i].layers); - } - } - } - } - }; - }()); - - var checkShapes = (function () { - var minimumVersion = [4, 4, 18]; - - function completeClosingShapes(arr) { - var i; - var len = arr.length; - var j; - var jLen; - for (i = len - 1; i >= 0; i -= 1) { - if (arr[i].ty === 'sh') { - if (arr[i].ks.k.i) { - arr[i].ks.k.c = arr[i].closed; - } else { - jLen = arr[i].ks.k.length; - for (j = 0; j < jLen; j += 1) { - if (arr[i].ks.k[j].s) { - arr[i].ks.k[j].s[0].c = arr[i].closed; - } - if (arr[i].ks.k[j].e) { - arr[i].ks.k[j].e[0].c = arr[i].closed; - } - } - } - } else if (arr[i].ty === 'gr') { - completeClosingShapes(arr[i].it); - } - } - } - - function iterateLayers(layers) { - var layerData; - var i; - var len = layers.length; - var j; - var jLen; - var k; - var kLen; - for (i = 0; i < len; i += 1) { - layerData = layers[i]; - if (layerData.hasMask) { - var maskProps = layerData.masksProperties; - jLen = maskProps.length; - for (j = 0; j < jLen; j += 1) { - if (maskProps[j].pt.k.i) { - maskProps[j].pt.k.c = maskProps[j].cl; - } else { - kLen = maskProps[j].pt.k.length; - for (k = 0; k < kLen; k += 1) { - if (maskProps[j].pt.k[k].s) { - maskProps[j].pt.k[k].s[0].c = maskProps[j].cl; - } - if (maskProps[j].pt.k[k].e) { - maskProps[j].pt.k[k].e[0].c = maskProps[j].cl; - } - } - } - } - } - if (layerData.ty === 4) { - completeClosingShapes(layerData.shapes); - } - } - } - - return function (animationData) { - if (checkVersion(minimumVersion, animationData.v)) { - iterateLayers(animationData.layers); - if (animationData.assets) { - var i; - var len = animationData.assets.length; - for (i = 0; i < len; i += 1) { - if (animationData.assets[i].layers) { - iterateLayers(animationData.assets[i].layers); - } - } - } - } - }; - }()); - - function completeData(animationData) { - if (!animationData || animationData.__complete) { - return; - } - checkColors(animationData); - checkText(animationData); - checkChars(animationData); - checkPathProperties(animationData); - checkShapes(animationData); - completeLayers(animationData.layers, animationData.assets); - completeChars(animationData.chars, animationData.assets); - animationData.__complete = true; - } - - function completeText(data) { - if (data.t.a.length === 0 && !('m' in data.t.p)) { - // data.singleShape = true; - } - } - - var moduleOb = {}; - moduleOb.completeData = completeData; - moduleOb.checkColors = checkColors; - moduleOb.checkChars = checkChars; - moduleOb.checkPathProperties = checkPathProperties; - moduleOb.checkShapes = checkShapes; - moduleOb.completeLayers = completeLayers; - - return moduleOb; - } - if (!_workerSelf.dataManager) { - _workerSelf.dataManager = dataFunctionManager(); - } - - if (!_workerSelf.assetLoader) { - _workerSelf.assetLoader = (function () { - function formatResponse(xhr) { - // using typeof doubles the time of execution of this method, - // so if available, it's better to use the header to validate the type - var contentTypeHeader = xhr.getResponseHeader('content-type'); - if (contentTypeHeader && xhr.responseType === 'json' && contentTypeHeader.indexOf('json') !== -1) { - return xhr.response; - } - if (xhr.response && typeof xhr.response === 'object') { - return xhr.response; - } if (xhr.response && typeof xhr.response === 'string') { - return JSON.parse(xhr.response); - } if (xhr.responseText) { - return JSON.parse(xhr.responseText); - } - return null; - } - - function loadAsset(context2D, path, isNetwork, fullPath, callback, errorCallback) { - setTimeout(() => { - if (context2D && typeof context2D.getJsonData === 'function') { - let filePath = getContext()?.filesDir + '/' + path; - let isExist = isSandboxFileExist(filePath); - //判断沙箱动画资源是否存在 - if (isExist) { - loadSandboxData(path, callback, errorCallback, isNetwork); - } else { - // 判断rawfile目录动画资源是否存在 - let isRawExist = isRawFileExist(getContext(), path); - if (isRawExist) { - loadRawfileData(path, callback, errorCallback, isNetwork); - return; - } - - let jsonString = context2D.getJsonData(path); - if (jsonString) { - getJsonData(jsonString, callback, errorCallback, isNetwork); - } else { - errorCallback('Lottie: the path has no data'); - } - } - } else { - errorCallback('Lottie: the path has no data'); - } - }, 0) - } - return { - load: loadAsset, - }; - }()); - } - - if (e.data.type === 'loadAnimation') { - _workerSelf.assetLoader.load( - e.data.context2D, - e.data.path, - e.data.isNetwork, - e.data.fullPath, - function (data, isNetLoad) { - _workerSelf.dataManager.completeData(data); - _workerSelf.postMessage({ - id: e.data.id, - isNetLoad:isNetLoad, - payload: data, - status: 'success', - }); - }, - function () { - _workerSelf.postMessage({ - id: e.data.id, - status: 'error', - }); - } - ); - } else if (e.data.type === 'complete') { - var animation = e.data.animation; - _workerSelf.dataManager.completeData(animation); - _workerSelf.postMessage({ - id: e.data.id, - payload: animation, - status: 'success', - }); - } else if (e.data.type === 'loadData') { - _workerSelf.assetLoader.load( - null, // context2D - e.data.path, - false, // isNetwork - e.data.fullPath, - function (data) { - _workerSelf.postMessage({ - id: e.data.id, - payload: data, - status: 'success', - }); - }, - function () { - _workerSelf.postMessage({ - id: e.data.id, - status: 'error', - }); - } - ); - } - }); - - workerInstance.onmessage = function (event) { - var data = event.data; - var id = data.id; - var process = processes[id]; - processes[id] = null; - if (data.status === 'success') { - process?.onComplete(data.payload, data.isNetLoad); - } else if (process?.onError) { - process.onError(); - } - }; - } - } - - function createProcess(onComplete, onError) { - _counterId += 1; - var id = 'processId_' + _counterId; - processes[id] = { - onComplete: onComplete, - onError: onError, - }; - return id; - } - - function loadAnimation(context2D, path, isNetwork, onComplete, onError) { - setupWorker(); - var processId = createProcess(onComplete, onError); - workerInstance.postMessage({ - type: 'loadAnimation', - context2D: context2D, - path: path, - isNetwork: isNetwork, - fullPath: "", - id: processId, - }); - } - - function loadData(path, onComplete, onError) { - setupWorker(); - var processId = createProcess(onComplete, onError); - workerInstance.postMessage({ - type: 'loadData', - path: path, - fullPath: "", - id: processId, - }); - } - - function completeAnimation(anim, onComplete, onError) { - setupWorker(); - var processId = createProcess(onComplete, onError); - workerInstance.postMessage({ - type: 'complete', - animation: anim, - id: processId, - }); - } - - return { - loadAnimation: loadAnimation, - loadData: loadData, - completeAnimation: completeAnimation, - }; -}()); - -export default dataManager; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/DataUtil.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/DataUtil.js deleted file mode 100644 index a250cf857eb521123fac07f224a6468465b8da82..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/DataUtil.js +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Copyright (C) 2025 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 fs from '@ohos.file.fs'; -import util from '@ohos.util'; -import zlib from '@ohos.zlib'; -import { moveFileSync, mkdirSync, listFileSync, readFileSync, isSandboxFileExist } from './FileUtil'; -import {LogUtil} from './LogUtil'; - -/** - * 过滤并返回指定目录下的 JSON 文件 - * - * @param way - 要扫描的目录路径 - * @param isDotLottiePath - 是否为 .lottie 文件路径的标志 - * @returns 返回找到的 JSON 文件名,如果没有找到则返回 undefined - */ -const filterJson = function (way, isDotLottiePath) { - try { - // 以同步方式列出文件夹下所有文件名 - let files = listFileSync(way, ['.json']); - if (isDotLottiePath) { - return files.find(item => { - return item !== 'manifest.json' && item.endsWith('.json'); - }); - } else { - return files.find(item => item.endsWith('.json')); - } - } catch (err) { - LogUtil.error(`Method filterJson err: ${JSON.stringify(err)}`); - return undefined; - } -}; - -/** - * 检查指定目录下是否存在包含 JSON 文件的子目录 - * - * @param way - 要扫描的目录路径 - * @param isDotLottiePath - 是否为 .lottie 文件路径的标志 - * @returns 返回找到的包含 JSON 文件的子目录名,如果没有找到则返回 null - */ -const isHaveDirectory = function (way, isDotLottiePath) { - try { - // 以同步方式列出文件夹下所有文件名 - let files = listFileSync(way, ['.json']); - for (let i = 0; i < files.length; i++) { - let isDirectory = fs.statSync(`${way}/${files[i]}`).isDirectory(); - if (isDirectory && files[i] !== '__MACOSX' && files[i] !== 'images') { - if (filterJson(`${way}/${files[i]}`, isDotLottiePath)) { - return files[i]; - } - } - } - } catch (err) { - LogUtil.error(`Method isHaveDirectory err: ${JSON.stringify(err)}`); - } - return null; -}; - -/** - * 将指定目录下的图片文件移动到目标目录的 images 文件夹中 - * - * @param routerDir - 目标目录路径 - * @param way - 相对路径,用于指定源目录的位置 - */ -const moveImages = function (routerDir, way) { - try { - // files创建新images文件夹 - let dirPath = `${routerDir}/images`; - mkdirSync(dirPath); - let newWay = `${routerDir}/${way}/images`; - let files = listFileSync(newWay, ['.png', '.jpg', '.jpeg']); - for (let i = 0; i < files.length; i++) { - let srcPath = `${newWay}/${files[i]}`; - let destPath = `${dirPath}/${files[i]}`; - moveFileSync(srcPath, destPath); - } - } catch (err) { - LogUtil.error(`Method moveImages err: ${JSON.stringify(err)}`); - } -}; - -/** - * 将指定目录下的 JSON 文件移动到目标目录中 - * - * @param routerDir - 目标目录路径 - * @param way - 相对路径,用于指定源目录的位置 - */ -const moveJson = function (routerDir, way) { - try { - let jsonWay = `${routerDir}/${way}`; - let jsonFile = listFileSync(jsonWay, ['.json']); - let newJson = jsonFile.find(item => item.endsWith('.json')); - let srcPath = `${jsonWay}/${newJson}`; - let destPath = `${routerDir}/${newJson}`; - moveFileSync(srcPath, destPath); - } catch (err) { - LogUtil.error(`Method moveJson err: ${JSON.stringify(err)}`); - } -}; - -/** - * 解压缩并读取 JSON 文件 - * - * @param url - 文件的 URL 地址 - * @param cacheDir - 缓存目录路径 - * @param fileDir - 目标目录路径 - * @returns 返回一个 Promise,解析为处理后的 JSON 数据 - */ -export const decompressAndReadJson = function (url, cacheDir, fileDir) { - const lastIndex = url.lastIndexOf('/'); - const result = url.substring(lastIndex + 1); - let isDotLottiePath = url.endsWith('.lottie'); - let inFile = `${cacheDir}/${result}`; - let outFile = fileDir; - let options = { - level: zlib.CompressLevel.COMPRESS_LEVEL_DEFAULT_COMPRESSION, - memLevel: zlib.MemLevel.MEM_LEVEL_MAX, - strategy: zlib.CompressStrategy.COMPRESS_STRATEGY_DEFAULT_STRATEGY, - }; - return new Promise((resolve, reject) => { - zlib.decompressFile(inFile, outFile, options).then((data) => { - // 解压完成之后读取 json 数据 - if (isHaveDirectory(fileDir, isDotLottiePath)) { - let newFileDir = isHaveDirectory(fileDir, isDotLottiePath); - moveImages(fileDir, newFileDir); - moveJson(fileDir, newFileDir); - let zipData = readJson(url, fileDir); - // 修改u路径 - let newZipData = handleZipAssets(zipData, fileDir); - resolve(newZipData); - } else { - let zipData = readJson(url, fileDir); - // 修改u路径 - let newZipData = handleZipAssets(zipData, fileDir); - resolve(newZipData); - } - }).catch((errData) => { - reject(errData); - }); - }); -}; - -/** - * 读取并解析 JSON 文件 - * - * @param url - 文件的 URL 地址 - * @param readPath - 读取路径 - * @param errCallBack - 错误回调函数 - * @returns 返回解析后的 JSON 对象,如果没有解析成功则返回 undefined - */ -export const readJson = function (url, readPath, errCallBack) { - try { - let textDecoderOptions = { - fatal: false, - ignoreBOM : true, - }; - let resStr = util.TextDecoder.create('utf-8', textDecoderOptions); - let existResult = isCacheExist(url, readPath); - if (existResult?.isExist) { - let arrayBuffer = readFileSync(existResult.filePath); - // 解码的json数据 - let lottieStr = resStr.decodeToString(new Uint8Array(arrayBuffer)); - return JSON.parse(lottieStr); - } - return undefined; - } catch (err) { - LogUtil.error(`Method readJson err: ${JSON.stringify(err)}`); - if (errCallBack) { - errCallBack('error', err); - } - return undefined; - } -}; - -/** - * 检查指定 URL 对应的文件是否存在于缓存中 - * - * @param url - 文件的 URL 地址 - * @param readPath - 读取路径 - * @returns 返回一个包含是否存在文件和文件路径的对象,如果出错则返回 undefined - */ -export const isCacheExist = function (url, readPath) { - try { - const lastIndex = url.lastIndexOf('/'); - const result = url.substring(lastIndex + 1); // 最后一个斜杠后的字符串 `${readPath}/${filterJson(readPath, url.endsWith('.lottie'))}` - // 通过沙箱中下载或者解压的文件名来找到文件所在路径 - let filePath = hasSuffix(url, ['.json', '.js']) ? `${readPath}/${result}` : - `${readPath}/${filterJson(readPath, url.endsWith('.lottie'))}`; - // 同步方法判断沙箱里的文件是否存在 - let isExist = isSandboxFileExist(filePath); - return { - isExist, - filePath, - }; - } catch (err) { - LogUtil.error(`Method isCacheExist err: ${JSON.stringify(err)}`); - return undefined; - } -}; - -/** - * 检查指定路径下是否存在图片文件 - * - * @param way - 目标路径 - * @returns 返回一个布尔值,表示是否存在图片文件,如果出错则返回 undefined - */ -export const isHaveImg = function (way) { - try { - let imgFiles = listFileSync(way, ['.png', '.jpg', '.jpeg']); - return imgFiles.some(item => { - return item.endsWith('.png') || item.endsWith('.jpg') || item.endsWith('.jpeg'); - }); - } catch (err) { - LogUtil.error(`Method isCacheExist err: ${JSON.stringify(err)}`); - return undefined; - } -}; - - -/** - * 检查URL是否以指定的后缀结尾 - * - * @param url - 需要检查的URL字符串 - * @param suffixes - 允许的文件后缀数组(如['.json', '.js']) - * @returns 如果URL以指定后缀之一结尾则返回true,否则返回false - */ -const hasSuffix = function (url, suffixes) { - const lastDotIndex = url.lastIndexOf('.'); - return lastDotIndex !== -1 && lastDotIndex < url.length - 1 && suffixes.includes(url.substring(lastDotIndex)); -}; - - -/** - * 处理 Lottie 动画数据中的资源路径 - * - * @param lottieData - Lottie 动画数据对象 - * @returns 返回处理后的 Lottie 动画数据对象 - */ -export const handleAssets = function (lottieData) { - let updatedAssets = lottieData?.assets?.map((item, index) => { - if (item.id && item.p && item.p.startsWith('http')) { - item.p = `${item.id}.png`; - if (!item.u) { - item.u = 'lottie/loadImages/'; - item.e = 0; - } - } - return item; - }); - lottieData.assets = updatedAssets; - return lottieData; -}; - -/** - * 处理 ZIP 压缩包中的 Lottie 动画资源路径 - * - * @param lottieData - Lottie 动画数据对象 - * @param zipRoute - ZIP 文件的路径 - * @returns 返回处理后的 Lottie 动画数据对象 - */ -export const handleZipAssets = function (lottieData, zipRoute) { - const parts = zipRoute.split('/'); - const lastPart = parts.slice(-3); - let lastPartStr = ''; - if (Array.isArray(lastPart)) { - lastPartStr = lastPart.join('/'); - } - // 修改u路径 - let updatedZipAssets = lottieData?.assets?.map((item, index) => { - if (item.id && item.u) { - item.u = `${lastPartStr}/images/`; - } - return item; - }); - lottieData.assets = updatedZipAssets; - return lottieData; -}; - -/** - * 创建文件的目录结构 - * - * @param url - 文件的 URL 地址 - * @returns 返回一个包含文件名和完整路径的对象,如果 URL 格式无效则返回 undefined - */ -export const createFilesDir = function (url) { - const parts = url.split('/'); - if (parts.length < 2) { - LogUtil.error(`Invalid URL format`); - return undefined; - } - // 获取倒数第二部分(目录名) - const directoryName = parts[parts.length - 2]; - // 获取最后一部分(文件名)并移除扩展名 - const fileNameWithExtension = parts[parts.length - 1]; - const fileName = fileNameWithExtension.replace(/\.(?:zip|json|lottie)$/i, ''); - const basePath = `${getContext()?.filesDir || ''}/lottie/${directoryName}`; - const fullPath = `${basePath}/${fileName}`; - // 创建目录 - mkdirSync(fullPath, true); - let result = { - dataName: fileNameWithExtension, - route: fullPath, - }; - return result; -}; - -/** - * 创建用于加载图片的目录 - * @returns 返回创建的图片目录路径 - */ -export const createImageFilesDir = function () { - let dirImgPath = `${getContext()?.filesDir}/lottie/loadImages`; - mkdirSync(dirImgPath, true); - return dirImgPath; -}; - -/** - * 合并多个 ArrayBuffer 对象为一个新的 ArrayBuffer - * - * @param arrayBuffers - 要合并的 ArrayBuffer 数组 - * @returns 返回合并后的 ArrayBuffer - */ -export const combineArrayBuffers = function (arrayBuffers) { - // 计算多个ArrayBuffer的总字节大小 - let totalByteLength = 0; - for (const arrayBuffer of arrayBuffers) { - totalByteLength += arrayBuffer.byteLength; - } - // 创建一个新的ArrayBuffer - const combinedArrayBuffer = new ArrayBuffer(totalByteLength); - // 创建一个Uint8Array来操作新的ArrayBuffer - const combinedUint8Array = new Uint8Array(combinedArrayBuffer); - // 依次复制每个ArrayBuffer的内容到新的ArrayBuffer中 - let offset = 0; - for (const arrayBuffer of arrayBuffers) { - const sourceUint8Array = new Uint8Array(arrayBuffer); - combinedUint8Array.set(sourceUint8Array, offset); - offset += sourceUint8Array.length; - } - return combinedArrayBuffer; -}; - -/** - * 检查给定的 URI 是否为JSON文件 - * - * @param uri - 要检查的文件 URI - * @returns 返回一个布尔值,表示 URI 是否以 .json 或 .js 结尾 - */ -export const isJsonFile = function (uri) { - return uri.endsWith('.json') || uri.endsWith('.js'); -}; - -/** - * 检查给定的 URI 是否为压缩文件或 Lottie 动画文件 - * @param uri - 要检查的文件 URI - * @returns 返回一个布尔值,表示 URI 是否以 .zip 或 .lottie 结尾 - */ -export const isCompressdFile = function (uri) { - return uri.endsWith('.zip') || uri.endsWith('.lottie'); -}; - -/** - * 检查给定的资源数组中是否存在网络资源 - * - * @param assets - 资源数组,每个资源对象包含属性 p - * @returns 返回一个布尔值,表示资源数组中是否存在以 'http' 开头的网络资源 - */ -export const isExistNetworkAssets = function (assets) { - return assets?.some((item) => { - return item.p && item.p.startsWith('http'); - }); -}; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/DownloadManager.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/DownloadManager.js deleted file mode 100644 index 28389db345a5bd436a980781ef8e9b74361e0aa2..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/DownloadManager.js +++ /dev/null @@ -1,220 +0,0 @@ -/** - * MIT License - * - * Copyright (C) 2024 Huawei Device Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -import { - decompressAndReadJson, - readJson, - handleAssets, - handleZipAssets, - isCacheExist, - combineArrayBuffers, - createImageFilesDir, - isJsonFile, - isCompressdFile, - isExistNetworkAssets -} from './DataUtil'; -import http from '@ohos.net.http'; -import {LogUtil} from '../utils/LogUtil'; -import { writeFileSync, moveFileSync } from './FileUtil'; - -const downloadManager = (function () { - const downloadUri = new Map(); - const TIMEOUT = 60000; - /** - * 加载网络动画资源 - * - * @param uri - 动画资源的网络地址 - * @param onComplete - 加载完成时的回调函数 - * @param onError - 加载失败时的回调函数 - * @param resultDir - 结果目录信息 - * @param cacheFlag - 是否使用缓存标志 - */ - function loadNetworkAnimations(uri, onComplete, onError, resultDir, cacheFlag) { - let flag = downloadUri.has(uri); - if (flag) { - let tasks = setInterval(() => { - let existResult = isCacheExist(uri, resultDir.route); - if (!existResult?.isExist) { - return; - } - // 取消循环检测 - clearInterval(tasks); - let repeatData = readJson(uri, resultDir.route); - let newData = isJsonFile(uri) ? repeatData : handleZipAssets(repeatData, resultDir.route); - onComplete(newData, false); - }, 100); - } else { - // 将URI添加到Map中,表示下载已经开始 - downloadUri.set(uri, true); - let httpRequest = http.createHttp(); - let fileData = []; - httpRequest.on('dataReceive', (data) => { - fileData.push(data); - }); - let promise = httpRequest.requestInStream(uri, { - method: http.RequestMethod.GET, - expectDataType: http.HttpDataType.ARRAY_BUFFER, - connectTimeout: TIMEOUT, - readTimeout: TIMEOUT, - }); - - promise.then(async (data) => { - if (data === 200 || data === 206 || data === 204) { - let resBuf = combineArrayBuffers(fileData); - let filePath = `${getContext().cacheDir}/${resultDir.dataName}`; - writeFileSync(filePath, resBuf); - loadSuccess(uri, resultDir, onComplete); - } else { - loadFail(uri, resultDir, onComplete, onError, cacheFlag); - } - }).finally(()=>{ - downloadUri.delete(uri); - httpRequest.off('dataReceive'); - httpRequest.destroy(); - }); - } - }; - - /** - * 成功加载动画资源后的处理逻辑 - * - * @param uri - 动画资源的网络地址 - * @param resultDir - 结果目录信息 - * @param onComplete - 加载完成时的回调函数 - */ - function loadSuccess(uri, resultDir, onComplete) { - if (isJsonFile(uri)) { - let srcPath = `${getContext()?.cacheDir}/${resultDir.dataName}`; - let destPath = `${resultDir.route}/${resultDir.dataName}`; - moveFileSync(srcPath, destPath); - let lottieData = readJson(uri, resultDir.route); - if (lottieData?.assets?.length && isExistNetworkAssets(lottieData?.assets)) { - downLoadImg(lottieData).then((results) => { - // 下载成功加载网络 - let newJsonData = handleAssets(lottieData); - onComplete(newJsonData, true); - }) - .catch((err) => { - LogUtil.error(`Download error: ${JSON.stringify(err)}`); - errCallBack('error', err); - let filesJsonData = handleAssets(lottieData); - onComplete(filesJsonData, false); - }); - } else { - // 读取成功从Map中移除条目 - // uri方式无图片的json网络资源 - downloadUri.delete(uri); - onComplete(lottieData, true); - } - } else if (isCompressdFile(uri)) { - decompressAndReadJson(uri, `${getContext()?.cacheDir}`, resultDir.route).then((result) => { - // 解压成功,从Map中移除条目 - downloadUri.delete(uri); - onComplete(result, true); - }).catch((errData) => { - // 解压失败,从Map中移除条目 - downloadUri.delete(uri); - errCallBack('error', errData); - }); - } - }; - - /** - * 处理动画资源加载失败时的逻辑 - * - * @param uri - 动画资源的网络地址 - * @param resultDir - 结果目录信息 - * @param onComplete - 加载完成时的回调函数 - * @param onError - 错误回调函数 - * @param err - 错误对象 - * @param cacheFlag - 是否使用缓存标志 - */ - function loadFail(uri, resultDir, onComplete, onError, cacheFlag) { - // 处理网络异常加载缓存 - let existResult = isCacheExist(uri, resultDir.route); - if (existResult?.isExist && cacheFlag) { - downloadUri.delete(uri); - let cacheData = readJson(uri, resultDir.route); - let newData = isJsonFile(uri) ? cacheData : handleZipAssets(cacheData, resultDir.route); - onComplete(newData, false); - } else { - // 缓存无资源,给用户返回加载异常 - downloadUri.delete(uri); - onError('error', 'download fail'); - } - }; - - /** - * 下载并保存 Lottie 动画中的网络图片资源 - * - * @param lottieData - 包含动画图片资源的对象 - * @returns 返回一个 Promise,表示所有下载任务的状态 - */ - function loadNetworkImages(lottieData) { - let imgRouterFilesDir = createImageFilesDir(); - let downloadTasks = []; - let imgData = []; - lottieData?.assets?.forEach((item, index) => { - if (item.id && item.p && item.p.startsWith('http')) { - let httpRequest = http.createHttp(); - let jsonData = []; - httpRequest.on('dataReceive', (data) => { - jsonData.push(data); - jsonData.length === 1 ? imgData.push({ AssetItem: item, fileData: jsonData }) : undefined; - }); - let promise = httpRequest.requestInStream(item.p, { - method: http.RequestMethod.GET, - expectDataType: http.HttpDataType.ARRAY_BUFFER, - connectTimeout: TIMEOUT, - readTimeout: TIMEOUT, - }).finally(() => { - httpRequest.off('dataReceive'); - httpRequest.destroy(); - }); - downloadTasks.push(promise); - } - }); - - return Promise.all(downloadTasks) - .then((results) => { - results?.forEach((item, index) => { - let resBuf = combineArrayBuffers(imgData[index].fileData); - let filePath = `${imgRouterFilesDir}/${imgData[index].AssetItem.id}.png`; - writeFileSync(filePath, resBuf); - }); - LogUtil.error(`All download tasks completed success: ${JSON.stringify(results)}`); - }) - .catch((error) => { - if (error && error.message) { - LogUtil.error(`An error occurred during download: ${JSON.stringify(error)}`); - } - }); - }; - - return { - loadNetworkAnimation:loadNetworkAnimations, - loadNetworkImage:loadNetworkImages, - }; -}()); - -export default downloadManager; \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/FileUtil.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/FileUtil.js deleted file mode 100644 index 36d3355ace37ab45ea0403b3d597627827f93cae..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/FileUtil.js +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (C) 2025 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 fs from '@ohos.file.fs'; -import {LogUtil} from './LogUtil'; - -/** - * 判断Rawfile目录下该文件是否存在 - * - * @param context 上下文 - * @param filePath 文件路径 - * @returns 存在返回true,不存在返回false - */ -export const isRawFileExist = (context, filePath) => { - try { - context.resourceManager?.getRawFileContentSync(filePath); - return true; - } catch (err) { - return false; - } -}; - -/** - * 判断沙箱路径下该文件是否存在 - * - * @param filePath 文件路径 - * @returns 存在返回true,不存在返回false - */ -export const isSandboxFileExist = (filePath) => { - try { - let isExist = fs.accessSync(filePath); - return isExist; - } catch (err) { - return false; - } -}; - -/** - * 同步写入文件 - * - * @param filePath 文件路径 - * @param data 要写入的数据 - * @returns 写入成功返回true,失败返回false - */ -export const writeFileSync = (filePath, data) => { - try { - let file = fs.openSync(filePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); - fs.writeSync(file.fd, data); - fs.close(file); - return true; - } catch (err) { - return false; - } -}; - -/** - * 同步读取文件 - * - * @param filePath 文件路径 - * @returns 读取成功返回数据,失败返回false - */ -export const readFileSync = (filePath) => { - try { - // 打开文件 - let file = fs.openSync(filePath, fs.OpenMode.READ_ONLY); - // 以同步方法获取文件详细属性信息 - let stat = fs.statSync(filePath); - // 读取文件 - let arrayBuffer = new ArrayBuffer(stat.size); - // 以同步方法从文件读取数据 - fs.readSync(file.fd, arrayBuffer); - fs.close(file); - return arrayBuffer; - } catch (err) { - return false; - } -}; - -/** - * 同步移动文件到指定路径 - * - * @param srcPath - 源文件的路径 - * @param destPath - 目标路径,文件将被移动到此处 - */ -export const moveFileSync = (srcPath, destPath) => { - try { - fs.moveFileSync(srcPath, destPath); - } catch (err) { - LogUtil.error(`Method moveFileSync err: ${JSON.stringify(err)}`); - } -}; - -/** - * 同步创建目录 - * - * @param path - 要创建的目录路径 - * @param rescursion - 是否递归创建目录及其父目录 - */ -export const mkdirSync = (path, rescursion) => { - try { - if (!fs.accessSync(path)) { - fs.mkdirSync(path, rescursion); - } - } catch (err) { - LogUtil.error(`Method mkdirSync err: ${JSON.stringify(err)}`); - } -}; - -/** - * 同步列出指定目录下的文件,并支持根据后缀名过滤文件 - * - * @param path - 要列出文件的目录路径 - * @param suffix - 文件后缀名过滤条件(例如 '.png', '.jpg', '.jpeg') - * @returns 返回匹配的文件列表,如果发生错误则返回空数组 - */ -export const listFileSync = (path, suff) => { - try { - let listFileOption = { - recursion: false, // 是否递归列出子目录中的文件 - listNum: 0, // 返回的文件数量限制,0 表示无限制 - filter: { - suffix: suff, // 匹配指定后缀名的文件 - displayName: ['*'], // 匹配所有文件名 - fileSizeOver: 0, // 匹配文件大小大于等于 0 的文件 - lastModifiedAfter: new Date(0).getTime(), // 匹配文件最近修改时间在1970年1月1日之后 - }, - }; - return fs.listFileSync(path, listFileOption); - } catch (err) { - LogUtil.error(`Method listFileSync err: ${JSON.stringify(err)}`); - return []; - } -}; - -/** - * 同步删除文件(封装fs.unlinkSync并添加错误处理) - * @param {string} filePath - 要删除的文件绝对路径 - */ -export const unlinkSync = (filePath) => { - try { - fs.unlinkSync(filePath); - } catch (err) { - LogUtil.error(`Method unlinkSync err: ${JSON.stringify(err)}`); - } -}; - -/** - * 异步删除文件(封装fs.unlink并添加错误处理) - * @param {string} filePath - 要删除的文件绝对路径 - */ -export const unlink = (filePath) => { - fs.unlink(filePath) - .catch((err) => { - LogUtil.error(`Method unlink err: ${JSON.stringify(err)}`); - }); -}; - -/** - * 同步删除目录 - * @param {string} filePath - 要删除的文件绝对路径 - */ -export const rmdirSync = (filePath) => { - try { - fs.rmdirSync(filePath); - } catch (err) { - LogUtil.error(`Method rmdirSync err: ${JSON.stringify(err)}`); - } -}; - -/** - * 同步获取目录文件列表 - * @param {string} filePath - 要扫描的目标目录绝对路径 - * @returns {Array} 成功时返回文件名列数组,失败时返回空数组 - */ -export const listFileSyncs = (filePath) => { - try { - let filenames = fs.listFileSync(filePath); - return filenames; - } catch (err) { - LogUtil.error(`Method rmdirSync err: ${JSON.stringify(err)}`); - return []; - } -}; \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/FontManager.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/FontManager.js deleted file mode 100644 index eaa4148af78c6bcbd8d3b5b305c2e639e5d83ae4..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/FontManager.js +++ /dev/null @@ -1,376 +0,0 @@ -import createNS from './helpers/svg_elements'; -import createTag from './helpers/html_elements'; -import getFontProperties from './getFontProperties'; - -const FontManager = (function () { - var maxWaitingTime = 5000; - var emptyChar = { - w: 0, - size: 0, - shapes: [], - data: { - shapes: [], - }, - }; - var combinedCharacters = []; - // Hindi characters - combinedCharacters = combinedCharacters.concat([2304, 2305, 2306, 2307, 2362, 2363, 2364, 2364, 2366, - 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, - 2380, 2381, 2382, 2383, 2387, 2388, 2389, 2390, 2391, 2402, 2403]); - - var surrogateModifiers = [ - 'd83cdffb', - 'd83cdffc', - 'd83cdffd', - 'd83cdffe', - 'd83cdfff', - ]; - - var zeroWidthJoiner = [65039, 8205]; - - function trimFontOptions(font) { - var familyArray = font.split(','); - var i; - var len = familyArray.length; - var enabledFamilies = []; - for (i = 0; i < len; i += 1) { - if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') { - enabledFamilies.push(familyArray[i]); - } - } - return enabledFamilies.join(','); - } - - function setUpNode(font, family) { - var parentNode = createTag('span'); - // Node is invisible to screen readers. - parentNode.setAttribute('aria-hidden', true); - parentNode.style.fontFamily = family; - var node = createTag('span'); - // Characters that vary significantly among different fonts - node.innerText = 'giItT1WQy@!-/#'; - // Visible - so we can measure it - but not on the screen - parentNode.style.position = 'absolute'; - parentNode.style.left = '-10000px'; - parentNode.style.top = '-10000px'; - // Large font size makes even subtle changes obvious - parentNode.style.fontSize = '300px'; - // Reset any font properties - parentNode.style.fontVariant = 'normal'; - parentNode.style.fontStyle = 'normal'; - parentNode.style.fontWeight = 'normal'; - parentNode.style.letterSpacing = '0'; - parentNode.appendChild(node); - // document.body.appendChild(parentNode); - - // Remember width with no applied web font - var width = node.offsetWidth; - node.style.fontFamily = trimFontOptions(font) + ', ' + family; - return { node: node, w: width, parent: parentNode }; - } - - function checkLoadedFonts() { - var i; - var len = this.fonts.length; - var node; - var w; - var loadedCount = len; - for (i = 0; i < len; i += 1) { - if (this.fonts[i].loaded) { - loadedCount -= 1; - } else if (this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0) { - this.fonts[i].loaded = true; - } else { - node = this.fonts[i].monoCase.node; - w = this.fonts[i].monoCase.w; - if (node.offsetWidth !== w) { - loadedCount -= 1; - this.fonts[i].loaded = true; - } else { - node = this.fonts[i].sansCase.node; - w = this.fonts[i].sansCase.w; - if (node.offsetWidth !== w) { - loadedCount -= 1; - this.fonts[i].loaded = true; - } - } - if (this.fonts[i].loaded) { - this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent); - this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent); - } - } - } - - if (loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime) { - setTimeout(this.checkLoadedFontsBinded, 20); - } else { - setTimeout(this.setIsLoadedBinded, 10); - } - } - - function createHelper(fontData, def) { - var engine = 'canvas'; - var helper; - var fontProps = getFontProperties(fontData); - if (engine === 'svg') { - var tHelper = createNS('text'); - tHelper.style.fontSize = '100px'; - // tHelper.style.fontFamily = fontData.fFamily; - tHelper.setAttribute('font-family', fontData.fFamily); - tHelper.setAttribute('font-style', fontProps.style); - tHelper.setAttribute('font-weight', fontProps.weight); - tHelper.textContent = '1'; - if (fontData.fClass) { - tHelper.style.fontFamily = 'inherit'; - tHelper.setAttribute('class', fontData.fClass); - } else { - tHelper.style.fontFamily = fontData.fFamily; - } - def.appendChild(tHelper); - helper = tHelper; - } else { - var tCanvasHelper = new OffscreenCanvas(500, 500).getContext('2d'); - tCanvasHelper.font = fontProps.style + ' ' + fontProps.weight + ' 100px ' + fontData.fFamily; - helper = tCanvasHelper; - } - function measure(text) { - if (engine === 'svg') { - helper.textContent = text; - return helper.getComputedTextLength(); - } - return helper.measureText(text).width; - } - return { - measureText: measure, - }; - } - - function addFonts(fontData, defs) { - if (!fontData) { - this.isLoaded = true; - return; - } - if (this.chars) { - this.isLoaded = true; - this.fonts = fontData.list; - return; - } - // if (!document.body) { - // this.isLoaded = true; - // fontData.list.forEach((data) => { - // data.helper = createHelper(data); - // data.cache = {}; - // }); - // this.fonts = fontData.list; - // return; - // } - - var fontArr = fontData.list; - var i; - var len = fontArr.length; - var _pendingFonts = len; - for (i = 0; i < len; i += 1) { - var shouldLoadFont = true; - var loadedSelector; - var j; - fontArr[i].loaded = false; - fontArr[i].monoCase = setUpNode(fontArr[i].fFamily, 'monospace'); - fontArr[i].sansCase = setUpNode(fontArr[i].fFamily, 'sans-serif'); - //暂不支持自定义字体 - fontArr[i].fPath = ''; - if (!fontArr[i].fPath) { - fontArr[i].loaded = true; - _pendingFonts -= 1; - } else if (fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3) { - loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="' + fontArr[i].fFamily + '"], style[f-origin="3"][f-family="' + fontArr[i].fFamily + '"]'); - - if (loadedSelector.length > 0) { - shouldLoadFont = false; - } - - if (shouldLoadFont) { - var s = createTag('style'); - s.setAttribute('f-forigin', fontArr[i].fOrigin); - s.setAttribute('f-origin', fontArr[i].origin); - s.setAttribute('f-family', fontArr[i].fFamily); - s.type = 'text/css'; - s.innerText = '@font-face {font-family: ' + fontArr[i].fFamily + "; font-style: normal; src: url('" + fontArr[i].fPath + "');}"; - defs.appendChild(s); - } - } else if (fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1) { - loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'); - - for (j = 0; j < loadedSelector.length; j += 1) { - if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) { - // Font is already loaded - shouldLoadFont = false; - } - } - - if (shouldLoadFont) { - var l = createTag('link'); - l.setAttribute('f-forigin', fontArr[i].fOrigin); - l.setAttribute('f-origin', fontArr[i].origin); - l.type = 'text/css'; - l.rel = 'stylesheet'; - l.href = fontArr[i].fPath; - document.body.appendChild(l); - } - } else if (fontArr[i].fOrigin === 't' || fontArr[i].origin === 2) { - loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'); - - for (j = 0; j < loadedSelector.length; j += 1) { - if (fontArr[i].fPath === loadedSelector[j].src) { - // Font is already loaded - shouldLoadFont = false; - } - } - - if (shouldLoadFont) { - var sc = createTag('link'); - sc.setAttribute('f-forigin', fontArr[i].fOrigin); - sc.setAttribute('f-origin', fontArr[i].origin); - sc.setAttribute('rel', 'stylesheet'); - sc.setAttribute('href', fontArr[i].fPath); - defs.appendChild(sc); - } - } - fontArr[i].helper = createHelper(fontArr[i], defs); - fontArr[i].cache = {}; - this.fonts.push(fontArr[i]); - } - if (_pendingFonts === 0) { - this.isLoaded = true; - } else { - // On some cases even if the font is loaded, it won't load correctly when measuring text on canvas. - // Adding this timeout seems to fix it - setTimeout(this.checkLoadedFonts.bind(this), 100); - } - } - - function addChars(chars) { - if (!chars) { - return; - } - if (!this.chars) { - this.chars = []; - } - var i; - var len = chars.length; - var j; - var jLen = this.chars.length; - var found; - for (i = 0; i < len; i += 1) { - j = 0; - found = false; - while (j < jLen) { - if (this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch) { - found = true; - } - j += 1; - } - if (!found) { - this.chars.push(chars[i]); - jLen += 1; - } - } - } - - function getCharData(char, style, font) { - var i = 0; - var len = this.chars?.length; - while (i < len) { - if (this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font) { - return this.chars[i]; - } - i += 1; - } - if (((typeof char === 'string' && char.charCodeAt(0) !== 13) || !char) - && console - && console.warn // eslint-disable-line no-console - && !this._warned - ) { - this._warned = true; - console.warn('Missing character from exported characters list: ', char, style, font); // eslint-disable-line no-console - } - return emptyChar; - } - - function measureText(char, fontName, size) { - var fontData = this.getFontByName(fontName); - var index = char.charCodeAt(0); - if (!fontData.cache[index + 1]) { - var tHelper = fontData.helper; - if (char === ' ') { - var doubleSize = tHelper.measureText('|' + char + '|'); - var singleSize = tHelper.measureText('||'); - fontData.cache[index + 1] = (doubleSize - singleSize) / 100; - } else { - fontData.cache[index + 1] = tHelper.measureText(char) / 100; - } - } - return fontData.cache[index + 1] * size; - } - - function getFontByName(name) { - var i = 0; - var len = this.fonts.length; - while (i < len) { - if (this.fonts[i].fName === name) { - return this.fonts[i]; - } - i += 1; - } - return this.fonts[0]; - } - - function isModifier(firstCharCode, secondCharCode) { - var sum = firstCharCode.toString(16) + secondCharCode.toString(16); - return surrogateModifiers.indexOf(sum) !== -1; - } - - function isZeroWidthJoiner(firstCharCode, secondCharCode) { - if (!secondCharCode) { - return firstCharCode === zeroWidthJoiner[1]; - } - return firstCharCode === zeroWidthJoiner[0] && secondCharCode === zeroWidthJoiner[1]; - } - - function isCombinedCharacter(char) { - return combinedCharacters.indexOf(char) !== -1; - } - - function setIsLoaded() { - this.isLoaded = true; - } - - var Font = function () { - this.fonts = []; - this.chars = null; - this.typekitLoaded = 0; - this.isLoaded = false; - this._warned = false; - this.initTime = Date.now(); - this.setIsLoadedBinded = this.setIsLoaded.bind(this); - this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this); - }; - Font.isModifier = isModifier; - Font.isZeroWidthJoiner = isZeroWidthJoiner; - Font.isCombinedCharacter = isCombinedCharacter; - - var fontPrototype = { - addChars: addChars, - addFonts: addFonts, - getCharData: getCharData, - getFontByName: getFontByName, - measureText: measureText, - checkLoadedFonts: checkLoadedFonts, - setIsLoaded: setIsLoaded, - }; - - Font.prototype = fontPrototype; - - return Font; -}()); - -export default FontManager; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/LogUtil.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/LogUtil.js deleted file mode 100644 index cf30c94e14d9051ba8169f8e84b3d7361074f94e..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/LogUtil.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 hilog from '@ohos.hilog'; - -export class LogUtil { - static DOMAIN = 0xFF00; - static TAG = 'lottie_ohos'; - static ON = true; - static OFF = false; - static mLogLevel = LogUtil.ON; - static VERSION = '2.0.24'; - - static debug(message, ...args) { - if (LogUtil.mLogLevel === LogUtil.ON) { - hilog.debug(LogUtil.DOMAIN, LogUtil.TAG, message, args); - } - } - - static info(message, ...args) { - if (LogUtil.mLogLevel === LogUtil.ON) { - hilog.info(LogUtil.DOMAIN, LogUtil.TAG, message, args); - } - } - - static log(message, ...args) { - if (LogUtil.mLogLevel === LogUtil.ON) { - hilog.debug(LogUtil.DOMAIN, LogUtil.TAG, message, args); - } - } - - static warn(message, ...args) { - hilog.warn(LogUtil.DOMAIN, LogUtil.TAG, message, args); - } - - static error(message, ...args) { - hilog.error(LogUtil.DOMAIN, LogUtil.TAG, message, args); - } - - static version() { - hilog.info(LogUtil.DOMAIN, LogUtil.TAG, `current Lottie version: ${LogUtil.VERSION}`); - return LogUtil.VERSION; - } -} \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/PolynomialBezier.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/PolynomialBezier.js deleted file mode 100644 index 07e9786f8426fe0119c3d063f5ef776abf3145ed..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/PolynomialBezier.js +++ /dev/null @@ -1,253 +0,0 @@ -function floatEqual(a, b) { - return Math.abs(a - b) * 100000 <= Math.min(Math.abs(a), Math.abs(b)); -} - -function floatZero(f) { - return Math.abs(f) <= 0.00001; -} - -function lerp(p0, p1, amount) { - return p0 * (1 - amount) + p1 * amount; -} - -function lerpPoint(p0, p1, amount) { - return [lerp(p0[0], p1[0], amount), lerp(p0[1], p1[1], amount)]; -} - -function quadRoots(a, b, c) { - // no root - if (a === 0) return []; - var s = b * b - 4 * a * c; - // Complex roots - if (s < 0) return []; - var singleRoot = -b / (2 * a); - // 1 root - if (s === 0) return [singleRoot]; - var delta = Math.sqrt(s) / (2 * a); - // 2 roots - return [singleRoot - delta, singleRoot + delta]; -} - -function polynomialCoefficients(p0, p1, p2, p3) { - return [ - -p0 + 3 * p1 - 3 * p2 + p3, - 3 * p0 - 6 * p1 + 3 * p2, - -3 * p0 + 3 * p1, - p0, - ]; -} - -function singlePoint(p) { - return new PolynomialBezier(p, p, p, p, false); -} - -function PolynomialBezier(p0, p1, p2, p3, linearize) { - if (linearize && pointEqual(p0, p1)) { - p1 = lerpPoint(p0, p3, 1 / 3); - } - if (linearize && pointEqual(p2, p3)) { - p2 = lerpPoint(p0, p3, 2 / 3); - } - var coeffx = polynomialCoefficients(p0[0], p1[0], p2[0], p3[0]); - var coeffy = polynomialCoefficients(p0[1], p1[1], p2[1], p3[1]); - this.a = [coeffx[0], coeffy[0]]; - this.b = [coeffx[1], coeffy[1]]; - this.c = [coeffx[2], coeffy[2]]; - this.d = [coeffx[3], coeffy[3]]; - this.points = [p0, p1, p2, p3]; -} -PolynomialBezier.prototype.point = function (t) { - return [ - (((this.a[0] * t) + this.b[0]) * t + this.c[0]) * t + this.d[0], - (((this.a[1] * t) + this.b[1]) * t + this.c[1]) * t + this.d[1], - ]; -}; -PolynomialBezier.prototype.derivative = function (t) { - return [ - (3 * t * this.a[0] + 2 * this.b[0]) * t + this.c[0], - (3 * t * this.a[1] + 2 * this.b[1]) * t + this.c[1], - ]; -}; -PolynomialBezier.prototype.tangentAngle = function (t) { - var p = this.derivative(t); - return Math.atan2(p[1], p[0]); -}; -PolynomialBezier.prototype.normalAngle = function (t) { - var p = this.derivative(t); - return Math.atan2(p[0], p[1]); -}; - -PolynomialBezier.prototype.inflectionPoints = function () { - var denom = this.a[1] * this.b[0] - this.a[0] * this.b[1]; - if (floatZero(denom)) return []; - var tcusp = (-0.5 * (this.a[1] * this.c[0] - this.a[0] * this.c[1])) / denom; - var square = tcusp * tcusp - ((1 / 3) * (this.b[1] * this.c[0] - this.b[0] * this.c[1])) / denom; - if (square < 0) return []; - var root = Math.sqrt(square); - if (floatZero(root)) { - if (root > 0 && root < 1) return [tcusp]; - return []; - } - return [tcusp - root, tcusp + root].filter(function (r) { return r > 0 && r < 1; }); -}; -PolynomialBezier.prototype.split = function (t) { - if (t <= 0) return [singlePoint(this.points[0]), this]; - if (t >= 1) return [this, singlePoint(this.points[this.points.length - 1])]; - var p10 = lerpPoint(this.points[0], this.points[1], t); - var p11 = lerpPoint(this.points[1], this.points[2], t); - var p12 = lerpPoint(this.points[2], this.points[3], t); - var p20 = lerpPoint(p10, p11, t); - var p21 = lerpPoint(p11, p12, t); - var p3 = lerpPoint(p20, p21, t); - return [ - new PolynomialBezier(this.points[0], p10, p20, p3, true), - new PolynomialBezier(p3, p21, p12, this.points[3], true), - ]; -}; -function extrema(bez, comp) { - var min = bez.points[0][comp]; - var max = bez.points[bez.points.length - 1][comp]; - if (min > max) { - var e = max; - max = min; - min = e; - } - // Derivative roots to find min/max - var f = quadRoots(3 * bez.a[comp], 2 * bez.b[comp], bez.c[comp]); - for (var i = 0; i < f.length; i += 1) { - if (f[i] > 0 && f[i] < 1) { - var val = bez.point(f[i])[comp]; - if (val < min) min = val; - else if (val > max) max = val; - } - } - return { - min: min, - max: max, - }; -} -PolynomialBezier.prototype.bounds = function () { - return { - x: extrema(this, 0), - y: extrema(this, 1), - }; -}; -PolynomialBezier.prototype.boundingBox = function () { - var bounds = this.bounds(); - return { - left: bounds.x.min, - right: bounds.x.max, - top: bounds.y.min, - bottom: bounds.y.max, - width: bounds.x.max - bounds.x.min, - height: bounds.y.max - bounds.y.min, - cx: (bounds.x.max + bounds.x.min) / 2, - cy: (bounds.y.max + bounds.y.min) / 2, - }; -}; - -function intersectData(bez, t1, t2) { - var box = bez.boundingBox(); - return { - cx: box.cx, - cy: box.cy, - width: box.width, - height: box.height, - bez: bez, - t: (t1 + t2) / 2, - t1: t1, - t2: t2, - }; -} -function splitData(data) { - var split = data.bez.split(0.5); - return [ - intersectData(split[0], data.t1, data.t), - intersectData(split[1], data.t, data.t2), - ]; -} - -function boxIntersect(b1, b2) { - return Math.abs(b1.cx - b2.cx) * 2 < b1.width + b2.width - && Math.abs(b1.cy - b2.cy) * 2 < b1.height + b2.height; -} - -function intersectsImpl(d1, d2, depth, tolerance, intersections, maxRecursion) { - if (!boxIntersect(d1, d2)) return; - if (depth >= maxRecursion || (d1.width <= tolerance && d1.height <= tolerance && d2.width <= tolerance && d2.height <= tolerance)) { - intersections.push([d1.t, d2.t]); - return; - } - var d1s = splitData(d1); - var d2s = splitData(d2); - intersectsImpl(d1s[0], d2s[0], depth + 1, tolerance, intersections, maxRecursion); - intersectsImpl(d1s[0], d2s[1], depth + 1, tolerance, intersections, maxRecursion); - intersectsImpl(d1s[1], d2s[0], depth + 1, tolerance, intersections, maxRecursion); - intersectsImpl(d1s[1], d2s[1], depth + 1, tolerance, intersections, maxRecursion); -} - -PolynomialBezier.prototype.intersections = function (other, tolerance, maxRecursion) { - if (tolerance === undefined) tolerance = 2; - if (maxRecursion === undefined) maxRecursion = 7; - var intersections = []; - intersectsImpl(intersectData(this, 0, 1), intersectData(other, 0, 1), 0, tolerance, intersections, maxRecursion); - return intersections; -}; - -PolynomialBezier.shapeSegment = function (shapePath, index) { - var nextIndex = (index + 1) % shapePath.length(); - return new PolynomialBezier(shapePath.v[index], shapePath.o[index], shapePath.i[nextIndex], shapePath.v[nextIndex], true); -}; - -PolynomialBezier.shapeSegmentInverted = function (shapePath, index) { - var nextIndex = (index + 1) % shapePath.length(); - return new PolynomialBezier(shapePath.v[nextIndex], shapePath.i[nextIndex], shapePath.o[index], shapePath.v[index], true); -}; - -function crossProduct(a, b) { - return [ - a[1] * b[2] - a[2] * b[1], - a[2] * b[0] - a[0] * b[2], - a[0] * b[1] - a[1] * b[0], - ]; -} - -function lineIntersection(start1, end1, start2, end2) { - var v1 = [start1[0], start1[1], 1]; - var v2 = [end1[0], end1[1], 1]; - var v3 = [start2[0], start2[1], 1]; - var v4 = [end2[0], end2[1], 1]; - - var r = crossProduct( - crossProduct(v1, v2), - crossProduct(v3, v4) - ); - - if (floatZero(r[2])) return null; - - return [r[0] / r[2], r[1] / r[2]]; -} - -function polarOffset(p, angle, length) { - return [ - p[0] + Math.cos(angle) * length, - p[1] - Math.sin(angle) * length, - ]; -} - -function pointDistance(p1, p2) { - return Math.hypot(p1[0] - p2[0], p1[1] - p2[1]); -} - -function pointEqual(p1, p2) { - return floatEqual(p1[0], p2[0]) && floatEqual(p1[1], p2[1]); -} - -export { - PolynomialBezier, - lineIntersection, - polarOffset, - pointDistance, - pointEqual, - floatEqual, -}; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/PropertyFactory.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/PropertyFactory.js deleted file mode 100644 index 74d7b04bccbf44b18d5470006bb5f971fb67061a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/PropertyFactory.js +++ /dev/null @@ -1,490 +0,0 @@ -import { - degToRads, -} from './common'; -import { - createTypedArray, -} from './helpers/arrays'; -import BezierFactory from '../3rd_party/BezierEaser'; -import { - initialDefaultFrame, -} from '../main'; -import bez from './bez'; - - - var initFrame = initialDefaultFrame; - var mathAbs = Math.abs; - - function interpolateValue(frameNum, caching) { - var offsetTime = this.offsetTime; - var newValue; - if (this.propType === 'multidimensional') { - newValue = createTypedArray('float32', this.pv.length); - } - var iterationIndex = caching.lastIndex; - var i = iterationIndex; - var len = this.keyframes.length - 1; - var flag = true; - var keyData; - var nextKeyData; - var keyframeMetadata; - - while (flag) { - keyData = this.keyframes[i]; - nextKeyData = this.keyframes[i + 1]; - if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime) { - if (keyData.h) { - keyData = nextKeyData; - } - iterationIndex = 0; - break; - } - if ((nextKeyData.t - offsetTime) > frameNum) { - iterationIndex = i; - break; - } - if (i < len - 1) { - i += 1; - } else { - iterationIndex = 0; - flag = false; - } - } - keyframeMetadata = this.keyframesMetadata[i] || {}; - - var k; - var kLen; - var perc; - var jLen; - var j; - var fnc; - var nextKeyTime = nextKeyData.t - offsetTime; - var keyTime = keyData.t - offsetTime; - var endValue; - if (keyData.to) { - if (!keyframeMetadata.bezierData) { - keyframeMetadata.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti); - } - var bezierData = keyframeMetadata.bezierData; - if (frameNum >= nextKeyTime || frameNum < keyTime) { - var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0; - kLen = bezierData.points[ind].point.length; - for (k = 0; k < kLen; k += 1) { - newValue[k] = bezierData.points[ind].point[k]; - } - // caching._lastKeyframeIndex = -1; - } else { - if (keyframeMetadata.__fnct) { - fnc = keyframeMetadata.__fnct; - } else { - fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get; - keyframeMetadata.__fnct = fnc; - } - perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime)); - var distanceInLine = bezierData.segmentLength * perc; - - var segmentPerc; - var addedLength = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0; - j = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0; - flag = true; - jLen = bezierData.points.length; - while (flag) { - addedLength += bezierData.points[j].partialLength; - if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) { - kLen = bezierData.points[j].point.length; - for (k = 0; k < kLen; k += 1) { - newValue[k] = bezierData.points[j].point[k]; - } - break; - } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) { - segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength; - kLen = bezierData.points[j].point.length; - for (k = 0; k < kLen; k += 1) { - newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc; - } - break; - } - if (j < jLen - 1) { - j += 1; - } else { - flag = false; - } - } - caching._lastPoint = j; - caching._lastAddedLength = addedLength - bezierData.points[j].partialLength; - caching._lastKeyframeIndex = i; - } - } else { - var outX; - var outY; - var inX; - var inY; - var keyValue; - len = keyData.s.length; - endValue = nextKeyData.s || keyData.e; - if (this.sh && keyData.h !== 1) { - if (frameNum >= nextKeyTime) { - newValue[0] = endValue[0]; - newValue[1] = endValue[1]; - newValue[2] = endValue[2]; - } else if (frameNum <= keyTime) { - newValue[0] = keyData.s[0]; - newValue[1] = keyData.s[1]; - newValue[2] = keyData.s[2]; - } else { - var quatStart = createQuaternion(keyData.s); - var quatEnd = createQuaternion(endValue); - var time = (frameNum - keyTime) / (nextKeyTime - keyTime); - quaternionToEuler(newValue, slerp(quatStart, quatEnd, time)); - } - } else { - for (i = 0; i < len; i += 1) { - if (keyData.h !== 1) { - if (frameNum >= nextKeyTime) { - perc = 1; - } else if (frameNum < keyTime) { - perc = 0; - } else { - if (keyData.o.x.constructor === Array) { - if (!keyframeMetadata.__fnct) { - keyframeMetadata.__fnct = []; - } - if (!keyframeMetadata.__fnct[i]) { - outX = keyData.o.x[i] === undefined ? keyData.o.x[0] : keyData.o.x[i]; - outY = keyData.o.y[i] === undefined ? keyData.o.y[0] : keyData.o.y[i]; - inX = keyData.i.x[i] === undefined ? keyData.i.x[0] : keyData.i.x[i]; - inY = keyData.i.y[i] === undefined ? keyData.i.y[0] : keyData.i.y[i]; - fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get; - keyframeMetadata.__fnct[i] = fnc; - } else { - fnc = keyframeMetadata.__fnct[i]; - } - } else if (!keyframeMetadata.__fnct) { - outX = keyData.o.x; - outY = keyData.o.y; - inX = keyData.i.x; - inY = keyData.i.y; - fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get; - keyData.keyframeMetadata = fnc; - } else { - fnc = keyframeMetadata.__fnct; - } - perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime)); - } - } - - endValue = nextKeyData.s || keyData.e; - keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc; - - if (this.propType === 'multidimensional') { - newValue[i] = keyValue; - } else { - newValue = keyValue; - } - } - } - } - caching.lastIndex = iterationIndex; - return newValue; - } - - // based on @Toji's https://github.com/toji/gl-matrix/ - function slerp(a, b, t) { - var out = []; - var ax = a[0]; - var ay = a[1]; - var az = a[2]; - var aw = a[3]; - var bx = b[0]; - var by = b[1]; - var bz = b[2]; - var bw = b[3]; - - var omega; - var cosom; - var sinom; - var scale0; - var scale1; - - cosom = ax * bx + ay * by + az * bz + aw * bw; - if (cosom < 0.0) { - cosom = -cosom; - bx = -bx; - by = -by; - bz = -bz; - bw = -bw; - } - if ((1.0 - cosom) > 0.000001) { - omega = Math.acos(cosom); - sinom = Math.sin(omega); - scale0 = Math.sin((1.0 - t) * omega) / sinom; - scale1 = Math.sin(t * omega) / sinom; - } else { - scale0 = 1.0 - t; - scale1 = t; - } - out[0] = scale0 * ax + scale1 * bx; - out[1] = scale0 * ay + scale1 * by; - out[2] = scale0 * az + scale1 * bz; - out[3] = scale0 * aw + scale1 * bw; - - return out; - } - - function quaternionToEuler(out, quat) { - var qx = quat[0]; - var qy = quat[1]; - var qz = quat[2]; - var qw = quat[3]; - var heading = Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy * qy - 2 * qz * qz); - var attitude = Math.asin(2 * qx * qy + 2 * qz * qw); - var bank = Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx * qx - 2 * qz * qz); - out[0] = heading / degToRads; - out[1] = attitude / degToRads; - out[2] = bank / degToRads; - } - - function createQuaternion(values) { - var heading = values[0] * degToRads; - var attitude = values[1] * degToRads; - var bank = values[2] * degToRads; - var c1 = Math.cos(heading / 2); - var c2 = Math.cos(attitude / 2); - var c3 = Math.cos(bank / 2); - var s1 = Math.sin(heading / 2); - var s2 = Math.sin(attitude / 2); - var s3 = Math.sin(bank / 2); - var w = c1 * c2 * c3 - s1 * s2 * s3; - var x = s1 * s2 * c3 + c1 * c2 * s3; - var y = s1 * c2 * c3 + c1 * s2 * s3; - var z = c1 * s2 * c3 - s1 * c2 * s3; - - return [x, y, z, w]; - } - - function getValueAtCurrentTime() { - var frameNum = this.comp.renderedFrame - this.offsetTime; - var initTime = this.keyframes[0].t - this.offsetTime; - var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime; - if (!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))) { - if (this._caching.lastFrame >= frameNum) { - this._caching._lastKeyframeIndex = -1; - this._caching.lastIndex = 0; - } - - var renderResult = this.interpolateValue(frameNum, this._caching); - this.pv = renderResult; - } - this._caching.lastFrame = frameNum; - return this.pv; - } - - function setVValue(val) { - var multipliedValue; - if (this.propType === 'unidimensional') { - multipliedValue = val * this.mult; - if (mathAbs(this.v - multipliedValue) > 0.00001) { - this.v = multipliedValue; - this._mdf = true; - } - } else { - var i = 0; - var len = this.v.length; - while (i < len) { - multipliedValue = val[i] * this.mult; - if (mathAbs(this.v[i] - multipliedValue) > 0.00001) { - this.v[i] = multipliedValue; - this._mdf = true; - } - i += 1; - } - } - } - - function processEffectsSequence() { - if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) { - return; - } - if (this.lock) { - this.setVValue(this.pv); - return; - } - this.lock = true; - this._mdf = this._isFirstFrame; - var i; - var len = this.effectsSequence.length; - var finalValue = this.kf ? this.pv : this.data.k; - for (i = 0; i < len; i += 1) { - finalValue = this.effectsSequence[i](finalValue); - } - this.setVValue(finalValue); - this._isFirstFrame = false; - this.lock = false; - this.frameId = this.elem.globalData.frameId; - } - - function addEffect(effectFunction) { - this.effectsSequence.push(effectFunction); - this.container.addDynamicProperty(this); - } - - function ValueProperty(elem, data, mult, container) { - this.propType = 'unidimensional'; - this.mult = mult || 1; - this.data = data; - this.v = mult ? data.k * mult : data.k; - this.pv = data.k; - this._mdf = false; - this.elem = elem; - this.container = container; - this.comp = elem.comp; - this.k = false; - this.kf = false; - this.vel = 0; - this.effectsSequence = []; - this._isFirstFrame = true; - this.getValue = processEffectsSequence; - this.setVValue = setVValue; - this.addEffect = addEffect; - } - - function MultiDimensionalProperty(elem, data, mult, container) { - this.propType = 'multidimensional'; - this.mult = mult || 1; - this.data = data; - this._mdf = false; - this.elem = elem; - this.container = container; - this.comp = elem.comp; - this.k = false; - this.kf = false; - this.frameId = -1; - var i; - var len = data.k.length; - this.v = createTypedArray('float32', len); - this.pv = createTypedArray('float32', len); - this.vel = createTypedArray('float32', len); - for (i = 0; i < len; i += 1) { - this.v[i] = data.k[i] * this.mult; - this.pv[i] = data.k[i]; - } - this._isFirstFrame = true; - this.effectsSequence = []; - this.getValue = processEffectsSequence; - this.setVValue = setVValue; - this.addEffect = addEffect; - } - - function KeyframedValueProperty(elem, data, mult, container) { - this.propType = 'unidimensional'; - this.keyframes = data.k; - this.keyframesMetadata = []; - this.offsetTime = elem.data.st; - this.frameId = -1; - this._caching = { - lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1, - }; - this.k = true; - this.kf = true; - this.data = data; - this.mult = mult || 1; - this.elem = elem; - this.container = container; - this.comp = elem.comp; - this.v = initFrame; - this.pv = initFrame; - this._isFirstFrame = true; - this.getValue = processEffectsSequence; - this.setVValue = setVValue; - this.interpolateValue = interpolateValue; - this.effectsSequence = [getValueAtCurrentTime.bind(this)]; - this.addEffect = addEffect; - } - - function KeyframedMultidimensionalProperty(elem, data, mult, container) { - this.propType = 'multidimensional'; - var i; - var len = data.k.length; - var s; - var e; - var to; - var ti; - for (i = 0; i < len - 1; i += 1) { - if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) { - s = data.k[i].s; - e = data.k[i + 1].s; - to = data.k[i].to; - ti = data.k[i].ti; - if ((s.length === 2 && !(s[0] === e[0] && s[1] === e[1]) && bez.pointOnLine2D(s[0], s[1], e[0], e[1], s[0] + to[0], s[1] + to[1]) && bez.pointOnLine2D(s[0], s[1], e[0], e[1], e[0] + ti[0], e[1] + ti[1])) || (s.length === 3 && !(s[0] === e[0] && s[1] === e[1] && s[2] === e[2]) && bez.pointOnLine3D(s[0], s[1], s[2], e[0], e[1], e[2], s[0] + to[0], s[1] + to[1], s[2] + to[2]) && bez.pointOnLine3D(s[0], s[1], s[2], e[0], e[1], e[2], e[0] + ti[0], e[1] + ti[1], e[2] + ti[2]))) { - data.k[i].to = null; - data.k[i].ti = null; - } - if (s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) { - if (s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) { - data.k[i].to = null; - data.k[i].ti = null; - } - } - } - } - this.effectsSequence = [getValueAtCurrentTime.bind(this)]; - this.data = data; - this.keyframes = data.k; - this.keyframesMetadata = []; - this.offsetTime = elem.data.st; - this.k = true; - this.kf = true; - this._isFirstFrame = true; - this.mult = mult || 1; - this.elem = elem; - this.container = container; - this.comp = elem.comp; - this.getValue = processEffectsSequence; - this.setVValue = setVValue; - this.interpolateValue = interpolateValue; - this.frameId = -1; - var arrLen = data.k[0].s.length; - this.v = createTypedArray('float32', arrLen); - this.pv = createTypedArray('float32', arrLen); - for (i = 0; i < arrLen; i += 1) { - this.v[i] = initFrame; - this.pv[i] = initFrame; - } - this._caching = { lastFrame: initFrame, lastIndex: 0, value: createTypedArray('float32', arrLen) }; - this.addEffect = addEffect; - } - -const PropertyFactory = (function () { - function getProp(elem, data, type, mult, container) { - if (data.sid) { - data = elem.globalData.slotManager.getProp(data); - } - var p; - if (!data.k.length) { - p = new ValueProperty(elem, data, mult, container); - } else if (typeof (data.k[0]) === 'number') { - p = new MultiDimensionalProperty(elem, data, mult, container); - } else { - switch (type) { - case 0: - p = new KeyframedValueProperty(elem, data, mult, container); - break; - case 1: - p = new KeyframedMultidimensionalProperty(elem, data, mult, container); - break; - default: - break; - } - } - if (p.effectsSequence.length) { - container.addDynamicProperty(p); - } - return p; - } - - var ob = { - getProp: getProp, - }; - return ob; -}()); - -export default PropertyFactory; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/SlotManager.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/SlotManager.js deleted file mode 100644 index 68d492524328c4116834df21f566ba83f8866d9f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/SlotManager.js +++ /dev/null @@ -1,16 +0,0 @@ -function SlotManager(animationData) { - this.animationData = animationData; -} - -SlotManager.prototype.getProp = function (data) { - if (this.animationData.slots && this.animationData.slots[data.sid]) { - return Object.assign(data, this.animationData.slots[data.sid].p); - } - return data; -}; - -function slotFactory(animationData) { - return new SlotManager(animationData); -} - -export default slotFactory; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/TransformProperty.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/TransformProperty.js deleted file mode 100644 index 2284d429768809ad54dce6e9da3c3100635a0e2e..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/TransformProperty.js +++ /dev/null @@ -1,248 +0,0 @@ -import { - degToRads, -} from './common'; -import { - extendPrototype, -} from './functionExtensions'; -import DynamicPropertyContainer from './helpers/dynamicProperties'; -import Matrix from '../3rd_party/transformation-matrix'; -import PropertyFactory from './PropertyFactory'; - -const TransformPropertyFactory = (function () { - var defaultVector = [0, 0]; - - function applyToMatrix(mat) { - var _mdf = this._mdf; - this.iterateDynamicProperties(); - this._mdf = this._mdf || _mdf; - if (this.a) { - mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]); - } - if (this.s) { - mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]); - } - if (this.sk) { - mat.skewFromAxis(-this.sk.v, this.sa.v); - } - if (this.r) { - mat.rotate(-this.r.v); - } else { - mat.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]) - .rotateY(this.or.v[1]) - .rotateX(this.or.v[0]); - } - if (this.data.p.s) { - if (this.data.p.z) { - mat.translate(this.px.v, this.py.v, -this.pz.v); - } else { - mat.translate(this.px.v, this.py.v, 0); - } - } else { - mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]); - } - } - function processKeys(forceRender) { - if (this.elem.globalData.frameId === this.frameId) { - return; - } - if (this._isDirty) { - this.precalculateMatrix(); - this._isDirty = false; - } - - this.iterateDynamicProperties(); - - if (this._mdf || forceRender) { - var frameRate; - this.v.cloneFromProps(this.pre.props); - if (this.appliedTransformations < 1) { - this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]); - } - if (this.appliedTransformations < 2) { - this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]); - } - if (this.sk && this.appliedTransformations < 3) { - this.v.skewFromAxis(-this.sk.v, this.sa.v); - } - if (this.r && this.appliedTransformations < 4) { - this.v.rotate(-this.r.v); - } else if (!this.r && this.appliedTransformations < 4) { - this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]) - .rotateY(this.or.v[1]) - .rotateX(this.or.v[0]); - } - if (this.autoOriented) { - var v1; - var v2; - frameRate = this.elem.globalData.frameRate; - if (this.p && this.p.keyframes && this.p.getValueAtTime) { - if (this.p._caching.lastFrame + this.p.offsetTime <= this.p.keyframes[0].t) { - v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate, 0); - v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0); - } else if (this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) { - v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0); - v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0); - } else { - v1 = this.p.pv; - v2 = this.p.getValueAtTime((this.p._caching.lastFrame + this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime); - } - } else if (this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) { - v1 = []; - v2 = []; - var px = this.px; - var py = this.py; - if (px._caching.lastFrame + px.offsetTime <= px.keyframes[0].t) { - v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate, 0); - v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate, 0); - v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate, 0); - v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate, 0); - } else if (px._caching.lastFrame + px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) { - v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate), 0); - v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate), 0); - v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate, 0); - v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate, 0); - } else { - v1 = [px.pv, py.pv]; - v2[0] = px.getValueAtTime((px._caching.lastFrame + px.offsetTime - 0.01) / frameRate, px.offsetTime); - v2[1] = py.getValueAtTime((py._caching.lastFrame + py.offsetTime - 0.01) / frameRate, py.offsetTime); - } - } else { - v2 = defaultVector; - v1 = v2; - } - this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0])); - } - if (this.data.p && this.data.p.s) { - if (this.data.p.z) { - this.v.translate(this.px.v, this.py.v, -this.pz.v); - } else { - this.v.translate(this.px.v, this.py.v, 0); - } - } else { - this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]); - } - } - this.frameId = this.elem.globalData.frameId; - } - - function precalculateMatrix() { - if (!this.a.k) { - this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]); - this.appliedTransformations = 1; - } else { - return; - } - if (!this.s.effectsSequence.length) { - this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]); - this.appliedTransformations = 2; - } else { - return; - } - if (this.sk) { - if (!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) { - this.pre.skewFromAxis(-this.sk.v, this.sa.v); - this.appliedTransformations = 3; - } else { - return; - } - } - if (this.r) { - if (!this.r.effectsSequence.length) { - this.pre.rotate(-this.r.v); - this.appliedTransformations = 4; - } - } else if (!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) { - this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]) - .rotateY(this.or.v[1]) - .rotateX(this.or.v[0]); - this.appliedTransformations = 4; - } - } - - function autoOrient() { - // - // var prevP = this.getValueAtTime(); - } - - function addDynamicProperty(prop) { - this._addDynamicProperty(prop); - this.elem.addDynamicProperty(prop); - this._isDirty = true; - } - - function TransformProperty(elem, data, container) { - this.elem = elem; - this.frameId = -1; - this.propType = 'transform'; - this.data = data; - this.v = new Matrix(); - // Precalculated matrix with non animated properties - this.pre = new Matrix(); - this.appliedTransformations = 0; - this.initDynamicPropertyContainer(container || elem); - if (data.p && data.p.s) { - this.px = PropertyFactory.getProp(elem, data.p.x, 0, 0, this); - this.py = PropertyFactory.getProp(elem, data.p.y, 0, 0, this); - if (data.p.z) { - this.pz = PropertyFactory.getProp(elem, data.p.z, 0, 0, this); - } - } else { - this.p = PropertyFactory.getProp(elem, data.p || { k: [0, 0, 0] }, 1, 0, this); - } - if (data.rx) { - this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this); - this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this); - this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this); - if (data.or.k[0].ti) { - var i; - var len = data.or.k.length; - for (i = 0; i < len; i += 1) { - data.or.k[i].to = null; - data.or.k[i].ti = null; - } - } - this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this); - // sh Indicates it needs to be capped between -180 and 180 - this.or.sh = true; - } else { - this.r = PropertyFactory.getProp(elem, data.r || { k: 0 }, 0, degToRads, this); - } - if (data.sk) { - this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this); - this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this); - } - this.a = PropertyFactory.getProp(elem, data.a || { k: [0, 0, 0] }, 1, 0, this); - this.s = PropertyFactory.getProp(elem, data.s || { k: [100, 100, 100] }, 1, 0.01, this); - // Opacity is not part of the transform properties, that's why it won't use this.dynamicProperties. That way transforms won't get updated if opacity changes. - if (data.o) { - this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, elem); - } else { - this.o = { _mdf: false, v: 1 }; - } - this._isDirty = true; - if (!this.dynamicProperties.length) { - this.getValue(true); - } - } - - TransformProperty.prototype = { - applyToMatrix: applyToMatrix, - getValue: processKeys, - precalculateMatrix: precalculateMatrix, - autoOrient: autoOrient, - }; - - extendPrototype([DynamicPropertyContainer], TransformProperty); - TransformProperty.prototype.addDynamicProperty = addDynamicProperty; - TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty; - - function getTransformProperty(elem, data, container) { - return new TransformProperty(elem, data, container); - } - - return { - getTransformProperty: getTransformProperty, - }; -}()); - -export default TransformPropertyFactory; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/audio/AudioController.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/audio/AudioController.js deleted file mode 100644 index 420a54939c016cb8ef05b496f25f42b39fdc4a57..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/audio/AudioController.js +++ /dev/null @@ -1,81 +0,0 @@ -// import Howl from '../../3rd_party/howler'; - -const audioControllerFactory = (function () { - function AudioController(audioFactory) { - this.audios = []; - this.audioFactory = audioFactory; - this._volume = 1; - this._isMuted = false; - } - - AudioController.prototype = { - addAudio: function (audio) { - this.audios.push(audio); - }, - pause: function () { - var i; - var len = this.audios.length; - for (i = 0; i < len; i += 1) { - this.audios[i].pause(); - } - }, - resume: function () { - var i; - var len = this.audios.length; - for (i = 0; i < len; i += 1) { - this.audios[i].resume(); - } - }, - setRate: function (rateValue) { - var i; - var len = this.audios.length; - for (i = 0; i < len; i += 1) { - this.audios[i].setRate(rateValue); - } - }, - createAudio: function (assetPath) { - if (this.audioFactory) { - return this.audioFactory(assetPath); - } - return { - isPlaying: false, - play: function () { this.isPlaying = true; }, - seek: function () { this.isPlaying = false; }, - playing: function () {}, - rate: function () {}, - setVolume: function () {}, - }; - }, - setAudioFactory: function (audioFactory) { - this.audioFactory = audioFactory; - }, - setVolume: function (value) { - this._volume = value; - this._updateVolume(); - }, - mute: function () { - this._isMuted = true; - this._updateVolume(); - }, - unmute: function () { - this._isMuted = false; - this._updateVolume(); - }, - getVolume: function () { - return this._volume; - }, - _updateVolume: function () { - var i; - var len = this.audios.length; - for (i = 0; i < len; i += 1) { - this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1)); - } - }, - }; - - return function () { - return new AudioController(); - }; -}()); - -export default audioControllerFactory; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/audio/AudioElement.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/audio/AudioElement.js deleted file mode 100644 index af9593675b1d777b3a82f24c3e099f9c7972c4af..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/audio/AudioElement.js +++ /dev/null @@ -1,6 +0,0 @@ -// TODO: fix Overwrite -function AudioElement(data) { - this.audioData = data; -} - -export default AudioElement; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/bez.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/bez.js deleted file mode 100644 index ea83913c359586d7ca2cef7d9292103ade3875b7..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/bez.js +++ /dev/null @@ -1,260 +0,0 @@ -import { - bmPow, - bmFloor, - bmSqrt, - getDefaultCurveSegments, -} from './common'; -import { - createSizedArray, - createTypedArray, -} from './helpers/arrays'; -import segmentsLengthPool from './pooling/segments_length_pool'; -import bezierLengthPool from './pooling/bezier_length_pool'; - -function bezFunction() { - var math = Math; - - function pointOnLine2D(x1, y1, x2, y2, x3, y3) { - var det1 = (x1 * y2) + (y1 * x3) + (x2 * y3) - (x3 * y2) - (y3 * x1) - (x2 * y1); - return det1 > -0.001 && det1 < 0.001; - } - - function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) { - if (z1 === 0 && z2 === 0 && z3 === 0) { - return pointOnLine2D(x1, y1, x2, y2, x3, y3); - } - var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2)); - var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2)); - var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2)); - var diffDist; - if (dist1 > dist2) { - if (dist1 > dist3) { - diffDist = dist1 - dist2 - dist3; - } else { - diffDist = dist3 - dist2 - dist1; - } - } else if (dist3 > dist2) { - diffDist = dist3 - dist2 - dist1; - } else { - diffDist = dist2 - dist1 - dist3; - } - return diffDist > -0.0001 && diffDist < 0.0001; - } - - var getBezierLength = (function () { - return function (pt1, pt2, pt3, pt4) { - var curveSegments = getDefaultCurveSegments(); - var k; - var i; - var len; - var ptCoord; - var perc; - var addedLength = 0; - var ptDistance; - var point = []; - var lastPoint = []; - var lengthData = bezierLengthPool.newElement(); - len = pt3.length; - for (k = 0; k < curveSegments; k += 1) { - perc = k / (curveSegments - 1); - ptDistance = 0; - for (i = 0; i < len; i += 1) { - ptCoord = bmPow(1 - perc, 3) * pt1[i] + 3 * bmPow(1 - perc, 2) * perc * pt3[i] + 3 * (1 - perc) * bmPow(perc, 2) * pt4[i] + bmPow(perc, 3) * pt2[i]; - point[i] = ptCoord; - if (lastPoint[i] !== null) { - ptDistance += bmPow(point[i] - lastPoint[i], 2); - } - lastPoint[i] = point[i]; - } - if (ptDistance) { - ptDistance = bmSqrt(ptDistance); - addedLength += ptDistance; - } - lengthData.percents[k] = perc; - lengthData.lengths[k] = addedLength; - } - lengthData.addedLength = addedLength; - return lengthData; - }; - }()); - - function getSegmentsLength(shapeData) { - var segmentsLength = segmentsLengthPool.newElement(); - var closed = shapeData.c; - var pathV = shapeData.v; - var pathO = shapeData.o; - var pathI = shapeData.i; - var i; - var len = shapeData._length; - var lengths = segmentsLength.lengths; - var totalLength = 0; - for (i = 0; i < len - 1; i += 1) { - lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]); - totalLength += lengths[i].addedLength; - } - if (closed && len) { - lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]); - totalLength += lengths[i].addedLength; - } - segmentsLength.totalLength = totalLength; - return segmentsLength; - } - - function BezierData(length) { - this.segmentLength = 0; - this.points = new Array(length); - } - - function PointData(partial, point) { - this.partialLength = partial; - this.point = point; - } - - var buildBezierData = (function () { - var storedData = {}; - - return function (pt1, pt2, pt3, pt4) { - var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\./g, 'p'); - if (!storedData[bezierName]) { - var curveSegments = getDefaultCurveSegments(); - var k; - var i; - var len; - var ptCoord; - var perc; - var addedLength = 0; - var ptDistance; - var point; - var lastPoint = null; - if (pt1.length === 2 && (pt1[0] !== pt2[0] || pt1[1] !== pt2[1]) && pointOnLine2D(pt1[0], pt1[1], pt2[0], pt2[1], pt1[0] + pt3[0], pt1[1] + pt3[1]) && pointOnLine2D(pt1[0], pt1[1], pt2[0], pt2[1], pt2[0] + pt4[0], pt2[1] + pt4[1])) { - curveSegments = 2; - } - var bezierData = new BezierData(curveSegments); - len = pt3.length; - for (k = 0; k < curveSegments; k += 1) { - point = createSizedArray(len); - perc = k / (curveSegments - 1); - ptDistance = 0; - for (i = 0; i < len; i += 1) { - ptCoord = bmPow(1 - perc, 3) * pt1[i] + 3 * bmPow(1 - perc, 2) * perc * (pt1[i] + pt3[i]) + 3 * (1 - perc) * bmPow(perc, 2) * (pt2[i] + pt4[i]) + bmPow(perc, 3) * pt2[i]; - point[i] = ptCoord; - if (lastPoint !== null) { - ptDistance += bmPow(point[i] - lastPoint[i], 2); - } - } - ptDistance = bmSqrt(ptDistance); - addedLength += ptDistance; - bezierData.points[k] = new PointData(ptDistance, point); - lastPoint = point; - } - bezierData.segmentLength = addedLength; - storedData[bezierName] = bezierData; - } - return storedData[bezierName]; - }; - }()); - - function getDistancePerc(perc, bezierData) { - var percents = bezierData.percents; - var lengths = bezierData.lengths; - var len = percents.length; - var initPos = bmFloor((len - 1) * perc); - var lengthPos = perc * bezierData.addedLength; - var lPerc = 0; - if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) { - return percents[initPos]; - } - var dir = lengths[initPos] > lengthPos ? -1 : 1; - var flag = true; - let tag = 0; - while (flag) { - // 为了防止while循环条件未满足而陷入死循环,导致进程卡死的问题,添加一个保护机制,当循环执行次数达到2000次是,强制退出循环 - tag += 1; - if (tag > 2000) { - flag = false; - break; - } - - if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) { - lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]); - flag = false; - } else { - initPos += dir; - } - if (initPos < 0 || initPos >= len - 1) { - // FIX for TypedArrays that don't store floating point values with enough accuracy - if (initPos === len - 1) { - flag = false; - return percents[initPos]; - } - flag = false; - } - } - return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc; - } - - function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) { - var t1 = getDistancePerc(percent, bezierData); - var u1 = 1 - t1; - var ptX = math.round((u1 * u1 * u1 * pt1[0] + (t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1) * pt3[0] + (t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1) * pt4[0] + t1 * t1 * t1 * pt2[0]) * 1000) / 1000; - var ptY = math.round((u1 * u1 * u1 * pt1[1] + (t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1) * pt3[1] + (t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1) * pt4[1] + t1 * t1 * t1 * pt2[1]) * 1000) / 1000; - return [ptX, ptY]; - } - - var bezierSegmentPoints = createTypedArray('float32', 8); - - function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) { - if (startPerc < 0) { - startPerc = 0; - } else if (startPerc > 1) { - startPerc = 1; - } - var t0 = getDistancePerc(startPerc, bezierData); - endPerc = endPerc > 1 ? 1 : endPerc; - var t1 = getDistancePerc(endPerc, bezierData); - var i; - var len = pt1.length; - var u0 = 1 - t0; - var u1 = 1 - t1; - var u0u0u0 = u0 * u0 * u0; - var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase - var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase - var t0t0t0 = t0 * t0 * t0; - // - var u0u0u1 = u0 * u0 * u1; - var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase - var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase - var t0t0t1 = t0 * t0 * t1; - // - var u0u1u1 = u0 * u1 * u1; - var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase - var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase - var t0t1t1 = t0 * t1 * t1; - // - var u1u1u1 = u1 * u1 * u1; - var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase - var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase - var t1t1t1 = t1 * t1 * t1; - for (i = 0; i < len; i += 1) { - bezierSegmentPoints[i * 4] = math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase - bezierSegmentPoints[i * 4 + 1] = math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase - bezierSegmentPoints[i * 4 + 2] = math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase - bezierSegmentPoints[i * 4 + 3] = math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase - } - - return bezierSegmentPoints; - } - - return { - getSegmentsLength: getSegmentsLength, - getNewSegment: getNewSegment, - getPointInSegment: getPointInSegment, - buildBezierData: buildBezierData, - pointOnLine2D: pointOnLine2D, - pointOnLine3D: pointOnLine3D, - }; -} - -const bez = bezFunction(); - -export default bez; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/common.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/common.js deleted file mode 100644 index 4d502e78baa41ec6ca423c2120d18a38b4951b87..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/common.js +++ /dev/null @@ -1,280 +0,0 @@ -import { - createSizedArray, -} from './helpers/arrays'; - -let subframeEnabled = true; -let expressionsPlugin = null; -let expressionsInterfaces = null; -let idPrefix = ''; -const isSafari = false; -let _shouldRoundValues = false; -const bmPow = Math.pow; -const bmSqrt = Math.sqrt; -const bmFloor = Math.floor; -const bmMax = Math.max; -const bmMin = Math.min; - -const BMMath = {}; -(function () { - var propertyNames = ['abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atanh', 'atan2', 'ceil', 'cbrt', 'expm1', 'clz32', 'cos', 'cosh', 'exp', 'floor', 'fround', 'hypot', 'imul', 'log', 'log1p', 'log2', 'log10', 'max', 'min', 'pow', 'random', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc', 'E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2']; - var i; - var len = propertyNames.length; - for (i = 0; i < len; i += 1) { - BMMath[propertyNames[i]] = Math[propertyNames[i]]; - } -}()); - -function ProjectInterface() { return {}; } -BMMath.random = Math.random; -BMMath.abs = function (val) { - var tOfVal = typeof val; - if (tOfVal === 'object' && val.length) { - var absArr = createSizedArray(val.length); - var i; - var len = val.length; - for (i = 0; i < len; i += 1) { - absArr[i] = Math.abs(val[i]); - } - return absArr; - } - return Math.abs(val); -}; -let defaultCurveSegments = 150; -const degToRads = Math.PI / 180; -const roundCorner = 0.5519; - -function roundValues(flag) { - _shouldRoundValues = !!flag; -} - -function bmRnd(value) { - if (_shouldRoundValues) { - return Math.round(value); - } - return value; -} - -function styleDiv(element) { - element.style.position = 'absolute'; - element.style.top = 0; - element.style.left = 0; - element.style.display = 'block'; - element.style.transformOrigin = '0 0'; - element.style.webkitTransformOrigin = '0 0'; - element.style.backfaceVisibility = 'visible'; - element.style.webkitBackfaceVisibility = 'visible'; - element.style.transformStyle = 'preserve-3d'; - element.style.webkitTransformStyle = 'preserve-3d'; - element.style.mozTransformStyle = 'preserve-3d'; -} - -function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier) { - this.type = type; - this.currentTime = currentTime; - this.totalTime = totalTime; - this.direction = frameMultiplier < 0 ? -1 : 1; -} - -function BMCompleteEvent(type, frameMultiplier) { - this.type = type; - this.direction = frameMultiplier < 0 ? -1 : 1; -} - -function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier) { - this.type = type; - this.currentLoop = currentLoop; - this.totalLoops = totalLoops; - this.direction = frameMultiplier < 0 ? -1 : 1; -} - -function BMSegmentStartEvent(type, firstFrame, totalFrames) { - this.type = type; - this.firstFrame = firstFrame; - this.totalFrames = totalFrames; -} - -function BMDestroyEvent(type, target) { - this.type = type; - this.target = target; -} - -function BMRenderFrameErrorEvent(nativeError, currentTime) { - this.type = 'renderFrameError'; - this.nativeError = nativeError; - this.currentTime = currentTime; -} - -function BMConfigErrorEvent(nativeError) { - this.type = 'configError'; - this.nativeError = nativeError; -} - -function BMAnimationConfigErrorEvent(type, nativeError) { - this.type = type; - this.nativeError = nativeError; -} - -const createElementID = (function () { - var _count = 0; - return function createID() { - _count += 1; - return idPrefix + '__lottie_element_' + _count; - }; -}()); - -function HSVtoRGB(h, s, v) { - var r; - var g; - var b; - var i; - var f; - var p; - var q; - var t; - i = Math.floor(h * 6); - f = h * 6 - i; - p = v * (1 - s); - q = v * (1 - f * s); - t = v * (1 - (1 - f) * s); - switch (i % 6) { - case 0: r = v; g = t; b = p; break; - case 1: r = q; g = v; b = p; break; - case 2: r = p; g = v; b = t; break; - case 3: r = p; g = q; b = v; break; - case 4: r = t; g = p; b = v; break; - case 5: r = v; g = p; b = q; break; - default: break; - } - return [r, - g, - b]; -} - -function RGBtoHSV(r, g, b) { - var max = Math.max(r, g, b); - var min = Math.min(r, g, b); - var d = max - min; - var h; - var s = (max === 0 ? 0 : d / max); - var v = max / 255; - - switch (max) { - case min: h = 0; break; - case r: h = (g - b) + d * (g < b ? 6 : 0); h /= 6 * d; break; - case g: h = (b - r) + d * 2; h /= 6 * d; break; - case b: h = (r - g) + d * 4; h /= 6 * d; break; - default: break; - } - - return [ - h, - s, - v, - ]; -} - -function addSaturationToRGB(color, offset) { - var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255); - hsv[1] += offset; - if (hsv[1] > 1) { - hsv[1] = 1; - } else if (hsv[1] <= 0) { - hsv[1] = 0; - } - return HSVtoRGB(hsv[0], hsv[1], hsv[2]); -} - -function addBrightnessToRGB(color, offset) { - var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255); - hsv[2] += offset; - if (hsv[2] > 1) { - hsv[2] = 1; - } else if (hsv[2] < 0) { - hsv[2] = 0; - } - return HSVtoRGB(hsv[0], hsv[1], hsv[2]); -} - -function addHueToRGB(color, offset) { - var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255); - hsv[0] += offset / 360; - if (hsv[0] > 1) { - hsv[0] -= 1; - } else if (hsv[0] < 0) { - hsv[0] += 1; - } - return HSVtoRGB(hsv[0], hsv[1], hsv[2]); -} - -const rgbToHex = (function () { - var colorMap = []; - var i; - var hex; - for (i = 0; i < 256; i += 1) { - hex = i.toString(16); - colorMap[i] = hex.length === 1 ? '0' + hex : hex; - } - - return function (r, g, b) { - if (r < 0) { - r = 0; - } - if (g < 0) { - g = 0; - } - if (b < 0) { - b = 0; - } - return '#' + colorMap[r] + colorMap[g] + colorMap[b]; - }; -}()); - -const setSubframeEnabled = (flag) => { subframeEnabled = !!flag; }; -const getSubframeEnabled = () => subframeEnabled; -const setExpressionsPlugin = (value) => { expressionsPlugin = value; }; -const getExpressionsPlugin = () => expressionsPlugin; -const setExpressionInterfaces = (value) => { expressionsInterfaces = value; }; -const getExpressionInterfaces = () => expressionsInterfaces; -const setDefaultCurveSegments = (value) => { defaultCurveSegments = value; }; -const getDefaultCurveSegments = () => defaultCurveSegments; -const setIdPrefix = (value) => { idPrefix = value; }; -const getIdPrefix = () => idPrefix; - -export { - setSubframeEnabled, - getSubframeEnabled, - setExpressionsPlugin, - getExpressionsPlugin, - setExpressionInterfaces, - getExpressionInterfaces, - setDefaultCurveSegments, - getDefaultCurveSegments, - isSafari, - bmPow, - bmSqrt, - bmFloor, - bmMax, - bmMin, - degToRads, - roundCorner, - styleDiv, - bmRnd, - roundValues, - BMEnterFrameEvent, - BMCompleteEvent, - BMCompleteLoopEvent, - BMSegmentStartEvent, - BMDestroyEvent, - BMRenderFrameErrorEvent, - BMConfigErrorEvent, - BMAnimationConfigErrorEvent, - createElementID, - addSaturationToRGB, - addBrightnessToRGB, - addHueToRGB, - rgbToHex, - setIdPrefix, - getIdPrefix, - BMMath, - ProjectInterface, -}; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/CompInterface.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/CompInterface.js deleted file mode 100644 index 179e26ea47d7c588f8f215471f2a7c5a4380a27a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/CompInterface.js +++ /dev/null @@ -1,28 +0,0 @@ -const CompExpressionInterface = (function () { - return function (comp) { - function _thisLayerFunction(name) { - var i = 0; - var len = comp.layers.length; - while (i < len) { - if (comp.layers[i].nm === name || comp.layers[i].ind === name) { - return comp.elements[i].layerInterface; - } - i += 1; - } - return null; - // return {active:false}; - } - Object.defineProperty(_thisLayerFunction, '_name', { value: comp.data.nm }); - _thisLayerFunction.layer = _thisLayerFunction; - _thisLayerFunction.pixelAspect = 1; - _thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h; - _thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w; - _thisLayerFunction.pixelAspect = 1; - _thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate; - _thisLayerFunction.displayStartTime = 0; - _thisLayerFunction.numLayers = comp.layers.length; - return _thisLayerFunction; - }; -}()); - -export default CompExpressionInterface; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/EffectInterface.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/EffectInterface.js deleted file mode 100644 index 94e13b98a83099bd51fa5452fb4b7e16797679e7..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/EffectInterface.js +++ /dev/null @@ -1,111 +0,0 @@ -import ExpressionPropertyInterface from './ExpressionValueFactory'; -import propertyGroupFactory from './PropertyGroupFactory'; -import PropertyInterface from './PropertyInterface'; - -const EffectsExpressionInterface = (function () { - var ob = { - createEffectsInterface: createEffectsInterface, - }; - - function createEffectsInterface(elem, propertyGroup) { - if (elem.effectsManager) { - var effectElements = []; - var effectsData = elem.data.ef; - var i; - var len = elem.effectsManager.effectElements.length; - for (i = 0; i < len; i += 1) { - effectElements.push(createGroupInterface(effectsData[i], elem.effectsManager.effectElements[i], propertyGroup, elem)); - } - - var effects = elem.data.ef || []; - var groupInterface = function (name) { - i = 0; - len = effects.length; - while (i < len) { - if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) { - return effectElements[i]; - } - i += 1; - } - return null; - }; - Object.defineProperty(groupInterface, 'numProperties', { - get: function () { - return effects.length; - }, - }); - return groupInterface; - } - return null; - } - - function createGroupInterface(data, elements, propertyGroup, elem) { - function groupInterface(name) { - var effects = data.ef; - var i = 0; - var len = effects.length; - while (i < len) { - if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) { - if (effects[i].ty === 5) { - return effectElements[i]; - } - return effectElements[i](); - } - i += 1; - } - throw new Error(); - } - var _propertyGroup = propertyGroupFactory(groupInterface, propertyGroup); - - var effectElements = []; - var i; - var len = data.ef.length; - for (i = 0; i < len; i += 1) { - if (data.ef[i].ty === 5) { - effectElements.push(createGroupInterface(data.ef[i], elements.effectElements[i], elements.effectElements[i].propertyGroup, elem)); - } else { - effectElements.push(createValueInterface(elements.effectElements[i], data.ef[i].ty, elem, _propertyGroup)); - } - } - - if (data.mn === 'ADBE Color Control') { - Object.defineProperty(groupInterface, 'color', { - get: function () { - return effectElements[0](); - }, - }); - } - Object.defineProperties(groupInterface, { - numProperties: { - get: function () { - return data.np; - }, - }, - _name: { value: data.nm }, - propertyGroup: { value: _propertyGroup }, - }); - groupInterface.enabled = data.en !== 0; - groupInterface.active = groupInterface.enabled; - return groupInterface; - } - - function createValueInterface(element, type, elem, propertyGroup) { - var expressionProperty = ExpressionPropertyInterface(element.p); - function interfaceFunction() { - if (type === 10) { - return elem.comp.compInterface(element.p.v); - } - return expressionProperty(); - } - - if (element.p.setGroupProperty) { - element.p.setGroupProperty(PropertyInterface('', propertyGroup)); - } - - return interfaceFunction; - } - - return ob; -}()); - -export default EffectsExpressionInterface; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionManager.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionManager.js deleted file mode 100644 index 65c698ae059ba414cee188e0920f00f474ec34ab..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionManager.js +++ /dev/null @@ -1,743 +0,0 @@ -/* eslint-disable camelcase */ - -import { - degToRads, - BMMath, -} from '../common'; -import { - createTypedArray, -} from '../helpers/arrays'; -import BezierFactory from '../../3rd_party/BezierEaser'; -import shapePool from '../pooling/shape_pool'; -import seedrandom from '../../3rd_party/seedrandom'; -import propTypes from '../helpers/propTypes'; - -const ExpressionManager = (function () { - 'use strict'; - - var ob = {}; - var Math = BMMath; - var window = null; - var document = null; - var XMLHttpRequest = null; - var fetch = null; - var frames = null; - seedrandom(BMMath); - - function $bm_isInstanceOfArray(arr) { - return arr.constructor === Array || arr.constructor === Float32Array; - } - - function isNumerable(tOfV, v) { - return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number; - } - - function $bm_neg(a) { - var tOfA = typeof a; - if (tOfA === 'number' || tOfA === 'boolean' || a instanceof Number) { - return -a; - } - if ($bm_isInstanceOfArray(a)) { - var i; - var lenA = a.length; - var retArr = []; - for (i = 0; i < lenA; i += 1) { - retArr[i] = -a[i]; - } - return retArr; - } - if (a.propType) { - return a.v; - } - return -a; - } - - var easeInBez = BezierFactory.getBezierEasing(0.333, 0, 0.833, 0.833, 'easeIn').get; - var easeOutBez = BezierFactory.getBezierEasing(0.167, 0.167, 0.667, 1, 'easeOut').get; - var easeInOutBez = BezierFactory.getBezierEasing(0.33, 0, 0.667, 1, 'easeInOut').get; - - function sum(a, b) { - var tOfA = typeof a; - var tOfB = typeof b; - if (tOfA === 'string' || tOfB === 'string') { - return a + b; - } - if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) { - return a + b; - } - if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) { - a = a.slice(0); - a[0] += b; - return a; - } - if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) { - b = b.slice(0); - b[0] = a + b[0]; - return b; - } - if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) { - var i = 0; - var lenA = a.length; - var lenB = b.length; - var retArr = []; - while (i < lenA || i < lenB) { - if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) { - retArr[i] = a[i] + b[i]; - } else { - retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i]; - } - i += 1; - } - return retArr; - } - return 0; - } - var add = sum; - - function sub(a, b) { - var tOfA = typeof a; - var tOfB = typeof b; - if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) { - if (tOfA === 'string') { - a = parseInt(a, 10); - } - if (tOfB === 'string') { - b = parseInt(b, 10); - } - return a - b; - } - if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) { - a = a.slice(0); - a[0] -= b; - return a; - } - if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) { - b = b.slice(0); - b[0] = a - b[0]; - return b; - } - if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) { - var i = 0; - var lenA = a.length; - var lenB = b.length; - var retArr = []; - while (i < lenA || i < lenB) { - if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) { - retArr[i] = a[i] - b[i]; - } else { - retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i]; - } - i += 1; - } - return retArr; - } - return 0; - } - - function mul(a, b) { - var tOfA = typeof a; - var tOfB = typeof b; - var arr; - if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) { - return a * b; - } - - var i; - var len; - if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) { - len = a.length; - arr = createTypedArray('float32', len); - for (i = 0; i < len; i += 1) { - arr[i] = a[i] * b; - } - return arr; - } - if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) { - len = b.length; - arr = createTypedArray('float32', len); - for (i = 0; i < len; i += 1) { - arr[i] = a * b[i]; - } - return arr; - } - return 0; - } - - function div(a, b) { - var tOfA = typeof a; - var tOfB = typeof b; - var arr; - if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) { - return a / b; - } - var i; - var len; - if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) { - len = a.length; - arr = createTypedArray('float32', len); - for (i = 0; i < len; i += 1) { - arr[i] = a[i] / b; - } - return arr; - } - if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) { - len = b.length; - arr = createTypedArray('float32', len); - for (i = 0; i < len; i += 1) { - arr[i] = a / b[i]; - } - return arr; - } - return 0; - } - function mod(a, b) { - if (typeof a === 'string') { - a = parseInt(a, 10); - } - if (typeof b === 'string') { - b = parseInt(b, 10); - } - return a % b; - } - var $bm_sum = sum; - var $bm_sub = sub; - var $bm_mul = mul; - var $bm_div = div; - var $bm_mod = mod; - - function clamp(num, min, max) { - if (min > max) { - var mm = max; - max = min; - min = mm; - } - return Math.min(Math.max(num, min), max); - } - - function radiansToDegrees(val) { - return val / degToRads; - } - var radians_to_degrees = radiansToDegrees; - - function degreesToRadians(val) { - return val * degToRads; - } - var degrees_to_radians = radiansToDegrees; - - var helperLengthArray = [0, 0, 0, 0, 0, 0]; - - function length(arr1, arr2) { - if (typeof arr1 === 'number' || arr1 instanceof Number) { - arr2 = arr2 || 0; - return Math.abs(arr1 - arr2); - } - if (!arr2) { - arr2 = helperLengthArray; - } - var i; - var len = Math.min(arr1.length, arr2.length); - var addedLength = 0; - for (i = 0; i < len; i += 1) { - addedLength += Math.pow(arr2[i] - arr1[i], 2); - } - return Math.sqrt(addedLength); - } - - function normalize(vec) { - return div(vec, length(vec)); - } - - function rgbToHsl(val) { - var r = val[0]; var g = val[1]; var b = val[2]; - var max = Math.max(r, g, b); - var min = Math.min(r, g, b); - var h; - var s; - var l = (max + min) / 2; - - if (max === min) { - h = 0; // achromatic - s = 0; // achromatic - } else { - var d = max - min; - s = l > 0.5 ? d / (2 - max - min) : d / (max + min); - switch (max) { - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - default: break; - } - h /= 6; - } - - return [h, s, l, val[3]]; - } - - function hue2rgb(p, q, t) { - if (t < 0) t += 1; - if (t > 1) t -= 1; - if (t < 1 / 6) return p + (q - p) * 6 * t; - if (t < 1 / 2) return q; - if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; - return p; - } - - function hslToRgb(val) { - var h = val[0]; - var s = val[1]; - var l = val[2]; - - var r; - var g; - var b; - - if (s === 0) { - r = l; // achromatic - b = l; // achromatic - g = l; // achromatic - } else { - var q = l < 0.5 ? l * (1 + s) : l + s - l * s; - var p = 2 * l - q; - r = hue2rgb(p, q, h + 1 / 3); - g = hue2rgb(p, q, h); - b = hue2rgb(p, q, h - 1 / 3); - } - - return [r, g, b, val[3]]; - } - - function linear(t, tMin, tMax, value1, value2) { - if (value1 === undefined || value2 === undefined) { - value1 = tMin; - value2 = tMax; - tMin = 0; - tMax = 1; - } - if (tMax < tMin) { - var _tMin = tMax; - tMax = tMin; - tMin = _tMin; - } - if (t <= tMin) { - return value1; - } if (t >= tMax) { - return value2; - } - var perc = tMax === tMin ? 0 : (t - tMin) / (tMax - tMin); - if (!value1.length) { - return value1 + (value2 - value1) * perc; - } - var i; - var len = value1.length; - var arr = createTypedArray('float32', len); - for (i = 0; i < len; i += 1) { - arr[i] = value1[i] + (value2[i] - value1[i]) * perc; - } - return arr; - } - function random(min, max) { - if (max === undefined) { - if (min === undefined) { - min = 0; - max = 1; - } else { - max = min; - min = undefined; - } - } - if (max.length) { - var i; - var len = max.length; - if (!min) { - min = createTypedArray('float32', len); - } - var arr = createTypedArray('float32', len); - var rnd = BMMath.random(); - for (i = 0; i < len; i += 1) { - arr[i] = min[i] + rnd * (max[i] - min[i]); - } - return arr; - } - if (min === undefined) { - min = 0; - } - var rndm = BMMath.random(); - return min + rndm * (max - min); - } - - function createPath(points, inTangents, outTangents, closed) { - var i; - var len = points.length; - var path = shapePool.newElement(); - path.setPathData(!!closed, len); - var arrPlaceholder = [0, 0]; - var inVertexPoint; - var outVertexPoint; - for (i = 0; i < len; i += 1) { - inVertexPoint = (inTangents && inTangents[i]) ? inTangents[i] : arrPlaceholder; - outVertexPoint = (outTangents && outTangents[i]) ? outTangents[i] : arrPlaceholder; - path.setTripleAt(points[i][0], points[i][1], outVertexPoint[0] + points[i][0], outVertexPoint[1] + points[i][1], inVertexPoint[0] + points[i][0], inVertexPoint[1] + points[i][1], i, true); - } - return path; - } - - function initiateExpression(elem, data, property) { - // Bail out if we don't want expressions - function noOp(_value) { - return _value; - } - if (!elem.globalData.renderConfig.runExpressions) { - return noOp; - } - - var val = data.x; - var needsVelocity = /velocity(?![\w\d])/.test(val); - var _needsRandom = val.indexOf('random') !== -1; - var elemType = elem.data.ty; - var transform; - var $bm_transform; - var content; - var effect; - var thisProperty = property; - thisProperty.valueAtTime = thisProperty.getValueAtTime; - Object.defineProperty(thisProperty, 'value', { - get: function () { - return thisProperty.v; - }, - }); - elem.comp.frameDuration = 1 / elem.comp.globalData.frameRate; - elem.comp.displayStartTime = 0; - var inPoint = elem.data.ip / elem.comp.globalData.frameRate; - var outPoint = elem.data.op / elem.comp.globalData.frameRate; - var width = elem.data.sw ? elem.data.sw : 0; - var height = elem.data.sh ? elem.data.sh : 0; - var name = elem.data.nm; - var loopIn; - var loop_in; - var loopOut; - var loop_out; - var smooth; - var toWorld; - var fromWorld; - var fromComp; - var toComp; - var fromCompToSurface; - var position; - var rotation; - var anchorPoint; - var scale; - var thisLayer; - var thisComp; - var mask; - var valueAtTime; - var velocityAtTime; - - var scoped_bm_rt; - // val = val.replace(/(\\?"|')((http)(s)?(:\/))?\/.*?(\\?"|')/g, "\"\""); // deter potential network calls - //eval()用法违反编码规范,使用JSON.parse()方法来替换 - var expressions = '[function _expression_function(){' + val + ';scoped_bm_rt=$bm_rt}]'; - var datas = JSON.parse(expressions); - var expression_function = datas[0]; - var numKeys = property.kf ? data.k.length : 0; - - var active = !this.data || this.data.hd !== true; - - var wiggle = function wiggle(freq, amp) { - var iWiggle; - var j; - var lenWiggle = this.pv.length ? this.pv.length : 1; - var addedAmps = createTypedArray('float32', lenWiggle); - freq = 5; - var iterations = Math.floor(time * freq); - iWiggle = 0; - j = 0; - while (iWiggle < iterations) { - for (j = 0; j < lenWiggle; j += 1) { - addedAmps[j] += -amp + amp * 2 * BMMath.random(); - } - iWiggle += 1; - } - var periods = time * freq; - var perc = periods - Math.floor(periods); - var arr = createTypedArray('float32', lenWiggle); - if (lenWiggle > 1) { - for (j = 0; j < lenWiggle; j += 1) { - arr[j] = this.pv[j] + addedAmps[j] + (-amp + amp * 2 * BMMath.random()) * perc; - } - return arr; - } - return this.pv + addedAmps[0] + (-amp + amp * 2 * BMMath.random()) * perc; - }.bind(this); - - if (thisProperty.loopIn) { - loopIn = thisProperty.loopIn.bind(thisProperty); - loop_in = loopIn; - } - - if (thisProperty.loopOut) { - loopOut = thisProperty.loopOut.bind(thisProperty); - loop_out = loopOut; - } - - if (thisProperty.smooth) { - smooth = thisProperty.smooth.bind(thisProperty); - } - - function loopInDuration(type, duration) { - return loopIn(type, duration, true); - } - - function loopOutDuration(type, duration) { - return loopOut(type, duration, true); - } - - if (this.getValueAtTime) { - valueAtTime = this.getValueAtTime.bind(this); - } - - if (this.getVelocityAtTime) { - velocityAtTime = this.getVelocityAtTime.bind(this); - } - - var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface); - - function lookAt(elem1, elem2) { - var fVec = [elem2[0] - elem1[0], elem2[1] - elem1[1], elem2[2] - elem1[2]]; - var pitch = Math.atan2(fVec[0], Math.sqrt(fVec[1] * fVec[1] + fVec[2] * fVec[2])) / degToRads; - var yaw = -Math.atan2(fVec[1], fVec[2]) / degToRads; - return [yaw, pitch, 0]; - } - - function easeOut(t, tMin, tMax, val1, val2) { - return applyEase(easeOutBez, t, tMin, tMax, val1, val2); - } - - function easeIn(t, tMin, tMax, val1, val2) { - return applyEase(easeInBez, t, tMin, tMax, val1, val2); - } - - function ease(t, tMin, tMax, val1, val2) { - return applyEase(easeInOutBez, t, tMin, tMax, val1, val2); - } - - function applyEase(fn, t, tMin, tMax, val1, val2) { - if (val1 === undefined) { - val1 = tMin; - val2 = tMax; - } else { - t = (t - tMin) / (tMax - tMin); - } - if (t > 1) { - t = 1; - } else if (t < 0) { - t = 0; - } - var mult = fn(t); - if ($bm_isInstanceOfArray(val1)) { - var iKey; - var lenKey = val1.length; - var arr = createTypedArray('float32', lenKey); - for (iKey = 0; iKey < lenKey; iKey += 1) { - arr[iKey] = (val2[iKey] - val1[iKey]) * mult + val1[iKey]; - } - return arr; - } - return (val2 - val1) * mult + val1; - } - - function nearestKey(time) { - var iKey; - var lenKey = data.k.length; - var index; - var keyTime; - if (!data.k.length || typeof (data.k[0]) === 'number') { - index = 0; - keyTime = 0; - } else { - index = -1; - time *= elem.comp.globalData.frameRate; - if (time < data.k[0].t) { - index = 1; - keyTime = data.k[0].t; - } else { - for (iKey = 0; iKey < lenKey - 1; iKey += 1) { - if (time === data.k[iKey].t) { - index = iKey + 1; - keyTime = data.k[iKey].t; - break; - } else if (time > data.k[iKey].t && time < data.k[iKey + 1].t) { - if (time - data.k[iKey].t > data.k[iKey + 1].t - time) { - index = iKey + 2; - keyTime = data.k[iKey + 1].t; - } else { - index = iKey + 1; - keyTime = data.k[iKey].t; - } - break; - } - } - if (index === -1) { - index = iKey + 1; - keyTime = data.k[iKey].t; - } - } - } - var obKey = {}; - obKey.index = index; - obKey.time = keyTime / elem.comp.globalData.frameRate; - return obKey; - } - - function key(ind) { - var obKey; - var iKey; - var lenKey; - if (!data.k.length || typeof (data.k[0]) === 'number') { - throw new Error('The property has no keyframe at index ' + ind); - } - ind -= 1; - obKey = { - time: data.k[ind].t / elem.comp.globalData.frameRate, - value: [], - }; - var arr = Object.prototype.hasOwnProperty.call(data.k[ind], 's') ? data.k[ind].s : data.k[ind - 1].e; - - lenKey = arr.length; - for (iKey = 0; iKey < lenKey; iKey += 1) { - obKey[iKey] = arr[iKey]; - obKey.value[iKey] = arr[iKey]; - } - return obKey; - } - - function framesToTime(fr, fps) { - if (!fps) { - fps = elem.comp.globalData.frameRate; - } - return fr / fps; - } - - function timeToFrames(t, fps) { - if (!t && t !== 0) { - t = time; - } - if (!fps) { - fps = elem.comp.globalData.frameRate; - } - return t * fps; - } - - function seedRandom(seed) { - BMMath.seedrandom(randSeed + seed); - } - - function sourceRectAtTime() { - return elem.sourceRectAtTime(); - } - - function substring(init, end) { - if (typeof value === 'string') { - if (end === undefined) { - return value.substring(init); - } - return value.substring(init, end); - } - return ''; - } - - function substr(init, end) { - if (typeof value === 'string') { - if (end === undefined) { - return value.substr(init); - } - return value.substr(init, end); - } - return ''; - } - - function posterizeTime(framesPerSecond) { - time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond; - value = valueAtTime(time); - } - - var time; - var velocity; - var value; - var text; - var textIndex; - var textTotal; - var selectorValue; - var index = elem.data.ind; - var hasParent = !!(elem.hierarchy && elem.hierarchy.length); - var parent; - var randSeed = Math.floor(Math.random() * 1000000); - var globalData = elem.globalData; - - function executeExpression(_value) { - // globalData.pushExpression(); - value = _value; - if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') { - return value; - } - if (this.propType === 'textSelector') { - textIndex = this.textIndex; - textTotal = this.textTotal; - selectorValue = this.selectorValue; - } - if (!thisLayer) { - text = elem.layerInterface.text; - thisLayer = elem.layerInterface; - thisComp = elem.comp.compInterface; - toWorld = thisLayer.toWorld.bind(thisLayer); - fromWorld = thisLayer.fromWorld.bind(thisLayer); - fromComp = thisLayer.fromComp.bind(thisLayer); - toComp = thisLayer.toComp.bind(thisLayer); - mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null; - fromCompToSurface = fromComp; - } - if (!transform) { - transform = elem.layerInterface('ADBE Transform Group'); - $bm_transform = transform; - if (transform) { - anchorPoint = transform.anchorPoint; - } - } - - if (elemType === 4 && !content) { - content = thisLayer('ADBE Root Vectors Group'); - } - if (!effect) { - effect = thisLayer(4); - } - hasParent = !!(elem.hierarchy && elem.hierarchy.length); - if (hasParent && !parent) { - parent = elem.hierarchy[0].layerInterface; - } - time = this.comp.renderedFrame / this.comp.globalData.frameRate; - if (_needsRandom) { - seedRandom(randSeed + time); - } - if (needsVelocity) { - velocity = velocityAtTime(time); - } - expression_function(); - this.frameExpressionId = elem.globalData.frameId; - - // TODO: Check if it's possible to return on ShapeInterface the .v value - // Changed this to a ternary operation because Rollup failed compiling it correctly - scoped_bm_rt = scoped_bm_rt.propType === propTypes.SHAPE - ? scoped_bm_rt.v - : scoped_bm_rt; - return scoped_bm_rt; - } - // Bundlers will see these as dead code and unless we reference them - executeExpression.__preventDeadCodeRemoval = [$bm_transform, anchorPoint, time, velocity, inPoint, outPoint, width, height, name, loop_in, loop_out, smooth, toComp, fromCompToSurface, toWorld, fromWorld, mask, position, rotation, scale, thisComp, numKeys, active, wiggle, loopInDuration, loopOutDuration, comp, lookAt, easeOut, easeIn, ease, nearestKey, key, text, textIndex, textTotal, selectorValue, framesToTime, timeToFrames, sourceRectAtTime, substring, substr, posterizeTime, index, globalData]; - return executeExpression; - } - - ob.initiateExpression = initiateExpression; - ob.__preventDeadCodeRemoval = [window, document, XMLHttpRequest, fetch, frames, $bm_neg, add, $bm_sum, $bm_sub, $bm_mul, $bm_div, $bm_mod, clamp, radians_to_degrees, degreesToRadians, degrees_to_radians, normalize, rgbToHsl, hslToRgb, linear, random, createPath]; - return ob; -}()); - -export default ExpressionManager; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionPropertyDecorator.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionPropertyDecorator.js deleted file mode 100644 index 4c4ead3d22c81402944381d0013678f885070eec..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionPropertyDecorator.js +++ /dev/null @@ -1,463 +0,0 @@ -import { - extendPrototype, -} from '../functionExtensions'; -import { - createSizedArray, - createTypedArray, -} from '../helpers/arrays'; -import ShapePropertyFactory from '../shapes/ShapeProperty'; -import PropertyFactory from '../PropertyFactory'; -import shapePool from '../pooling/shape_pool'; -import { - initialDefaultFrame, -} from '../../main'; -import bez from '../bez'; -import Matrix from '../../3rd_party/transformation-matrix'; -import TransformPropertyFactory from '../TransformProperty'; -import expressionHelpers from './expressionHelpers'; -import ExpressionManager from './ExpressionManager'; - -function addPropertyDecorator() { - function loopOut(type, duration, durationFlag) { - if (!this.k || !this.keyframes) { - return this.pv; - } - type = type ? type.toLowerCase() : ''; - var currentFrame = this.comp.renderedFrame; - var keyframes = this.keyframes; - var lastKeyFrame = keyframes[keyframes.length - 1].t; - if (currentFrame <= lastKeyFrame) { - return this.pv; - } - var cycleDuration; - var firstKeyFrame; - if (!durationFlag) { - if (!duration || duration > keyframes.length - 1) { - duration = keyframes.length - 1; - } - firstKeyFrame = keyframes[keyframes.length - 1 - duration].t; - cycleDuration = lastKeyFrame - firstKeyFrame; - } else { - if (!duration) { - cycleDuration = Math.max(0, lastKeyFrame - this.elem.data.ip); - } else { - cycleDuration = Math.abs(lastKeyFrame - this.elem.comp.globalData.frameRate * duration); - } - firstKeyFrame = lastKeyFrame - cycleDuration; - } - var i; - var len; - var ret; - if (type === 'pingpong') { - var iterations = Math.floor((currentFrame - firstKeyFrame) / cycleDuration); - if (iterations % 2 !== 0) { - return this.getValueAtTime(((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line - } - } else if (type === 'offset') { - var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0); - var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0); - var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0); // eslint-disable-line - var repeats = Math.floor((currentFrame - firstKeyFrame) / cycleDuration); - if (this.pv.length) { - ret = new Array(initV.length); - len = ret.length; - for (i = 0; i < len; i += 1) { - ret[i] = (endV[i] - initV[i]) * repeats + current[i]; - } - return ret; - } - return (endV - initV) * repeats + current; - } else if (type === 'continue') { - var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0); - var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0); - if (this.pv.length) { - ret = new Array(lastValue.length); - len = ret.length; - for (i = 0; i < len; i += 1) { - ret[i] = lastValue[i] + (lastValue[i] - nextLastValue[i]) * ((currentFrame - lastKeyFrame) / this.comp.globalData.frameRate) / 0.0005; // eslint-disable-line - } - return ret; - } - return lastValue + (lastValue - nextLastValue) * (((currentFrame - lastKeyFrame)) / 0.001); - } - return this.getValueAtTime((((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line - - } - - function loopIn(type, duration, durationFlag) { - if (!this.k) { - return this.pv; - } - type = type ? type.toLowerCase() : ''; - var currentFrame = this.comp.renderedFrame; - var keyframes = this.keyframes; - var firstKeyFrame = keyframes[0].t; - if (currentFrame >= firstKeyFrame) { - return this.pv; - } - var cycleDuration; - var lastKeyFrame; - if (!durationFlag) { - if (!duration || duration > keyframes.length - 1) { - duration = keyframes.length - 1; - } - lastKeyFrame = keyframes[duration].t; - cycleDuration = lastKeyFrame - firstKeyFrame; - } else { - if (!duration) { - cycleDuration = Math.max(0, this.elem.data.op - firstKeyFrame); - } else { - cycleDuration = Math.abs(this.elem.comp.globalData.frameRate * duration); - } - lastKeyFrame = firstKeyFrame + cycleDuration; - } - var i; - var len; - var ret; - if (type === 'pingpong') { - var iterations = Math.floor((firstKeyFrame - currentFrame) / cycleDuration); - if (iterations % 2 === 0) { - return this.getValueAtTime((((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line - } - } else if (type === 'offset') { - var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0); - var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0); - var current = this.getValueAtTime((cycleDuration - ((firstKeyFrame - currentFrame) % cycleDuration) + firstKeyFrame) / this.comp.globalData.frameRate, 0); - var repeats = Math.floor((firstKeyFrame - currentFrame) / cycleDuration) + 1; - if (this.pv.length) { - ret = new Array(initV.length); - len = ret.length; - for (i = 0; i < len; i += 1) { - ret[i] = current[i] - (endV[i] - initV[i]) * repeats; - } - return ret; - } - return current - (endV - initV) * repeats; - } else if (type === 'continue') { - var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0); - var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0); - if (this.pv.length) { - ret = new Array(firstValue.length); - len = ret.length; - for (i = 0; i < len; i += 1) { - ret[i] = firstValue[i] + ((firstValue[i] - nextFirstValue[i]) * (firstKeyFrame - currentFrame)) / 0.001; - } - return ret; - } - return firstValue + ((firstValue - nextFirstValue) * (firstKeyFrame - currentFrame)) / 0.001; - } - return this.getValueAtTime(((cycleDuration - ((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame))) / this.comp.globalData.frameRate, 0); // eslint-disable-line - - } - - function smooth(width, samples) { - if (!this.k) { - return this.pv; - } - width = (width || 0.4) * 0.5; - samples = Math.floor(samples || 5); - if (samples <= 1) { - return this.pv; - } - var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate; - var initFrame = currentTime - width; - var endFrame = currentTime + width; - var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1; - var i = 0; - var j = 0; - var value; - if (this.pv.length) { - value = createTypedArray('float32', this.pv.length); - } else { - value = 0; - } - var sampleValue; - while (i < samples) { - sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency); - if (this.pv.length) { - for (j = 0; j < this.pv.length; j += 1) { - value[j] += sampleValue[j]; - } - } else { - value += sampleValue; - } - i += 1; - } - if (this.pv.length) { - for (j = 0; j < this.pv.length; j += 1) { - value[j] /= samples; - } - } else { - value /= samples; - } - return value; - } - - function getTransformValueAtTime(time) { - if (!this._transformCachingAtTime) { - this._transformCachingAtTime = { - v: new Matrix(), - }; - } - /// / - var matrix = this._transformCachingAtTime.v; - matrix.cloneFromProps(this.pre.props); - if (this.appliedTransformations < 1) { - var anchor = this.a.getValueAtTime(time); - matrix.translate( - -anchor[0] * this.a.mult, - -anchor[1] * this.a.mult, - anchor[2] * this.a.mult - ); - } - if (this.appliedTransformations < 2) { - var scale = this.s.getValueAtTime(time); - matrix.scale( - scale[0] * this.s.mult, - scale[1] * this.s.mult, - scale[2] * this.s.mult - ); - } - if (this.sk && this.appliedTransformations < 3) { - var skew = this.sk.getValueAtTime(time); - var skewAxis = this.sa.getValueAtTime(time); - matrix.skewFromAxis(-skew * this.sk.mult, skewAxis * this.sa.mult); - } - if (this.r && this.appliedTransformations < 4) { - var rotation = this.r.getValueAtTime(time); - matrix.rotate(-rotation * this.r.mult); - } else if (!this.r && this.appliedTransformations < 4) { - var rotationZ = this.rz.getValueAtTime(time); - var rotationY = this.ry.getValueAtTime(time); - var rotationX = this.rx.getValueAtTime(time); - var orientation = this.or.getValueAtTime(time); - matrix.rotateZ(-rotationZ * this.rz.mult) - .rotateY(rotationY * this.ry.mult) - .rotateX(rotationX * this.rx.mult) - .rotateZ(-orientation[2] * this.or.mult) - .rotateY(orientation[1] * this.or.mult) - .rotateX(orientation[0] * this.or.mult); - } - if (this.data.p && this.data.p.s) { - var positionX = this.px.getValueAtTime(time); - var positionY = this.py.getValueAtTime(time); - if (this.data.p.z) { - var positionZ = this.pz.getValueAtTime(time); - matrix.translate( - positionX * this.px.mult, - positionY * this.py.mult, - -positionZ * this.pz.mult - ); - } else { - matrix.translate(positionX * this.px.mult, positionY * this.py.mult, 0); - } - } else { - var position = this.p.getValueAtTime(time); - matrix.translate( - position[0] * this.p.mult, - position[1] * this.p.mult, - -position[2] * this.p.mult - ); - } - return matrix; - /// / - } - - function getTransformStaticValueAtTime() { - return this.v.clone(new Matrix()); - } - - var getTransformProperty = TransformPropertyFactory.getTransformProperty; - TransformPropertyFactory.getTransformProperty = function (elem, data, container) { - var prop = getTransformProperty(elem, data, container); - if (prop.dynamicProperties.length) { - prop.getValueAtTime = getTransformValueAtTime.bind(prop); - } else { - prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop); - } - prop.setGroupProperty = expressionHelpers.setGroupProperty; - return prop; - }; - - var propertyGetProp = PropertyFactory.getProp; - PropertyFactory.getProp = function (elem, data, type, mult, container) { - var prop = propertyGetProp(elem, data, type, mult, container); - // prop.getVelocityAtTime = getVelocityAtTime; - // prop.loopOut = loopOut; - // prop.loopIn = loopIn; - if (prop.kf) { - prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop); - } else { - prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop); - } - prop.setGroupProperty = expressionHelpers.setGroupProperty; - prop.loopOut = loopOut; - prop.loopIn = loopIn; - prop.smooth = smooth; - prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop); - prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop); - prop.numKeys = data.a === 1 ? data.k.length : 0; - prop.propertyIndex = data.ix; - var value = 0; - if (type !== 0) { - value = createTypedArray('float32', data.a === 1 ? data.k[0].s.length : data.k.length); - } - prop._cachingAtTime = { - lastFrame: initialDefaultFrame, - lastIndex: 0, - value: value, - }; - expressionHelpers.searchExpressions(elem, data, prop); - if (prop.k) { - container.addDynamicProperty(prop); - } - - return prop; - }; - - function getShapeValueAtTime(frameNum) { - // For now this caching object is created only when needed instead of creating it when the shape is initialized. - if (!this._cachingAtTime) { - this._cachingAtTime = { - shapeValue: shapePool.clone(this.pv), - lastIndex: 0, - lastTime: initialDefaultFrame, - }; - } - - frameNum *= this.elem.globalData.frameRate; - frameNum -= this.offsetTime; - if (frameNum !== this._cachingAtTime.lastTime) { - this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0; - this._cachingAtTime.lastTime = frameNum; - this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime); - } - return this._cachingAtTime.shapeValue; - } - - var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction(); - var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction(); - - function ShapeExpressions() {} - ShapeExpressions.prototype = { - vertices: function (prop, time) { - if (this.k) { - this.getValue(); - } - var shapePath = this.v; - if (time !== undefined) { - shapePath = this.getValueAtTime(time, 0); - } - var i; - var len = shapePath._length; - var vertices = shapePath[prop]; - var points = shapePath.v; - var arr = createSizedArray(len); - for (i = 0; i < len; i += 1) { - if (prop === 'i' || prop === 'o') { - arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]]; - } else { - arr[i] = [vertices[i][0], vertices[i][1]]; - } - } - return arr; - }, - points: function (time) { - return this.vertices('v', time); - }, - inTangents: function (time) { - return this.vertices('i', time); - }, - outTangents: function (time) { - return this.vertices('o', time); - }, - isClosed: function () { - return this.v.c; - }, - pointOnPath: function (perc, time) { - var shapePath = this.v; - if (time !== undefined) { - shapePath = this.getValueAtTime(time, 0); - } - if (!this._segmentsLength) { - this._segmentsLength = bez.getSegmentsLength(shapePath); - } - - var segmentsLength = this._segmentsLength; - var lengths = segmentsLength.lengths; - var lengthPos = segmentsLength.totalLength * perc; - var i = 0; - var len = lengths.length; - var accumulatedLength = 0; - var pt; - while (i < len) { - if (accumulatedLength + lengths[i].addedLength > lengthPos) { - var initIndex = i; - var endIndex = (shapePath.c && i === len - 1) ? 0 : i + 1; - var segmentPerc = (lengthPos - accumulatedLength) / lengths[i].addedLength; - pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]); - break; - } else { - accumulatedLength += lengths[i].addedLength; - } - i += 1; - } - if (!pt) { - pt = shapePath.c ? [shapePath.v[0][0], shapePath.v[0][1]] : [shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1]]; - } - return pt; - }, - vectorOnPath: function (perc, time, vectorType) { - // perc doesn't use triple equality because it can be a Number object as well as a primitive. - if (perc == 1) { // eslint-disable-line eqeqeq - perc = this.v.c; - } else if (perc == 0) { // eslint-disable-line eqeqeq - perc = 0.999; - } - var pt1 = this.pointOnPath(perc, time); - var pt2 = this.pointOnPath(perc + 0.001, time); - var xLength = pt2[0] - pt1[0]; - var yLength = pt2[1] - pt1[1]; - var magnitude = Math.sqrt(Math.pow(xLength, 2) + Math.pow(yLength, 2)); - if (magnitude === 0) { - return [0, 0]; - } - var unitVector = vectorType === 'tangent' ? [xLength / magnitude, yLength / magnitude] : [-yLength / magnitude, xLength / magnitude]; - return unitVector; - }, - tangentOnPath: function (perc, time) { - return this.vectorOnPath(perc, time, 'tangent'); - }, - normalOnPath: function (perc, time) { - return this.vectorOnPath(perc, time, 'normal'); - }, - setGroupProperty: expressionHelpers.setGroupProperty, - getValueAtTime: expressionHelpers.getStaticValueAtTime, - }; - extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction); - extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction); - KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime; - KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression; - - var propertyGetShapeProp = ShapePropertyFactory.getShapeProp; - ShapePropertyFactory.getShapeProp = function (elem, data, type, arr, trims) { - var prop = propertyGetShapeProp(elem, data, type, arr, trims); - prop.propertyIndex = data.ix; - prop.lock = false; - if (type === 3) { - expressionHelpers.searchExpressions(elem, data.pt, prop); - } else if (type === 4) { - expressionHelpers.searchExpressions(elem, data.ks, prop); - } - if (prop.k) { - elem.addDynamicProperty(prop); - } - return prop; - }; -} - -function initialize() { - addPropertyDecorator(); -} - -export default initialize; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionTextPropertyDecorator.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionTextPropertyDecorator.js deleted file mode 100644 index d777c63e655f47404a8b7ddd75aeb93ea5cd746c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionTextPropertyDecorator.js +++ /dev/null @@ -1,40 +0,0 @@ -import TextProperty from '../text/TextProperty'; -import ExpressionManager from './ExpressionManager'; - -function addDecorator() { - function searchExpressions() { - if (this.data.d.x) { - this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem, this.data.d, this); - this.addEffect(this.getExpressionValue.bind(this)); - return true; - } - return null; - } - - TextProperty.prototype.getExpressionValue = function (currentValue, text) { - var newValue = this.calculateExpression(text); - if (currentValue.t !== newValue) { - var newData = {}; - this.copyData(newData, currentValue); - newData.t = newValue.toString(); - newData.__complete = false; - return newData; - } - return currentValue; - }; - - TextProperty.prototype.searchProperty = function () { - var isKeyframed = this.searchKeyframes(); - var hasExpressions = this.searchExpressions(); - this.kf = isKeyframed || hasExpressions; - return this.kf; - }; - - TextProperty.prototype.searchExpressions = searchExpressions; -} - -function initialize() { - addDecorator(); -} - -export default initialize; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionValue.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionValue.js deleted file mode 100644 index 7088e48c7a6fd55029d05df92ee10ffa4d7be0d1..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionValue.js +++ /dev/null @@ -1,61 +0,0 @@ -import { - createTypedArray, -} from '../helpers/arrays'; - -function ExpressionValue(elementProp, mult, type) { - mult = mult || 1; - var expressionValue; - - if (elementProp.k) { - elementProp.getValue(); - } - var i; - var len; - var arrValue; - var val; - if (type) { - if (type === 'color') { - len = 4; - expressionValue = createTypedArray('float32', len); - arrValue = createTypedArray('float32', len); - for (i = 0; i < len; i += 1) { - arrValue[i] = (i < 3) ? elementProp.v[i] * mult : 1; - expressionValue[i] = arrValue[i]; - } - expressionValue.value = arrValue; - } - } else if (elementProp.propType === 'unidimensional') { - val = elementProp.v * mult; - expressionValue = new Number(val); // eslint-disable-line no-new-wrappers - expressionValue.value = val; - } else { - len = elementProp.pv.length; - expressionValue = createTypedArray('float32', len); - arrValue = createTypedArray('float32', len); - for (i = 0; i < len; i += 1) { - arrValue[i] = elementProp.v[i] * mult; - expressionValue[i] = arrValue[i]; - } - expressionValue.value = arrValue; - } - - expressionValue.numKeys = elementProp.keyframes ? elementProp.keyframes.length : 0; - expressionValue.key = function (pos) { - if (!expressionValue.numKeys) { - return 0; - } - return elementProp.keyframes[pos - 1].t; - }; - expressionValue.valueAtTime = elementProp.getValueAtTime; - expressionValue.speedAtTime = elementProp.getSpeedAtTime; - expressionValue.velocityAtTime = elementProp.getVelocityAtTime; - expressionValue.propertyGroup = elementProp.propertyGroup; - Object.defineProperty(expressionValue, 'velocity', { - get: function () { - return elementProp.getVelocityAtTime(elementProp.comp.currentFrame); - }, - }); - return expressionValue; -} - -export default ExpressionValue; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionValueFactory.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionValueFactory.js deleted file mode 100644 index ea90b4e706f33b4f3e80ee972a5817050037ef6e..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ExpressionValueFactory.js +++ /dev/null @@ -1,101 +0,0 @@ -import { - createTypedArray, -} from '../helpers/arrays'; - -const ExpressionPropertyInterface = (function () { - var defaultUnidimensionalValue = { pv: 0, v: 0, mult: 1 }; - var defaultMultidimensionalValue = { pv: [0, 0, 0], v: [0, 0, 0], mult: 1 }; - - function completeProperty(expressionValue, property, type) { - Object.defineProperty(expressionValue, 'velocity', { - get: function () { - return property.getVelocityAtTime(property.comp.currentFrame); - }, - }); - expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0; - expressionValue.key = function (pos) { - if (!expressionValue.numKeys) { - return 0; - } - var value = ''; - if ('s' in property.keyframes[pos - 1]) { - value = property.keyframes[pos - 1].s; - } else if ('e' in property.keyframes[pos - 2]) { - value = property.keyframes[pos - 2].e; - } else { - value = property.keyframes[pos - 2].s; - } - var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value); // eslint-disable-line no-new-wrappers - valueProp.time = property.keyframes[pos - 1].t / property.elem.comp.globalData.frameRate; - valueProp.value = type === 'unidimensional' ? value[0] : value; - return valueProp; - }; - expressionValue.valueAtTime = property.getValueAtTime; - expressionValue.speedAtTime = property.getSpeedAtTime; - expressionValue.velocityAtTime = property.getVelocityAtTime; - expressionValue.propertyGroup = property.propertyGroup; - } - - function UnidimensionalPropertyInterface(property) { - if (!property || !('pv' in property)) { - property = defaultUnidimensionalValue; - } - var mult = 1 / property.mult; - var val = property.pv * mult; - var expressionValue = new Number(val); // eslint-disable-line no-new-wrappers - expressionValue.value = val; - completeProperty(expressionValue, property, 'unidimensional'); - - return function () { - if (property.k) { - property.getValue(); - } - val = property.v * mult; - if (expressionValue.value !== val) { - expressionValue = new Number(val); // eslint-disable-line no-new-wrappers - expressionValue.value = val; - completeProperty(expressionValue, property, 'unidimensional'); - } - return expressionValue; - }; - } - - function MultidimensionalPropertyInterface(property) { - if (!property || !('pv' in property)) { - property = defaultMultidimensionalValue; - } - var mult = 1 / property.mult; - var len = (property.data && property.data.l) || property.pv.length; - var expressionValue = createTypedArray('float32', len); - var arrValue = createTypedArray('float32', len); - expressionValue.value = arrValue; - completeProperty(expressionValue, property, 'multidimensional'); - - return function () { - if (property.k) { - property.getValue(); - } - for (var i = 0; i < len; i += 1) { - arrValue[i] = property.v[i] * mult; - expressionValue[i] = arrValue[i]; - } - return expressionValue; - }; - } - - // TODO: try to avoid using this getter - function defaultGetter() { - return defaultUnidimensionalValue; - } - - return function (property) { - if (!property) { - return defaultGetter; - } if (property.propType === 'unidimensional') { - return UnidimensionalPropertyInterface(property); - } - return MultidimensionalPropertyInterface(property); - }; -}()); - -export default ExpressionPropertyInterface; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/Expressions.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/Expressions.js deleted file mode 100644 index 8355a73fa17caf6ab6e598674300c294690c272d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/Expressions.js +++ /dev/null @@ -1,46 +0,0 @@ -import CompExpressionInterface from './CompInterface'; - -const Expressions = (function () { - var ob = {}; - ob.initExpressions = initExpressions; - - function initExpressions(animation) { - var stackCount = 0; - var registers = []; - - function pushExpression() { - stackCount += 1; - } - - function popExpression() { - stackCount -= 1; - if (stackCount === 0) { - releaseInstances(); - } - } - - function registerExpressionProperty(expression) { - if (registers.indexOf(expression) === -1) { - registers.push(expression); - } - } - - function releaseInstances() { - var i; - var len = registers.length; - for (i = 0; i < len; i += 1) { - registers[i].release(); - } - registers.length = 0; - } - - animation.renderer.compInterface = CompExpressionInterface(animation.renderer); - animation.renderer.globalData.projectInterface.registerComposition(animation.renderer); - animation.renderer.globalData.pushExpression = pushExpression; - animation.renderer.globalData.popExpression = popExpression; - animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty; - } - return ob; -}()); - -export default Expressions; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/FootageInterface.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/FootageInterface.js deleted file mode 100644 index 27b8be988f2195f97d082769ef84f469b8290f69..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/FootageInterface.js +++ /dev/null @@ -1,60 +0,0 @@ -const FootageInterface = (function () { - var outlineInterfaceFactory = (function (elem) { - var currentPropertyName = ''; - var currentProperty = elem.getFootageData(); - function init() { - currentPropertyName = ''; - currentProperty = elem.getFootageData(); - return searchProperty; - } - function searchProperty(value) { - if (currentProperty[value]) { - currentPropertyName = value; - currentProperty = currentProperty[value]; - if (typeof currentProperty === 'object') { - return searchProperty; - } - return currentProperty; - } - var propertyNameIndex = value.indexOf(currentPropertyName); - if (propertyNameIndex !== -1) { - var index = parseInt(value.substr(propertyNameIndex + currentPropertyName.length), 10); - currentProperty = currentProperty[index]; - if (typeof currentProperty === 'object') { - return searchProperty; - } - return currentProperty; - } - return ''; - } - return init; - }); - - var dataInterfaceFactory = function (elem) { - function interfaceFunction(value) { - if (value === 'Outline') { - return interfaceFunction.outlineInterface(); - } - return null; - } - - interfaceFunction._name = 'Outline'; - interfaceFunction.outlineInterface = outlineInterfaceFactory(elem); - return interfaceFunction; - }; - - return function (elem) { - function _interfaceFunction(value) { - if (value === 'Data') { - return _interfaceFunction.dataInterface; - } - return null; - } - - _interfaceFunction._name = 'Data'; - _interfaceFunction.dataInterface = dataInterfaceFactory(elem); - return _interfaceFunction; - }; -}()); - -export default FootageInterface; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/InterfacesProvider.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/InterfacesProvider.js deleted file mode 100644 index 22accf1bed065ddb23de4b021f421eef49f72177..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/InterfacesProvider.js +++ /dev/null @@ -1,21 +0,0 @@ -import LayerExpressionInterface from './LayerInterface'; -import EffectsExpressionInterface from './EffectInterface'; -import CompExpressionInterface from './CompInterface'; -import ShapeExpressionInterface from './ShapeInterface'; -import TextExpressionInterface from './TextInterface'; -import FootageInterface from './FootageInterface'; - -var interfaces = { - layer: LayerExpressionInterface, - effects: EffectsExpressionInterface, - comp: CompExpressionInterface, - shape: ShapeExpressionInterface, - text: TextExpressionInterface, - footage: FootageInterface, -}; - -function getInterface(type) { - return interfaces[type] || null; -} - -export default getInterface; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/LayerInterface.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/LayerInterface.js deleted file mode 100644 index e1a17cdacab3f73936929c38a6a595ba4f710a81..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/LayerInterface.js +++ /dev/null @@ -1,179 +0,0 @@ -import { - getDescriptor, -} from '../functionExtensions'; -import Matrix from '../../3rd_party/transformation-matrix'; -import MaskManagerInterface from './MaskInterface'; -import TransformExpressionInterface from './TransformInterface'; - -const LayerExpressionInterface = (function () { - function getMatrix(time) { - var toWorldMat = new Matrix(); - if (time !== undefined) { - var propMatrix = this._elem.finalTransform.mProp.getValueAtTime(time); - propMatrix.clone(toWorldMat); - } else { - var transformMat = this._elem.finalTransform.mProp; - transformMat.applyToMatrix(toWorldMat); - } - return toWorldMat; - } - - function toWorldVec(arr, time) { - var toWorldMat = this.getMatrix(time); - toWorldMat.props[12] = 0; - toWorldMat.props[13] = 0; - toWorldMat.props[14] = 0; - return this.applyPoint(toWorldMat, arr); - } - - function toWorld(arr, time) { - var toWorldMat = this.getMatrix(time); - return this.applyPoint(toWorldMat, arr); - } - - function fromWorldVec(arr, time) { - var toWorldMat = this.getMatrix(time); - toWorldMat.props[12] = 0; - toWorldMat.props[13] = 0; - toWorldMat.props[14] = 0; - return this.invertPoint(toWorldMat, arr); - } - - function fromWorld(arr, time) { - var toWorldMat = this.getMatrix(time); - return this.invertPoint(toWorldMat, arr); - } - - function applyPoint(matrix, arr) { - if (this._elem.hierarchy && this._elem.hierarchy.length) { - var i; - var len = this._elem.hierarchy.length; - for (i = 0; i < len; i += 1) { - this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix); - } - } - return matrix.applyToPointArray(arr[0], arr[1], arr[2] || 0); - } - - function invertPoint(matrix, arr) { - if (this._elem.hierarchy && this._elem.hierarchy.length) { - var i; - var len = this._elem.hierarchy.length; - for (i = 0; i < len; i += 1) { - this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix); - } - } - return matrix.inversePoint(arr); - } - - function fromComp(arr) { - var toWorldMat = new Matrix(); - toWorldMat.reset(); - this._elem.finalTransform.mProp.applyToMatrix(toWorldMat); - if (this._elem.hierarchy && this._elem.hierarchy.length) { - var i; - var len = this._elem.hierarchy.length; - for (i = 0; i < len; i += 1) { - this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat); - } - return toWorldMat.inversePoint(arr); - } - return toWorldMat.inversePoint(arr); - } - - function sampleImage() { - return [1, 1, 1, 1]; - } - - return function (elem) { - var transformInterface; - - function _registerMaskInterface(maskManager) { - _thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem); - } - function _registerEffectsInterface(effects) { - _thisLayerFunction.effect = effects; - } - - function _thisLayerFunction(name) { - switch (name) { - case 'ADBE Root Vectors Group': - case 'Contents': - case 2: - return _thisLayerFunction.shapeInterface; - case 1: - case 6: - case 'Transform': - case 'transform': - case 'ADBE Transform Group': - return transformInterface; - case 4: - case 'ADBE Effect Parade': - case 'effects': - case 'Effects': - return _thisLayerFunction.effect; - case 'ADBE Text Properties': - return _thisLayerFunction.textInterface; - default: - return null; - } - } - _thisLayerFunction.getMatrix = getMatrix; - _thisLayerFunction.invertPoint = invertPoint; - _thisLayerFunction.applyPoint = applyPoint; - _thisLayerFunction.toWorld = toWorld; - _thisLayerFunction.toWorldVec = toWorldVec; - _thisLayerFunction.fromWorld = fromWorld; - _thisLayerFunction.fromWorldVec = fromWorldVec; - _thisLayerFunction.toComp = toWorld; - _thisLayerFunction.fromComp = fromComp; - _thisLayerFunction.sampleImage = sampleImage; - _thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem); - _thisLayerFunction._elem = elem; - transformInterface = TransformExpressionInterface(elem.finalTransform.mProp); - var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint'); - Object.defineProperties(_thisLayerFunction, { - hasParent: { - get: function () { - return elem.hierarchy.length; - }, - }, - parent: { - get: function () { - return elem.hierarchy[0].layerInterface; - }, - }, - rotation: getDescriptor(transformInterface, 'rotation'), - scale: getDescriptor(transformInterface, 'scale'), - position: getDescriptor(transformInterface, 'position'), - opacity: getDescriptor(transformInterface, 'opacity'), - anchorPoint: anchorPointDescriptor, - anchor_point: anchorPointDescriptor, - transform: { - get: function () { - return transformInterface; - }, - }, - active: { - get: function () { - return elem.isInRange; - }, - }, - }); - - _thisLayerFunction.startTime = elem.data.st; - _thisLayerFunction.index = elem.data.ind; - _thisLayerFunction.source = elem.data.refId; - _thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100; - _thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100; - _thisLayerFunction.inPoint = elem.data.ip / elem.comp.globalData.frameRate; - _thisLayerFunction.outPoint = elem.data.op / elem.comp.globalData.frameRate; - _thisLayerFunction._name = elem.data.nm; - - _thisLayerFunction.registerMaskInterface = _registerMaskInterface; - _thisLayerFunction.registerEffectsInterface = _registerEffectsInterface; - return _thisLayerFunction; - }; -}()); - -export default LayerExpressionInterface; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/MaskInterface.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/MaskInterface.js deleted file mode 100644 index f3232d6668deb750866c2b014eabd7d83200cad7..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/MaskInterface.js +++ /dev/null @@ -1,50 +0,0 @@ -import { - createSizedArray, -} from '../helpers/arrays'; - -const MaskManagerInterface = (function () { - function MaskInterface(mask, data) { - this._mask = mask; - this._data = data; - } - Object.defineProperty(MaskInterface.prototype, 'maskPath', { - get: function () { - if (this._mask.prop.k) { - this._mask.prop.getValue(); - } - return this._mask.prop; - }, - }); - Object.defineProperty(MaskInterface.prototype, 'maskOpacity', { - get: function () { - if (this._mask.op.k) { - this._mask.op.getValue(); - } - return this._mask.op.v * 100; - }, - }); - - var MaskManager = function (maskManager) { - var _masksInterfaces = createSizedArray(maskManager.viewData.length); - var i; - var len = maskManager.viewData.length; - for (i = 0; i < len; i += 1) { - _masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]); - } - - var maskFunction = function (name) { - i = 0; - while (i < len) { - if (maskManager.masksProperties[i].nm === name) { - return _masksInterfaces[i]; - } - i += 1; - } - return null; - }; - return maskFunction; - }; - return MaskManager; -}()); - -export default MaskManagerInterface; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ProjectInterface.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ProjectInterface.js deleted file mode 100644 index db59500fdf6c6ba763589a8132fd54f763b23874..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ProjectInterface.js +++ /dev/null @@ -1,31 +0,0 @@ -const ProjectInterface = (function () { - function registerComposition(comp) { - this.compositions.push(comp); - } - - return function () { - function _thisProjectFunction(name) { - var i = 0; - var len = this.compositions.length; - while (i < len) { - if (this.compositions[i].data && this.compositions[i].data.nm === name) { - if (this.compositions[i].prepareFrame && this.compositions[i].data.xt) { - this.compositions[i].prepareFrame(this.currentFrame); - } - return this.compositions[i].compInterface; - } - i += 1; - } - return null; - } - - _thisProjectFunction.compositions = []; - _thisProjectFunction.currentFrame = 0; - - _thisProjectFunction.registerComposition = registerComposition; - - return _thisProjectFunction; - }; -}()); - -export default ProjectInterface; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/PropertyGroupFactory.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/PropertyGroupFactory.js deleted file mode 100644 index bd9b63264d0be4ce15425158e7854b8e896c8344..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/PropertyGroupFactory.js +++ /dev/null @@ -1,13 +0,0 @@ -const propertyGroupFactory = (function () { - return function (interfaceFunction, parentPropertyGroup) { - return function (val) { - val = val === undefined ? 1 : val; - if (val <= 0) { - return interfaceFunction; - } - return parentPropertyGroup(val - 1); - }; - }; -}()); - -export default propertyGroupFactory; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/PropertyInterface.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/PropertyInterface.js deleted file mode 100644 index 5e8a09653572dcdbca48137bd3a07615b9a89f3d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/PropertyInterface.js +++ /dev/null @@ -1,19 +0,0 @@ -const PropertyInterface = (function () { - return function (propertyName, propertyGroup) { - var interfaceFunction = { - _name: propertyName, - }; - - function _propertyGroup(val) { - val = val === undefined ? 1 : val; - if (val <= 0) { - return interfaceFunction; - } - return propertyGroup(val - 1); - } - - return _propertyGroup; - }; -}()); - -export default PropertyInterface; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ShapeInterface.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ShapeInterface.js deleted file mode 100644 index b2c6c8ffa46e6e50c2fabc8e3a4f669e3b48b6e6..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/ShapeInterface.js +++ /dev/null @@ -1,543 +0,0 @@ -import ExpressionPropertyInterface from './ExpressionValueFactory'; -import propertyGroupFactory from './PropertyGroupFactory'; -import PropertyInterface from './PropertyInterface'; -import ShapePathInterface from './shapes/ShapePathInterface'; - -const ShapeExpressionInterface = (function () { - function iterateElements(shapes, view, propertyGroup) { - var arr = []; - var i; - var len = shapes ? shapes.length : 0; - for (i = 0; i < len; i += 1) { - if (shapes[i].ty === 'gr') { - arr.push(groupInterfaceFactory(shapes[i], view[i], propertyGroup)); - } else if (shapes[i].ty === 'fl') { - arr.push(fillInterfaceFactory(shapes[i], view[i], propertyGroup)); - } else if (shapes[i].ty === 'st') { - arr.push(strokeInterfaceFactory(shapes[i], view[i], propertyGroup)); - } else if (shapes[i].ty === 'tm') { - arr.push(trimInterfaceFactory(shapes[i], view[i], propertyGroup)); - } else if (shapes[i].ty === 'tr') { - // arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup)); - } else if (shapes[i].ty === 'el') { - arr.push(ellipseInterfaceFactory(shapes[i], view[i], propertyGroup)); - } else if (shapes[i].ty === 'sr') { - arr.push(starInterfaceFactory(shapes[i], view[i], propertyGroup)); - } else if (shapes[i].ty === 'sh') { - arr.push(ShapePathInterface(shapes[i], view[i], propertyGroup)); - } else if (shapes[i].ty === 'rc') { - arr.push(rectInterfaceFactory(shapes[i], view[i], propertyGroup)); - } else if (shapes[i].ty === 'rd') { - arr.push(roundedInterfaceFactory(shapes[i], view[i], propertyGroup)); - } else if (shapes[i].ty === 'rp') { - arr.push(repeaterInterfaceFactory(shapes[i], view[i], propertyGroup)); - } else if (shapes[i].ty === 'gf') { - arr.push(gradientFillInterfaceFactory(shapes[i], view[i], propertyGroup)); - } else { - arr.push(defaultInterfaceFactory(shapes[i], view[i], propertyGroup)); - } - } - return arr; - } - - function contentsInterfaceFactory(shape, view, propertyGroup) { - var interfaces; - var interfaceFunction = function _interfaceFunction(value) { - var i = 0; - var len = interfaces.length; - while (i < len) { - if (interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value) { - return interfaces[i]; - } - i += 1; - } - if (typeof value === 'number') { - return interfaces[value - 1]; - } - return null; - }; - - interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup); - interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup); - interfaceFunction.numProperties = interfaces.length; - var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup); - interfaceFunction.transform = transformInterface; - interfaceFunction.propertyIndex = shape.cix; - interfaceFunction._name = shape.nm; - - return interfaceFunction; - } - - function groupInterfaceFactory(shape, view, propertyGroup) { - var interfaceFunction = function _interfaceFunction(value) { - switch (value) { - case 'ADBE Vectors Group': - case 'Contents': - case 2: - return interfaceFunction.content; - // Not necessary for now. Keeping them here in case a new case appears - // case 'ADBE Vector Transform Group': - // case 3: - default: - return interfaceFunction.transform; - } - }; - interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup); - var content = contentsInterfaceFactory(shape, view, interfaceFunction.propertyGroup); - var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup); - interfaceFunction.content = content; - interfaceFunction.transform = transformInterface; - Object.defineProperty(interfaceFunction, '_name', { - get: function () { - return shape.nm; - }, - }); - // interfaceFunction.content = interfaceFunction; - interfaceFunction.numProperties = shape.np; - interfaceFunction.propertyIndex = shape.ix; - interfaceFunction.nm = shape.nm; - interfaceFunction.mn = shape.mn; - return interfaceFunction; - } - - function fillInterfaceFactory(shape, view, propertyGroup) { - function interfaceFunction(val) { - if (val === 'Color' || val === 'color') { - return interfaceFunction.color; - } if (val === 'Opacity' || val === 'opacity') { - return interfaceFunction.opacity; - } - return null; - } - Object.defineProperties(interfaceFunction, { - color: { - get: ExpressionPropertyInterface(view.c), - }, - opacity: { - get: ExpressionPropertyInterface(view.o), - }, - _name: { value: shape.nm }, - mn: { value: shape.mn }, - }); - - view.c.setGroupProperty(PropertyInterface('Color', propertyGroup)); - view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup)); - return interfaceFunction; - } - - function gradientFillInterfaceFactory(shape, view, propertyGroup) { - function interfaceFunction(val) { - if (val === 'Start Point' || val === 'start point') { - return interfaceFunction.startPoint; - } - if (val === 'End Point' || val === 'end point') { - return interfaceFunction.endPoint; - } - if (val === 'Opacity' || val === 'opacity') { - return interfaceFunction.opacity; - } - return null; - } - Object.defineProperties(interfaceFunction, { - startPoint: { - get: ExpressionPropertyInterface(view.s), - }, - endPoint: { - get: ExpressionPropertyInterface(view.e), - }, - opacity: { - get: ExpressionPropertyInterface(view.o), - }, - type: { - get: function () { - return 'a'; - }, - }, - _name: { value: shape.nm }, - mn: { value: shape.mn }, - }); - - view.s.setGroupProperty(PropertyInterface('Start Point', propertyGroup)); - view.e.setGroupProperty(PropertyInterface('End Point', propertyGroup)); - view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup)); - return interfaceFunction; - } - function defaultInterfaceFactory() { - function interfaceFunction() { - return null; - } - return interfaceFunction; - } - - function strokeInterfaceFactory(shape, view, propertyGroup) { - var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup); - var _dashPropertyGroup = propertyGroupFactory(dashOb, _propertyGroup); - function addPropertyToDashOb(i) { - Object.defineProperty(dashOb, shape.d[i].nm, { - get: ExpressionPropertyInterface(view.d.dataProps[i].p), - }); - } - var i; - var len = shape.d ? shape.d.length : 0; - var dashOb = {}; - for (i = 0; i < len; i += 1) { - addPropertyToDashOb(i); - view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup); - } - - function interfaceFunction(val) { - if (val === 'Color' || val === 'color') { - return interfaceFunction.color; - } if (val === 'Opacity' || val === 'opacity') { - return interfaceFunction.opacity; - } if (val === 'Stroke Width' || val === 'stroke width') { - return interfaceFunction.strokeWidth; - } - return null; - } - Object.defineProperties(interfaceFunction, { - color: { - get: ExpressionPropertyInterface(view.c), - }, - opacity: { - get: ExpressionPropertyInterface(view.o), - }, - strokeWidth: { - get: ExpressionPropertyInterface(view.w), - }, - dash: { - get: function () { - return dashOb; - }, - }, - _name: { value: shape.nm }, - mn: { value: shape.mn }, - }); - - view.c.setGroupProperty(PropertyInterface('Color', _propertyGroup)); - view.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup)); - view.w.setGroupProperty(PropertyInterface('Stroke Width', _propertyGroup)); - return interfaceFunction; - } - - function trimInterfaceFactory(shape, view, propertyGroup) { - function interfaceFunction(val) { - if (val === shape.e.ix || val === 'End' || val === 'end') { - return interfaceFunction.end; - } - if (val === shape.s.ix) { - return interfaceFunction.start; - } - if (val === shape.o.ix) { - return interfaceFunction.offset; - } - return null; - } - - var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup); - interfaceFunction.propertyIndex = shape.ix; - - view.s.setGroupProperty(PropertyInterface('Start', _propertyGroup)); - view.e.setGroupProperty(PropertyInterface('End', _propertyGroup)); - view.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup)); - interfaceFunction.propertyIndex = shape.ix; - interfaceFunction.propertyGroup = propertyGroup; - - Object.defineProperties(interfaceFunction, { - start: { - get: ExpressionPropertyInterface(view.s), - }, - end: { - get: ExpressionPropertyInterface(view.e), - }, - offset: { - get: ExpressionPropertyInterface(view.o), - }, - _name: { value: shape.nm }, - }); - interfaceFunction.mn = shape.mn; - return interfaceFunction; - } - - function transformInterfaceFactory(shape, view, propertyGroup) { - function interfaceFunction(value) { - if (shape.a.ix === value || value === 'Anchor Point') { - return interfaceFunction.anchorPoint; - } - if (shape.o.ix === value || value === 'Opacity') { - return interfaceFunction.opacity; - } - if (shape.p.ix === value || value === 'Position') { - return interfaceFunction.position; - } - if (shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation') { - return interfaceFunction.rotation; - } - if (shape.s.ix === value || value === 'Scale') { - return interfaceFunction.scale; - } - if ((shape.sk && shape.sk.ix === value) || value === 'Skew') { - return interfaceFunction.skew; - } - if ((shape.sa && shape.sa.ix === value) || value === 'Skew Axis') { - return interfaceFunction.skewAxis; - } - return null; - } - var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup); - view.transform.mProps.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup)); - view.transform.mProps.p.setGroupProperty(PropertyInterface('Position', _propertyGroup)); - view.transform.mProps.a.setGroupProperty(PropertyInterface('Anchor Point', _propertyGroup)); - view.transform.mProps.s.setGroupProperty(PropertyInterface('Scale', _propertyGroup)); - view.transform.mProps.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup)); - if (view.transform.mProps.sk) { - view.transform.mProps.sk.setGroupProperty(PropertyInterface('Skew', _propertyGroup)); - view.transform.mProps.sa.setGroupProperty(PropertyInterface('Skew Angle', _propertyGroup)); - } - view.transform.op.setGroupProperty(PropertyInterface('Opacity', _propertyGroup)); - Object.defineProperties(interfaceFunction, { - opacity: { - get: ExpressionPropertyInterface(view.transform.mProps.o), - }, - position: { - get: ExpressionPropertyInterface(view.transform.mProps.p), - }, - anchorPoint: { - get: ExpressionPropertyInterface(view.transform.mProps.a), - }, - scale: { - get: ExpressionPropertyInterface(view.transform.mProps.s), - }, - rotation: { - get: ExpressionPropertyInterface(view.transform.mProps.r), - }, - skew: { - get: ExpressionPropertyInterface(view.transform.mProps.sk), - }, - skewAxis: { - get: ExpressionPropertyInterface(view.transform.mProps.sa), - }, - _name: { value: shape.nm }, - }); - interfaceFunction.ty = 'tr'; - interfaceFunction.mn = shape.mn; - interfaceFunction.propertyGroup = propertyGroup; - return interfaceFunction; - } - - function ellipseInterfaceFactory(shape, view, propertyGroup) { - function interfaceFunction(value) { - if (shape.p.ix === value) { - return interfaceFunction.position; - } - if (shape.s.ix === value) { - return interfaceFunction.size; - } - return null; - } - var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup); - interfaceFunction.propertyIndex = shape.ix; - var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh; - prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup)); - prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup)); - - Object.defineProperties(interfaceFunction, { - size: { - get: ExpressionPropertyInterface(prop.s), - }, - position: { - get: ExpressionPropertyInterface(prop.p), - }, - _name: { value: shape.nm }, - }); - interfaceFunction.mn = shape.mn; - return interfaceFunction; - } - - function starInterfaceFactory(shape, view, propertyGroup) { - function interfaceFunction(value) { - if (shape.p.ix === value) { - return interfaceFunction.position; - } - if (shape.r.ix === value) { - return interfaceFunction.rotation; - } - if (shape.pt.ix === value) { - return interfaceFunction.points; - } - if (shape.or.ix === value || value === 'ADBE Vector Star Outer Radius') { - return interfaceFunction.outerRadius; - } - if (shape.os.ix === value) { - return interfaceFunction.outerRoundness; - } - if (shape.ir && (shape.ir.ix === value || value === 'ADBE Vector Star Inner Radius')) { - return interfaceFunction.innerRadius; - } - if (shape.is && shape.is.ix === value) { - return interfaceFunction.innerRoundness; - } - return null; - } - - var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup); - var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh; - interfaceFunction.propertyIndex = shape.ix; - prop.or.setGroupProperty(PropertyInterface('Outer Radius', _propertyGroup)); - prop.os.setGroupProperty(PropertyInterface('Outer Roundness', _propertyGroup)); - prop.pt.setGroupProperty(PropertyInterface('Points', _propertyGroup)); - prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup)); - prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup)); - if (shape.ir) { - prop.ir.setGroupProperty(PropertyInterface('Inner Radius', _propertyGroup)); - prop.is.setGroupProperty(PropertyInterface('Inner Roundness', _propertyGroup)); - } - - Object.defineProperties(interfaceFunction, { - position: { - get: ExpressionPropertyInterface(prop.p), - }, - rotation: { - get: ExpressionPropertyInterface(prop.r), - }, - points: { - get: ExpressionPropertyInterface(prop.pt), - }, - outerRadius: { - get: ExpressionPropertyInterface(prop.or), - }, - outerRoundness: { - get: ExpressionPropertyInterface(prop.os), - }, - innerRadius: { - get: ExpressionPropertyInterface(prop.ir), - }, - innerRoundness: { - get: ExpressionPropertyInterface(prop.is), - }, - _name: { value: shape.nm }, - }); - interfaceFunction.mn = shape.mn; - return interfaceFunction; - } - - function rectInterfaceFactory(shape, view, propertyGroup) { - function interfaceFunction(value) { - if (shape.p.ix === value) { - return interfaceFunction.position; - } - if (shape.r.ix === value) { - return interfaceFunction.roundness; - } - if (shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size') { - return interfaceFunction.size; - } - return null; - } - var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup); - - var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh; - interfaceFunction.propertyIndex = shape.ix; - prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup)); - prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup)); - prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup)); - - Object.defineProperties(interfaceFunction, { - position: { - get: ExpressionPropertyInterface(prop.p), - }, - roundness: { - get: ExpressionPropertyInterface(prop.r), - }, - size: { - get: ExpressionPropertyInterface(prop.s), - }, - _name: { value: shape.nm }, - }); - interfaceFunction.mn = shape.mn; - return interfaceFunction; - } - - function roundedInterfaceFactory(shape, view, propertyGroup) { - function interfaceFunction(value) { - if (shape.r.ix === value || value === 'Round Corners 1') { - return interfaceFunction.radius; - } - return null; - } - - var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup); - var prop = view; - interfaceFunction.propertyIndex = shape.ix; - prop.rd.setGroupProperty(PropertyInterface('Radius', _propertyGroup)); - - Object.defineProperties(interfaceFunction, { - radius: { - get: ExpressionPropertyInterface(prop.rd), - }, - _name: { value: shape.nm }, - }); - interfaceFunction.mn = shape.mn; - return interfaceFunction; - } - - function repeaterInterfaceFactory(shape, view, propertyGroup) { - function interfaceFunction(value) { - if (shape.c.ix === value || value === 'Copies') { - return interfaceFunction.copies; - } if (shape.o.ix === value || value === 'Offset') { - return interfaceFunction.offset; - } - return null; - } - - var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup); - var prop = view; - interfaceFunction.propertyIndex = shape.ix; - prop.c.setGroupProperty(PropertyInterface('Copies', _propertyGroup)); - prop.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup)); - Object.defineProperties(interfaceFunction, { - copies: { - get: ExpressionPropertyInterface(prop.c), - }, - offset: { - get: ExpressionPropertyInterface(prop.o), - }, - _name: { value: shape.nm }, - }); - interfaceFunction.mn = shape.mn; - return interfaceFunction; - } - - return function (shapes, view, propertyGroup) { - var interfaces; - function _interfaceFunction(value) { - if (typeof value === 'number') { - value = value === undefined ? 1 : value; - if (value === 0) { - return propertyGroup; - } - return interfaces[value - 1]; - } - var i = 0; - var len = interfaces.length; - while (i < len) { - if (interfaces[i]._name === value) { - return interfaces[i]; - } - i += 1; - } - return null; - } - function parentGroupWrapper() { - return propertyGroup; - } - _interfaceFunction.propertyGroup = propertyGroupFactory(_interfaceFunction, parentGroupWrapper); - interfaces = iterateElements(shapes, view, _interfaceFunction.propertyGroup); - _interfaceFunction.numProperties = interfaces.length; - _interfaceFunction._name = 'Contents'; - return _interfaceFunction; - }; -}()); - -export default ShapeExpressionInterface; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/TextInterface.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/TextInterface.js deleted file mode 100644 index dc59ecb52a1b30ac3db62d6d2606cefd32a410ff..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/TextInterface.js +++ /dev/null @@ -1,35 +0,0 @@ -const TextExpressionInterface = (function () { - return function (elem) { - var _sourceText; - function _thisLayerFunction(name) { - switch (name) { - case 'ADBE Text Document': - return _thisLayerFunction.sourceText; - default: - return null; - } - } - Object.defineProperty(_thisLayerFunction, 'sourceText', { - get: function () { - elem.textProperty.getValue(); - var stringValue = elem.textProperty.currentData.t; - if (!_sourceText || stringValue !== _sourceText.value) { - _sourceText = new String(stringValue); // eslint-disable-line no-new-wrappers - // If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive - _sourceText.value = stringValue || new String(stringValue); // eslint-disable-line no-new-wrappers - Object.defineProperty(_sourceText, 'style', { - get: function () { - return { - fillColor: elem.textProperty.currentData.fc, - }; - }, - }); - } - return _sourceText; - }, - }); - return _thisLayerFunction; - }; -}()); - -export default TextExpressionInterface; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/TextSelectorPropertyDecorator.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/TextSelectorPropertyDecorator.js deleted file mode 100644 index 5b4c000d17d7cbc68625eaee772be84f7ead7f99..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/TextSelectorPropertyDecorator.js +++ /dev/null @@ -1,44 +0,0 @@ -import ExpressionManager from './ExpressionManager'; -import expressionHelpers from './expressionHelpers'; -import TextSelectorProp from '../text/TextSelectorProperty'; - -const TextExpressionSelectorPropFactory = (function () { // eslint-disable-line no-unused-vars - function getValueProxy(index, total) { - this.textIndex = index + 1; - this.textTotal = total; - this.v = this.getValue() * this.mult; - return this.v; - } - - return function (elem, data) { - this.pv = 1; - this.comp = elem.comp; - this.elem = elem; - this.mult = 0.01; - this.propType = 'textSelector'; - this.textTotal = data.totalChars; - this.selectorValue = 100; - this.lastValue = [1, 1, 1]; - this.k = true; - this.x = true; - this.getValue = ExpressionManager.initiateExpression.bind(this)(elem, data, this); - this.getMult = getValueProxy; - this.getVelocityAtTime = expressionHelpers.getVelocityAtTime; - if (this.kf) { - this.getValueAtTime = expressionHelpers.getValueAtTime.bind(this); - } else { - this.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(this); - } - this.setGroupProperty = expressionHelpers.setGroupProperty; - }; -}()); - -var propertyGetTextProp = TextSelectorProp.getTextSelectorProp; -TextSelectorProp.getTextSelectorProp = function (elem, data, arr) { - if (data.t === 1) { - return new TextExpressionSelectorPropFactory(elem, data, arr); // eslint-disable-line no-undef - } - return propertyGetTextProp(elem, data, arr); -}; - -export default TextExpressionSelectorPropFactory; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/TransformInterface.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/TransformInterface.js deleted file mode 100644 index 147bddddfc96aaaeaa7e983d98a9637cdecb20dc..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/TransformInterface.js +++ /dev/null @@ -1,126 +0,0 @@ -import ExpressionPropertyInterface from './ExpressionValueFactory'; - -const TransformExpressionInterface = (function () { - return function (transform) { - function _thisFunction(name) { - switch (name) { - case 'scale': - case 'Scale': - case 'ADBE Scale': - case 6: - return _thisFunction.scale; - case 'rotation': - case 'Rotation': - case 'ADBE Rotation': - case 'ADBE Rotate Z': - case 10: - return _thisFunction.rotation; - case 'ADBE Rotate X': - return _thisFunction.xRotation; - case 'ADBE Rotate Y': - return _thisFunction.yRotation; - case 'position': - case 'Position': - case 'ADBE Position': - case 2: - return _thisFunction.position; - case 'ADBE Position_0': - return _thisFunction.xPosition; - case 'ADBE Position_1': - return _thisFunction.yPosition; - case 'ADBE Position_2': - return _thisFunction.zPosition; - case 'anchorPoint': - case 'AnchorPoint': - case 'Anchor Point': - case 'ADBE AnchorPoint': - case 1: - return _thisFunction.anchorPoint; - case 'opacity': - case 'Opacity': - case 11: - return _thisFunction.opacity; - default: - return null; - } - } - Object.defineProperty(_thisFunction, 'rotation', { - get: ExpressionPropertyInterface(transform.r || transform.rz), - }); - - Object.defineProperty(_thisFunction, 'zRotation', { - get: ExpressionPropertyInterface(transform.rz || transform.r), - }); - - Object.defineProperty(_thisFunction, 'xRotation', { - get: ExpressionPropertyInterface(transform.rx), - }); - - Object.defineProperty(_thisFunction, 'yRotation', { - get: ExpressionPropertyInterface(transform.ry), - }); - Object.defineProperty(_thisFunction, 'scale', { - get: ExpressionPropertyInterface(transform.s), - }); - var _px; - var _py; - var _pz; - var _transformFactory; - if (transform.p) { - _transformFactory = ExpressionPropertyInterface(transform.p); - } else { - _px = ExpressionPropertyInterface(transform.px); - _py = ExpressionPropertyInterface(transform.py); - if (transform.pz) { - _pz = ExpressionPropertyInterface(transform.pz); - } - } - Object.defineProperty(_thisFunction, 'position', { - get: function () { - if (transform.p) { - return _transformFactory(); - } - return [ - _px(), - _py(), - _pz ? _pz() : 0]; - }, - }); - - Object.defineProperty(_thisFunction, 'xPosition', { - get: ExpressionPropertyInterface(transform.px), - }); - - Object.defineProperty(_thisFunction, 'yPosition', { - get: ExpressionPropertyInterface(transform.py), - }); - - Object.defineProperty(_thisFunction, 'zPosition', { - get: ExpressionPropertyInterface(transform.pz), - }); - - Object.defineProperty(_thisFunction, 'anchorPoint', { - get: ExpressionPropertyInterface(transform.a), - }); - - Object.defineProperty(_thisFunction, 'opacity', { - get: ExpressionPropertyInterface(transform.o), - }); - - Object.defineProperty(_thisFunction, 'skew', { - get: ExpressionPropertyInterface(transform.sk), - }); - - Object.defineProperty(_thisFunction, 'skewAxis', { - get: ExpressionPropertyInterface(transform.sa), - }); - - Object.defineProperty(_thisFunction, 'orientation', { - get: ExpressionPropertyInterface(transform.or), - }); - - return _thisFunction; - }; -}()); - -export default TransformExpressionInterface; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/expressionHelpers.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/expressionHelpers.js deleted file mode 100644 index 2dc06f69d1fbbd5db777c38f81fcc169dd1db2ae..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/expressionHelpers.js +++ /dev/null @@ -1,90 +0,0 @@ -import { - createTypedArray, -} from '../helpers/arrays'; -import ExpressionManager from './ExpressionManager'; - -const expressionHelpers = (function () { - function searchExpressions(elem, data, prop) { - if (data.x) { - /** - * 由于禁用了 Expression 的能力, 此 prop 脱离了 keyframe 的范畴。 故将 prop.k = true 注释。 - * 否则在仅有 "x", 没有 "a": 1 的情况下, 会导致 processKeys 始终不会被调用。 - */ - // prop.k = true; - prop.x = true; - prop.initiateExpression = ExpressionManager.initiateExpression; - //prop.effectsSequence.push(prop.initiateExpression(elem, data, prop).bind(prop)); 不支持正则表达式内容 - } - } - - function getValueAtTime(frameNum) { - frameNum *= this.elem.globalData.frameRate; - frameNum -= this.offsetTime; - if (frameNum !== this._cachingAtTime.lastFrame) { - this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0; - this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime); - this._cachingAtTime.lastFrame = frameNum; - } - return this._cachingAtTime.value; - } - - function getSpeedAtTime(frameNum) { - var delta = -0.01; - var v1 = this.getValueAtTime(frameNum); - var v2 = this.getValueAtTime(frameNum + delta); - var speed = 0; - if (v1.length) { - var i; - for (i = 0; i < v1.length; i += 1) { - speed += Math.pow(v2[i] - v1[i], 2); - } - speed = Math.sqrt(speed) * 100; - } else { - speed = 0; - } - return speed; - } - - function getVelocityAtTime(frameNum) { - if (this.vel !== undefined) { - return this.vel; - } - var delta = -0.001; - // frameNum += this.elem.data.st; - var v1 = this.getValueAtTime(frameNum); - var v2 = this.getValueAtTime(frameNum + delta); - var velocity; - if (v1.length) { - velocity = createTypedArray('float32', v1.length); - var i; - for (i = 0; i < v1.length; i += 1) { - // removing frameRate - // if needed, don't add it here - // velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta); - velocity[i] = (v2[i] - v1[i]) / delta; - } - } else { - velocity = (v2 - v1) / delta; - } - return velocity; - } - - function getStaticValueAtTime() { - return this.pv; - } - - function setGroupProperty(propertyGroup) { - this.propertyGroup = propertyGroup; - } - - return { - searchExpressions: searchExpressions, - getSpeedAtTime: getSpeedAtTime, - getVelocityAtTime: getVelocityAtTime, - getValueAtTime: getValueAtTime, - getStaticValueAtTime: getStaticValueAtTime, - setGroupProperty: setGroupProperty, - }; -}()); - -export default expressionHelpers; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/shapes/ShapePathInterface.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/shapes/ShapePathInterface.js deleted file mode 100644 index 4a95149769e063251edc2daef623d45a9c8740aa..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/expressions/shapes/ShapePathInterface.js +++ /dev/null @@ -1,47 +0,0 @@ -import propertyGroupFactory from '../PropertyGroupFactory'; -import PropertyInterface from '../PropertyInterface'; - -const ShapePathInterface = ( - - function () { - return function pathInterfaceFactory(shape, view, propertyGroup) { - var prop = view.sh; - - function interfaceFunction(val) { - if (val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2) { - return interfaceFunction.path; - } - return null; - } - - var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup); - prop.setGroupProperty(PropertyInterface('Path', _propertyGroup)); - Object.defineProperties(interfaceFunction, { - path: { - get: function () { - if (prop.k) { - prop.getValue(); - } - return prop; - }, - }, - shape: { - get: function () { - if (prop.k) { - prop.getValue(); - } - return prop; - }, - }, - _name: { value: shape.nm }, - ix: { value: shape.ix }, - propertyIndex: { value: shape.ix }, - mn: { value: shape.mn }, - propertyGroup: { value: propertyGroup }, - }); - return interfaceFunction; - }; - }() -); - -export default ShapePathInterface; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/featureSupport.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/featureSupport.js deleted file mode 100644 index d4cecb8885c59b3a85ff10e70e961c49e2c32705..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/featureSupport.js +++ /dev/null @@ -1,10 +0,0 @@ -const featureSupport = (function () { - var ob = { - maskType: true, - svgLumaHidden: true, - offscreenCanvas: typeof OffscreenCanvas !== 'undefined', - }; - return ob; -}()); - -export default featureSupport; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/filters.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/filters.js deleted file mode 100644 index b3c2a43025cbcef9dcb55aab618dfa13270edff5..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/filters.js +++ /dev/null @@ -1,32 +0,0 @@ -import createNS from './helpers/svg_elements'; - -const filtersFactory = (function () { - var ob = {}; - ob.createFilter = createFilter; - ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter; - - function createFilter(filId, skipCoordinates) { - var fil = createNS('filter'); - fil.setAttribute('id', filId); - if (skipCoordinates !== true) { - fil.setAttribute('filterUnits', 'objectBoundingBox'); - fil.setAttribute('x', '0%'); - fil.setAttribute('y', '0%'); - fil.setAttribute('width', '100%'); - fil.setAttribute('height', '100%'); - } - return fil; - } - - function createAlphaToLuminanceFilter() { - var feColorMatrix = createNS('feColorMatrix'); - feColorMatrix.setAttribute('type', 'matrix'); - feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB'); - feColorMatrix.setAttribute('values', '0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1'); - return feColorMatrix; - } - - return ob; -}()); - -export default filtersFactory; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/functionExtensions.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/functionExtensions.js deleted file mode 100644 index f2281e2572ce4831aea4650ef233b83d422928ba..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/functionExtensions.js +++ /dev/null @@ -1,27 +0,0 @@ -function extendPrototype(sources, destination) { - var i; - var len = sources.length; - var sourcePrototype; - for (i = 0; i < len; i += 1) { - sourcePrototype = sources[i].prototype; - for (var attr in sourcePrototype) { - if (Object.prototype.hasOwnProperty.call(sourcePrototype, attr)) destination.prototype[attr] = sourcePrototype[attr]; - } - } -} - -function getDescriptor(object, prop) { - return Object.getOwnPropertyDescriptor(object, prop); -} - -function createProxyFunction(prototype) { - function ProxyFunction() {} - ProxyFunction.prototype = prototype; - return ProxyFunction; -} - -export { - extendPrototype, - getDescriptor, - createProxyFunction, -}; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/getFontProperties.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/getFontProperties.js deleted file mode 100644 index 9d8595b6bc92669af1f99df4a5ecb05072030b74..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/getFontProperties.js +++ /dev/null @@ -1,42 +0,0 @@ -function getFontProperties(fontData) { - var styles = fontData.fStyle ? fontData.fStyle.split(' ') : []; - - var fWeight = 'normal'; var - fStyle = 'normal'; - var len = styles.length; - var styleName; - for (var i = 0; i < len; i += 1) { - styleName = styles[i].toLowerCase(); - switch (styleName) { - case 'italic': - fStyle = 'italic'; - break; - case 'bold': - fWeight = '700'; - break; - case 'black': - fWeight = '900'; - break; - case 'medium': - fWeight = '500'; - break; - case 'regular': - case 'normal': - fWeight = '400'; - break; - case 'light': - case 'thin': - fWeight = '200'; - break; - default: - break; - } - } - - return { - style: fStyle, - weight: fontData.fWeight || fWeight, - }; -} - -export default getFontProperties; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/arrays.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/arrays.js deleted file mode 100644 index 2c9c0e8ace6e7de6875def210d4ecc0613d4d217..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/arrays.js +++ /dev/null @@ -1,46 +0,0 @@ -const createTypedArray = (function () { - function createRegularArray(type, len) { - var i = 0; - var arr = []; - var value; - switch (type) { - case 'int16': - case 'uint8c': - value = 1; - break; - default: - value = 1.1; - break; - } - for (i = 0; i < len; i += 1) { - arr.push(value); - } - return arr; - } - function createTypedArrayFactory(type, len) { - if (type === 'float32') { - return new Float32Array(len); - } if (type === 'int16') { - return new Int16Array(len); - } if (type === 'uint8c') { - return new Uint8ClampedArray(len); - } - return createRegularArray(type, len); - } - if (typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') { - return createTypedArrayFactory; - } - return createRegularArray; -}()); - -function createSizedArray(len) { - if (!len) { - len = 0; - } - return Array.apply(null, { length: len }); -} - -export { - createTypedArray, - createSizedArray, -}; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/assetManager.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/assetManager.js deleted file mode 100644 index 74e17c30503791201df7050f52c834a7868d7f60..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/assetManager.js +++ /dev/null @@ -1,96 +0,0 @@ -import createTag from './html_elements'; -import createNS from './svg_elements'; -import featureSupport from '../featureSupport'; - -var lumaLoader = (function () { - var id = '__lottie_element_luma_buffer'; - var lumaBuffer = null; - var lumaBufferCtx = null; - var svg = null; - - // This alternate solution has a slight delay before the filter is applied, resulting in a flicker on the first frame. - // Keeping this here for reference, and in the future, if offscreen canvas supports url filters, this can be used. - // For now, neither of them work for offscreen canvas, so canvas workers can't support the luma track matte mask. - // Naming it solution 2 to mark the extra comment lines. - /* - var svgString = [ - '', - '', - '', - '', - '', - ].join(''); - var blob = new Blob([svgString], { type: 'image/svg+xml' }); - var url = URL.createObjectURL(blob); - */ - - function createLumaSvgFilter() { - var _svg = createNS('svg'); - var fil = createNS('filter'); - var matrix = createNS('feColorMatrix'); - fil.setAttribute('id', id); - matrix.setAttribute('type', 'matrix'); - matrix.setAttribute('color-interpolation-filters', 'sRGB'); - matrix.setAttribute('values', '0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0'); - fil.appendChild(matrix); - _svg.appendChild(fil); - _svg.setAttribute('id', id + '_svg'); - if (featureSupport.svgLumaHidden) { - _svg.style.display = 'none'; - } - return _svg; - } - - function loadLuma() { - if (!lumaBuffer) { - svg = createLumaSvgFilter(); - document.body.appendChild(svg); - lumaBuffer = createTag('canvas'); - lumaBufferCtx = lumaBuffer.getContext('2d'); - // lumaBufferCtx.filter = `url('${url}#__lottie_element_luma_buffer')`; // part of solution 2 - lumaBufferCtx.filter = 'url(#' + id + ')'; - lumaBufferCtx.fillStyle = 'rgba(0,0,0,0)'; - lumaBufferCtx.fillRect(0, 0, 1, 1); - } - } - - function getLuma(canvas) { - if (!lumaBuffer) { - loadLuma(); - } - lumaBuffer.width = canvas.width; - lumaBuffer.height = canvas.height; - // lumaBufferCtx.filter = `url('${url}#__lottie_element_luma_buffer')`; // part of solution 2 - lumaBufferCtx.filter = 'url(#' + id + ')'; - return lumaBuffer; - } - return { - load: loadLuma, - get: getLuma, - }; -}); - -function createCanvas(width, height) { - if (featureSupport.offscreenCanvas) { - return new OffscreenCanvas(width, height); - } - var canvas = createTag('canvas'); - canvas.width = width; - canvas.height = height; - return canvas; -} - -const assetLoader = (function () { - return { - loadLumaCanvas: lumaLoader.load, - getLumaCanvas: lumaLoader.get, - createCanvas: createCanvas, - }; -}()); - -export default assetLoader; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/blendModes.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/blendModes.js deleted file mode 100644 index 55acdf53ebfca42ac6977f637e2ec80ffa6712bc..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/blendModes.js +++ /dev/null @@ -1,26 +0,0 @@ -const getBlendMode = (function () { - var blendModeEnums = { - 0: 'source-over', - 1: 'multiply', - 2: 'screen', - 3: 'overlay', - 4: 'darken', - 5: 'lighten', - 6: 'color-dodge', - 7: 'color-burn', - 8: 'hard-light', - 9: 'soft-light', - 10: 'difference', - 11: 'exclusion', - 12: 'hue', - 13: 'saturation', - 14: 'color', - 15: 'luminosity', - }; - - return function (mode) { - return blendModeEnums[mode] || ''; - }; -}()); - -export default getBlendMode; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/dynamicProperties.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/dynamicProperties.js deleted file mode 100644 index 621bf4e371c23f2055c9884966cd6eab25c053d2..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/dynamicProperties.js +++ /dev/null @@ -1,29 +0,0 @@ -function DynamicPropertyContainer() {} -DynamicPropertyContainer.prototype = { - addDynamicProperty: function (prop) { - if (this.dynamicProperties.indexOf(prop) === -1) { - this.dynamicProperties.push(prop); - this.container.addDynamicProperty(this); - this._isAnimated = true; - } - }, - iterateDynamicProperties: function () { - this._mdf = false; - var i; - var len = this.dynamicProperties.length; - for (i = 0; i < len; i += 1) { - this.dynamicProperties[i].getValue(); - if (this.dynamicProperties[i]._mdf) { - this._mdf = true; - } - } - }, - initDynamicPropertyContainer: function (container) { - this.container = container; - this.dynamicProperties = []; - this._mdf = false; - this._isAnimated = false; - }, -}; - -export default DynamicPropertyContainer; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/html_elements.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/html_elements.js deleted file mode 100644 index 5a5d56b2d624af250febf3069e07ac0b20449e0d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/html_elements.js +++ /dev/null @@ -1,14 +0,0 @@ -function createTag(type) { - return { - appendChild: function (n) { - }, - setAttribute: function (k, v) { - }, - style: {}, - getContext: function (s) { - return {}; - } - } -} - -export default createTag; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/propTypes.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/propTypes.js deleted file mode 100644 index 6a1c570e1b5f7bcd07d3f25df096737977e730d0..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/propTypes.js +++ /dev/null @@ -1,3 +0,0 @@ -export default { - SHAPE: 'shape', -}; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/shapeEnums.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/shapeEnums.js deleted file mode 100644 index 581a1cdc1b68814b77d3d0197b24d268e8c93469..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/shapeEnums.js +++ /dev/null @@ -1,16 +0,0 @@ -const lineCapEnum = { - 1: 'butt', - 2: 'round', - 3: 'square', -}; - -const lineJoinEnum = { - 1: 'miter', - 2: 'round', - 3: 'bevel', -}; - -export { - lineCapEnum, - lineJoinEnum, -}; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/svg_elements.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/svg_elements.js deleted file mode 100644 index 227742e3edf570ac60dd6e0b0a728890079a4978..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/helpers/svg_elements.js +++ /dev/null @@ -1,35 +0,0 @@ -import { svgNS } from '../../main'; - -function createNS(types) { - return new createNs(types, svgNS) -} - -function createNs(types, svg) { - this.label = types - this.ks = {} - this.childs = new Array() - this.style = {} - if (types == 'svg' && svg != null) - this.setAttribute("xmlns", svg) -} - -createNs.prototype.setAttributeNS = function (n, k, v) { - this.setAttribute("xmlns", n) - this.ks[k+''] = v -} - -createNs.prototype.setAttribute = function (k, v) { - this.ks[k+''] = v -} - -createNs.prototype.appendChild = function (element) { - if (element != undefined) - this.childs.push(element) -} - -createNs.prototype.insertBefore = function (newNode, referenceNode) { - let addindex = this.childs.indexOf(referenceNode) - this.childs.splice(addindex, 0, newNode) -} - -export default createNS; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/imagePreloader.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/imagePreloader.js deleted file mode 100644 index 0fb65033073fabb9ed9db1b63f00aefebdf75d99..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/imagePreloader.js +++ /dev/null @@ -1,348 +0,0 @@ -import { isSafari } from './common'; -import createNS from './helpers/svg_elements'; -import dataManager from './DataManager'; -import image from '@ohos.multimedia.image'; -import fs from '@ohos.file.fs'; -import {LogUtil} from './LogUtil' - -//类型定义参考 https://lottiefiles.github.io/lottie-docs/assets/ -const SOURCE_BASE64 = /data:image\/([a-zA-Z0-9+-]+\/?);base64/; -const TYPE_IMAGE_SOURCE_RAWFILE = 0 -const TYPE_IMAGE_SOURCE_BASE64 = 1 - -const ImagePreloader = (function () { - var proxyImage = (function () { - - // 使用空对象替代不支持动态创建的Canvas组件 - return { }; - }()); - - function imageLoaded() { - this.loadedAssets += 1; - if (this.loadedAssets === this.totalImages && this.loadedFootagesCount === this.totalFootages) { - if (this.imagesLoadedCb) { - this.imagesLoadedCb(null); - } - } - } - function footageLoaded() { - this.loadedFootagesCount += 1; - if (this.loadedAssets === this.totalImages && this.loadedFootagesCount === this.totalFootages) { - if (this.imagesLoadedCb) { - this.imagesLoadedCb(null); - } - } - } - - function getAssetsPath(assetData, assetsPath, originalPath) { - var path = ''; - if (assetData.e) { - path = assetData.p; - } else if (assetsPath) { - var imagePath = assetData.p; - if (imagePath.indexOf('images/') !== -1) { - imagePath = imagePath.split('/')[1]; - } - path = assetsPath + imagePath; - } else { - path = originalPath; - path += assetData.u ? assetData.u : ''; - path += assetData.p; - } - return path; - } - - function testImageLoaded(img) { - var _count = 0; - var intervalId = setInterval(function () { - var box = img.getBBox(); - if (box.width || _count > 500) { - this._imageLoaded(); - clearInterval(intervalId); - } - _count += 1; - }.bind(this), 50); - } - - function generatePixelMapAndRefreshUI2(data, ob, callback) { - let image_source = image.createImageSource(data) - //piexlmap改成不可编辑状态,优化图形图像端读取速度 - let opts = { - editable: false, - desiredPixelFormat: image.PixelMapFormat.RGBA_8888 - }; - //创建pixel_map - image_source?.createPixelMap(opts, (err, pixel_map) => { - if (!err) { - ob.img.pixel_map = pixel_map; - if (ob.assetData && ob.assetData.w && ob.assetData.h) { - ob.img.width = ob.assetData.w; - ob.img.height = ob.assetData.h; - callback(); - } else { - //获取解析出来的pixel_map的宽、高 - pixel_map.getImageInfo().then((image_info) => { - ob.img.width = image_info.size.width; - ob.img.height = image_info.size.height; - callback(); - }); - } - } else { - callback(); - } - }); - } - - function createImageData(assetData) { - var path = getAssetsPath(assetData, this.assetsPath, this.path); - var img = createNS('image'); - if (isSafari) { - this.testImageLoaded(img); - } else { - img.addEventListener('load', this._imageLoaded, false); - } - img.addEventListener('error', function () { - ob.img = proxyImage; - this._imageLoaded(); - }.bind(this), false); - img.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path); - if (this._elementHelper.append) { - this._elementHelper.append(img); - } else { - this._elementHelper.appendChild(img); - } - var ob = { - img: img, - assetData: assetData, - }; - return ob; - } - - function createImgData(assetData) { - var path = getAssetsPath(assetData, this.assetsPath, this.path); - var context = this.context; - if (context == null) { - context = getContext(); - } - //因OpenHarmony无法通过createTag创建html中的img标签,所以这里构造一个img对象,同进添加其使用到的addEventListener方法 - var img = { - addEventListener: function (type, callback, flag) { - if (type === "load") { - if (this._imageAssetDelegate) { - this._imageAssetDelegate(path, (err, pixel_map) => { - if (pixel_map == null) { - //assetData.e值是不唯一的参数,所以由assetData.p值来判断图片资源是base64图片资源,还是外部图片资源 - if (SOURCE_BASE64.test(assetData.p)) { //正则表达式判断是否含有data:image/;base64字段 - readBase64(assetData, ob, callback); //base64图片 - } else { //rawfile资源图片 - readRawFile(context, assetData, ob, callback); - } - } else { - ob.img.pixel_map = pixel_map; - if (ob.assetData && ob.assetData.w && ob.assetData.h) { - ob.img.width = ob.assetData.w; - ob.img.height = ob.assetData.h; - callback(); - } else { - //获取解析出来的pixel_map的宽、高 - pixel_map.getImageInfo().then((image_info) => { - ob.img.width = image_info.size.width; - ob.img.height = image_info.size.height; - callback(); - }); - } - } - }); - return; - } - //assetData.e值是不唯一的参数,所以由assetData.p值来判断图片资源是base64图片资源,还是外部图片资源 - if (SOURCE_BASE64.test(assetData.p)) { //正则表达式判断是否含有data:image/;base64字段 - readBase64(assetData, ob, callback); //base64图片 - } else { //rawfile资源图片 - readRawFile(context, assetData, ob, callback); - } - } - }.bind(this) - }; - var ob = { - img: img, - assetData: assetData, - }; - img.crossOrigin = 'anonymous'; - img.addEventListener('load', this._imageLoaded, false); - img.addEventListener('error', function () { - ob.img = proxyImage; - this._imageLoaded(); - }.bind(this), false); - img.src = path; - return ob; - } - - function readBase64(assetData, ob, callback) { - //generatePixelMapAndRefreshUI的入参ob可能为undefined,所以这里需要每隔一段时间检测一下ob是否实例化好了 - let task_id = setInterval(() => { - if (!ob) { - return - } - generatePixelMapAndRefreshUI2(assetData.p, ob, callback) - //取消循环检测 - clearInterval(task_id) - }, 10) - } - - function readRawFile(context, assetData, ob, callback) { - //拼接rawfile url - let res = assetData.u + assetData.p; //->common/image/lottie/icon.png - try { - let filePath = context.filesDir + '/' + res; - let isExist = fs.accessSync(filePath); //判断图片资源是否存在 - if (isExist) { - let file = fs.openSync(filePath, fs.OpenMode.READ_ONLY); - let stat = fs.statSync(filePath); - let arrayBuffer = new ArrayBuffer(stat.size); - fs.read(file.fd, arrayBuffer, (err, readLen) => { - if (!!!err) { - generatePixelMapAndRefreshUI2(arrayBuffer, ob, callback); - } else { - //加载依赖图片异常时,默认动画加载正常 - callback(); - } - fs.close(file) - }) - } else { - //获取rawfile的字节数组数据 - context.resourceManager.getRawFileContent(res, (err, raw_file_content) => { - if (!!!err) { - generatePixelMapAndRefreshUI2(raw_file_content.buffer, ob, callback); - } else { - //加载依赖图片异常时,默认动画加载正常 - callback(); - } - }) - } - } catch (err) { - LogUtil.error('Method readRawFile execute error: ' + JSON.stringify(err)); - } - } - - function createFootageData(data) { - var ob = { - assetData: data, - }; - var path = getAssetsPath(data, this.assetsPath, this.path); - dataManager.loadData(path, function (footageData) { - ob.img = footageData; - this._footageLoaded(); - }.bind(this), function () { - ob.img = {}; - this._footageLoaded(); - }.bind(this)); - return ob; - } - - function loadAssets(assets, cb) { - this.imagesLoadedCb = cb; - var i; - var len = assets.length; - for (i = 0; i < len; i += 1) { - if (!assets[i].layers) { - if (this.imagePath && this.imagePath != '') { - assets[i].u = this.imagePath; - } - if (!assets[i].t || assets[i].t === 'seq') { - this.totalImages += 1; - this.images.push(this._createImageData(assets[i])); - } else if (assets[i].t === 3) { - this.totalFootages += 1; - this.images.push(this.createFootageData(assets[i])); - } - } - } - } - - function setPath(path) { - this.path = path || ''; - } - - function setAssetsPath(path) { - this.assetsPath = path || ''; - } - - function getAsset(assetData) { - var i = 0; - var len = this.images.length; - while (i < len) { - if (this.images[i].assetData === assetData) { - return this.images[i].img; - } - i += 1; - } - return null; - } - - function destroy() { - this.imagesLoadedCb = null; - this.images.length = 0; - } - - function loadedImages() { - return this.totalImages === this.loadedAssets; - } - - function loadedFootages() { - return this.totalFootages === this.loadedFootagesCount; - } - - function setImageAssetDelegate(imageAssetDelegate) { - this._imageAssetDelegate = imageAssetDelegate; - } - - function setCacheType(type, elementHelper, context, imagePath) { - this.context = context; - this.imagePath = imagePath; - if (type === 'svg') { - this._elementHelper = elementHelper; - this._createImageData = this.createImageData.bind(this); - } else { - this._createImageData = this.createImgData.bind(this); - } - } - - function ImagePreloaderFactory() { - this._imageLoaded = imageLoaded.bind(this); - this._footageLoaded = footageLoaded.bind(this); - this._imageAssetDelegate = null; - this.testImageLoaded = testImageLoaded.bind(this); - this.createFootageData = createFootageData.bind(this); - this.assetsPath = ''; - this.path = ''; - this.totalImages = 0; - this.totalFootages = 0; - this.loadedAssets = 0; - this.loadedFootagesCount = 0; - this.imagesLoadedCb = null; - this.images = []; - this.context = null; - this.imagePath = ''; - } - - ImagePreloaderFactory.prototype = { - loadAssets: loadAssets, - setAssetsPath: setAssetsPath, - setPath: setPath, - loadedImages: loadedImages, - loadedFootages: loadedFootages, - destroy: destroy, - getAsset: getAsset, - createImgData: createImgData, - createImageData: createImageData, - imageLoaded: imageLoaded, - footageLoaded: footageLoaded, - setCacheType: setCacheType, - setImageAssetDelegate: setImageAssetDelegate, - }; - - return ImagePreloaderFactory; -}()); - -export default ImagePreloader; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/markers/markerParser.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/markers/markerParser.js deleted file mode 100644 index fe17929a9352a600d0ab1a6782fe40f7382ad465..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/markers/markerParser.js +++ /dev/null @@ -1,47 +0,0 @@ -const markerParser = ( - - function () { - function parsePayloadLines(payload) { - var lines = payload.split('\r\n'); - var keys = {}; - var line; - var keysCount = 0; - for (var i = 0; i < lines.length; i += 1) { - line = lines[i].split(':'); - if (line.length === 2) { - keys[line[0]] = line[1].trim(); - keysCount += 1; - } - } - if (keysCount === 0) { - throw new Error(); - } - return keys; - } - - return function (_markers) { - var markers = []; - for (var i = 0; i < _markers.length; i += 1) { - var _marker = _markers[i]; - var markerData = { - time: _marker.tm, - duration: _marker.dr, - }; - try { - markerData.payload = JSON.parse(_markers[i].cm); - } catch (_) { - try { - markerData.payload = parsePayloadLines(_markers[i].cm); - } catch (__) { - markerData.payload = { - name: _markers[i].cm, - }; - } - } - markers.push(markerData); - } - return markers; - }; - }()); - -export default markerParser; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/bezier_length_pool.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/bezier_length_pool.js deleted file mode 100644 index bd38b8bbf6a0d7136b62be75acc87a14d378e076..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/bezier_length_pool.js +++ /dev/null @@ -1,20 +0,0 @@ -import { - getDefaultCurveSegments, -} from '../common'; -import { - createTypedArray, -} from '../helpers/arrays'; -import poolFactory from './pool_factory'; - -const bezierLengthPool = (function () { - function create() { - return { - addedLength: 0, - percents: createTypedArray('float32', getDefaultCurveSegments()), - lengths: createTypedArray('float32', getDefaultCurveSegments()), - }; - } - return poolFactory(8, create); -}()); - -export default bezierLengthPool; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/point_pool.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/point_pool.js deleted file mode 100644 index 79eeacb3f6d04ebb63022f0c68691f5c4e0f1708..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/point_pool.js +++ /dev/null @@ -1,13 +0,0 @@ -import { - createTypedArray, -} from '../helpers/arrays'; -import poolFactory from './pool_factory'; - -const pointPool = (function () { - function create() { - return createTypedArray('float32', 2); - } - return poolFactory(8, create); -}()); - -export default pointPool; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/pool_factory.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/pool_factory.js deleted file mode 100644 index 5538c6588c43d50f4606bd21dfcf2dd2ecedff7f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/pool_factory.js +++ /dev/null @@ -1,44 +0,0 @@ -import { - createSizedArray, -} from '../helpers/arrays'; -import pooling from './pooling'; - -const poolFactory = (function () { - return function (initialLength, _create, _release) { - var _length = 0; - var _maxLength = initialLength; - var pool = createSizedArray(_maxLength); - - var ob = { - newElement: newElement, - release: release, - }; - - function newElement() { - var element; - if (_length) { - _length -= 1; - element = pool[_length]; - } else { - element = _create(); - } - return element; - } - - function release(element) { - if (_length === _maxLength) { - pool = pooling.double(pool); - _maxLength *= 2; - } - if (_release) { - _release(element); - } - pool[_length] = element; - _length += 1; - } - - return ob; - }; -}()); - -export default poolFactory; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/pooling.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/pooling.js deleted file mode 100644 index 44e06954ce4fe5cd076ef0fd403ce5d4a73fd138..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/pooling.js +++ /dev/null @@ -1,15 +0,0 @@ -import { - createSizedArray, -} from '../helpers/arrays'; - -const pooling = (function () { - function double(arr) { - return arr.concat(createSizedArray(arr.length)); - } - - return { - double: double, - }; -}()); - -export default pooling; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/segments_length_pool.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/segments_length_pool.js deleted file mode 100644 index e7c69dd035b56d73d2a54e2457b969936be47d20..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/segments_length_pool.js +++ /dev/null @@ -1,24 +0,0 @@ -import bezierLengthPool from './bezier_length_pool'; -import poolFactory from './pool_factory'; - -const segmentsLengthPool = (function () { - function create() { - return { - lengths: [], - totalLength: 0, - }; - } - - function release(element) { - var i; - var len = element.lengths.length; - for (i = 0; i < len; i += 1) { - bezierLengthPool.release(element.lengths[i]); - } - element.lengths.length = 0; - } - - return poolFactory(8, create, release); -}()); - -export default segmentsLengthPool; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/shapeCollection_pool.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/shapeCollection_pool.js deleted file mode 100644 index ae31fd92c6d7eb60b6f90d69b7ea5680764edb1a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/shapeCollection_pool.js +++ /dev/null @@ -1,48 +0,0 @@ -import { - createSizedArray, -} from '../helpers/arrays'; -import shapePool from './shape_pool'; -import pooling from './pooling'; -import ShapeCollection from '../shapes/ShapeCollection'; - -const shapeCollectionPool = (function () { - var ob = { - newShapeCollection: newShapeCollection, - release: release, - }; - - var _length = 0; - var _maxLength = 4; - var pool = createSizedArray(_maxLength); - - function newShapeCollection() { - var shapeCollection; - if (_length) { - _length -= 1; - shapeCollection = pool[_length]; - } else { - shapeCollection = new ShapeCollection(); - } - return shapeCollection; - } - - function release(shapeCollection) { - var i; - var len = shapeCollection._length; - for (i = 0; i < len; i += 1) { - shapePool.release(shapeCollection.shapes[i]); - } - shapeCollection._length = 0; - - if (_length === _maxLength) { - pool = pooling.double(pool); - _maxLength *= 2; - } - pool[_length] = shapeCollection; - _length += 1; - } - - return ob; -}()); - -export default shapeCollectionPool; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/shape_pool.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/shape_pool.js deleted file mode 100644 index cbcbb1e11dadff5f9974d2e6127d6842a228e8a4..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/pooling/shape_pool.js +++ /dev/null @@ -1,44 +0,0 @@ -import poolFactory from './pool_factory'; -import pointPool from './point_pool'; -import ShapePath from '../shapes/ShapePath'; - -const shapePool = (function () { - function create() { - return new ShapePath(); - } - - function release(shapePath) { - var len = shapePath._length; - var i; - for (i = 0; i < len; i += 1) { - pointPool.release(shapePath.v[i]); - pointPool.release(shapePath.i[i]); - pointPool.release(shapePath.o[i]); - shapePath.v[i] = null; - shapePath.i[i] = null; - shapePath.o[i] = null; - } - shapePath._length = 0; - shapePath.c = false; - } - - function clone(shape) { - var cloned = factory.newElement(); - var i; - var len = shape._length === undefined ? shape.v.length : shape._length; - cloned.setLength(len); - cloned.c = shape.c; - - for (i = 0; i < len; i += 1) { - cloned.setTripleAt(shape.v[i][0], shape.v[i][1], shape.o[i][0], shape.o[i][1], shape.i[i][0], shape.i[i][1], i); - } - return cloned; - } - - var factory = poolFactory(4, create, release); - factory.clone = clone; - - return factory; -}()); - -export default shapePool; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/DashProperty.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/DashProperty.js deleted file mode 100644 index f0594e32c067c1314541c14a21b43ff4443d6ffe..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/DashProperty.js +++ /dev/null @@ -1,63 +0,0 @@ -import { - extendPrototype, -} from '../functionExtensions'; -import DynamicPropertyContainer from '../helpers/dynamicProperties'; -import { - createSizedArray, - createTypedArray, -} from '../helpers/arrays'; -import PropertyFactory from '../PropertyFactory'; - -function DashProperty(elem, data, renderer, container) { - this.elem = elem; - this.frameId = -1; - this.dataProps = createSizedArray(data.length); - this.renderer = renderer; - this.k = false; - this.dashStr = ''; - this.dashArray = createTypedArray('float32', data.length ? data.length - 1 : 0); - this.dashoffset = createTypedArray('float32', 1); - this.initDynamicPropertyContainer(container); - var i; - var len = data.length || 0; - var prop; - for (i = 0; i < len; i += 1) { - prop = PropertyFactory.getProp(elem, data[i].v, 0, 0, this); - this.k = prop.k || this.k; - this.dataProps[i] = { n: data[i].n, p: prop }; - } - if (!this.k) { - this.getValue(true); - } - this._isAnimated = this.k; -} - -DashProperty.prototype.getValue = function (forceRender) { - if (this.elem.globalData.frameId === this.frameId && !forceRender) { - return; - } - this.frameId = this.elem.globalData.frameId; - this.iterateDynamicProperties(); - this._mdf = this._mdf || forceRender; - if (this._mdf) { - var i = 0; - var len = this.dataProps.length; - if (this.renderer === 'svg') { - this.dashStr = ''; - } - for (i = 0; i < len; i += 1) { - if (this.dataProps[i].n !== 'o') { - if (this.renderer === 'svg') { - this.dashStr += ' ' + this.dataProps[i].p.v; - } else { - this.dashArray[i] = this.dataProps[i].p.v; - } - } else { - this.dashoffset[0] = this.dataProps[i].p.v; - } - } - } -}; -extendPrototype([DynamicPropertyContainer], DashProperty); - -export default DashProperty; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/GradientProperty.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/GradientProperty.js deleted file mode 100644 index a96d9eecc44619f55a52c911fb448fc879fae15b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/GradientProperty.js +++ /dev/null @@ -1,93 +0,0 @@ -import { - extendPrototype, -} from '../functionExtensions'; -import DynamicPropertyContainer from '../helpers/dynamicProperties'; -import { - createTypedArray, -} from '../helpers/arrays'; -import PropertyFactory from '../PropertyFactory'; - -function GradientProperty(elem, data, container) { - this.data = data; - this.c = createTypedArray('uint8c', data.p * 4); - var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p * 4) : data.k.k.length - data.p * 4; - this.o = createTypedArray('float32', cLength); - this._cmdf = false; - this._omdf = false; - this._collapsable = this.checkCollapsable(); - this._hasOpacity = cLength; - this.initDynamicPropertyContainer(container); - this.prop = PropertyFactory.getProp(elem, data.k, 1, null, this); - this.k = this.prop.k; - this.getValue(true); -} - -GradientProperty.prototype.comparePoints = function (values, points) { - var i = 0; - var len = this.o.length / 2; - var diff; - while (i < len) { - diff = Math.abs(values[i * 4] - values[points * 4 + i * 2]); - if (diff > 0.01) { - return false; - } - i += 1; - } - return true; -}; - -GradientProperty.prototype.checkCollapsable = function () { - if (this.o.length / 2 !== this.c.length / 4) { - return false; - } - if (this.data.k.k[0].s) { - var i = 0; - var len = this.data.k.k.length; - while (i < len) { - if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) { - return false; - } - i += 1; - } - } else if (!this.comparePoints(this.data.k.k, this.data.p)) { - return false; - } - return true; -}; - -GradientProperty.prototype.getValue = function (forceRender) { - this.prop.getValue(); - this._mdf = false; - this._cmdf = false; - this._omdf = false; - if (this.prop._mdf || forceRender) { - var i; - var len = this.data.p * 4; - var mult; - var val; - for (i = 0; i < len; i += 1) { - mult = i % 4 === 0 ? 100 : 255; - val = Math.round(this.prop.v[i] * mult); - if (this.c[i] !== val) { - this.c[i] = val; - this._cmdf = !forceRender; - } - } - if (this.o.length) { - len = this.prop.v.length; - for (i = this.data.p * 4; i < len; i += 1) { - mult = i % 2 === 0 ? 100 : 1; - val = i % 2 === 0 ? Math.round(this.prop.v[i] * 100) : this.prop.v[i]; - if (this.o[i - this.data.p * 4] !== val) { - this.o[i - this.data.p * 4] = val; - this._omdf = !forceRender; - } - } - } - this._mdf = !forceRender; - } -}; - -extendPrototype([DynamicPropertyContainer], GradientProperty); - -export default GradientProperty; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/OffsetPathModifier.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/OffsetPathModifier.js deleted file mode 100644 index ef08e0545a3f745c4b4ce6164240310e5b1c6955..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/OffsetPathModifier.js +++ /dev/null @@ -1,306 +0,0 @@ -import { - roundCorner, -} from '../common'; -import { - extendPrototype, -} from '../functionExtensions'; -import PropertyFactory from '../PropertyFactory'; -import shapePool from '../pooling/shape_pool'; -import { - ShapeModifier, -} from './ShapeModifiers'; -import { - PolynomialBezier, - polarOffset, - lineIntersection, - pointDistance, - pointEqual, - floatEqual, -} from '../PolynomialBezier'; - -function linearOffset(p1, p2, amount) { - var angle = Math.atan2(p2[0] - p1[0], p2[1] - p1[1]); - return [ - polarOffset(p1, angle, amount), - polarOffset(p2, angle, amount), - ]; -} - -function offsetSegment(segment, amount) { - var p0; var p1a; var p1b; var p2b; var p2a; var - p3; - var e; - e = linearOffset(segment.points[0], segment.points[1], amount); - p0 = e[0]; - p1a = e[1]; - e = linearOffset(segment.points[1], segment.points[2], amount); - p1b = e[0]; - p2b = e[1]; - e = linearOffset(segment.points[2], segment.points[3], amount); - p2a = e[0]; - p3 = e[1]; - var p1 = lineIntersection(p0, p1a, p1b, p2b); - if (p1 === null) p1 = p1a; - var p2 = lineIntersection(p2a, p3, p1b, p2b); - if (p2 === null) p2 = p2a; - - return new PolynomialBezier(p0, p1, p2, p3); -} - -function joinLines(outputBezier, seg1, seg2, lineJoin, miterLimit) { - var p0 = seg1.points[3]; - var p1 = seg2.points[0]; - - // Bevel - if (lineJoin === 3) return p0; - - // Connected, they don't need a joint - if (pointEqual(p0, p1)) return p0; - - // Round - if (lineJoin === 2) { - var angleOut = -seg1.tangentAngle(1); - var angleIn = -seg2.tangentAngle(0) + Math.PI; - var center = lineIntersection( - p0, - polarOffset(p0, angleOut + Math.PI / 2, 100), - p1, - polarOffset(p1, angleOut + Math.PI / 2, 100) - ); - var radius = center ? pointDistance(center, p0) : pointDistance(p0, p1) / 2; - - var tan = polarOffset(p0, angleOut, 2 * radius * roundCorner); - outputBezier.setXYAt(tan[0], tan[1], 'o', outputBezier.length() - 1); - - tan = polarOffset(p1, angleIn, 2 * radius * roundCorner); - outputBezier.setTripleAt(p1[0], p1[1], p1[0], p1[1], tan[0], tan[1], outputBezier.length()); - - return p1; - } - - // Miter - var t0 = pointEqual(p0, seg1.points[2]) ? seg1.points[0] : seg1.points[2]; - var t1 = pointEqual(p1, seg2.points[1]) ? seg2.points[3] : seg2.points[1]; - var intersection = lineIntersection(t0, p0, p1, t1); - if (intersection && pointDistance(intersection, p0) < miterLimit) { - outputBezier.setTripleAt( - intersection[0], - intersection[1], - intersection[0], - intersection[1], - intersection[0], - intersection[1], - outputBezier.length() - ); - return intersection; - } - - return p0; -} - -function getIntersection(a, b) { - const intersect = a.intersections(b); - - if (intersect.length && floatEqual(intersect[0][0], 1)) intersect.shift(); - - if (intersect.length) return intersect[0]; - - return null; -} - -function pruneSegmentIntersection(a, b) { - var outa = a.slice(); - var outb = b.slice(); - var intersect = getIntersection(a[a.length - 1], b[0]); - if (intersect) { - outa[a.length - 1] = a[a.length - 1].split(intersect[0])[0]; - outb[0] = b[0].split(intersect[1])[1]; - } - if (a.length > 1 && b.length > 1) { - intersect = getIntersection(a[0], b[b.length - 1]); - if (intersect) { - return [ - [a[0].split(intersect[0])[0]], - [b[b.length - 1].split(intersect[1])[1]], - ]; - } - } - return [outa, outb]; -} - -function pruneIntersections(segments) { - var e; - for (var i = 1; i < segments.length; i += 1) { - e = pruneSegmentIntersection(segments[i - 1], segments[i]); - segments[i - 1] = e[0]; - segments[i] = e[1]; - } - - if (segments.length > 1) { - e = pruneSegmentIntersection(segments[segments.length - 1], segments[0]); - segments[segments.length - 1] = e[0]; - segments[0] = e[1]; - } - - return segments; -} - -function offsetSegmentSplit(segment, amount) { - /* - We split each bezier segment into smaller pieces based - on inflection points, this ensures the control point - polygon is convex. - - (A cubic bezier can have none, one, or two inflection points) - */ - var flex = segment.inflectionPoints(); - var left; - var right; - var split; - var mid; - - if (flex.length === 0) { - return [offsetSegment(segment, amount)]; - } - - if (flex.length === 1 || floatEqual(flex[1], 1)) { - split = segment.split(flex[0]); - left = split[0]; - right = split[1]; - - return [ - offsetSegment(left, amount), - offsetSegment(right, amount), - ]; - } - - split = segment.split(flex[0]); - left = split[0]; - var t = (flex[1] - flex[0]) / (1 - flex[0]); - split = split[1].split(t); - mid = split[0]; - right = split[1]; - - return [ - offsetSegment(left, amount), - offsetSegment(mid, amount), - offsetSegment(right, amount), - ]; -} - -function OffsetPathModifier() {} - -extendPrototype([ShapeModifier], OffsetPathModifier); -OffsetPathModifier.prototype.initModifierProperties = function (elem, data) { - this.getValue = this.processKeys; - this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this); - this.miterLimit = PropertyFactory.getProp(elem, data.ml, 0, null, this); - this.lineJoin = data.lj; - this._isAnimated = this.amount.effectsSequence.length !== 0; -}; - -OffsetPathModifier.prototype.processPath = function (inputBezier, amount, lineJoin, miterLimit) { - var outputBezier = shapePool.newElement(); - outputBezier.c = inputBezier.c; - var count = inputBezier.length(); - if (!inputBezier.c) { - count -= 1; - } - var i; var j; var segment; - var multiSegments = []; - - for (i = 0; i < count; i += 1) { - segment = PolynomialBezier.shapeSegment(inputBezier, i); - multiSegments.push(offsetSegmentSplit(segment, amount)); - } - - if (!inputBezier.c) { - for (i = count - 1; i >= 0; i -= 1) { - segment = PolynomialBezier.shapeSegmentInverted(inputBezier, i); - multiSegments.push(offsetSegmentSplit(segment, amount)); - } - } - - multiSegments = pruneIntersections(multiSegments); - - // Add bezier segments to the output and apply line joints - var lastPoint = null; - var lastSeg = null; - - for (i = 0; i < multiSegments.length; i += 1) { - var multiSegment = multiSegments[i]; - - if (lastSeg) lastPoint = joinLines(outputBezier, lastSeg, multiSegment[0], lineJoin, miterLimit); - - lastSeg = multiSegment[multiSegment.length - 1]; - - for (j = 0; j < multiSegment.length; j += 1) { - segment = multiSegment[j]; - - if (lastPoint && pointEqual(segment.points[0], lastPoint)) { - outputBezier.setXYAt(segment.points[1][0], segment.points[1][1], 'o', outputBezier.length() - 1); - } else { - outputBezier.setTripleAt( - segment.points[0][0], - segment.points[0][1], - segment.points[1][0], - segment.points[1][1], - segment.points[0][0], - segment.points[0][1], - outputBezier.length() - ); - } - - outputBezier.setTripleAt( - segment.points[3][0], - segment.points[3][1], - segment.points[3][0], - segment.points[3][1], - segment.points[2][0], - segment.points[2][1], - outputBezier.length() - ); - - lastPoint = segment.points[3]; - } - } - - if (multiSegments.length) joinLines(outputBezier, lastSeg, multiSegments[0][0], lineJoin, miterLimit); - - return outputBezier; -}; - -OffsetPathModifier.prototype.processShapes = function (_isFirstFrame) { - var shapePaths; - var i; - var len = this.shapes.length; - var j; - var jLen; - var amount = this.amount.v; - var miterLimit = this.miterLimit.v; - var lineJoin = this.lineJoin; - - if (amount !== 0) { - var shapeData; - var localShapeCollection; - for (i = 0; i < len; i += 1) { - shapeData = this.shapes[i]; - localShapeCollection = shapeData.localShapeCollection; - if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) { - localShapeCollection.releaseShapes(); - shapeData.shape._mdf = true; - shapePaths = shapeData.shape.paths.shapes; - jLen = shapeData.shape.paths._length; - for (j = 0; j < jLen; j += 1) { - localShapeCollection.addShape(this.processPath(shapePaths[j], amount, lineJoin, miterLimit)); - } - } - shapeData.shape.paths = shapeData.localShapeCollection; - } - } - if (!this.dynamicProperties.length) { - this._mdf = false; - } -}; - -export default OffsetPathModifier; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/PuckerAndBloatModifier.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/PuckerAndBloatModifier.js deleted file mode 100644 index 5586c2871ec525b16a5b9446ae291110f495dd23..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/PuckerAndBloatModifier.js +++ /dev/null @@ -1,80 +0,0 @@ -import { - extendPrototype, -} from '../functionExtensions'; -import PropertyFactory from '../PropertyFactory'; -import shapePool from '../pooling/shape_pool'; -import { - ShapeModifier, -} from './ShapeModifiers'; - -function PuckerAndBloatModifier() {} -extendPrototype([ShapeModifier], PuckerAndBloatModifier); -PuckerAndBloatModifier.prototype.initModifierProperties = function (elem, data) { - this.getValue = this.processKeys; - this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this); - this._isAnimated = !!this.amount.effectsSequence.length; -}; - -PuckerAndBloatModifier.prototype.processPath = function (path, amount) { - var percent = amount / 100; - var centerPoint = [0, 0]; - var pathLength = path._length; - var i = 0; - for (i = 0; i < pathLength; i += 1) { - centerPoint[0] += path.v[i][0]; - centerPoint[1] += path.v[i][1]; - } - centerPoint[0] /= pathLength; - centerPoint[1] /= pathLength; - var clonedPath = shapePool.newElement(); - clonedPath.c = path.c; - var vX; - var vY; - var oX; - var oY; - var iX; - var iY; - for (i = 0; i < pathLength; i += 1) { - vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent; - vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent; - oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent; - oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent; - iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent; - iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent; - clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, i); - } - return clonedPath; -}; - -PuckerAndBloatModifier.prototype.processShapes = function (_isFirstFrame) { - var shapePaths; - var i; - var len = this.shapes.length; - var j; - var jLen; - var amount = this.amount.v; - - if (amount !== 0) { - var shapeData; - var localShapeCollection; - for (i = 0; i < len; i += 1) { - shapeData = this.shapes[i]; - localShapeCollection = shapeData.localShapeCollection; - if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) { - localShapeCollection.releaseShapes(); - shapeData.shape._mdf = true; - shapePaths = shapeData.shape.paths.shapes; - jLen = shapeData.shape.paths._length; - for (j = 0; j < jLen; j += 1) { - localShapeCollection.addShape(this.processPath(shapePaths[j], amount)); - } - } - shapeData.shape.paths = shapeData.localShapeCollection; - } - } - if (!this.dynamicProperties.length) { - this._mdf = false; - } -}; - -export default PuckerAndBloatModifier; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/RepeaterModifier.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/RepeaterModifier.js deleted file mode 100644 index 8284b7ae7fe81bc272c4e188da27dc0ae1154b40..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/RepeaterModifier.js +++ /dev/null @@ -1,232 +0,0 @@ -import { - extendPrototype, -} from '../functionExtensions'; -import PropertyFactory from '../PropertyFactory'; -import Matrix from '../../3rd_party/transformation-matrix'; -import TransformPropertyFactory from '../TransformProperty'; -import { - ShapeModifier, -} from './ShapeModifiers'; - -function RepeaterModifier() {} -extendPrototype([ShapeModifier], RepeaterModifier); - -RepeaterModifier.prototype.initModifierProperties = function (elem, data) { - this.getValue = this.processKeys; - this.c = PropertyFactory.getProp(elem, data.c, 0, null, this); - this.o = PropertyFactory.getProp(elem, data.o, 0, null, this); - this.tr = TransformPropertyFactory.getTransformProperty(elem, data.tr, this); - this.so = PropertyFactory.getProp(elem, data.tr.so, 0, 0.01, this); - this.eo = PropertyFactory.getProp(elem, data.tr.eo, 0, 0.01, this); - this.data = data; - if (!this.dynamicProperties.length) { - this.getValue(true); - } - this._isAnimated = !!this.dynamicProperties.length; - this.pMatrix = new Matrix(); - this.rMatrix = new Matrix(); - this.sMatrix = new Matrix(); - this.tMatrix = new Matrix(); - this.matrix = new Matrix(); -}; - -RepeaterModifier.prototype.applyTransforms = function (pMatrix, rMatrix, sMatrix, transform, perc, inv) { - var dir = inv ? -1 : 1; - var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc); - var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc); - pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]); - rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]); - rMatrix.rotate(-transform.r.v * dir * perc); - rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]); - sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]); - sMatrix.scale(inv ? 1 / scaleX : scaleX, inv ? 1 / scaleY : scaleY); - sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]); -}; - -RepeaterModifier.prototype.init = function (elem, arr, pos, elemsData) { - this.elem = elem; - this.arr = arr; - this.pos = pos; - this.elemsData = elemsData; - this._currentCopies = 0; - this._elements = []; - this._groups = []; - this.frameId = -1; - this.initDynamicPropertyContainer(elem); - this.initModifierProperties(elem, arr[pos]); - while (pos > 0) { - pos -= 1; - // this._elements.unshift(arr.splice(pos,1)[0]); - this._elements.unshift(arr[pos]); - } - if (this.dynamicProperties.length) { - this.k = true; - } else { - this.getValue(true); - } -}; - -RepeaterModifier.prototype.resetElements = function (elements) { - var i; - var len = elements.length; - for (i = 0; i < len; i += 1) { - elements[i]._processed = false; - if (elements[i].ty === 'gr') { - this.resetElements(elements[i].it); - } - } -}; - -RepeaterModifier.prototype.cloneElements = function (elements) { - var newElements = JSON.parse(JSON.stringify(elements)); - this.resetElements(newElements); - return newElements; -}; - -RepeaterModifier.prototype.changeGroupRender = function (elements, renderFlag) { - var i; - var len = elements.length; - for (i = 0; i < len; i += 1) { - elements[i]._render = renderFlag; - if (elements[i].ty === 'gr') { - this.changeGroupRender(elements[i].it, renderFlag); - } - } -}; - -RepeaterModifier.prototype.processShapes = function (_isFirstFrame) { - var items; - var itemsTransform; - var i; - var dir; - var cont; - var hasReloaded = false; - if (this._mdf || _isFirstFrame) { - var copies = Math.ceil(this.c.v); - if (this._groups.length < copies) { - while (this._groups.length < copies) { - var group = { - it: this.cloneElements(this._elements), - ty: 'gr', - }; - group.it.push({ - a: { a: 0, ix: 1, k: [0, 0] }, nm: 'Transform', o: { a: 0, ix: 7, k: 100 }, p: { a: 0, ix: 2, k: [0, 0] }, r: { a: 1, ix: 6, k: [{ s: 0, e: 0, t: 0 }, { s: 0, e: 0, t: 1 }] }, s: { a: 0, ix: 3, k: [100, 100] }, sa: { a: 0, ix: 5, k: 0 }, sk: { a: 0, ix: 4, k: 0 }, ty: 'tr', - }); - - this.arr.splice(0, 0, group); - this._groups.splice(0, 0, group); - this._currentCopies += 1; - } - this.elem.reloadShapes(); - hasReloaded = true; - } - cont = 0; - var renderFlag; - for (i = 0; i <= this._groups.length - 1; i += 1) { - renderFlag = cont < copies; - this._groups[i]._render = renderFlag; - this.changeGroupRender(this._groups[i].it, renderFlag); - if (!renderFlag) { - var elems = this.elemsData[i].it; - var transformData = elems[elems.length - 1]; - if (transformData.transform.op.v !== 0) { - transformData.transform.op._mdf = true; - transformData.transform.op.v = 0; - } else { - transformData.transform.op._mdf = false; - } - } - cont += 1; - } - - this._currentCopies = copies; - /// / - - var offset = this.o.v; - var offsetModulo = offset % 1; - var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset); - var pProps = this.pMatrix.props; - var rProps = this.rMatrix.props; - var sProps = this.sMatrix.props; - this.pMatrix.reset(); - this.rMatrix.reset(); - this.sMatrix.reset(); - this.tMatrix.reset(); - this.matrix.reset(); - var iteration = 0; - - if (offset > 0) { - while (iteration < roundOffset) { - this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false); - iteration += 1; - } - if (offsetModulo) { - this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false); - iteration += offsetModulo; - } - } else if (offset < 0) { - while (iteration > roundOffset) { - this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true); - iteration -= 1; - } - if (offsetModulo) { - this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, -offsetModulo, true); - iteration -= offsetModulo; - } - } - i = this.data.m === 1 ? 0 : this._currentCopies - 1; - dir = this.data.m === 1 ? 1 : -1; - cont = this._currentCopies; - var j; - var jLen; - while (cont) { - items = this.elemsData[i].it; - itemsTransform = items[items.length - 1].transform.mProps.v.props; - jLen = itemsTransform.length; - items[items.length - 1].transform.mProps._mdf = true; - items[items.length - 1].transform.op._mdf = true; - items[items.length - 1].transform.op.v = this._currentCopies === 1 - ? this.so.v - : this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1)); - - if (iteration !== 0) { - if ((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)) { - this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false); - } - this.matrix.transform(rProps[0], rProps[1], rProps[2], rProps[3], rProps[4], rProps[5], rProps[6], rProps[7], rProps[8], rProps[9], rProps[10], rProps[11], rProps[12], rProps[13], rProps[14], rProps[15]); - this.matrix.transform(sProps[0], sProps[1], sProps[2], sProps[3], sProps[4], sProps[5], sProps[6], sProps[7], sProps[8], sProps[9], sProps[10], sProps[11], sProps[12], sProps[13], sProps[14], sProps[15]); - this.matrix.transform(pProps[0], pProps[1], pProps[2], pProps[3], pProps[4], pProps[5], pProps[6], pProps[7], pProps[8], pProps[9], pProps[10], pProps[11], pProps[12], pProps[13], pProps[14], pProps[15]); - - for (j = 0; j < jLen; j += 1) { - itemsTransform[j] = this.matrix.props[j]; - } - this.matrix.reset(); - } else { - this.matrix.reset(); - for (j = 0; j < jLen; j += 1) { - itemsTransform[j] = this.matrix.props[j]; - } - } - iteration += 1; - cont -= 1; - i += dir; - } - } else { - cont = this._currentCopies; - i = 0; - dir = 1; - while (cont) { - items = this.elemsData[i].it; - itemsTransform = items[items.length - 1].transform.mProps.v.props; - items[items.length - 1].transform.mProps._mdf = false; - items[items.length - 1].transform.op._mdf = false; - cont -= 1; - i += dir; - } - } - return hasReloaded; -}; - -RepeaterModifier.prototype.addShape = function () {}; - -export default RepeaterModifier; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/RoundCornersModifier.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/RoundCornersModifier.js deleted file mode 100644 index b45c3fb528fcddb69282f8e7d025a75feda95b7c..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/RoundCornersModifier.js +++ /dev/null @@ -1,122 +0,0 @@ -import { - roundCorner, -} from '../common'; -import { - extendPrototype, -} from '../functionExtensions'; -import PropertyFactory from '../PropertyFactory'; -import shapePool from '../pooling/shape_pool'; -import { - ShapeModifier, -} from './ShapeModifiers'; - -function RoundCornersModifier() {} -extendPrototype([ShapeModifier], RoundCornersModifier); -RoundCornersModifier.prototype.initModifierProperties = function (elem, data) { - this.getValue = this.processKeys; - this.rd = PropertyFactory.getProp(elem, data.r, 0, null, this); - this._isAnimated = !!this.rd.effectsSequence.length; -}; - -RoundCornersModifier.prototype.processPath = function (path, round) { - var clonedPath = shapePool.newElement(); - clonedPath.c = path.c; - var i; - var len = path._length; - var currentV; - var currentI; - var currentO; - var closerV; - var distance; - var newPosPerc; - var index = 0; - var vX; - var vY; - var oX; - var oY; - var iX; - var iY; - for (i = 0; i < len; i += 1) { - currentV = path.v[i]; - currentO = path.o[i]; - currentI = path.i[i]; - if (currentV[0] === currentO[0] && currentV[1] === currentO[1] && currentV[0] === currentI[0] && currentV[1] === currentI[1]) { - if ((i === 0 || i === len - 1) && !path.c) { - clonedPath.setTripleAt(currentV[0], currentV[1], currentO[0], currentO[1], currentI[0], currentI[1], index); - /* clonedPath.v[index] = currentV; - clonedPath.o[index] = currentO; - clonedPath.i[index] = currentI; */ - index += 1; - } else { - if (i === 0) { - closerV = path.v[len - 1]; - } else { - closerV = path.v[i - 1]; - } - distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2)); - newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0; - iX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc; - vX = iX; - iY = currentV[1] - (currentV[1] - closerV[1]) * newPosPerc; - vY = iY; - oX = vX - (vX - currentV[0]) * roundCorner; - oY = vY - (vY - currentV[1]) * roundCorner; - clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index); - index += 1; - - if (i === len - 1) { - closerV = path.v[0]; - } else { - closerV = path.v[i + 1]; - } - distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2)); - newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0; - oX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc; - vX = oX; - oY = currentV[1] + (closerV[1] - currentV[1]) * newPosPerc; - vY = oY; - iX = vX - (vX - currentV[0]) * roundCorner; - iY = vY - (vY - currentV[1]) * roundCorner; - clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index); - index += 1; - } - } else { - clonedPath.setTripleAt(path.v[i][0], path.v[i][1], path.o[i][0], path.o[i][1], path.i[i][0], path.i[i][1], index); - index += 1; - } - } - return clonedPath; -}; - -RoundCornersModifier.prototype.processShapes = function (_isFirstFrame) { - var shapePaths; - var i; - var len = this.shapes.length; - var j; - var jLen; - var rd = this.rd.v; - - if (rd !== 0) { - var shapeData; - var localShapeCollection; - for (i = 0; i < len; i += 1) { - shapeData = this.shapes[i]; - localShapeCollection = shapeData.localShapeCollection; - if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) { - localShapeCollection.releaseShapes(); - shapeData.shape._mdf = true; - shapePaths = shapeData.shape.paths.shapes; - jLen = shapeData.shape.paths._length; - for (j = 0; j < jLen; j += 1) { - localShapeCollection.addShape(this.processPath(shapePaths[j], rd)); - } - } - shapeData.shape.paths = shapeData.localShapeCollection; - } - } - if (!this.dynamicProperties.length) { - this._mdf = false; - } -}; - -export default RoundCornersModifier; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ShapeCollection.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ShapeCollection.js deleted file mode 100644 index ea4be625b89c51bb64875646973ee8984639895a..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ShapeCollection.js +++ /dev/null @@ -1,29 +0,0 @@ -import { - createSizedArray, -} from '../helpers/arrays'; -import shapePool from '../pooling/shape_pool'; - -function ShapeCollection() { - this._length = 0; - this._maxLength = 4; - this.shapes = createSizedArray(this._maxLength); -} - -ShapeCollection.prototype.addShape = function (shapeData) { - if (this._length === this._maxLength) { - this.shapes = this.shapes.concat(createSizedArray(this._maxLength)); - this._maxLength *= 2; - } - this.shapes[this._length] = shapeData; - this._length += 1; -}; - -ShapeCollection.prototype.releaseShapes = function () { - var i; - for (i = 0; i < this._length; i += 1) { - shapePool.release(this.shapes[i]); - } - this._length = 0; -}; - -export default ShapeCollection; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ShapeModifiers.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ShapeModifiers.js deleted file mode 100644 index 6340f1f8bce4b5ed00b8dfb1be953f4fb1c8b4d7..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ShapeModifiers.js +++ /dev/null @@ -1,71 +0,0 @@ -import { - extendPrototype, -} from '../functionExtensions'; -import DynamicPropertyContainer from '../helpers/dynamicProperties'; -import { - initialDefaultFrame, -} from '../../main'; -import shapeCollectionPool from '../pooling/shapeCollection_pool'; - -const ShapeModifiers = (function () { - var ob = {}; - var modifiers = {}; - ob.registerModifier = registerModifier; - ob.getModifier = getModifier; - - function registerModifier(nm, factory) { - if (!modifiers[nm]) { - modifiers[nm] = factory; - } - } - - function getModifier(nm, elem, data) { - return new modifiers[nm](elem, data); - } - - return ob; -}()); - -function ShapeModifier() {} -ShapeModifier.prototype.initModifierProperties = function () {}; -ShapeModifier.prototype.addShapeToModifier = function () {}; -ShapeModifier.prototype.addShape = function (data) { - if (!this.closed) { - // Adding shape to dynamic properties. It covers the case where a shape has no effects applied, to reset it's _mdf state on every tick. - data.sh.container.addDynamicProperty(data.sh); - var shapeData = { shape: data.sh, data: data, localShapeCollection: shapeCollectionPool.newShapeCollection() }; - this.shapes.push(shapeData); - this.addShapeToModifier(shapeData); - if (this._isAnimated) { - data.setAsAnimated(); - } - } -}; -ShapeModifier.prototype.init = function (elem, data) { - this.shapes = []; - this.elem = elem; - this.initDynamicPropertyContainer(elem); - this.initModifierProperties(elem, data); - this.frameId = initialDefaultFrame; - this.closed = false; - this.k = false; - if (this.dynamicProperties.length) { - this.k = true; - } else { - this.getValue(true); - } -}; -ShapeModifier.prototype.processKeys = function () { - if (this.elem.globalData.frameId === this.frameId) { - return; - } - this.frameId = this.elem.globalData.frameId; - this.iterateDynamicProperties(); -}; - -extendPrototype([DynamicPropertyContainer], ShapeModifier); - -export { - ShapeModifiers, - ShapeModifier, -}; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ShapePath.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ShapePath.js deleted file mode 100644 index 3e55287882cc597b337afdaeb72573f14430135f..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ShapePath.js +++ /dev/null @@ -1,100 +0,0 @@ -import { - createSizedArray, -} from '../helpers/arrays'; -import pointPool from '../pooling/point_pool'; - -function ShapePath() { - this.c = false; - this._length = 0; - this._maxLength = 8; - this.v = createSizedArray(this._maxLength); - this.o = createSizedArray(this._maxLength); - this.i = createSizedArray(this._maxLength); -} - -ShapePath.prototype.setPathData = function (closed, len) { - this.c = closed; - this.setLength(len); - var i = 0; - while (i < len) { - this.v[i] = pointPool.newElement(); - this.o[i] = pointPool.newElement(); - this.i[i] = pointPool.newElement(); - i += 1; - } -}; - -ShapePath.prototype.setLength = function (len) { - while (this._maxLength < len) { - this.doubleArrayLength(); - } - this._length = len; -}; - -ShapePath.prototype.doubleArrayLength = function () { - this.v = this.v.concat(createSizedArray(this._maxLength)); - this.i = this.i.concat(createSizedArray(this._maxLength)); - this.o = this.o.concat(createSizedArray(this._maxLength)); - this._maxLength *= 2; -}; - -ShapePath.prototype.setXYAt = function (x, y, type, pos, replace) { - var arr; - this._length = Math.max(this._length, pos + 1); - if (this._length >= this._maxLength) { - this.doubleArrayLength(); - } - switch (type) { - case 'v': - arr = this.v; - break; - case 'i': - arr = this.i; - break; - case 'o': - arr = this.o; - break; - default: - arr = []; - break; - } - if (!arr[pos] || (arr[pos] && !replace)) { - arr[pos] = pointPool.newElement(); - } - arr[pos][0] = x; - arr[pos][1] = y; -}; - -ShapePath.prototype.setTripleAt = function (vX, vY, oX, oY, iX, iY, pos, replace) { - this.setXYAt(vX, vY, 'v', pos, replace); - this.setXYAt(oX, oY, 'o', pos, replace); - this.setXYAt(iX, iY, 'i', pos, replace); -}; - -ShapePath.prototype.reverse = function () { - var newPath = new ShapePath(); - newPath.setPathData(this.c, this._length); - var vertices = this.v; - var outPoints = this.o; - var inPoints = this.i; - var init = 0; - if (this.c) { - newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false); - init = 1; - } - var cnt = this._length - 1; - var len = this._length; - - var i; - for (i = init; i < len; i += 1) { - newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false); - cnt -= 1; - } - return newPath; -}; - -ShapePath.prototype.length = function () { - return this._length; -}; - -export default ShapePath; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ShapeProperty.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ShapeProperty.js deleted file mode 100644 index f06e38fcc8947a7addb0c8144d229152de83a73b..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ShapeProperty.js +++ /dev/null @@ -1,546 +0,0 @@ -import { - degToRads, - roundCorner, - bmMin, -} from '../common'; -import { - extendPrototype, -} from '../functionExtensions'; -import DynamicPropertyContainer from '../helpers/dynamicProperties'; -import PropertyFactory from '../PropertyFactory'; -import BezierFactory from '../../3rd_party/BezierEaser'; -import shapePool from '../pooling/shape_pool'; -import shapeCollectionPool from '../pooling/shapeCollection_pool'; - -const ShapePropertyFactory = (function () { - var initFrame = -999999; - - function interpolateShape(frameNum, previousValue, caching) { - var iterationIndex = caching.lastIndex; - var keyPropS; - var keyPropE; - var isHold; - var j; - var k; - var jLen; - var kLen; - var perc; - var vertexValue; - var kf = this.keyframes; - if (frameNum < kf[0].t - this.offsetTime) { - keyPropS = kf[0].s[0]; - isHold = true; - iterationIndex = 0; - } else if (frameNum >= kf[kf.length - 1].t - this.offsetTime) { - keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0]; - /* if(kf[kf.length - 1].s){ - keyPropS = kf[kf.length - 1].s[0]; - }else{ - keyPropS = kf[kf.length - 2].e[0]; - } */ - isHold = true; - } else { - var i = iterationIndex; - var len = kf.length - 1; - var flag = true; - var keyData; - var nextKeyData; - var keyframeMetadata; - while (flag) { - keyData = kf[i]; - nextKeyData = kf[i + 1]; - if ((nextKeyData.t - this.offsetTime) > frameNum) { - break; - } - if (i < len - 1) { - i += 1; - } else { - flag = false; - } - } - keyframeMetadata = this.keyframesMetadata[i] || {}; - isHold = keyData.h === 1; - iterationIndex = i; - if (!isHold) { - if (frameNum >= nextKeyData.t - this.offsetTime) { - perc = 1; - } else if (frameNum < keyData.t - this.offsetTime) { - perc = 0; - } else { - var fnc; - if (keyframeMetadata.__fnct) { - fnc = keyframeMetadata.__fnct; - } else { - fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y).get; - keyframeMetadata.__fnct = fnc; - } - perc = fnc((frameNum - (keyData.t - this.offsetTime)) / ((nextKeyData.t - this.offsetTime) - (keyData.t - this.offsetTime))); - } - keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0]; - } - keyPropS = keyData.s[0]; - } - jLen = previousValue._length; - kLen = keyPropS.i[0].length; - caching.lastIndex = iterationIndex; - - for (j = 0; j < jLen; j += 1) { - for (k = 0; k < kLen; k += 1) { - vertexValue = isHold ? keyPropS.i[j][k] : keyPropS.i[j][k] + (keyPropE.i[j][k] - keyPropS.i[j][k]) * perc; - previousValue.i[j][k] = vertexValue; - vertexValue = isHold ? keyPropS.o[j][k] : keyPropS.o[j][k] + (keyPropE.o[j][k] - keyPropS.o[j][k]) * perc; - previousValue.o[j][k] = vertexValue; - vertexValue = isHold ? keyPropS.v[j][k] : keyPropS.v[j][k] + (keyPropE.v[j][k] - keyPropS.v[j][k]) * perc; - previousValue.v[j][k] = vertexValue; - } - } - } - - function interpolateShapeCurrentTime() { - var frameNum = this.comp.renderedFrame - this.offsetTime; - var initTime = this.keyframes[0].t - this.offsetTime; - var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime; - var lastFrame = this._caching.lastFrame; - if (!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))) { - /// / - this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0; - this.interpolateShape(frameNum, this.pv, this._caching); - /// / - } - this._caching.lastFrame = frameNum; - return this.pv; - } - - function resetShape() { - this.paths = this.localShapeCollection; - } - - function shapesEqual(shape1, shape2) { - if (shape1._length !== shape2._length || shape1.c !== shape2.c) { - return false; - } - var i; - var len = shape1._length; - for (i = 0; i < len; i += 1) { - if (shape1.v[i][0] !== shape2.v[i][0] - || shape1.v[i][1] !== shape2.v[i][1] - || shape1.o[i][0] !== shape2.o[i][0] - || shape1.o[i][1] !== shape2.o[i][1] - || shape1.i[i][0] !== shape2.i[i][0] - || shape1.i[i][1] !== shape2.i[i][1]) { - return false; - } - } - return true; - } - - function setVValue(newPath) { - if (!shapesEqual(this.v, newPath)) { - this.v = shapePool.clone(newPath); - this.localShapeCollection.releaseShapes(); - this.localShapeCollection.addShape(this.v); - this._mdf = true; - this.paths = this.localShapeCollection; - } - } - - function processEffectsSequence() { - if (this.elem.globalData.frameId === this.frameId) { - return; - } if (!this.effectsSequence.length) { - this._mdf = false; - return; - } - if (this.lock) { - this.setVValue(this.pv); - return; - } - this.lock = true; - this._mdf = false; - var finalValue; - if (this.kf) { - finalValue = this.pv; - } else if (this.data.ks) { - finalValue = this.data.ks.k; - } else { - finalValue = this.data.pt.k; - } - var i; - var len = this.effectsSequence.length; - for (i = 0; i < len; i += 1) { - finalValue = this.effectsSequence[i](finalValue); - } - this.setVValue(finalValue); - this.lock = false; - this.frameId = this.elem.globalData.frameId; - } - - function ShapeProperty(elem, data, type) { - this.propType = 'shape'; - this.comp = elem.comp; - this.container = elem; - this.elem = elem; - this.data = data; - this.k = false; - this.kf = false; - this._mdf = false; - var pathData = type === 3 ? data.pt.k : data.ks.k; - this.v = shapePool.clone(pathData); - this.pv = shapePool.clone(this.v); - this.localShapeCollection = shapeCollectionPool.newShapeCollection(); - this.paths = this.localShapeCollection; - this.paths.addShape(this.v); - this.reset = resetShape; - this.effectsSequence = []; - } - - function addEffect(effectFunction) { - this.effectsSequence.push(effectFunction); - this.container.addDynamicProperty(this); - } - - ShapeProperty.prototype.interpolateShape = interpolateShape; - ShapeProperty.prototype.getValue = processEffectsSequence; - ShapeProperty.prototype.setVValue = setVValue; - ShapeProperty.prototype.addEffect = addEffect; - - function KeyframedShapeProperty(elem, data, type) { - this.propType = 'shape'; - this.comp = elem.comp; - this.elem = elem; - this.container = elem; - this.offsetTime = elem.data.st; - this.keyframes = type === 3 ? data.pt.k : data.ks.k; - this.keyframesMetadata = []; - this.k = true; - this.kf = true; - var len = this.keyframes[0].s[0].i.length; - this.v = shapePool.newElement(); - this.v.setPathData(this.keyframes[0].s[0].c, len); - this.pv = shapePool.clone(this.v); - this.localShapeCollection = shapeCollectionPool.newShapeCollection(); - this.paths = this.localShapeCollection; - this.paths.addShape(this.v); - this.lastFrame = initFrame; - this.reset = resetShape; - this._caching = { lastFrame: initFrame, lastIndex: 0 }; - this.effectsSequence = [interpolateShapeCurrentTime.bind(this)]; - } - KeyframedShapeProperty.prototype.getValue = processEffectsSequence; - KeyframedShapeProperty.prototype.interpolateShape = interpolateShape; - KeyframedShapeProperty.prototype.setVValue = setVValue; - KeyframedShapeProperty.prototype.addEffect = addEffect; - - var EllShapeProperty = (function () { - var cPoint = roundCorner; - - function EllShapePropertyFactory(elem, data) { - this.v = shapePool.newElement(); - this.v.setPathData(true, 4); - this.localShapeCollection = shapeCollectionPool.newShapeCollection(); - this.paths = this.localShapeCollection; - this.localShapeCollection.addShape(this.v); - this.d = data.d; - this.elem = elem; - this.comp = elem.comp; - this.frameId = -1; - this.initDynamicPropertyContainer(elem); - this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this); - this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this); - if (this.dynamicProperties.length) { - this.k = true; - } else { - this.k = false; - this.convertEllToPath(); - } - } - - EllShapePropertyFactory.prototype = { - reset: resetShape, - getValue: function () { - if (this.elem.globalData.frameId === this.frameId) { - return; - } - this.frameId = this.elem.globalData.frameId; - this.iterateDynamicProperties(); - - if (this._mdf) { - this.convertEllToPath(); - } - }, - convertEllToPath: function () { - var p0 = this.p.v[0]; - var p1 = this.p.v[1]; - var s0 = this.s.v[0] / 2; - var s1 = this.s.v[1] / 2; - var _cw = this.d !== 3; - var _v = this.v; - _v.v[0][0] = p0; - _v.v[0][1] = p1 - s1; - _v.v[1][0] = _cw ? p0 + s0 : p0 - s0; - _v.v[1][1] = p1; - _v.v[2][0] = p0; - _v.v[2][1] = p1 + s1; - _v.v[3][0] = _cw ? p0 - s0 : p0 + s0; - _v.v[3][1] = p1; - _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint; - _v.i[0][1] = p1 - s1; - _v.i[1][0] = _cw ? p0 + s0 : p0 - s0; - _v.i[1][1] = p1 - s1 * cPoint; - _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint; - _v.i[2][1] = p1 + s1; - _v.i[3][0] = _cw ? p0 - s0 : p0 + s0; - _v.i[3][1] = p1 + s1 * cPoint; - _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint; - _v.o[0][1] = p1 - s1; - _v.o[1][0] = _cw ? p0 + s0 : p0 - s0; - _v.o[1][1] = p1 + s1 * cPoint; - _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint; - _v.o[2][1] = p1 + s1; - _v.o[3][0] = _cw ? p0 - s0 : p0 + s0; - _v.o[3][1] = p1 - s1 * cPoint; - }, - }; - - extendPrototype([DynamicPropertyContainer], EllShapePropertyFactory); - - return EllShapePropertyFactory; - }()); - - var StarShapeProperty = (function () { - function StarShapePropertyFactory(elem, data) { - this.v = shapePool.newElement(); - this.v.setPathData(true, 0); - this.elem = elem; - this.comp = elem.comp; - this.data = data; - this.frameId = -1; - this.d = data.d; - this.initDynamicPropertyContainer(elem); - if (data.sy === 1) { - this.ir = PropertyFactory.getProp(elem, data.ir, 0, 0, this); - this.is = PropertyFactory.getProp(elem, data.is, 0, 0.01, this); - this.convertToPath = this.convertStarToPath; - } else { - this.convertToPath = this.convertPolygonToPath; - } - this.pt = PropertyFactory.getProp(elem, data.pt, 0, 0, this); - this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this); - this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this); - this.or = PropertyFactory.getProp(elem, data.or, 0, 0, this); - this.os = PropertyFactory.getProp(elem, data.os, 0, 0.01, this); - this.localShapeCollection = shapeCollectionPool.newShapeCollection(); - this.localShapeCollection.addShape(this.v); - this.paths = this.localShapeCollection; - if (this.dynamicProperties.length) { - this.k = true; - } else { - this.k = false; - this.convertToPath(); - } - } - - StarShapePropertyFactory.prototype = { - reset: resetShape, - getValue: function () { - if (this.elem.globalData.frameId === this.frameId) { - return; - } - this.frameId = this.elem.globalData.frameId; - this.iterateDynamicProperties(); - if (this._mdf) { - this.convertToPath(); - } - }, - convertStarToPath: function () { - var numPts = Math.floor(this.pt.v) * 2; - var angle = (Math.PI * 2) / numPts; - /* this.v.v.length = numPts; - this.v.i.length = numPts; - this.v.o.length = numPts; */ - var longFlag = true; - var longRad = this.or.v; - var shortRad = this.ir.v; - var longRound = this.os.v; - var shortRound = this.is.v; - var longPerimSegment = (2 * Math.PI * longRad) / (numPts * 2); - var shortPerimSegment = (2 * Math.PI * shortRad) / (numPts * 2); - var i; - var rad; - var roundness; - var perimSegment; - var currentAng = -Math.PI / 2; - currentAng += this.r.v; - var dir = this.data.d === 3 ? -1 : 1; - this.v._length = 0; - for (i = 0; i < numPts; i += 1) { - rad = longFlag ? longRad : shortRad; - roundness = longFlag ? longRound : shortRound; - perimSegment = longFlag ? longPerimSegment : shortPerimSegment; - var x = rad * Math.cos(currentAng); - var y = rad * Math.sin(currentAng); - var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y); - var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y); - x += +this.p.v[0]; - y += +this.p.v[1]; - this.v.setTripleAt(x, y, x - ox * perimSegment * roundness * dir, y - oy * perimSegment * roundness * dir, x + ox * perimSegment * roundness * dir, y + oy * perimSegment * roundness * dir, i, true); - - /* this.v.v[i] = [x,y]; - this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir]; - this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir]; - this.v._length = numPts; */ - longFlag = !longFlag; - currentAng += angle * dir; - } - }, - convertPolygonToPath: function () { - var numPts = Math.floor(this.pt.v); - var angle = (Math.PI * 2) / numPts; - var rad = this.or.v; - var roundness = this.os.v; - var perimSegment = (2 * Math.PI * rad) / (numPts * 4); - var i; - var currentAng = -Math.PI * 0.5; - var dir = this.data.d === 3 ? -1 : 1; - currentAng += this.r.v; - this.v._length = 0; - for (i = 0; i < numPts; i += 1) { - var x = rad * Math.cos(currentAng); - var y = rad * Math.sin(currentAng); - var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y); - var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y); - x += +this.p.v[0]; - y += +this.p.v[1]; - this.v.setTripleAt(x, y, x - ox * perimSegment * roundness * dir, y - oy * perimSegment * roundness * dir, x + ox * perimSegment * roundness * dir, y + oy * perimSegment * roundness * dir, i, true); - currentAng += angle * dir; - } - this.paths.length = 0; - this.paths[0] = this.v; - }, - - }; - extendPrototype([DynamicPropertyContainer], StarShapePropertyFactory); - - return StarShapePropertyFactory; - }()); - - var RectShapeProperty = (function () { - function RectShapePropertyFactory(elem, data) { - this.v = shapePool.newElement(); - this.v.c = true; - this.localShapeCollection = shapeCollectionPool.newShapeCollection(); - this.localShapeCollection.addShape(this.v); - this.paths = this.localShapeCollection; - this.elem = elem; - this.comp = elem.comp; - this.frameId = -1; - this.d = data.d; - this.initDynamicPropertyContainer(elem); - this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this); - this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this); - this.r = PropertyFactory.getProp(elem, data.r, 0, 0, this); - if (this.dynamicProperties.length) { - this.k = true; - } else { - this.k = false; - this.convertRectToPath(); - } - } - - RectShapePropertyFactory.prototype = { - convertRectToPath: function () { - var p0 = this.p.v[0]; - var p1 = this.p.v[1]; - var v0 = this.s.v[0] / 2; - var v1 = this.s.v[1] / 2; - var round = bmMin(v0, v1, this.r.v); - var cPoint = round * (1 - roundCorner); - this.v._length = 0; - - if (this.d === 2 || this.d === 1) { - this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, 0, true); - this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, p0 + v0, p1 + v1 - round, 1, true); - if (round !== 0) { - this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, 2, true); - this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0 + round, p1 + v1, 3, true); - this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, 4, true); - this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1 + round, 5, true); - this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, 6, true); - this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, p0 + v0 - round, p1 - v1, 7, true); - } else { - this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0, p1 + v1, 2); - this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1, 3); - } - } else { - this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, p0 + v0, p1 - v1 + round, 0, true); - if (round !== 0) { - this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, 1, true); - this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0 + round, p1 - v1, 2, true); - this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, 3, true); - this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1 - round, 4, true); - this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, 5, true); - this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0 - round, p1 + v1, 6, true); - this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, 7, true); - } else { - this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0, p1 - v1, 1, true); - this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1, 2, true); - this.v.setTripleAt(p0 + v0, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0, p1 + v1, 3, true); - } - } - }, - getValue: function () { - if (this.elem.globalData.frameId === this.frameId) { - return; - } - this.frameId = this.elem.globalData.frameId; - this.iterateDynamicProperties(); - if (this._mdf) { - this.convertRectToPath(); - } - }, - reset: resetShape, - }; - extendPrototype([DynamicPropertyContainer], RectShapePropertyFactory); - - return RectShapePropertyFactory; - }()); - - function getShapeProp(elem, data, type) { - var prop; - if (type === 3 || type === 4) { - var dataProp = type === 3 ? data.pt : data.ks; - var keys = dataProp.k; - if (keys.length) { - prop = new KeyframedShapeProperty(elem, data, type); - } else { - prop = new ShapeProperty(elem, data, type); - } - } else if (type === 5) { - prop = new RectShapeProperty(elem, data); - } else if (type === 6) { - prop = new EllShapeProperty(elem, data); - } else if (type === 7) { - prop = new StarShapeProperty(elem, data); - } - if (prop.k) { - elem.addDynamicProperty(prop); - } - return prop; - } - - function getConstructorFunction() { - return ShapeProperty; - } - - function getKeyframedConstructorFunction() { - return KeyframedShapeProperty; - } - - var ob = {}; - ob.getShapeProp = getShapeProp; - ob.getConstructorFunction = getConstructorFunction; - ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction; - return ob; -}()); - -export default ShapePropertyFactory; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/TrimModifier.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/TrimModifier.js deleted file mode 100644 index 4d37df81c3bf039e8665e2f9cd8e5917210abece..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/TrimModifier.js +++ /dev/null @@ -1,359 +0,0 @@ -import { - extendPrototype, -} from '../functionExtensions'; -import PropertyFactory from '../PropertyFactory'; -import shapePool from '../pooling/shape_pool'; -import bez from '../bez'; -import { - ShapeModifier, -} from './ShapeModifiers'; -import segmentsLengthPool from '../pooling/segments_length_pool'; - -function TrimModifier() { -} -extendPrototype([ShapeModifier], TrimModifier); -TrimModifier.prototype.initModifierProperties = function (elem, data) { - this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this); - this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this); - this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this); - this.sValue = 0; - this.eValue = 0; - this.getValue = this.processKeys; - this.m = data.m; - this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length; -}; - -TrimModifier.prototype.addShapeToModifier = function (shapeData) { - shapeData.pathsData = []; -}; - -TrimModifier.prototype.calculateShapeEdges = function (s, e, shapeLength, addedLength, totalModifierLength) { - var segments = []; - if (e <= 1) { - segments.push({ - s: s, - e: e, - }); - } else if (s >= 1) { - segments.push({ - s: s - 1, - e: e - 1, - }); - } else { - segments.push({ - s: s, - e: 1, - }); - segments.push({ - s: 0, - e: e - 1, - }); - } - var shapeSegments = []; - var i; - var len = segments.length; - var segmentOb; - for (i = 0; i < len; i += 1) { - segmentOb = segments[i]; - if (!(segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength)) { - var shapeS; - var shapeE; - if (segmentOb.s * totalModifierLength <= addedLength) { - shapeS = 0; - } else { - shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength; - } - if (segmentOb.e * totalModifierLength >= addedLength + shapeLength) { - shapeE = 1; - } else { - shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength); - } - shapeSegments.push([shapeS, shapeE]); - } - } - if (!shapeSegments.length) { - shapeSegments.push([0, 0]); - } - return shapeSegments; -}; - -TrimModifier.prototype.releasePathsData = function (pathsData) { - var i; - var len = pathsData.length; - for (i = 0; i < len; i += 1) { - segmentsLengthPool.release(pathsData[i]); - } - pathsData.length = 0; - return pathsData; -}; - -TrimModifier.prototype.processShapes = function (_isFirstFrame) { - var s; - var e; - if (this._mdf || _isFirstFrame) { - var o = (this.o.v % 360) / 360; - if (o < 0) { - o += 1; - } - if (this.s.v > 1) { - s = 1 + o; - } else if (this.s.v < 0) { - s = 0 + o; - } else { - s = this.s.v + o; - } - if (this.e.v > 1) { - e = 1 + o; - } else if (this.e.v < 0) { - e = 0 + o; - } else { - e = this.e.v + o; - } - - if (s > e) { - var _s = s; - s = e; - e = _s; - } - s = Math.round(s * 10000) * 0.0001; - e = Math.round(e * 10000) * 0.0001; - this.sValue = s; - this.eValue = e; - } else { - s = this.sValue; - e = this.eValue; - } - var shapePaths; - var i; - var len = this.shapes.length; - var j; - var jLen; - var pathsData; - var pathData; - var totalShapeLength; - var totalModifierLength = 0; - - if (e === s) { - for (i = 0; i < len; i += 1) { - this.shapes[i].localShapeCollection.releaseShapes(); - this.shapes[i].shape._mdf = true; - this.shapes[i].shape.paths = this.shapes[i].localShapeCollection; - if (this._mdf) { - this.shapes[i].pathsData.length = 0; - } - } - } else if (!((e === 1 && s === 0) || (e === 0 && s === 1))) { - var segments = []; - var shapeData; - var localShapeCollection; - for (i = 0; i < len; i += 1) { - shapeData = this.shapes[i]; - // if shape hasn't changed and trim properties haven't changed, cached previous path can be used - if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) { - shapeData.shape.paths = shapeData.localShapeCollection; - } else { - shapePaths = shapeData.shape.paths; - jLen = shapePaths._length; - totalShapeLength = 0; - if (!shapeData.shape._mdf && shapeData.pathsData.length) { - totalShapeLength = shapeData.totalShapeLength; - } else { - pathsData = this.releasePathsData(shapeData.pathsData); - for (j = 0; j < jLen; j += 1) { - pathData = bez.getSegmentsLength(shapePaths.shapes[j]); - pathsData.push(pathData); - totalShapeLength += pathData.totalLength; - } - shapeData.totalShapeLength = totalShapeLength; - shapeData.pathsData = pathsData; - } - - totalModifierLength += totalShapeLength; - shapeData.shape._mdf = true; - } - } - var shapeS = s; - var shapeE = e; - var addedLength = 0; - var edges; - for (i = len - 1; i >= 0; i -= 1) { - shapeData = this.shapes[i]; - if (shapeData.shape._mdf) { - localShapeCollection = shapeData.localShapeCollection; - localShapeCollection.releaseShapes(); - // if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group - if (this.m === 2 && len > 1) { - edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength); - addedLength += shapeData.totalShapeLength; - } else { - edges = [[shapeS, shapeE]]; - } - jLen = edges.length; - for (j = 0; j < jLen; j += 1) { - shapeS = edges[j][0]; - shapeE = edges[j][1]; - segments.length = 0; - if (shapeE <= 1) { - segments.push({ - s: shapeData.totalShapeLength * shapeS, - e: shapeData.totalShapeLength * shapeE, - }); - } else if (shapeS >= 1) { - segments.push({ - s: shapeData.totalShapeLength * (shapeS - 1), - e: shapeData.totalShapeLength * (shapeE - 1), - }); - } else { - segments.push({ - s: shapeData.totalShapeLength * shapeS, - e: shapeData.totalShapeLength, - }); - segments.push({ - s: 0, - e: shapeData.totalShapeLength * (shapeE - 1), - }); - } - var newShapesData = this.addShapes(shapeData, segments[0]); - if (segments[0].s !== segments[0].e) { - if (segments.length > 1) { - var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1]; - if (lastShapeInCollection.c) { - var lastShape = newShapesData.pop(); - this.addPaths(newShapesData, localShapeCollection); - newShapesData = this.addShapes(shapeData, segments[1], lastShape); - } else { - this.addPaths(newShapesData, localShapeCollection); - newShapesData = this.addShapes(shapeData, segments[1]); - } - } - this.addPaths(newShapesData, localShapeCollection); - } - } - shapeData.shape.paths = localShapeCollection; - } - } - } else if (this._mdf) { - for (i = 0; i < len; i += 1) { - // Releasign Trim Cached paths data when no trim applied in case shapes are modified in between. - // Don't remove this even if it's losing cached info. - this.shapes[i].pathsData.length = 0; - this.shapes[i].shape._mdf = true; - } - } -}; - -TrimModifier.prototype.addPaths = function (newPaths, localShapeCollection) { - var i; - var len = newPaths.length; - for (i = 0; i < len; i += 1) { - localShapeCollection.addShape(newPaths[i]); - } -}; - -TrimModifier.prototype.addSegment = function (pt1, pt2, pt3, pt4, shapePath, pos, newShape) { - shapePath.setXYAt(pt2[0], pt2[1], 'o', pos); - shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1); - if (newShape) { - shapePath.setXYAt(pt1[0], pt1[1], 'v', pos); - } - shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1); -}; - -TrimModifier.prototype.addSegmentFromArray = function (points, shapePath, pos, newShape) { - shapePath.setXYAt(points[1], points[5], 'o', pos); - shapePath.setXYAt(points[2], points[6], 'i', pos + 1); - if (newShape) { - shapePath.setXYAt(points[0], points[4], 'v', pos); - } - shapePath.setXYAt(points[3], points[7], 'v', pos + 1); -}; - -TrimModifier.prototype.addShapes = function (shapeData, shapeSegment, shapePath) { - var pathsData = shapeData.pathsData; - var shapePaths = shapeData.shape.paths.shapes; - var i; - var len = shapeData.shape.paths._length; - var j; - var jLen; - var addedLength = 0; - var currentLengthData; - var segmentCount; - var lengths; - var segment; - var shapes = []; - var initPos; - var newShape = true; - if (!shapePath) { - shapePath = shapePool.newElement(); - segmentCount = 0; - initPos = 0; - } else { - segmentCount = shapePath._length; - initPos = shapePath._length; - } - shapes.push(shapePath); - for (i = 0; i < len; i += 1) { - lengths = pathsData[i].lengths; - shapePath.c = shapePaths[i].c; - jLen = shapePaths[i].c ? lengths.length : lengths.length + 1; - for (j = 1; j < jLen; j += 1) { - currentLengthData = lengths[j - 1]; - if (addedLength + currentLengthData.addedLength < shapeSegment.s) { - addedLength += currentLengthData.addedLength; - shapePath.c = false; - } else if (addedLength > shapeSegment.e) { - shapePath.c = false; - break; - } else { - if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) { - this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape); - newShape = false; - } else { - segment = bez.getNewSegment(shapePaths[i].v[j - 1], shapePaths[i].v[j], shapePaths[i].o[j - 1], shapePaths[i].i[j], (shapeSegment.s - addedLength) / currentLengthData.addedLength, (shapeSegment.e - addedLength) / currentLengthData.addedLength, lengths[j - 1]); - this.addSegmentFromArray(segment, shapePath, segmentCount, newShape); - // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape); - newShape = false; - shapePath.c = false; - } - addedLength += currentLengthData.addedLength; - segmentCount += 1; - } - } - if (shapePaths[i].c && lengths.length) { - currentLengthData = lengths[j - 1]; - if (addedLength <= shapeSegment.e) { - var segmentLength = lengths[j - 1].addedLength; - if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) { - this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape); - newShape = false; - } else { - segment = bez.getNewSegment(shapePaths[i].v[j - 1], shapePaths[i].v[0], shapePaths[i].o[j - 1], shapePaths[i].i[0], (shapeSegment.s - addedLength) / segmentLength, (shapeSegment.e - addedLength) / segmentLength, lengths[j - 1]); - this.addSegmentFromArray(segment, shapePath, segmentCount, newShape); - // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape); - newShape = false; - shapePath.c = false; - } - } else { - shapePath.c = false; - } - addedLength += currentLengthData.addedLength; - segmentCount += 1; - } - if (shapePath._length) { - shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos); - shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1], 'o', shapePath._length - 1); - } - if (addedLength > shapeSegment.e) { - break; - } - if (i < len - 1) { - shapePath = shapePool.newElement(); - newShape = true; - shapes.push(shapePath); - segmentCount = 0; - } - } - return shapes; -}; - -export default TrimModifier; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ZigZagModifier.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ZigZagModifier.js deleted file mode 100644 index f84538b9792bddbb755e8f877b196a65939ad6bd..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/ZigZagModifier.js +++ /dev/null @@ -1,174 +0,0 @@ -import { - extendPrototype, -} from '../functionExtensions'; -import PropertyFactory from '../PropertyFactory'; -import shapePool from '../pooling/shape_pool'; -import { - ShapeModifier, -} from './ShapeModifiers'; -import { PolynomialBezier } from '../PolynomialBezier'; - -function ZigZagModifier() {} -extendPrototype([ShapeModifier], ZigZagModifier); -ZigZagModifier.prototype.initModifierProperties = function (elem, data) { - this.getValue = this.processKeys; - this.amplitude = PropertyFactory.getProp(elem, data.s, 0, null, this); - this.frequency = PropertyFactory.getProp(elem, data.r, 0, null, this); - this.pointsType = PropertyFactory.getProp(elem, data.pt, 0, null, this); - this._isAnimated = this.amplitude.effectsSequence.length !== 0 || this.frequency.effectsSequence.length !== 0 || this.pointsType.effectsSequence.length !== 0; -}; - -function setPoint(outputBezier, point, angle, direction, amplitude, outAmplitude, inAmplitude) { - var angO = angle - Math.PI / 2; - var angI = angle + Math.PI / 2; - var px = point[0] + Math.cos(angle) * direction * amplitude; - var py = point[1] - Math.sin(angle) * direction * amplitude; - - outputBezier.setTripleAt( - px, - py, - px + Math.cos(angO) * outAmplitude, - py - Math.sin(angO) * outAmplitude, - px + Math.cos(angI) * inAmplitude, - py - Math.sin(angI) * inAmplitude, - outputBezier.length() - ); -} - -function getPerpendicularVector(pt1, pt2) { - var vector = [ - pt2[0] - pt1[0], - pt2[1] - pt1[1], - ]; - var rot = -Math.PI * 0.5; - var rotatedVector = [ - Math.cos(rot) * vector[0] - Math.sin(rot) * vector[1], - Math.sin(rot) * vector[0] + Math.cos(rot) * vector[1], - ]; - return rotatedVector; -} - -function getProjectingAngle(path, cur) { - var prevIndex = cur === 0 ? path.length() - 1 : cur - 1; - var nextIndex = (cur + 1) % path.length(); - var prevPoint = path.v[prevIndex]; - var nextPoint = path.v[nextIndex]; - var pVector = getPerpendicularVector(prevPoint, nextPoint); - return Math.atan2(0, 1) - Math.atan2(pVector[1], pVector[0]); -} - -function zigZagCorner(outputBezier, path, cur, amplitude, frequency, pointType, direction) { - var angle = getProjectingAngle(path, cur); - var point = path.v[cur % path._length]; - var prevPoint = path.v[cur === 0 ? path._length - 1 : cur - 1]; - var nextPoint = path.v[(cur + 1) % path._length]; - var prevDist = pointType === 2 - ? Math.sqrt(Math.pow(point[0] - prevPoint[0], 2) + Math.pow(point[1] - prevPoint[1], 2)) - : 0; - var nextDist = pointType === 2 - ? Math.sqrt(Math.pow(point[0] - nextPoint[0], 2) + Math.pow(point[1] - nextPoint[1], 2)) - : 0; - - setPoint( - outputBezier, - path.v[cur % path._length], - angle, - direction, - amplitude, - nextDist / ((frequency + 1) * 2), - prevDist / ((frequency + 1) * 2), - pointType - ); -} - -function zigZagSegment(outputBezier, segment, amplitude, frequency, pointType, direction) { - for (var i = 0; i < frequency; i += 1) { - var t = (i + 1) / (frequency + 1); - - var dist = pointType === 2 - ? Math.sqrt(Math.pow(segment.points[3][0] - segment.points[0][0], 2) + Math.pow(segment.points[3][1] - segment.points[0][1], 2)) - : 0; - - var angle = segment.normalAngle(t); - var point = segment.point(t); - setPoint( - outputBezier, - point, - angle, - direction, - amplitude, - dist / ((frequency + 1) * 2), - dist / ((frequency + 1) * 2), - pointType - ); - - direction = -direction; - } - - return direction; -} - -ZigZagModifier.prototype.processPath = function (path, amplitude, frequency, pointType) { - var count = path._length; - var clonedPath = shapePool.newElement(); - clonedPath.c = path.c; - - if (!path.c) { - count -= 1; - } - - if (count === 0) return clonedPath; - - var direction = -1; - var segment = PolynomialBezier.shapeSegment(path, 0); - zigZagCorner(clonedPath, path, 0, amplitude, frequency, pointType, direction); - - for (var i = 0; i < count; i += 1) { - direction = zigZagSegment(clonedPath, segment, amplitude, frequency, pointType, -direction); - - if (i === count - 1 && !path.c) { - segment = null; - } else { - segment = PolynomialBezier.shapeSegment(path, (i + 1) % count); - } - - zigZagCorner(clonedPath, path, i + 1, amplitude, frequency, pointType, direction); - } - - return clonedPath; -}; - -ZigZagModifier.prototype.processShapes = function (_isFirstFrame) { - var shapePaths; - var i; - var len = this.shapes.length; - var j; - var jLen; - var amplitude = this.amplitude.v; - var frequency = Math.max(0, Math.round(this.frequency.v)); - var pointType = this.pointsType.v; - - if (amplitude !== 0) { - var shapeData; - var localShapeCollection; - for (i = 0; i < len; i += 1) { - shapeData = this.shapes[i]; - localShapeCollection = shapeData.localShapeCollection; - if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) { - localShapeCollection.releaseShapes(); - shapeData.shape._mdf = true; - shapePaths = shapeData.shape.paths.shapes; - jLen = shapeData.shape.paths._length; - for (j = 0; j < jLen; j += 1) { - localShapeCollection.addShape(this.processPath(shapePaths[j], amplitude, frequency, pointType)); - } - } - shapeData.shape.paths = shapeData.localShapeCollection; - } - } - if (!this.dynamicProperties.length) { - this._mdf = false; - } -}; - -export default ZigZagModifier; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/shapePathBuilder.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/shapePathBuilder.js deleted file mode 100644 index 36fc1024ff49325787f47c88345167ee0a819ac5..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/shapes/shapePathBuilder.js +++ /dev/null @@ -1,20 +0,0 @@ -const buildShapeString = function (pathNodes, length, closed, mat) { - if (length === 0) { - return ''; - } - var _o = pathNodes.o; - var _i = pathNodes.i; - var _v = pathNodes.v; - var i; - var shapeString = ' M' + mat.applyToPointStringified(_v[0][0], _v[0][1]); - for (i = 1; i < length; i += 1) { - shapeString += ' C' + mat.applyToPointStringified(_o[i - 1][0], _o[i - 1][1]) + ' ' + mat.applyToPointStringified(_i[i][0], _i[i][1]) + ' ' + mat.applyToPointStringified(_v[i][0], _v[i][1]); - } - if (closed && length) { - shapeString += ' C' + mat.applyToPointStringified(_o[i - 1][0], _o[i - 1][1]) + ' ' + mat.applyToPointStringified(_i[0][0], _i[0][1]) + ' ' + mat.applyToPointStringified(_v[0][0], _v[0][1]); - shapeString += 'z'; - } - return shapeString; -}; - -export default buildShapeString; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/LetterProps.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/LetterProps.js deleted file mode 100644 index 1c752d6b18b1a53bf350793c7313c0ccb06442c3..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/LetterProps.js +++ /dev/null @@ -1,60 +0,0 @@ -function LetterProps(o, sw, sc, fc, m, p) { - this.o = o; - this.sw = sw; - this.sc = sc; - this.fc = fc; - this.m = m; - this.p = p; - this._mdf = { - o: true, - sw: !!sw, - sc: !!sc, - fc: !!fc, - m: true, - p: true, - }; -} - -LetterProps.prototype.update = function (o, sw, sc, fc, m, p) { - this._mdf.o = false; - this._mdf.sw = false; - this._mdf.sc = false; - this._mdf.fc = false; - this._mdf.m = false; - this._mdf.p = false; - var updated = false; - - if (this.o !== o) { - this.o = o; - this._mdf.o = true; - updated = true; - } - if (this.sw !== sw) { - this.sw = sw; - this._mdf.sw = true; - updated = true; - } - if (this.sc !== sc) { - this.sc = sc; - this._mdf.sc = true; - updated = true; - } - if (this.fc !== fc) { - this.fc = fc; - this._mdf.fc = true; - updated = true; - } - if (this.m !== m) { - this.m = m; - this._mdf.m = true; - updated = true; - } - if (p.length && (this.p[0] !== p[0] || this.p[1] !== p[1] || this.p[4] !== p[4] || this.p[5] !== p[5] || this.p[12] !== p[12] || this.p[13] !== p[13])) { - this.p = p; - this._mdf.p = true; - updated = true; - } - return updated; -}; - -export default LetterProps; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/TextAnimatorDataProperty.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/TextAnimatorDataProperty.js deleted file mode 100644 index 535c882e618f69bee4e03a0fae9d204cb40dff67..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/TextAnimatorDataProperty.js +++ /dev/null @@ -1,34 +0,0 @@ -import { - degToRads, -} from '../common'; -import PropertyFactory from '../PropertyFactory'; -import TextSelectorProp from './TextSelectorProperty'; - -function TextAnimatorDataProperty(elem, animatorProps, container) { - var defaultData = { propType: false }; - var getProp = PropertyFactory.getProp; - var textAnimatorAnimatables = animatorProps.a; - this.a = { - r: textAnimatorAnimatables.r ? getProp(elem, textAnimatorAnimatables.r, 0, degToRads, container) : defaultData, - rx: textAnimatorAnimatables.rx ? getProp(elem, textAnimatorAnimatables.rx, 0, degToRads, container) : defaultData, - ry: textAnimatorAnimatables.ry ? getProp(elem, textAnimatorAnimatables.ry, 0, degToRads, container) : defaultData, - sk: textAnimatorAnimatables.sk ? getProp(elem, textAnimatorAnimatables.sk, 0, degToRads, container) : defaultData, - sa: textAnimatorAnimatables.sa ? getProp(elem, textAnimatorAnimatables.sa, 0, degToRads, container) : defaultData, - s: textAnimatorAnimatables.s ? getProp(elem, textAnimatorAnimatables.s, 1, 0.01, container) : defaultData, - a: textAnimatorAnimatables.a ? getProp(elem, textAnimatorAnimatables.a, 1, 0, container) : defaultData, - o: textAnimatorAnimatables.o ? getProp(elem, textAnimatorAnimatables.o, 0, 0.01, container) : defaultData, - p: textAnimatorAnimatables.p ? getProp(elem, textAnimatorAnimatables.p, 1, 0, container) : defaultData, - sw: textAnimatorAnimatables.sw ? getProp(elem, textAnimatorAnimatables.sw, 0, 0, container) : defaultData, - sc: textAnimatorAnimatables.sc ? getProp(elem, textAnimatorAnimatables.sc, 1, 0, container) : defaultData, - fc: textAnimatorAnimatables.fc ? getProp(elem, textAnimatorAnimatables.fc, 1, 0, container) : defaultData, - fh: textAnimatorAnimatables.fh ? getProp(elem, textAnimatorAnimatables.fh, 0, 0, container) : defaultData, - fs: textAnimatorAnimatables.fs ? getProp(elem, textAnimatorAnimatables.fs, 0, 0.01, container) : defaultData, - fb: textAnimatorAnimatables.fb ? getProp(elem, textAnimatorAnimatables.fb, 0, 0.01, container) : defaultData, - t: textAnimatorAnimatables.t ? getProp(elem, textAnimatorAnimatables.t, 0, 0, container) : defaultData, - }; - - this.s = TextSelectorProp.getTextSelectorProp(elem, animatorProps.s, container); - this.s.t = animatorProps.s.t; -} - -export default TextAnimatorDataProperty; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/TextAnimatorProperty.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/TextAnimatorProperty.js deleted file mode 100644 index 47df2d9e1731ccfb5e73642dca7468c7325c1463..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/TextAnimatorProperty.js +++ /dev/null @@ -1,610 +0,0 @@ -import { - addSaturationToRGB, - addBrightnessToRGB, - addHueToRGB, -} from '../common'; -import { - extendPrototype, -} from '../functionExtensions'; -import DynamicPropertyContainer from '../helpers/dynamicProperties'; -import { - createSizedArray, -} from '../helpers/arrays'; -import PropertyFactory from '../PropertyFactory'; -import bez from '../bez'; -import Matrix from '../../3rd_party/transformation-matrix'; -import TextAnimatorDataProperty from './TextAnimatorDataProperty'; -import LetterProps from './LetterProps'; - -function TextAnimatorProperty(textData, renderType, elem) { - this._isFirstFrame = true; - this._hasMaskedPath = false; - this._frameId = -1; - this._textData = textData; - this._renderType = renderType; - this._elem = elem; - this._animatorsData = createSizedArray(this._textData.a.length); - this._pathData = {}; - this._moreOptions = { - alignment: {}, - }; - this.renderedLetters = []; - this.lettersChangedFlag = false; - this.initDynamicPropertyContainer(elem); -} - -TextAnimatorProperty.prototype.searchProperties = function () { - var i; - var len = this._textData.a.length; - var animatorProps; - var getProp = PropertyFactory.getProp; - for (i = 0; i < len; i += 1) { - animatorProps = this._textData.a[i]; - this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this); - } - if (this._textData.p && 'm' in this._textData.p) { - this._pathData = { - a: getProp(this._elem, this._textData.p.a, 0, 0, this), - f: getProp(this._elem, this._textData.p.f, 0, 0, this), - l: getProp(this._elem, this._textData.p.l, 0, 0, this), - r: getProp(this._elem, this._textData.p.r, 0, 0, this), - p: getProp(this._elem, this._textData.p.p, 0, 0, this), - m: this._elem.maskManager.getMaskProperty(this._textData.p.m), - }; - this._hasMaskedPath = true; - } else { - this._hasMaskedPath = false; - } - this._moreOptions.alignment = getProp(this._elem, this._textData.m.a, 1, 0, this); -}; - -TextAnimatorProperty.prototype.getMeasures = function (documentData, lettersChangedFlag) { - this.lettersChangedFlag = lettersChangedFlag; - if (!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) { - return; - } - this._isFirstFrame = false; - var alignment = this._moreOptions.alignment.v; - var animators = this._animatorsData; - var textData = this._textData; - var matrixHelper = this.mHelper; - var renderType = this._renderType; - var renderedLettersCount = this.renderedLetters.length; - var xPos; - var yPos; - var i; - var len; - var letters = documentData.l; - var pathInfo; - var currentLength; - var currentPoint; - var segmentLength; - var flag; - var pointInd; - var segmentInd; - var prevPoint; - var points; - var segments; - var partialLength; - var totalLength; - var perc; - var tanAngle; - var mask; - if (this._hasMaskedPath) { - mask = this._pathData.m; - if (!this._pathData.n || this._pathData._mdf) { - var paths = mask.v; - if (this._pathData.r.v) { - paths = paths.reverse(); - } - // TODO: release bezier data cached from previous pathInfo: this._pathData.pi - pathInfo = { - tLength: 0, - segments: [], - }; - len = paths._length - 1; - var bezierData; - totalLength = 0; - for (i = 0; i < len; i += 1) { - bezierData = bez.buildBezierData(paths.v[i], - paths.v[i + 1], - [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]], - [paths.i[i + 1][0] - paths.v[i + 1][0], paths.i[i + 1][1] - paths.v[i + 1][1]]); - pathInfo.tLength += bezierData.segmentLength; - pathInfo.segments.push(bezierData); - totalLength += bezierData.segmentLength; - } - i = len; - if (mask.v.c) { - bezierData = bez.buildBezierData(paths.v[i], - paths.v[0], - [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]], - [paths.i[0][0] - paths.v[0][0], paths.i[0][1] - paths.v[0][1]]); - pathInfo.tLength += bezierData.segmentLength; - pathInfo.segments.push(bezierData); - totalLength += bezierData.segmentLength; - } - this._pathData.pi = pathInfo; - } - pathInfo = this._pathData.pi; - - currentLength = this._pathData.f.v; - segmentInd = 0; - pointInd = 1; - segmentLength = 0; - flag = true; - segments = pathInfo.segments; - if (currentLength < 0 && mask.v.c) { - if (pathInfo.tLength < Math.abs(currentLength)) { - currentLength = -Math.abs(currentLength) % pathInfo.tLength; - } - segmentInd = segments.length - 1; - points = segments[segmentInd].points; - pointInd = points.length - 1; - while (currentLength < 0) { - currentLength += points[pointInd].partialLength; - pointInd -= 1; - if (pointInd < 0) { - segmentInd -= 1; - points = segments[segmentInd].points; - pointInd = points.length - 1; - } - } - } - points = segments[segmentInd].points; - prevPoint = points[pointInd - 1]; - currentPoint = points[pointInd]; - partialLength = currentPoint.partialLength; - } - - len = letters.length; - xPos = 0; - yPos = 0; - var yOff = documentData.finalSize * 1.2 * 0.714; - var firstLine = true; - var animatorProps; - var animatorSelector; - var j; - var jLen; - var letterValue; - - jLen = animators.length; - - var mult; - var ind = -1; - var offf; - var xPathPos; - var yPathPos; - var initPathPos = currentLength; - var initSegmentInd = segmentInd; - var initPointInd = pointInd; - var currentLine = -1; - var elemOpacity; - var sc; - var sw; - var fc; - var k; - var letterSw; - var letterSc; - var letterFc; - var letterM = ''; - var letterP = this.defaultPropsArray; - var letterO; - - // - if (documentData.j === 2 || documentData.j === 1) { - var animatorJustifyOffset = 0; - var animatorFirstCharOffset = 0; - var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1; - var lastIndex = 0; - var isNewLine = true; - - for (i = 0; i < len; i += 1) { - if (letters[i].n) { - if (animatorJustifyOffset) { - animatorJustifyOffset += animatorFirstCharOffset; - } - while (lastIndex < i) { - letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset; - lastIndex += 1; - } - animatorJustifyOffset = 0; - isNewLine = true; - } else { - for (j = 0; j < jLen; j += 1) { - animatorProps = animators[j].a; - if (animatorProps.t.propType) { - if (isNewLine && documentData.j === 2) { - animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult; - } - animatorSelector = animators[j].s; - mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars); - if (mult.length) { - animatorJustifyOffset += animatorProps.t.v * mult[0] * justifyOffsetMult; - } else { - animatorJustifyOffset += animatorProps.t.v * mult * justifyOffsetMult; - } - } - } - isNewLine = false; - } - } - if (animatorJustifyOffset) { - animatorJustifyOffset += animatorFirstCharOffset; - } - while (lastIndex < i) { - letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset; - lastIndex += 1; - } - } - // - - for (i = 0; i < len; i += 1) { - matrixHelper.reset(); - elemOpacity = 1; - if (letters[i].n) { - xPos = 0; - yPos += documentData.yOffset; - yPos += firstLine ? 1 : 0; - currentLength = initPathPos; - firstLine = false; - if (this._hasMaskedPath) { - segmentInd = initSegmentInd; - pointInd = initPointInd; - points = segments[segmentInd].points; - prevPoint = points[pointInd - 1]; - currentPoint = points[pointInd]; - partialLength = currentPoint.partialLength; - segmentLength = 0; - } - letterM = ''; - letterFc = ''; - letterSw = ''; - letterO = ''; - letterP = this.defaultPropsArray; - } else { - if (this._hasMaskedPath) { - if (currentLine !== letters[i].line) { - switch (documentData.j) { - case 1: - currentLength += totalLength - documentData.lineWidths[letters[i].line]; - break; - case 2: - currentLength += (totalLength - documentData.lineWidths[letters[i].line]) / 2; - break; - default: - break; - } - currentLine = letters[i].line; - } - if (ind !== letters[i].ind) { - if (letters[ind]) { - currentLength += letters[ind].extra; - } - currentLength += letters[i].an / 2; - ind = letters[i].ind; - } - currentLength += (alignment[0] * letters[i].an) * 0.005; - var animatorOffset = 0; - for (j = 0; j < jLen; j += 1) { - animatorProps = animators[j].a; - if (animatorProps.p.propType) { - animatorSelector = animators[j].s; - mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars); - if (mult.length) { - animatorOffset += animatorProps.p.v[0] * mult[0]; - } else { - animatorOffset += animatorProps.p.v[0] * mult; - } - } - if (animatorProps.a.propType) { - animatorSelector = animators[j].s; - mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars); - if (mult.length) { - animatorOffset += animatorProps.a.v[0] * mult[0]; - } else { - animatorOffset += animatorProps.a.v[0] * mult; - } - } - } - flag = true; - // Force alignment only works with a single line for now - if (this._pathData.a.v) { - currentLength = letters[0].an * 0.5 + ((totalLength - this._pathData.f.v - letters[0].an * 0.5 - letters[letters.length - 1].an * 0.5) * ind) / (len - 1); - currentLength += this._pathData.f.v; - } - while (flag) { - if (segmentLength + partialLength >= currentLength + animatorOffset || !points) { - perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength; - xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc; - yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc; - matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, -(alignment[1] * yOff) * 0.01); - flag = false; - } else if (points) { - segmentLength += currentPoint.partialLength; - pointInd += 1; - if (pointInd >= points.length) { - pointInd = 0; - segmentInd += 1; - if (!segments[segmentInd]) { - if (mask.v.c) { - pointInd = 0; - segmentInd = 0; - points = segments[segmentInd].points; - } else { - segmentLength -= currentPoint.partialLength; - points = null; - } - } else { - points = segments[segmentInd].points; - } - } - if (points) { - prevPoint = currentPoint; - currentPoint = points[pointInd]; - partialLength = currentPoint.partialLength; - } - } - } - offf = letters[i].an / 2 - letters[i].add; - matrixHelper.translate(-offf, 0, 0); - } else { - offf = letters[i].an / 2 - letters[i].add; - matrixHelper.translate(-offf, 0, 0); - - // Grouping alignment - matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, (-alignment[1] * yOff) * 0.01, 0); - } - - for (j = 0; j < jLen; j += 1) { - animatorProps = animators[j].a; - if (animatorProps.t.propType) { - animatorSelector = animators[j].s; - mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars); - // This condition is to prevent applying tracking to first character in each line. Might be better to use a boolean "isNewLine" - if (xPos !== 0 || documentData.j !== 0) { - if (this._hasMaskedPath) { - if (mult.length) { - currentLength += animatorProps.t.v * mult[0]; - } else { - currentLength += animatorProps.t.v * mult; - } - } else if (mult.length) { - xPos += animatorProps.t.v * mult[0]; - } else { - xPos += animatorProps.t.v * mult; - } - } - } - } - if (documentData.strokeWidthAnim) { - sw = documentData.sw || 0; - } - if (documentData.strokeColorAnim) { - if (documentData.sc) { - sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]]; - } else { - sc = [0, 0, 0]; - } - } - if (documentData.fillColorAnim && documentData.fc) { - fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]]; - } - for (j = 0; j < jLen; j += 1) { - animatorProps = animators[j].a; - if (animatorProps.a.propType) { - animatorSelector = animators[j].s; - mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars); - - if (mult.length) { - matrixHelper.translate(-animatorProps.a.v[0] * mult[0], -animatorProps.a.v[1] * mult[1], animatorProps.a.v[2] * mult[2]); - } else { - matrixHelper.translate(-animatorProps.a.v[0] * mult, -animatorProps.a.v[1] * mult, animatorProps.a.v[2] * mult); - } - } - } - for (j = 0; j < jLen; j += 1) { - animatorProps = animators[j].a; - if (animatorProps.s.propType) { - animatorSelector = animators[j].s; - mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars); - if (mult.length) { - matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult[0]), 1 + ((animatorProps.s.v[1] - 1) * mult[1]), 1); - } else { - matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult), 1 + ((animatorProps.s.v[1] - 1) * mult), 1); - } - } - } - for (j = 0; j < jLen; j += 1) { - animatorProps = animators[j].a; - animatorSelector = animators[j].s; - mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars); - if (animatorProps.sk.propType) { - if (mult.length) { - matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]); - } else { - matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult); - } - } - if (animatorProps.r.propType) { - if (mult.length) { - matrixHelper.rotateZ(-animatorProps.r.v * mult[2]); - } else { - matrixHelper.rotateZ(-animatorProps.r.v * mult); - } - } - if (animatorProps.ry.propType) { - if (mult.length) { - matrixHelper.rotateY(animatorProps.ry.v * mult[1]); - } else { - matrixHelper.rotateY(animatorProps.ry.v * mult); - } - } - if (animatorProps.rx.propType) { - if (mult.length) { - matrixHelper.rotateX(animatorProps.rx.v * mult[0]); - } else { - matrixHelper.rotateX(animatorProps.rx.v * mult); - } - } - if (animatorProps.o.propType) { - if (mult.length) { - elemOpacity += ((animatorProps.o.v) * mult[0] - elemOpacity) * mult[0]; - } else { - elemOpacity += ((animatorProps.o.v) * mult - elemOpacity) * mult; - } - } - if (documentData.strokeWidthAnim && animatorProps.sw.propType) { - if (mult.length) { - sw += animatorProps.sw.v * mult[0]; - } else { - sw += animatorProps.sw.v * mult; - } - } - if (documentData.strokeColorAnim && animatorProps.sc.propType) { - for (k = 0; k < 3; k += 1) { - if (mult.length) { - sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult[0]; - } else { - sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult; - } - } - } - if (documentData.fillColorAnim && documentData.fc) { - if (animatorProps.fc.propType) { - for (k = 0; k < 3; k += 1) { - if (mult.length) { - fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult[0]; - } else { - fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult; - } - } - } - if (animatorProps.fh.propType) { - if (mult.length) { - fc = addHueToRGB(fc, animatorProps.fh.v * mult[0]); - } else { - fc = addHueToRGB(fc, animatorProps.fh.v * mult); - } - } - if (animatorProps.fs.propType) { - if (mult.length) { - fc = addSaturationToRGB(fc, animatorProps.fs.v * mult[0]); - } else { - fc = addSaturationToRGB(fc, animatorProps.fs.v * mult); - } - } - if (animatorProps.fb.propType) { - if (mult.length) { - fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult[0]); - } else { - fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult); - } - } - } - } - - for (j = 0; j < jLen; j += 1) { - animatorProps = animators[j].a; - - if (animatorProps.p.propType) { - animatorSelector = animators[j].s; - mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars); - if (this._hasMaskedPath) { - if (mult.length) { - matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]); - } else { - matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult); - } - } else if (mult.length) { - matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]); - } else { - matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult); - } - } - } - if (documentData.strokeWidthAnim) { - letterSw = sw < 0 ? 0 : sw; - } - if (documentData.strokeColorAnim) { - letterSc = 'rgb(' + Math.round(sc[0] * 255) + ',' + Math.round(sc[1] * 255) + ',' + Math.round(sc[2] * 255) + ')'; - } - if (documentData.fillColorAnim && documentData.fc) { - letterFc = 'rgb(' + Math.round(fc[0] * 255) + ',' + Math.round(fc[1] * 255) + ',' + Math.round(fc[2] * 255) + ')'; - } - - if (this._hasMaskedPath) { - matrixHelper.translate(0, -documentData.ls); - - matrixHelper.translate(0, (alignment[1] * yOff) * 0.01 + yPos, 0); - if (this._pathData.p.v) { - tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]); - var rot = (Math.atan(tanAngle) * 180) / Math.PI; - if (currentPoint.point[0] < prevPoint.point[0]) { - rot += 180; - } - matrixHelper.rotate((-rot * Math.PI) / 180); - } - matrixHelper.translate(xPathPos, yPathPos, 0); - currentLength -= (alignment[0] * letters[i].an) * 0.005; - if (letters[i + 1] && ind !== letters[i + 1].ind) { - currentLength += letters[i].an / 2; - currentLength += (documentData.tr * 0.001) * documentData.finalSize; - } - } else { - matrixHelper.translate(xPos, yPos, 0); - - if (documentData.ps) { - // matrixHelper.translate(documentData.ps[0],documentData.ps[1],0); - matrixHelper.translate(documentData.ps[0], documentData.ps[1] + px2vp(documentData.ascent), 0); - } - switch (documentData.j) { - case 1: - matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]), 0, 0); - break; - case 2: - matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]) / 2, 0, 0); - break; - default: - break; - } - matrixHelper.translate(0, -documentData.ls); - matrixHelper.translate(offf, 0, 0); - matrixHelper.translate((alignment[0] * letters[i].an) * 0.005, (alignment[1] * yOff) * 0.01, 0); - xPos += letters[i].l + (documentData.tr * 0.001) * documentData.finalSize; - } - if (renderType === 'html') { - letterM = matrixHelper.toCSS(); - } else if (renderType === 'svg') { - letterM = matrixHelper.to2dCSS(); - } else { - letterP = [matrixHelper.props[0], matrixHelper.props[1], matrixHelper.props[2], matrixHelper.props[3], matrixHelper.props[4], matrixHelper.props[5], matrixHelper.props[6], matrixHelper.props[7], matrixHelper.props[8], matrixHelper.props[9], matrixHelper.props[10], matrixHelper.props[11], matrixHelper.props[12], matrixHelper.props[13], matrixHelper.props[14], matrixHelper.props[15]]; - } - letterO = elemOpacity; - } - - if (renderedLettersCount <= i) { - letterValue = new LetterProps(letterO, letterSw, letterSc, letterFc, letterM, letterP); - this.renderedLetters.push(letterValue); - renderedLettersCount += 1; - this.lettersChangedFlag = true; - } else { - letterValue = this.renderedLetters[i]; - this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag; - } - } -}; - -TextAnimatorProperty.prototype.getValue = function () { - if (this._elem.globalData.frameId === this._frameId) { - return; - } - this._frameId = this._elem.globalData.frameId; - this.iterateDynamicProperties(); -}; - -TextAnimatorProperty.prototype.mHelper = new Matrix(); -TextAnimatorProperty.prototype.defaultPropsArray = []; -extendPrototype([DynamicPropertyContainer], TextAnimatorProperty); - -export default TextAnimatorProperty; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/TextProperty.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/TextProperty.js deleted file mode 100644 index dfbfa60a9905e6f758abf85f0806f710ca47b737..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/TextProperty.js +++ /dev/null @@ -1,453 +0,0 @@ -import { - initialDefaultFrame, -} from '../../main'; -import getFontProperties from '../getFontProperties'; -import FontManager from '../FontManager'; - -function TextProperty(elem, data) { - this._frameId = initialDefaultFrame; - this.pv = ''; - this.v = ''; - this.kf = false; - this._isFirstFrame = true; - this._mdf = false; - if (data.d && data.d.sid) { - data.d = elem.globalData.slotManager.getProp(data.d); - } - this.data = data; - this.elem = elem; - this.comp = this.elem.comp; - this.keysIndex = 0; - this.canResize = false; - this.minimumFontSize = 1; - this.effectsSequence = []; - this.currentData = { - ascent: 0, - boxWidth: this.defaultBoxWidth, - f: '', - fStyle: '', - fWeight: '', - fc: '', - j: '', - justifyOffset: '', - l: [], - lh: 0, - lineWidths: [], - ls: '', - of: '', - s: '', - sc: '', - sw: 0, - t: 0, - tr: 0, - sz: 0, - ps: null, - fillColorAnim: false, - strokeColorAnim: false, - strokeWidthAnim: false, - yOffset: 0, - finalSize: 0, - finalText: [], - finalLineHeight: 0, - __complete: false, - - }; - this.copyData(this.currentData, this.data.d.k[0].s); - - if (!this.searchProperty()) { - this.completeTextData(this.currentData); - } -} - -TextProperty.prototype.defaultBoxWidth = [0, 0]; - -TextProperty.prototype.copyData = function (obj, data) { - for (var s in data) { - if (Object.prototype.hasOwnProperty.call(data, s)) { - obj[s] = data[s]; - } - } - return obj; -}; - -TextProperty.prototype.setCurrentData = function (data) { - if (!data.__complete) { - this.completeTextData(data); - } - this.currentData = data; - this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth; - this._mdf = true; -}; - -TextProperty.prototype.searchProperty = function () { - return this.searchKeyframes(); -}; - -TextProperty.prototype.searchKeyframes = function () { - this.kf = this.data.d.k.length > 1; - if (this.kf) { - this.addEffect(this.getKeyframeValue.bind(this)); - } - return this.kf; -}; - -TextProperty.prototype.addEffect = function (effectFunction) { - this.effectsSequence.push(effectFunction); - this.elem.addDynamicProperty(this); -}; - -TextProperty.prototype.getValue = function (_finalValue) { - if ((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) { - return; - } - this.currentData.t = this.data.d.k[this.keysIndex].s.t; - var currentValue = this.currentData; - var currentIndex = this.keysIndex; - if (this.lock) { - this.setCurrentData(this.currentData); - return; - } - this.lock = true; - this._mdf = false; - var i; var - len = this.effectsSequence.length; - var finalValue = _finalValue || this.data.d.k[this.keysIndex].s; - for (i = 0; i < len; i += 1) { - // Checking if index changed to prevent creating a new object every time the expression updates. - if (currentIndex !== this.keysIndex) { - finalValue = this.effectsSequence[i](finalValue, finalValue.t); - } else { - finalValue = this.effectsSequence[i](this.currentData, finalValue.t); - } - } - if (currentValue !== finalValue) { - this.setCurrentData(finalValue); - } - this.v = this.currentData; - this.pv = this.v; - this.lock = false; - this.frameId = this.elem.globalData.frameId; -}; - -TextProperty.prototype.getKeyframeValue = function () { - var textKeys = this.data.d.k; - var frameNum = this.elem.comp.renderedFrame; - var i = 0; var - len = textKeys.length; - while (i <= len - 1) { - if (i === len - 1 || textKeys[i + 1].t > frameNum) { - break; - } - i += 1; - } - if (this.keysIndex !== i) { - this.keysIndex = i; - } - return this.data.d.k[this.keysIndex].s; -}; - -TextProperty.prototype.buildFinalText = function (text) { - var charactersArray = []; - var i = 0; - var len = text.length; - var charCode; - var secondCharCode; - var shouldCombine = false; - while (i < len) { - charCode = text.charCodeAt(i); - if (FontManager.isCombinedCharacter(charCode)) { - charactersArray[charactersArray.length - 1] += text.charAt(i); - } else if (charCode >= 0xD800 && charCode <= 0xDBFF) { - secondCharCode = text.charCodeAt(i + 1); - if (secondCharCode >= 0xDC00 && secondCharCode <= 0xDFFF) { - if (shouldCombine || FontManager.isModifier(charCode, secondCharCode)) { - charactersArray[charactersArray.length - 1] += text.substr(i, 2); - shouldCombine = false; - } else { - charactersArray.push(text.substr(i, 2)); - } - i += 1; - } else { - charactersArray.push(text.charAt(i)); - } - } else if (charCode > 0xDBFF) { - secondCharCode = text.charCodeAt(i + 1); - if (FontManager.isZeroWidthJoiner(charCode, secondCharCode)) { - shouldCombine = true; - charactersArray[charactersArray.length - 1] += text.substr(i, 2); - i += 1; - } else { - charactersArray.push(text.charAt(i)); - } - } else if (FontManager.isZeroWidthJoiner(charCode)) { - charactersArray[charactersArray.length - 1] += text.charAt(i); - shouldCombine = true; - } else { - charactersArray.push(text.charAt(i)); - } - i += 1; - } - return charactersArray; -}; - -TextProperty.prototype.completeTextData = function (documentData) { - documentData.__complete = true; - var fontManager = this.elem.globalData.fontManager; - var data = this.data; - var letters = []; - var i; var - len; - var newLineFlag; var index = 0; var - val; - var anchorGrouping = data.m.g; - var currentSize = 0; var currentPos = 0; var currentLine = 0; var - lineWidths = []; - var lineWidth = 0; - var maxLineWidth = 0; - var j; var - jLen; - var fontData = fontManager.getFontByName(documentData.f); - var charData; var - cLength = 0; - - var fontProps = getFontProperties(fontData); - documentData.fWeight = fontProps.weight; - documentData.fStyle = fontProps.style; - let fp = fp2px(documentData.s); - documentData.finalSize = fp; - documentData.finalText = this.buildFinalText(documentData.t); - len = documentData.finalText.length; - documentData.finalLineHeight = documentData.lh; - var trackingOffset = (documentData.tr / 1000) * documentData.finalSize; - var charCode; - if (documentData.sz) { - var flag = true; - var boxWidth = documentData.sz[0]; - var boxHeight = documentData.sz[1]; - var currentHeight; var - finalText; - while (flag) { - finalText = this.buildFinalText(documentData.t); - currentHeight = 0; - lineWidth = 0; - len = finalText.length; - trackingOffset = (documentData.tr / 1000) * documentData.finalSize; - var lastSpaceIndex = -1; - for (i = 0; i < len; i += 1) { - charCode = finalText[i].charCodeAt(0); - newLineFlag = false; - if (finalText[i] === ' ') { - lastSpaceIndex = i; - } else if (charCode === 13 || charCode === 3) { - lineWidth = 0; - newLineFlag = true; - currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2; - } - if (fontManager.chars) { - charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily); - cLength = newLineFlag ? 0 : (px2vp(charData.w) * documentData.finalSize) / 100; - } else { - // tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily; - cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize); - } - if (lineWidth + cLength > boxWidth && finalText[i] !== ' ') { - if (lastSpaceIndex === -1) { - len += 1; - } else { - i = lastSpaceIndex; - } - currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2; - finalText.splice(i, lastSpaceIndex === i ? 1 : 0, '\r'); - // finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i); - lastSpaceIndex = -1; - lineWidth = 0; - } else { - lineWidth += cLength; - lineWidth += trackingOffset; - } - } - currentHeight += (fontData.ascent * documentData.finalSize) / 100; - if (this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) { - documentData.finalSize -= 1; - documentData.finalLineHeight = (documentData.finalSize * documentData.lh) / documentData.s; - } else { - documentData.finalText = finalText; - len = documentData.finalText.length; - flag = false; - } - } - } - lineWidth = -trackingOffset; - cLength = 0; - var uncollapsedSpaces = 0; - var currentChar; - for (i = 0; i < len; i += 1) { - newLineFlag = false; - currentChar = documentData.finalText[i]; - charCode = currentChar.charCodeAt(0); - if (charCode === 13 || charCode === 3) { - uncollapsedSpaces = 0; - lineWidths.push(lineWidth); - maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth; - lineWidth = -2 * trackingOffset; - val = ''; - newLineFlag = true; - currentLine += 1; - } else { - val = currentChar; - } - if (fontManager.chars) { - charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily); - let width = px2vp(fontManager.chars[0].w); - cLength = newLineFlag ? 0 : (width * documentData.finalSize) / 100; - } else { - // var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize); - // tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily; - cLength = fontManager.measureText(val, documentData.f, documentData.finalSize); - } - - // - if (currentChar === ' ') { - uncollapsedSpaces += cLength + trackingOffset; - } else { - lineWidth += cLength + trackingOffset + uncollapsedSpaces; - uncollapsedSpaces = 0; - } - letters.push({ - l: cLength, an: cLength, add: currentSize, n: newLineFlag, anIndexes: [], val: val, line: currentLine, animatorJustifyOffset: 0, - }); - if (anchorGrouping == 2) { // eslint-disable-line eqeqeq - currentSize += cLength; - if (val === '' || val === ' ' || i === len - 1) { - if (val === '' || val === ' ') { - currentSize -= cLength; - } - while (currentPos <= i) { - letters[currentPos].an = currentSize; - letters[currentPos].ind = index; - letters[currentPos].extra = cLength; - currentPos += 1; - } - index += 1; - currentSize = 0; - } - } else if (anchorGrouping == 3) { // eslint-disable-line eqeqeq - currentSize += cLength; - if (val === '' || i === len - 1) { - if (val === '') { - currentSize -= cLength; - } - while (currentPos <= i) { - letters[currentPos].an = currentSize; - letters[currentPos].ind = index; - letters[currentPos].extra = cLength; - currentPos += 1; - } - currentSize = 0; - index += 1; - } - } else { - letters[index].ind = index; - letters[index].extra = 0; - index += 1; - } - } - documentData.l = letters; - maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth; - lineWidths.push(lineWidth); - if (documentData.sz) { - documentData.boxWidth = documentData.sz[0]; - documentData.justifyOffset = 0; - } else { - documentData.boxWidth = maxLineWidth; - switch (documentData.j) { - case 1: - documentData.justifyOffset = -documentData.boxWidth; - break; - case 2: - documentData.justifyOffset = -documentData.boxWidth / 2; - break; - default: - documentData.justifyOffset = 0; - } - } - documentData.lineWidths = lineWidths; - - var animators = data.a; var animatorData; var - letterData; - jLen = animators.length; - var based; var ind; var - indexes = []; - for (j = 0; j < jLen; j += 1) { - animatorData = animators[j]; - if (animatorData.a.sc) { - documentData.strokeColorAnim = true; - } - if (animatorData.a.sw) { - documentData.strokeWidthAnim = true; - } - if (animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb) { - documentData.fillColorAnim = true; - } - ind = 0; - based = animatorData.s.b; - for (i = 0; i < len; i += 1) { - letterData = letters[i]; - letterData.anIndexes[j] = ind; - if ((based == 1 && letterData.val !== '') || (based == 2 && letterData.val !== '' && letterData.val !== ' ') || (based == 3 && (letterData.n || letterData.val == ' ' || i == len - 1)) || (based == 4 && (letterData.n || i == len - 1))) { // eslint-disable-line eqeqeq - if (animatorData.s.rn === 1) { - indexes.push(ind); - } - ind += 1; - } - } - data.a[j].s.totalChars = ind; - var currentInd = -1; var - newInd; - if (animatorData.s.rn === 1) { - for (i = 0; i < len; i += 1) { - letterData = letters[i]; - if (currentInd != letterData.anIndexes[j]) { // eslint-disable-line eqeqeq - currentInd = letterData.anIndexes[j]; - newInd = indexes.splice(Math.floor(Math.random() * indexes.length), 1)[0]; - } - letterData.anIndexes[j] = newInd; - } - } - } - documentData.yOffset = documentData.finalLineHeight || documentData.finalSize * 1.2; - documentData.ls = documentData.ls || 0; - documentData.ascent = (fontData.ascent * documentData.finalSize) / 100; -}; - -TextProperty.prototype.updateDocumentData = function (newData, index) { - index = index === undefined ? this.keysIndex : index; - var dData = this.copyData({}, this.data.d.k[index].s); - dData = this.copyData(dData, newData); - this.data.d.k[index].s = dData; - this.recalculate(index); - this.setCurrentData(dData); - this.elem.addDynamicProperty(this); -}; - -TextProperty.prototype.recalculate = function (index) { - var dData = this.data.d.k[index].s; - dData.__complete = false; - this.keysIndex = 0; - this._isFirstFrame = true; - this.getValue(dData); -}; - -TextProperty.prototype.canResizeFont = function (_canResize) { - this.canResize = _canResize; - this.recalculate(this.keysIndex); - this.elem.addDynamicProperty(this); -}; - -TextProperty.prototype.setMinimumFontSize = function (_fontValue) { - this.minimumFontSize = Math.floor(_fontValue) || 1; - this.recalculate(this.keysIndex); - this.elem.addDynamicProperty(this); -}; - -export default TextProperty; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/TextSelectorProperty.js b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/TextSelectorProperty.js deleted file mode 100644 index ce3af3897ad628f8b53726e8388056546b24a8f9..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/js/utils/text/TextSelectorProperty.js +++ /dev/null @@ -1,179 +0,0 @@ -import { - extendPrototype, -} from '../functionExtensions'; -import DynamicPropertyContainer from '../helpers/dynamicProperties'; -import PropertyFactory from '../PropertyFactory'; -import BezierFactory from '../../3rd_party/BezierEaser'; - -const TextSelectorProp = (function () { - var max = Math.max; - var min = Math.min; - var floor = Math.floor; - - function TextSelectorPropFactory(elem, data) { - this._currentTextLength = -1; - this.k = false; - this.data = data; - this.elem = elem; - this.comp = elem.comp; - this.finalS = 0; - this.finalE = 0; - this.initDynamicPropertyContainer(elem); - this.s = PropertyFactory.getProp(elem, data.s || { k: 0 }, 0, 0, this); - if ('e' in data) { - this.e = PropertyFactory.getProp(elem, data.e, 0, 0, this); - } else { - this.e = { v: 100 }; - } - this.o = PropertyFactory.getProp(elem, data.o || { k: 0 }, 0, 0, this); - this.xe = PropertyFactory.getProp(elem, data.xe || { k: 0 }, 0, 0, this); - this.ne = PropertyFactory.getProp(elem, data.ne || { k: 0 }, 0, 0, this); - this.sm = PropertyFactory.getProp(elem, data.sm || { k: 100 }, 0, 0, this); - this.a = PropertyFactory.getProp(elem, data.a, 0, 0.01, this); - if (!this.dynamicProperties.length) { - this.getValue(); - } - } - - TextSelectorPropFactory.prototype = { - getMult: function (ind) { - if (this._currentTextLength !== this.elem.textProperty.currentData.l.length) { - this.getValue(); - } - var x1 = 0; - var y1 = 0; - var x2 = 1; - var y2 = 1; - if (this.ne.v > 0) { - x1 = this.ne.v / 100.0; - } else { - y1 = -this.ne.v / 100.0; - } - if (this.xe.v > 0) { - x2 = 1.0 - this.xe.v / 100.0; - } else { - y2 = 1.0 + this.xe.v / 100.0; - } - var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get; - - var mult = 0; - var s = this.finalS; - var e = this.finalE; - var type = this.data.sh; - if (type === 2) { - if (e === s) { - mult = ind >= e ? 1 : 0; - } else { - mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1)); - } - mult = easer(mult); - } else if (type === 3) { - if (e === s) { - mult = ind >= e ? 0 : 1; - } else { - mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1)); - } - - mult = easer(mult); - } else if (type === 4) { - if (e === s) { - mult = 0; - } else { - mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1)); - if (mult < 0.5) { - mult *= 2; - } else { - mult = 1 - 2 * (mult - 0.5); - } - } - mult = easer(mult); - } else if (type === 5) { - if (e === s) { - mult = 0; - } else { - var tot = e - s; - /* ind += 0.5; - mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind; */ - ind = min(max(0, ind + 0.5 - s), e - s); - var x = -tot / 2 + ind; - var a = tot / 2; - mult = Math.sqrt(1 - (x * x) / (a * a)); - } - mult = easer(mult); - } else if (type === 6) { - if (e === s) { - mult = 0; - } else { - ind = min(max(0, ind + 0.5 - s), e - s); - mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2; // eslint-disable-line - } - mult = easer(mult); - } else { - if (ind >= floor(s)) { - if (ind - s < 0) { - mult = max(0, min(min(e, 1) - (s - ind), 1)); - } else { - mult = max(0, min(e - ind, 1)); - } - } - mult = easer(mult); - } - // Smoothness implementation. - // The smoothness represents a reduced range of the original [0; 1] range. - // if smoothness is 25%, the new range will be [0.375; 0.625] - // Steps are: - // - find the lower value of the new range (threshold) - // - if multiplier is smaller than that value, floor it to 0 - // - if it is larger, - // - subtract the threshold - // - divide it by the smoothness (this will return the range to [0; 1]) - // Note: If it doesn't work on some scenarios, consider applying it before the easer. - if (this.sm.v !== 100) { - var smoothness = this.sm.v * 0.01; - if (smoothness === 0) { - smoothness = 0.00000001; - } - var threshold = 0.5 - smoothness * 0.5; - if (mult < threshold) { - mult = 0; - } else { - mult = (mult - threshold) / smoothness; - if (mult > 1) { - mult = 1; - } - } - } - return mult * this.a.v; - }, - getValue: function (newCharsFlag) { - this.iterateDynamicProperties(); - this._mdf = newCharsFlag || this._mdf; - this._currentTextLength = this.elem.textProperty.currentData.l.length || 0; - if (newCharsFlag && this.data.r === 2) { - this.e.v = this._currentTextLength; - } - var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars; - var o = this.o.v / divisor; - var s = this.s.v / divisor + o; - var e = (this.e.v / divisor) + o; - if (s > e) { - var _s = s; - s = e; - e = _s; - } - this.finalS = s; - this.finalE = e; - }, - }; - extendPrototype([DynamicPropertyContainer], TextSelectorPropFactory); - - function getTextSelectorProp(elem, data, arr) { - return new TextSelectorPropFactory(elem, data, arr); - } - - return { - getTextSelectorProp: getTextSelectorProp, - }; -}()); - -export default TextSelectorProp; diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/module.json b/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/module.json deleted file mode 100644 index 13f46f30e980cec4e2dbde83f1b01fc70b356aae..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+lottie@2.0.24/oh_modules/@ohos/lottie/src/main/module.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "app": { - "bundleName": "com.openharmony.lottie", - "debug": true, - "versionCode": 1000000, - "versionName": "2.0.24", - "minAPIVersion": 12, - "targetAPIVersion": 12, - "apiReleaseType": "Release", - "compileSdkVersion": "5.0.0.71", - "compileSdkType": "OpenHarmony", - "appEnvironments": [], - "bundleType": "app", - "buildMode": "debug" - }, - "module": { - "name": "library", - "type": "har", - "deviceTypes": [ - "default", - "phone", - "tablet", - "2in1", - "car" - ], - "packageName": "@ohos/lottie", - "installationFree": false, - "virtualMachine": "ark12.0.2.0", - "compileMode": "esmodule", - "dependencies": [] - } -} diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/lock.json5 b/ArkUIKit/StateTrack/oh_modules/.ohpm/lock.json5 deleted file mode 100644 index ba27e28beab4b9b2e3c181f55fa19c37edb9738d..0000000000000000000000000000000000000000 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/lock.json5 +++ /dev/null @@ -1,74 +0,0 @@ -{ - "lockVersion": "1.0", - "settings": { - "resolveConflict": true, - "resolveConflictStrict": false, - "installAll": true - }, - "overrides": {}, - "overrideDependencyMap": {}, - "modules": { - ".": { - "name": "", - "dependencies": { - "@ohos/lottie": { - "specifier": "^2.0.24", - "version": "2.0.24" - } - }, - "devDependencies": { - "@ohos/hypium": { - "specifier": "1.0.24", - "version": "1.0.24" - }, - "@ohos/hamock": { - "specifier": "1.0.0", - "version": "1.0.0" - } - }, - "dynamicDependencies": {}, - "maskedByOverrideDependencyMap": false - }, - "entry": { - "name": "entry", - "dependencies": { - "@ohos/lottie": { - "specifier": "^2.0.24", - "version": "2.0.24" - } - }, - "devDependencies": {}, - "dynamicDependencies": {}, - "maskedByOverrideDependencyMap": false - } - }, - "packages": { - "@ohos/lottie@2.0.24": { - "integrity": "sha512-TjqRTRqPT244ctFLVGw1pw8iZ4HHSCR+mJu7fPMvtlhVD+bsBpOY+V1tj17dAbySlbxJFUBGRpO21yDkmnjiYQ==", - "storePath": "oh_modules/.ohpm/@ohos+lottie@2.0.24", - "dependencies": {}, - "dynamicDependencies": {}, - "dev": false, - "dynamic": false, - "maskedByOverrideDependencyMap": false - }, - "@ohos/hypium@1.0.24": { - "integrity": "sha512-3dCqc+BAR5LqEGG2Vtzi8O3r7ci/3fYU+FWjwvUobbfko7DUnXGOccaror0yYuUhJfXzFK0aZNMGSnXaTwEnbw==", - "storePath": "oh_modules/.ohpm/@ohos+hypium@1.0.24", - "dependencies": {}, - "dynamicDependencies": {}, - "dev": true, - "dynamic": false, - "maskedByOverrideDependencyMap": false - }, - "@ohos/hamock@1.0.0": { - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "storePath": "oh_modules/.ohpm/@ohos+hamock@1.0.0", - "dependencies": {}, - "dynamicDependencies": {}, - "dev": true, - "dynamic": false, - "maskedByOverrideDependencyMap": false - } - } -} \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/.gitignore b/ArkUIKit/TextComponent/entry/.gitignore index f3535187223c8213efbb13158686dde88817d8e3..cbb33e2bd3050a97674b029d392c8786f0177278 100644 --- a/ArkUIKit/TextComponent/entry/.gitignore +++ b/ArkUIKit/TextComponent/entry/.gitignore @@ -5,3 +5,4 @@ /.cxx /.test /oh-package-lock.json5 +/src/main/syscap.json \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/Index.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/Index.ets index 0b620e6fb514d704192770e5dca477ddc72588e1..59e571317d6db21ccfd4ee1ffe176b92ac9ff8ad 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/Index.ets @@ -23,7 +23,12 @@ import { SymbolGlyphSpanDestination, SYMBOL_GLYPH_SPAN } from './symbol'; import { PropertyStringDestination, PROPERTY_STRING_ROUTE_PREFIX } from './propertyString'; import { NDKDestination, NDK_ROUTE_PREFIX } from './ndk'; import resource from '../common/resource'; +import { TextImageMixedLayoutDestination, TEXT_IMAGE_MIXED_LAYOUT } from './textImageMixedLayout'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +const TAG = '[Sample_Textcomponent]'; +const DOMAIN = 0xF811; +const BUNDLE = 'Textcomponent_'; const routes: Route[] = [ { title: resource.resourceToString($r('app.string.pageIndex_Text')), @@ -48,6 +53,10 @@ const routes: Route[] = [ { title: resource.resourceToString($r('app.string.pageIndex_TextNDKUI')), name: NDK_ROUTE_PREFIX + }, + { + title: resource.resourceToString($r('app.string.pageIndex_TextImageMixedLayout')), + name: TEXT_IMAGE_MIXED_LAYOUT } ]; @@ -65,6 +74,8 @@ function Destination(name: string) { PropertyStringDestination(name); }else if (name.startsWith(NDK_ROUTE_PREFIX)) { NDKDestination(name); + }else if (name.startsWith(TEXT_IMAGE_MIXED_LAYOUT)) { + TextImageMixedLayoutDestination(name); } } @@ -105,6 +116,7 @@ struct Index { } .width('100%') .onClick(() => { + hilog.info(DOMAIN, TAG, BUNDLE + "route.name" + route.name); this.pathStack.pushPath({ name: route.name }); }) }) diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/CreateApply.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/CreateApply.ets index 6edcb481112deadf731e283604dc80101aeaa9e6..b4df36b2e3b4d616b1c3a65ee8a51f4dbf3477e9 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/CreateApply.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/CreateApply.ets @@ -14,7 +14,7 @@ */ import resource from '../../common/resource'; - +// [Start createStyledString_start] @Entry @Component struct styled_string_demo1 { @@ -40,4 +40,5 @@ struct styled_string_demo1 { } .width('100%') } -} \ No newline at end of file +} +// [End createStyledString_start] \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/mock/VerificationMode.js b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringBaselineOffsetStyle.ets similarity index 39% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/mock/VerificationMode.js rename to ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringBaselineOffsetStyle.ets index aaf2fdfae00135d3d2055320fc5ea403b44d0bf3..9542c93c2e68c63e2041539a73355b8def94b569 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/mock/VerificationMode.js +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringBaselineOffsetStyle.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -12,38 +12,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -import {expect} from '../../interface'; - -class VerificationMode { - constructor(times) { - this.doTimes = times; - } - - times(count) { - expect(count).assertEqual(this.doTimes); - } - - never() { - console.info(this.doTimes); - expect(0).assertEqual(this.doTimes); +// [Start styledStringBaselineOffsetStyle_start] +import { LengthMetrics } from '@kit.ArkUI'; + +// xxx.ets +@Entry +@Component +struct styled_string_demo5 { + @State str: string = + this.getUIContext().getHostContext()?.resourceManager.getStringSync($r('app.string.CreateApply_Text_2')) as string; + mutableStyledString: MutableStyledString = new MutableStyledString(this.str, [ + { + start: 0, + length: 3, + styledKey: StyledStringKey.BASELINE_OFFSET, + styledValue: new BaselineOffsetStyle(LengthMetrics.px(20)) } + ]); + controller: TextController = new TextController(); - once() { - expect(1).assertEqual(this.doTimes); - } + async onPageShow() { + this.controller.setStyledString(this.mutableStyledString); + } - atLeast(count) { - if (count > this.doTimes) { - throw Error('failed ' + count + ' greater than the actual execution times of method'); - } - } - - atMost(count) { - if (count < this.doTimes) { - throw Error('failed ' + count + ' less than the actual execution times of method'); - } + build() { + Column() { + // 显示属性字符串 + Text(undefined, { controller: this.controller }) } + .width('100%') + } } - -export default VerificationMode; \ No newline at end of file +// [End styledStringBaselineOffsetStyle_start] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringConvertedToParagraph.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringConvertedToParagraph.ets new file mode 100644 index 0000000000000000000000000000000000000000..af8879c3a25a84ad98aed7eea730a3fd712e93e1 --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringConvertedToParagraph.ets @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start styledStringConvertedToParagraph_start] +import { LengthMetrics } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number, context: UIContext) { + super(); + this.word = word; + this.width = width; + this.height = height; + this.context = context; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + this.context.vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + public width: number = 160; + public word: string = 'drawing'; + public height: number = 10; + public context: UIContext; +} + +@Entry +@Component +struct Index { + @State fullText: string = + this.getUIContext().getHostContext()?.resourceManager.getStringSync($r('app.string.Full_text')) as string; + @State originalText: string = + this.getUIContext().getHostContext()?.resourceManager.getStringSync($r('app.string.Original_text')) as string; + @State afterTypesetting: string = + this.getUIContext().getHostContext()?.resourceManager.getStringSync($r('app.string.After_typesetting')) as string; + + str: string = + 'Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.'; + mutableStr2 = new MutableStyledString(this.str, [ + { + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontSize: LengthMetrics.px(20) }) + }, + { + start: 3, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Brown }) + } + ]); + + // 测算属性字符串在指定宽度下能显示的行数 + getLineNum(styledString: StyledString, width: LengthMetrics) { + let paragraphArr = this.getUIContext().getMeasureUtils().getParagraphs(styledString, { constraintWidth: width }); + let res = 0; + for (let i = 0; i < paragraphArr.length; ++i) { + res += paragraphArr[i].getLineCount(); + } + return res; + } + + // 测算属性字符串显示maxLines行时最多可以显示的字数 + getCorrectIndex(styledString: MutableStyledString, maxLines: number, width: LengthMetrics) { + let low = 0; + let high = styledString.length - 1; + // 使用二分查找 + while (low <= high) { + let mid = (low + high) >> 1; + console.info('demo: get ' + low + ' ' + high + ' ' + mid); + let moreStyledString = new MutableStyledString(this.fullText, [{ + start: 4, + length: 2, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }]); + moreStyledString.insertStyledString(0, styledString.subStyledString(0, mid)); + let lineNum = this.getLineNum(moreStyledString, LengthMetrics.px(500)); + if (lineNum <= maxLines) { + low = mid + 1; + } else { + high = mid - 1; + } + } + return high; + } + + mutableStrAllContent = new MutableStyledString(this.str, [ + { + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontSize: LengthMetrics.px(40) }) + }, + { + start: 3, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Brown }) + } + ]); + customSpan1: MyCustomSpan = new MyCustomSpan('Hello', 120, 10, this.getUIContext()); + mutableStrAllContent2 = new MutableStyledString(this.str, [ + { + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontSize: LengthMetrics.px(100) }) + }, + { + start: 3, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Brown }) + } + ]); + controller: TextController = new TextController(); + controller2: TextController = new TextController(); + textController: TextController = new TextController(); + textController2: TextController = new TextController(); + + aboutToAppear() { + this.mutableStrAllContent2.insertStyledString(0, new StyledString(this.customSpan1)); + this.mutableStr2.insertStyledString(0, new StyledString(this.customSpan1)); + } + + build() { + Scroll() { + Column() { + Text(this.originalText) + Text(undefined, { controller: this.controller }).width('500px').onAppear(() => { + this.controller.setStyledString(this.mutableStrAllContent); + }) + Divider().strokeWidth(8).color('#F1F3F5') + Text(this.afterTypesetting) + Text(undefined, { controller: this.textController }).onAppear(() => { + let now = this.getCorrectIndex(this.mutableStrAllContent, 3, LengthMetrics.px(500)); + if (now != this.mutableStrAllContent.length - 1) { + let moreStyledString = new MutableStyledString(this.fullText, [{ + start: 4, + length: 2, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }]); + moreStyledString.insertStyledString(0, this.mutableStrAllContent.subStyledString(0, now)); + this.textController.setStyledString(moreStyledString); + } else { + this.textController.setStyledString(this.mutableStrAllContent); + } + }) + .width('500px') + Divider().strokeWidth(8).color('#F1F3F5') + Text(this.originalText) + Text(undefined, { controller: this.controller2 }).width('500px').onAppear(() => { + this.controller2.setStyledString(this.mutableStrAllContent2); + }) + Divider().strokeWidth(8).color('#F1F3F5') + Text(this.afterTypesetting) + Text(undefined, { controller: this.textController2 }).onAppear(() => { + let now = this.getCorrectIndex(this.mutableStrAllContent2, 3, LengthMetrics.px(500)); + let moreStyledString = new MutableStyledString(this.fullText, [{ + start: 4, + length: 2, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }]); + moreStyledString.insertStyledString(0, this.mutableStrAllContent2.subStyledString(0, now)); + this.textController2.setStyledString(moreStyledString); + }) + .width('500px') + }.width('100%') + } + } +} +// [End styledStringConvertedToParagraph_start] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringDecorationStyle.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringDecorationStyle.ets new file mode 100644 index 0000000000000000000000000000000000000000..a63d3351846385ff3da9917911e45a39e28ab504 --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringDecorationStyle.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start styledStringDecorationStyle_start] +// xxx.ets +@Entry +@Component +struct styled_string_demo4 { + @State str: string = + this.getUIContext().getHostContext()?.resourceManager.getStringSync($r('app.string.CreateApply_Text_2')) as string; + mutableStyledString: MutableStyledString = new MutableStyledString(this.str, [ + { + start: 0, + length: 4, + styledKey: StyledStringKey.DECORATION, + styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red, thicknessScale: 3 }) + }, + { + start: 4, + length: 2, + styledKey: StyledStringKey.DECORATION, + styledValue: new DecorationStyle( + { + type: TextDecorationType.Underline, + }, + { + // 开启多装饰线 + enableMultiType: true + } + ) + }, + { + start: 4, + length: 2, + styledKey: StyledStringKey.DECORATION, + styledValue: new DecorationStyle( + { + type: TextDecorationType.LineThrough, + }, + { + // 开启多装饰线 + enableMultiType: true + } + ) + }, + ]); + controller: TextController = new TextController(); + + async onPageShow() { + this.controller.setStyledString(this.mutableStyledString); + } + + build() { + Column() { + // 显示属性字符串 + Text(undefined, { controller: this.controller }) + } + .width('100%') + } +} +// [End styledStringDecorationStyle_start] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringGestureStyle.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringGestureStyle.ets index 5438ae04c7b9d5af479f8cf00526694c7e162400..a00971e20b0f380361099fd1a848f7b4bf74a328 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringGestureStyle.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringGestureStyle.ets @@ -14,6 +14,7 @@ */ import { ComponentCard } from '../../common/Card'; +// [Start styledStringGestureStyle_start] import { drawing } from '@kit.ArkGraphics2D'; let gUIContext: UIContext; @@ -161,4 +162,5 @@ export struct StyledStringGestureStyle { .backgroundColor('#f1f2f3') .title($r('app.string.TStyledStringGestureStyle_title')) } -} \ No newline at end of file +} +// [End styledStringGestureStyle_start] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringHtml.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringHtml.ets index 4d5eb81cf975b7867a933b584e01fc66ec7a0c8b..dc8773b7c15e8a12ad1d9c0cbd172ed4ca9026cf 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringHtml.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringHtml.ets @@ -14,9 +14,11 @@ */ import { ComponentCard } from '../../common/Card'; +import resource from '../../common/resource'; +// [Start styledStringHtml_start] +// xxx.ets import { image } from '@kit.ImageKit'; import { LengthMetrics } from '@kit.ArkUI'; -import resource from '../../common/resource'; @Entry @Component @@ -95,4 +97,5 @@ export struct StyledStringHtml { .backgroundColor('#f1f2f3') .title($r('app.string.StyledStringHtml_title')) } -} \ No newline at end of file +} +// [End styledStringHtml_start] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringHtmlOne.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringHtmlOne.ets new file mode 100644 index 0000000000000000000000000000000000000000..f4ec75ef688a2aa5b30c4aa898bbc9e780cfff44 --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringHtmlOne.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start styledStringHtmlOne_start] +// xxx.ets +@Entry +@Component +struct HtmlSpanStringDemo { + @State html: string = + "

This is b strong em i u del s www.example red span superscript and subscript

"; + @State spanString: StyledString | undefined = undefined; + @State resultText: string = ''; // 保存结果文本的状态 + controller: TextController = new TextController; + + build() { + Column() { + // 显示转换后的spanString + Text(undefined, { controller: this.controller }).height(100).id('text1') + + // TextArea显示每个步骤的结果 + TextArea({ text: this.html }) + .width('100%') + .height(100) + .margin(5) + + // 按钮1:将HTML转换为SpanString + Button($r('app.string.Converted_HTML_to_SpanString')).onClick(async () => { + this.spanString = await StyledString.fromHtml(this.html); + this.controller.setStyledString(this.spanString); + this.resultText = 'Converted HTML to SpanString successfully.'; + }).margin(5) + + // 按钮2:将SpanString转换为HTML + Button($r('app.string.Converted_SpanString_to_HTML')).onClick(() => { + if (this.spanString) { + // 将spanString转换为HTML并替换当前的HTML状态 + const newHtml = StyledString.toHtml(this.spanString); + if (newHtml !== this.html) { // 通过检查内容是否已经相同来防止重复 + this.html = newHtml; + } + this.resultText = 'Converted SpanString to HTML successfully.'; + } else { + this.resultText = 'SpanString is undefined.'; + } + }).margin(5) + + // 按钮3:将HTML转换回SpanString + Button($r('app.string.Converted_HTML_back_to_SpanString')).onClick(async () => { + this.spanString = await StyledString.fromHtml(this.html); + this.controller.setStyledString(this.spanString); + this.resultText = 'Converted HTML back to SpanString successfully.'; + }).margin(5) + + // 重置:重置HTML和SpanString + Button($r('app.string.Reset')).onClick(() => { + this.html = + "

This is b strong em i u del s www.example red span superscript and subscript

"; + this.spanString = undefined; + this.controller.setStyledString(new StyledString('')); // 使用空的StyledString实例 + this.resultText = 'Reset HTML and SpanString successfully.'; + }).margin(5) + }.width('100%').padding(20) + } +} +// [End styledStringHtmlOne_start] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringImageAttachment.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringImageAttachment.ets index c07afa4b0ae9e4d53971d006446482415e079f51..a4805ecea09f1545cfac550efe3b67ff940c67ce 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringImageAttachment.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringImageAttachment.ets @@ -14,9 +14,11 @@ */ import { ComponentCard } from '../../common/Card'; +import resource from '../../common/resource'; +// [Start styledStringImageAttachment_start] +// xxx.ets import { image } from '@kit.ImageKit'; import { LengthMetrics } from '@kit.ArkUI'; -import resource from '../../common/resource'; @Entry @Component @@ -40,7 +42,7 @@ export struct StyledStringImageAttachment { async aboutToAppear() { console.info('aboutToAppear initial imagePixelMap'); - this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.startIcon')); + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.background')); } private async getPixmapFromMedia(resource: Resource) { @@ -181,4 +183,5 @@ export struct StyledStringImageAttachment { .backgroundColor('#f1f2f3') .title($r('app.string.StyledStringImageAttachment_title')) } -} \ No newline at end of file +} +// [End styledStringImageAttachment_start] diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringLetterSpacingStyle.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringLetterSpacingStyle.ets new file mode 100644 index 0000000000000000000000000000000000000000..38beb15cfe0a30bf3ef2f3f94a9db0f5c89f671d --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringLetterSpacingStyle.ets @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start styledStringLetterSpacingStyle_start] +import { LengthMetrics, LengthUnit } from '@kit.ArkUI'; + +// xxx.ets +@Entry +@Component +struct styled_string_demo7 { + @State str: string = + this.getUIContext().getHostContext()?.resourceManager.getStringSync($r('app.string.CreateApply_Text_2')) as string; + mutableStyledString: MutableStyledString = new MutableStyledString(this.str, [ + { + start: 0, + length: 2, + styledKey: StyledStringKey.LETTER_SPACING, + styledValue: new LetterSpacingStyle(new LengthMetrics(20, LengthUnit.VP)) + } + ]); + controller: TextController = new TextController(); + + async onPageShow() { + this.controller.setStyledString(this.mutableStyledString); + } + + build() { + Column() { + // 显示属性字符串 + Text(undefined, { controller: this.controller }) + } + .width('100%') + } +} +// [End styledStringLetterSpacingStyle_start] \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ExtendInterface.ts b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringLineHeightStyle.ets similarity index 38% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ExtendInterface.ts rename to ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringLineHeightStyle.ets index 55f7a0b36bc2895e17a2e6b32a6c1980853cbce9..d8262af03cbc83bd5c452f29e8399470e4a43b34 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ExtendInterface.ts +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringLineHeightStyle.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -12,52 +12,37 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -import { MockKit } from "./MockKit.js"; - -class ExtendInterface { - - private mocker: MockKit - private params: any - - constructor(mocker: MockKit) { - this.mocker = mocker; - } - - stub() { - this.params = arguments; - return this; - } - - stubMockedCall(returnInfo: any) { - this.mocker.stubApply(this, this.params, returnInfo); - } - - afterReturn(value: any) { - this.stubMockedCall(function () { - return value; - }); - } - - afterReturnNothing() { - this.stubMockedCall(function () { - return undefined; - }); - } - - afterAction(action: Function) { - this.stubMockedCall(action); - } - - afterThrow(msg: string) { - this.stubMockedCall(function () { - throw msg; - }); - } - - clear(obj?: any) { - this.mocker.clear(obj); - } +// [Start styledStringLineHeightStyle_start] +import { LengthMetrics } from '@kit.ArkUI'; + +// xxx.ets +@Entry +@Component +struct styled_string_demo6 { + @State str: string = + this.getUIContext() + .getHostContext()?.resourceManager.getStringSync($r('app.string.StyledStringStyle_Text_5')) as string; + mutableStyledString: MutableStyledString = new MutableStyledString(this.str, [ + { + start: 8, + length: 3, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: new LineHeightStyle(LengthMetrics.vp(50)) + } + ]); + controller: TextController = new TextController(); + + async onPageShow() { + this.controller.setStyledString(this.mutableStyledString); + } + + build() { + Column() { + // 显示属性字符串 + Text(undefined, { controller: this.controller }) + } + .width('100%') + .margin({ top: 10 }) + } } - -export default ExtendInterface; \ No newline at end of file +// [End styledStringLineHeightStyle_start] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringParagraphStyle.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringParagraphStyle.ets index f4fd880165fd18ba4e55fd3819b8d0fe98948341..8483026e919fa4174279328d1950b0c885c72928 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringParagraphStyle.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringParagraphStyle.ets @@ -14,8 +14,8 @@ */ import { ComponentCard } from '../../common/Card'; -import { LengthMetrics } from '@kit.ArkUI'; import resource from '../../common/resource'; +import { LengthMetrics } from '@kit.ArkUI'; @Entry @Component diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringParagraphStyleOne.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringParagraphStyleOne.ets new file mode 100644 index 0000000000000000000000000000000000000000..39f3918af2821f84add44b1b220cb35912fe9498 --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringParagraphStyleOne.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start styledStringParagraphStyleOne_start] +import { LengthMetrics} from '@kit.ArkUI'; + +// xxx.ets +@Entry +@Component +struct Index { + @State str: string = + this.getUIContext() + .getHostContext()?.resourceManager.getStringSync($r('app.string.StyledStringParagraphStyle_Text_1')) as string; + titleParagraphStyleAttr: ParagraphStyle = new ParagraphStyle({ textAlign: TextAlign.Center }); + // 段落首行缩进15vp + paragraphStyleAttr1: ParagraphStyle = new ParagraphStyle({ textIndent: LengthMetrics.vp(15) }); + // 行高样式对象 + lineHeightStyle1: LineHeightStyle = new LineHeightStyle(new LengthMetrics(24)); + // 创建含段落样式的对象paragraphStyledString1 + paragraphStyledString1: MutableStyledString = + new MutableStyledString(this.str, [ + { + start: 0, + length: 4, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.titleParagraphStyleAttr + }, + { + start: 0, + length: 4, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: new LineHeightStyle(new LengthMetrics(50)) + }, { + start: 0, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontSize: LengthMetrics.vp(24), fontWeight: FontWeight.Bolder }) + }, + { + start: 5, + length: 3, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr1 + }, + { + start: 5, + length: 20, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: this.lineHeightStyle1 + } + ]); + controller: TextController = new TextController(); + + async onPageShow() { + this.controller.setStyledString(this.paragraphStyledString1); + } + + build() { + Column() { + // 显示属性字符串 + Text(undefined, { controller: this.controller }) + } + .width('100%') + } +} +// [End styledStringParagraphStyleOne_start] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringReplaceParagraphStyle.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringReplaceParagraphStyle.ets new file mode 100644 index 0000000000000000000000000000000000000000..aa7262721c03efbfd8333be683f204a95c897728 --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringReplaceParagraphStyle.ets @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start styledStringReplaceParagraphStyle_start] +import { LengthMetrics } from '@kit.ArkUI'; + +// xxx.ets +@Entry +@Component +struct Index { + @State str: string = + this.getUIContext() + .getHostContext()?.resourceManager.getStringSync($r('app.string.StyledStringParagraphStyle_Text_2')) as string; + titleParagraphStyleAttr: ParagraphStyle = new ParagraphStyle({ textAlign: TextAlign.Center }); + // 段落首行缩进15vp + paragraphStyleAttr1: ParagraphStyle = new ParagraphStyle({ textIndent: LengthMetrics.vp(15) }); + // 行高样式对象 + lineHeightStyle1: LineHeightStyle = new LineHeightStyle(new LengthMetrics(24)); + // 创建含段落样式的对象paragraphStyledString1 + paragraphStyledString1: MutableStyledString = + new MutableStyledString(this.str, [ + { + start: 0, + length: 4, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.titleParagraphStyleAttr + }, + { + start: 0, + length: 4, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: new LineHeightStyle(new LengthMetrics(50)) + }, { + start: 0, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontSize: LengthMetrics.vp(24), fontWeight: FontWeight.Bolder }) + }, + { + start: 5, + length: 3, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr1 + }, + { + start: 5, + length: 20, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: this.lineHeightStyle1 + } + ]); + paragraphStyleAttr3: ParagraphStyle = new ParagraphStyle({ + textAlign: TextAlign.End, + maxLines: 1, + wordBreak: WordBreak.BREAK_ALL, + overflow: TextOverflow.Ellipsis + }); + controller: TextController = new TextController(); + + async onPageShow() { + this.controller.setStyledString(this.paragraphStyledString1); + } + + build() { + Column() { + // 显示属性字符串 + Text(undefined, { controller: this.controller }).width(300) + Button($r('app.string.Replace_paragraph_style')) + .onClick(() => { + this.paragraphStyledString1.replaceStyle({ + start: 5, + length: 3, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr3 + }); + this.controller.setStyledString(this.paragraphStyledString1); + }) + } + .width('100%') + } +} +// [End styledStringReplaceParagraphStyle_start] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringSceneExample.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringSceneExample.ets index 60a3431b1bef0a10142e77e9cb291b7669ec8f20..03dfabb87153324eb79427b24fad6d07698bc815 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringSceneExample.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringSceneExample.ets @@ -14,8 +14,9 @@ */ import { ComponentCard } from '../../common/Card'; -import { LengthMetrics } from '@kit.ArkUI'; import resource from '../../common/resource'; +// [Start styledStringSceneExample_start] +import { LengthMetrics } from '@kit.ArkUI'; @Entry @Component @@ -172,4 +173,5 @@ export struct StyledStringSceneExample { .backgroundColor('#f1f2f3') .title($r('app.string.StyledStringSceneExample_title')) } -} \ No newline at end of file +} +// [End styledStringSceneExample_start] \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/VerificationMode.ts b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringTextShadowStyle.ets similarity index 37% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/VerificationMode.ts rename to ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringTextShadowStyle.ets index 93d976ce73b2fbde199d31b3efd30eb3544179d8..1cf0c1400dda462e9d4edbbfbab2ec7044aaad2a 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/VerificationMode.ts +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringTextShadowStyle.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -12,45 +12,39 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - -class VerificationMode { - - private doTimes: number - - constructor(times: number) { - this.doTimes = times; - } - - times(count: number) { - if(count !== this.doTimes) { - throw Error(`expect ${count} actual ${this.doTimes}`); - } +// [Start styledStringTextShadowStyle_start] +// xxx.ets +@Entry +@Component +struct styled_string_demo3 { + @State str: string = + this.getUIContext().getHostContext()?.resourceManager.getStringSync($r('app.string.CreateApply_Text_2')) as string; + mutableStyledString: MutableStyledString = new MutableStyledString(this.str, [ + { + start: 0, + length: 3, + styledKey: StyledStringKey.TEXT_SHADOW, + styledValue: new TextShadowStyle({ + radius: 5, + type: ShadowType.COLOR, + color: Color.Red, + offsetX: 10, + offsetY: 10 + }) } + ]); + controller: TextController = new TextController(); - never() { - if (this.doTimes !== 0) { - throw Error(`expect 0 actual ${this.doTimes}`); - } - } - - once() { - if (this.doTimes !== 1) { - throw Error(`expect 1 actual ${this.doTimes}`); - } - } + async onPageShow() { + this.controller.setStyledString(this.mutableStyledString); + } - atLeast(count: number) { - if (count > this.doTimes) { - throw Error('failed ' + count + ' greater than the actual execution times of method'); - } - } - - atMost(count: number) { - if (count < this.doTimes) { - throw Error('failed ' + count + ' less than the actual execution times of method'); - } + build() { + Column() { + // 显示属性字符串 + Text(undefined, { controller: this.controller }) } + .width('100%') + } } - -export default VerificationMode; \ No newline at end of file +// [End styledStringTextShadowStyle_start] \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejectedWith.js b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringTextStyle.ets similarity index 30% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejectedWith.js rename to ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringTextStyle.ets index 8179589d5580f9c305d2200b4b197d64ac9d53ae..c45c40d71017f396148096812922ce56428095cb 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejectedWith.js +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/StyledStringTextStyle.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -12,44 +12,52 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start styledStringTextStyle_start] +import { LengthMetrics } from '@kit.ArkUI'; -import isPromiseLike from './isPromiseLike'; - -function assertPromiseIsRejectedWith(actualPromise, expectedValue) { - - if (!isPromiseLike(actualPromise)) { - return Promise.reject().then(function () { - }, function () { - return {pass: false, message: 'Expected not be called on a promise.'}; - }); +@Entry +@Component +struct styled_string_demo2 { + @State str: string = + this.getUIContext().getHostContext()?.resourceManager.getStringSync($r('app.string.CreateApply_Text_3')) as string; + textStyleAttrs: TextStyle = + new TextStyle({ + fontWeight: FontWeight.Bolder, + fontSize: LengthMetrics.vp(24), + fontStyle: FontStyle.Italic, + strokeWidth: LengthMetrics.px(5), + strokeColor: Color.Green + }); + mutableStyledString: MutableStyledString = new MutableStyledString(this.str, [ + { + start: 2, + length: 2, + styledKey: StyledStringKey.FONT, + styledValue: this.textStyleAttrs + }, + { + start: 7, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ + fontColor: Color.Orange, fontSize: LengthMetrics.vp(12), + superscript: SuperscriptStyle.SUPERSCRIPT + }) } + ]); + controller: TextController = new TextController(); - function tips(passed) { - return ('Expected a promise ' + (passed ? 'not ' : '') + - 'to be rejected with ' + JSON.stringify(expectedValue[0])); - } + async onPageShow() { + this.controller.setStyledString(this.mutableStyledString); + } - return actualPromise.then( - function (got) { - return { - pass: false, - message: tips(false) + ' but actualValue is resolve' - }; - }, - function (actualValue) { - if (JSON.stringify(actualValue) == JSON.stringify(expectedValue[0])) { - return { - pass: true, - message: 'actualValue was rejected with ' + JSON.stringify(actualValue) + '.' - }; - } else { - return { - pass: false, - message: tips(false) + ' but it was rejected with ' + JSON.stringify(actualValue) + '.' - }; - } - } - ); + build() { + Column() { + // 显示属性字符串 + Text(undefined, { controller: this.controller }) + .margin({ top: 10 }) + } + .width('100%') + } } - -export default assertPromiseIsRejectedWith; \ No newline at end of file +// [End styledStringTextStyle_start] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/index.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/index.ets index 69a07844fb1c415d572492ccc8bb77d82e6a6758..3735ebdc123a6fb38c919df308cc51ecfaf8808a 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/index.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/propertyString/index.ets @@ -27,14 +27,44 @@ const routes: Route[] = [ description: $r('app.string.Create_Apply_StyledString_MutableStyledString_desc') }, { - name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringStyle`, - title: resource.resourceToString($r('app.string.StyledStringStyle_title')), - description: $r('app.string.StyledStringStyle_description') + name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringTextStyle`, + title: resource.resourceToString($r('app.string.StyledStringStyle_title_1')), }, { - name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringParagraphStyle`, - title: resource.resourceToString($r('app.string.StyledStringParagraphStyle_title')), - description: $r('app.string.StyledStringParagraphStyle_description') + name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringTextShadowStyle`, + title: resource.resourceToString($r('app.string.StyledStringStyle_title_2')), + }, + { + name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringDecorationStyle`, + title: resource.resourceToString($r('app.string.StyledStringStyle_title_3')), + }, + { + name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringDecorationStyle`, + title: resource.resourceToString($r('app.string.StyledStringStyle_title_3')), + }, + { + name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringBaselineOffsetStyle`, + title: resource.resourceToString($r('app.string.StyledStringStyle_title_4')), + }, + { + name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringLineHeightStyle`, + title: resource.resourceToString($r('app.string.StyledStringStyle_title_5')), + }, + { + name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringLetterSpacingStyle`, + title: resource.resourceToString($r('app.string.StyledStringStyle_title_6')), + }, + { + name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringParagraphStyleOne`, + title: resource.resourceToString($r('app.string.StyledStringParagraphStyleOne_title')), + }, + { + name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringReplaceParagraphStyle`, + title: resource.resourceToString($r('app.string.StyledStringReplaceParagraphStyle_title')), + }, + { + name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringConvertedToParagraph`, + title: resource.resourceToString($r('app.string.StyledStringConvertedToParagraph_title')), }, { name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringImageAttachment`, @@ -51,6 +81,11 @@ const routes: Route[] = [ title: resource.resourceToString($r('app.string.StyledStringHtml_title')), description: $r('app.string.StyledStringHtml_description') }, + { + name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringHtmlOne`, + title: resource.resourceToString($r('app.string.StyledStringHtmlOne_title')), + description: $r('app.string.StyledStringHtmlOne_description') + }, { name: `${PROPERTY_STRING_ROUTE_PREFIX}/StyledStringSceneExample`, title: resource.resourceToString($r('app.string.StyledStringSceneExample_title')), diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/AddBuilderDecoratorContent.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/AddBuilderDecoratorContent.ets index 6a86c9af02355fe69efd50238a4c81c690ca3df7..263eaa1d487947645a31b952cdda40076181cb2b 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/AddBuilderDecoratorContent.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/AddBuilderDecoratorContent.ets @@ -22,7 +22,7 @@ export struct AddBuilderDecoratorContent { // [Start richEditor_addBuilder] controller: RichEditorController = new RichEditorController(); options: RichEditorOptions = { controller: this.controller }; - private myBuilder: CustomBuilder = undefined + private myBuilder: CustomBuilder = undefined; @Builder TextBuilder() { diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/AddEvent.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/AddEvent.ets index ac0caf6e500da21cd5eb48784464389a3c577411..08654e529a29566eedcdc6955f578dab0a729f92 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/AddEvent.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/AddEvent.ets @@ -16,7 +16,7 @@ import { ComponentCard } from '../../common/Card'; // [Start richEditor_eventPaste] import { pasteboard } from '@kit.BasicServicesKit'; -// [End richEditor_eventPaste] +// [StartExclude richEditor_eventPaste] import resource from '../../common/resource'; @Component @@ -54,7 +54,7 @@ struct event2 { infoShowController: RichEditorController = new RichEditorController(); infoShowOptions: RichEditorOptions = { controller: this.infoShowController }; - // [End richEditor_eventSelectChange] + // [StartExclude richEditor_eventSelectChange] build() { Column() { @@ -63,7 +63,7 @@ struct event2 { description: $r('app.string.Add_Event_title_2_desc'), }) { Column({ space: 3 }) { - // [Start richEditor_eventSelectChange] + // [EndExclude richEditor_eventSelectChange] // $r('app.string.xxx')需要替换为开发者所需的字符串 RichEditor(this.options) .onReady(() => { @@ -219,7 +219,7 @@ struct event4 { } } -// [Start richEditor_eventPaste] +// [EndExclude richEditor_eventPaste] @Component struct on_cut_copy_paste { controller: RichEditorController = new RichEditorController(); @@ -351,7 +351,7 @@ struct event7 { infoShowController: RichEditorController = new RichEditorController(); infoShowOptions: RichEditorOptions = { controller: this.infoShowController }; - // [End richEditor_eventCopy] + // [StartExclude richEditor_eventCopy] build() { Column() { @@ -360,7 +360,7 @@ struct event7 { description: $r('app.string.Add_Event_title_7') }) { Column({ space: 3 }) { - // [Start richEditor_eventCopy] + // [EndExclude richEditor_eventCopy] // $r('app.string.xxx')需要替换为开发者所需的资源文件 RichEditor(this.options) .onReady(() => { diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/BackplaneHighlighting.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/BackplaneHighlighting.ets index 35a33ff13caeb3c89bfc428f528f76b764a9c89c..df5ea27a8f14fb3e7b40dfbe969765485aa9bdcc 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/BackplaneHighlighting.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/BackplaneHighlighting.ets @@ -22,14 +22,14 @@ export struct BackplaneHighlighting { // [Start richEditor_selection] controller: RichEditorController = new RichEditorController(); options: RichEditorOptions = { controller: this.controller }; - // [End richEditor_selection] + // [StartExclude richEditor_selection] build() { NavDestination() { Column({ space: 12 }) { ComponentCard() { Column({ space: 3 }) { - // [Start richEditor_selection] + // [EndExclude richEditor_selection] RichEditor(this.options) .onReady(() => { // $r('app.string.BackplaneHighlighting_Text_1')需要替换为开发者所需的资源文件 diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/CreateRichEditor.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/CreateRichEditor.ets index 76fc9910836704631f289404602c8d6abad38e55..a1339a4ca2c8179f5e7724e0a0d44ce4c6cf55d3 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/CreateRichEditor.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/CreateRichEditor.ets @@ -60,11 +60,11 @@ export struct CreateRichEditor { // [End richEditor_create] } - // [EndExclude richEditor_create_span] // $r('app.string.Create_RichEditor_Component_title_2')需要替换为开发者所需的资源文件 ComponentCard({ title: $r('app.string.Create_RichEditor_Component_title_2'), }) { + // [EndExclude richEditor_create_span] RichEditor(this.optionsNoStyledString) .onReady(() => { this.controllerNoStyledString.addTextSpan( @@ -76,19 +76,17 @@ export struct CreateRichEditor { } }) }) + // [StartExclude richEditor_create_span] } + // [EndExclude richEditor_create_span] } .width('100%') .height('100%') - // [StartExclude richEditor_create_span] .padding({ left: 12, right: 12 }) - // [EndExclude richEditor_create_span] } - // [StartExclude richEditor_create_span] .backgroundColor('#f1f2f3') // $r('app.string.Create_RichEditor_Component_title')需要替换为开发者所需的资源文件 .title($r('app.string.Create_RichEditor_Component_title')) - // [EndExclude richEditor_create_span] } } // [End richEditor_create_span] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/DisableMenuItem.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/DisableMenuItem.ets index 5ebfa26cc8a3d872402e4ccd516492feb3b53574..74331bd401d08c2ae07c66e2d9a7bf0aed35d876 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/DisableMenuItem.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/DisableMenuItem.ets @@ -14,13 +14,13 @@ */ import { ComponentCard } from '../../common/Card'; +// [Start richEditor_disableMenu] import { TextMenuController } from '@kit.ArkUI'; @Entry @Component export struct DisableMenuItem { - // [Start richEditor_disableMenu] controller: RichEditorController = new RichEditorController(); options: RichEditorOptions = { controller: this.controller }; @@ -33,13 +33,13 @@ export struct DisableMenuItem { // 恢复系统服务菜单 TextMenuController.disableMenuItems([]); } - // [End richEditor_disableMenu] build() { + // [StartExclude richEditor_disableMenu] NavDestination() { Column({ space: 12 }) { ComponentCard() { - // [Start richEditor_disableMenu] + // [EndExclude richEditor_disableMenu] RichEditor(this.options) .onReady(() => { // $r('app.string.Demo_richEditor')需要替换为开发者所需的资源文件 @@ -59,7 +59,7 @@ export struct DisableMenuItem { return false; } }); - // [End richEditor_disableMenu] + // [StartExclude richEditor_disableMenu] } } .width('100%') @@ -67,5 +67,7 @@ export struct DisableMenuItem { } .backgroundColor('#f1f2f3') .title($r('app.string.Disable_Menu_Item_title')); + // [EndExclude richEditor_disableMenu] } -} \ No newline at end of file +} +// [End richEditor_disableMenu] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/DisableSystemServiceMenu.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/DisableSystemServiceMenu.ets index 4a17724fc4ed7a992e435020a8aa27a78b3a92fb..24e0f721a923cde7a87f9176a1e72286b7c17bf4 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/DisableSystemServiceMenu.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/DisableSystemServiceMenu.ets @@ -14,13 +14,12 @@ */ import { ComponentCard } from '../../common/Card'; +// [Start richEditor_disableSystemMenu] import { TextMenuController } from '@kit.ArkUI'; - @Entry @Component export struct DisableSystemServiceMenu { - // [Start richEditor_disableSystemMenu] controller: RichEditorController = new RichEditorController(); options: RichEditorOptions = { controller: this.controller }; @@ -33,13 +32,13 @@ export struct DisableSystemServiceMenu { // 页面消失恢复系统服务菜单 TextMenuController.disableSystemServiceMenuItems(false); } - // [End richEditor_disableSystemMenu] build() { + // [StartExclude richEditor_disableSystemMenu] NavDestination() { Column({ space: 12 }) { ComponentCard() { - // [Start richEditor_disableSystemMenu] + // [EndExclude richEditor_disableSystemMenu] RichEditor(this.options).onReady(() => { // $r('app.string.Demo_richEditor')需要替换为开发者所需的资源文件 this.controller.addTextSpan($r('app.string.Demo_richEditor'), @@ -60,7 +59,7 @@ export struct DisableSystemServiceMenu { return false; } }); - // [End richEditor_disableSystemMenu] + // [StartExclude richEditor_disableSystemMenu] } } .width('100%') @@ -68,5 +67,7 @@ export struct DisableSystemServiceMenu { } .backgroundColor('#f1f2f3') .title($r('app.string.Disable_SystemService_Menu_title')); + // [EndExclude richEditor_disableSystemMenu] } } +// [End richEditor_disableSystemMenu] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/SetAttributes.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/SetAttributes.ets index 93eb0f0e62631cec3d1e11ca4b6328e9d0eee880..dd33cd32509493d5b26b88dad34c3a11807f380a 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/SetAttributes.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/SetAttributes.ets @@ -142,7 +142,7 @@ struct attr2 { // [Start richEditor_color] controller: RichEditorController = new RichEditorController(); options: RichEditorOptions = { controller: this.controller }; - // [End richEditor_color] + // [StartExclude richEditor_color] build() { Column() { @@ -150,7 +150,7 @@ struct attr2 { title: $r('app.string.Set_Attributes_title_2'), description: $r('app.string.Set_Attributes_title_2_desc') }) { - // [Start richEditor_color] + // [EndExclude richEditor_color] // $r('app.string.SetAttributes_Text_5')需要替换为开发者所需的资源文件 RichEditor(this.options) .onReady(() => { @@ -208,7 +208,7 @@ struct attr4 { // [Start richEditor_maxLines] controller: RichEditorController = new RichEditorController(); options: RichEditorOptions = { controller: this.controller }; - // [End richEditor_maxLines] + // [StartExclude richEditor_maxLines] build() { Column() { @@ -216,7 +216,7 @@ struct attr4 { title: $r('app.string.Set_Attributes_title_4'), description: $r('app.string.Set_Attributes_title_4_desc') }) { - // [Start richEditor_maxLines] + // [EndExclude richEditor_maxLines] // $r('app.string.SetAttributes_Text_7')需要替换为开发者所需的资源文件 RichEditor(this.options) .onReady(() => { @@ -284,21 +284,24 @@ struct attr6 { } } -// [Start richEditor_decoration] + @Component struct Decoration { + // [Start richEditor_decoration] controller: RichEditorController = new RichEditorController(); options: RichEditorOptions = { controller: this.controller }; + // [StartExclude richEditor_decoration] build() { Column() { - // $r('app.string.xxx')需要替换为开发者所需的资源文件 ComponentCard({ title: $r('app.string.Set_Attributes_title_9'), description: $r('app.string.Set_Attributes_title_9_desc') }) { + // [EndExclude richEditor_decoration] RichEditor(this.options) .onReady(() => { + // $r('app.string.Demo_oneText')需要替换为开发者所需的资源文件 this.controller.addTextSpan($r('app.string.Demo_oneText'), { style: { fontSize: 25, @@ -311,11 +314,11 @@ struct Decoration { } }); }); + // [End richEditor_decoration] } }.width('100%'); } } -// [End richEditor_decoration] @Component struct DecorationOptions { @@ -384,7 +387,7 @@ struct SetTextVerticalAlign { // [Start richEditor_textVerticalAlign] controller: RichEditorController = new RichEditorController(); options: RichEditorOptions = { controller: this.controller }; - // [End richEditor_textVerticalAlign] + // [StartExclude richEditor_textVerticalAlign] build() { Column() { @@ -392,7 +395,7 @@ struct SetTextVerticalAlign { title: $r('app.string.Set_Attributes_title_11'), description: $r('app.string.Set_Attributes_title_11_desc') }) { - // [Start richEditor_textVerticalAlign] + // [EndExclude richEditor_textVerticalAlign] RichEditor(this.options) .onReady(() => { // $r('app.media.startIcon')需要替换为开发者所需的资源文件 @@ -426,7 +429,7 @@ struct EnableAutoSpacing { // [Start richEditor_enableAutoSpacing] controller: RichEditorController = new RichEditorController(); options: RichEditorOptions = { controller: this.controller }; - // [End richEditor_enableAutoSpacing] + // [StartExclude richEditor_enableAutoSpacing] @State enableAutoSpace:boolean = false; @@ -437,7 +440,7 @@ struct EnableAutoSpacing { description: $r('app.string.Set_Attributes_title_12_desc') }) { Column({ space: 3 }) { - // [Start richEditor_enableAutoSpacing] + // [EndExclude richEditor_enableAutoSpacing] // $r('app.string.Demo_autoSpacingString')需要替换为开发者所需的资源文件 RichEditor(this.options) .onReady(() => { @@ -463,10 +466,9 @@ struct EnableAutoSpacing { } } - +// [Start richEditor_prepareMenu] @Component struct PrepareMenu { - // [Start richEditor_prepareMenu] controller: RichEditorController = new RichEditorController(); options: RichEditorOptions = { controller: this.controller }; @State endIndex: number | undefined = 0; @@ -549,9 +551,8 @@ struct PrepareMenu { } } } - // [End richEditor_prepareMenu] } - +// [End richEditor_prepareMenu] @Entry @Component diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/SetUserPresetTextStyles.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/SetUserPresetTextStyles.ets index 971e1c387e6c54c8cabf6ca5fc34ac9657642dc5..2287442fc18779750dabecdc5729f69c7078699d 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/SetUserPresetTextStyles.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/richEditor/SetUserPresetTextStyles.ets @@ -22,14 +22,14 @@ export struct SetUserPresetTextStyles { // [Start richEditor_setTypingStyle] controller: RichEditorController = new RichEditorController(); options: RichEditorOptions = { controller: this.controller }; - // [End richEditor_setTypingStyle] + // [StartExclude richEditor_setTypingStyle] build() { NavDestination() { Column({ space: 12 }) { ComponentCard() { Column({ space: 3 }) { - // [Start richEditor_setTypingStyle] + // [EndExclude richEditor_setTypingStyle] RichEditor(this.options) .onReady(() => { // $r('app.string.SetUserPresetTextStyles_Text_1')需要替换为开发者所需的资源文件 diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolAddEvent.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolAddEvent.ets index 87d8cdc917e8a64c284962e1f1d00920b6309430..7cb6cad92bafa102bfcf9ff08684e44f99ed0cdd 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolAddEvent.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolAddEvent.ets @@ -18,7 +18,9 @@ import { ComponentCard } from '../../common/Card'; @Entry @Component export struct SymbolGlyphSpanAddEvent { + // [Start symbol_glyph_span_add_event] @State wifiColor: ResourceColor = Color.Black; + // [End symbol_glyph_span_add_event] build() { NavDestination() { diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolAddToText.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolAddToText.ets index 8faacdae9e0a4d7863d6239fe7e3e8a3b6bab99d..0c7d401cdf69b425e584d92e7328157ab9e704fa 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolAddToText.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolAddToText.ets @@ -30,8 +30,10 @@ export struct SymbolGlyphSpanAddToText { SymbolSpan($r('sys.symbol.ohos_trash')) .fontWeight(FontWeight.Normal) .fontSize(96) - }.id('1') - + } + // [StartExclude creat_symbol_span] + .id('1') + // [EndExclude creat_symbol_span] // [End creat_symbol_span] } @@ -45,7 +47,10 @@ export struct SymbolGlyphSpanAddToText { .fontSize(48) .renderingStrategy(SymbolRenderingStrategy.SINGLE) .fontColor([Color.Black, Color.Green, Color.White]) - }.id('2') + } + // [StartExclude symbol_span_font_size] + .id('2') + // [EndExclude symbol_span_font_size] } Column() { @@ -55,7 +60,10 @@ export struct SymbolGlyphSpanAddToText { .fontSize(72) .renderingStrategy(SymbolRenderingStrategy.SINGLE) .fontColor([Color.Black, Color.Green, Color.White]) - }.id('3') + } + // [StartExclude symbol_span_font_size] + .id('3') + // [EndExclude symbol_span_font_size] } Column() { @@ -65,7 +73,10 @@ export struct SymbolGlyphSpanAddToText { .fontSize(96) .renderingStrategy(SymbolRenderingStrategy.SINGLE) .fontColor([Color.Black, Color.Green, Color.White]) - }.id('4') + } + // [StartExclude symbol_span_font_size] + .id('4') + // [EndExclude symbol_span_font_size] } } @@ -81,7 +92,10 @@ export struct SymbolGlyphSpanAddToText { SymbolSpan($r('sys.symbol.ohos_trash')) .fontWeight(FontWeight.Lighter) .fontSize(96) - }.id('5') + } + // [StartExclude symbol_span_font_weight] + .id('5') + // [EndExclude symbol_span_font_weight] } Column() { @@ -90,7 +104,10 @@ export struct SymbolGlyphSpanAddToText { SymbolSpan($r('sys.symbol.ohos_trash')) .fontWeight(FontWeight.Normal) .fontSize(96) - }.id('6') + } + // [StartExclude symbol_span_font_weight] + .id('6') + // [EndExclude symbol_span_font_weight] } Column() { @@ -99,7 +116,10 @@ export struct SymbolGlyphSpanAddToText { SymbolSpan($r('sys.symbol.ohos_trash')) .fontWeight(FontWeight.Bold) .fontSize(96) - }.id('7') + } + // [StartExclude symbol_span_font_weight] + .id('7') + // [EndExclude symbol_span_font_weight] } } @@ -115,7 +135,10 @@ export struct SymbolGlyphSpanAddToText { SymbolSpan($r('sys.symbol.ohos_folder_badge_plus')) .fontSize(96) .fontColor([Color.Black]) - }.id('8') + } + // [StartExclude symbol_span_font_color] + .id('8') + // [EndExclude symbol_span_font_color] } Column() { @@ -124,7 +147,10 @@ export struct SymbolGlyphSpanAddToText { SymbolSpan($r('sys.symbol.ohos_folder_badge_plus')) .fontSize(96) .fontColor([Color.Green]) - }.id('9') + } + // [StartExclude symbol_span_font_color] + .id('9') + // [EndExclude symbol_span_font_color] } Column() { @@ -133,7 +159,10 @@ export struct SymbolGlyphSpanAddToText { SymbolSpan($r('sys.symbol.ohos_folder_badge_plus')) .fontSize(96) .fontColor([Color.Pink]) - }.id('10') + } + // [StartExclude symbol_span_font_color] + .id('10') + // [EndExclude symbol_span_font_color] } } @@ -144,33 +173,42 @@ export struct SymbolGlyphSpanAddToText { // [Start symbol_span_rendering_strategy] Row() { Column() { - Text($r('app.string.SymbolAddToText_Text_1')) + Text($r('app.string.SymbolAddToText_Text_1')); Text() { SymbolSpan($r('sys.symbol.ohos_folder_badge_plus')) .fontSize(96) .renderingStrategy(SymbolRenderingStrategy.SINGLE) .fontColor([Color.Black, Color.Green, Color.White]) - }.id('11') + } + // [StartExclude symbol_span_rendering_strategy] + .id('11') + // [EndExclude symbol_span_rendering_strategy] } Column() { - Text($r('app.string.SymbolAddToText_Text_2')) + Text($r('app.string.SymbolAddToText_Text_2')); Text() { SymbolSpan($r('sys.symbol.ohos_folder_badge_plus')) .fontSize(96) .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_COLOR) .fontColor([Color.Black, Color.Green, Color.White]) - }.id('12') + } + // [StartExclude symbol_span_rendering_strategy] + .id('12') + // [EndExclude symbol_span_rendering_strategy] } Column() { - Text($r('app.string.SymbolAddToText_Text_3')) + Text($r('app.string.SymbolAddToText_Text_3')); Text() { SymbolSpan($r('sys.symbol.ohos_folder_badge_plus')) .fontSize(96) .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY) .fontColor([Color.Black, Color.Green, Color.White]) - }.id('13') + } + // [StartExclude symbol_span_rendering_strategy] + .id('13') + // [EndExclude symbol_span_rendering_strategy] } } @@ -181,30 +219,39 @@ export struct SymbolGlyphSpanAddToText { // [Start symbol_span_effect_strategy] Row() { Column() { - Text($r('app.string.SymbolAddToText_Text_4')) + Text($r('app.string.SymbolAddToText_Text_4')); Text() { SymbolSpan($r('sys.symbol.ohos_wifi')) .fontSize(96) .effectStrategy(SymbolEffectStrategy.NONE) - }.id('14') + } + // [StartExclude symbol_span_effect_strategy] + .id('14') + // [EndExclude symbol_span_effect_strategy] } Column() { - Text($r('app.string.SymbolAddToText_Text_5')) + Text($r('app.string.SymbolAddToText_Text_5')); Text() { SymbolSpan($r('sys.symbol.ohos_wifi')) .fontSize(96) .effectStrategy(SymbolEffectStrategy.SCALE) - }.id('15') + } + // [StartExclude symbol_span_effect_strategy] + .id('15') + // [EndExclude symbol_span_effect_strategy] } Column() { - Text($r('app.string.SymbolAddToText_Text_6')) + Text($r('app.string.SymbolAddToText_Text_6')); Text() { SymbolSpan($r('sys.symbol.ohos_wifi')) .fontSize(96) .effectStrategy(SymbolEffectStrategy.HIERARCHICAL) - }.id('16') + } + // [StartExclude symbol_span_effect_strategy] + .id('16') + // [EndExclude symbol_span_effect_strategy] } } diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolCustomIconAnimation.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolCustomIconAnimation.ets index e74e5bda67a5a1290bf1d764c54be49e61f4d8f7..7c599cfcf27d8fb9e799e04796eb3d393550d88b 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolCustomIconAnimation.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolCustomIconAnimation.ets @@ -18,45 +18,98 @@ import { ComponentCard } from '../../common/Card'; @Entry @Component export struct SymbolGlyphSpanCustomIconAnimation { + scroller: Scroller = new Scroller(); + // [Start symbol_variable_color_new] @State isActive: boolean = true; + // [End symbol_variable_color_new] + // [Start symbol_bouncing_effect_new] + // [Start symbol_disable_effect_new] + // [Start symbol_quick_replacement_new] @State triggerValueReplace: number = 0; + // [End symbol_bouncing_effect_new] + @State renderMode: number = 1; + // [End symbol_disable_effect_new] + replaceFlag: boolean = true; + // [End symbol_quick_replacement_new] build() { NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.SymbolGlyphSpanCustomIconAnimation_title_1') }) { - // [Start symbol_effect_1] - Column() { - Text($r('app.string.SymbolCustomIconAnimation_Text_1')) - SymbolGlyph($r('sys.symbol.ohos_wifi')) - .id('1') - .fontSize(96) - .symbolEffect(new HierarchicalSymbolEffect(EffectFillStyle.ITERATIVE), this.isActive) - Button(this.isActive ? $r('app.string.SymbolGlyphSpanCustomIconAnimation_Button_1') : $r('app.string.SymbolGlyphSpanCustomIconAnimation_Button_2')).onClick(() => { - this.isActive = !this.isActive; - }) + Scroll(this.scroller) { + Column({ space: 12 }) { + ComponentCard({ title: $r('app.string.SymbolGlyphSpanCustomIconAnimation_title_1') }) { + // [Start symbol_variable_color] + Column() { + Text($r('app.string.SymbolCustomIconAnimation_Text_1')); + SymbolGlyph($r('sys.symbol.ohos_wifi')) + // [StartExclude symbol_variable_color] + .id('1') + // [EndExclude symbol_variable_color] + .fontSize(96) + .symbolEffect(new HierarchicalSymbolEffect(EffectFillStyle.ITERATIVE), this.isActive) + Button(this.isActive ? $r('app.string.SymbolGlyphSpanCustomIconAnimation_Button_1') : $r('app.string.SymbolGlyphSpanCustomIconAnimation_Button_2')).onClick(() => { + this.isActive = !this.isActive; + }) + } + // [End symbol_variable_color] } - // [End symbol_effect_1] - } - ComponentCard({ title: $r('app.string.SymbolGlyphSpanCustomIconAnimation_title_2') }) { - // [Start symbol_effect_2] - Column() { - Text($r('app.string.SymbolCustomIconAnimation_Text_2')) - SymbolGlyph($r('sys.symbol.ellipsis_message_1')) - .id('2') - .fontSize(96) - .fontColor([Color.Gray]) - .symbolEffect(new BounceSymbolEffect(EffectScope.WHOLE, EffectDirection.UP), this.triggerValueReplace) - Button($r('app.string.SymbolGlyphSpanCustomIconAnimation_Button_3')).onClick(() => { - this.triggerValueReplace = this.triggerValueReplace + 1; - }) + ComponentCard({ title: $r('app.string.SymbolGlyphSpanCustomIconAnimation_title_2') }) { + // [Start symbol_bouncing_effect] + Column() { + Text($r('app.string.SymbolCustomIconAnimation_Text_2')); + SymbolGlyph($r('sys.symbol.ellipsis_message_1')) + // [StartExclude symbol_bouncing_effect] + .id('2') + // [EndExclude symbol_bouncing_effect] + .fontSize(96) + .fontColor([Color.Gray]) + .symbolEffect(new BounceSymbolEffect(EffectScope.WHOLE, EffectDirection.UP), this.triggerValueReplace) + Button('trigger').onClick(() => { + this.triggerValueReplace = this.triggerValueReplace + 1; + }) + } + // [End symbol_bouncing_effect] + } + ComponentCard({ title: $r('app.string.SymbolGlyphSpanCustomIconAnimation_title_3') }) { + // [Start symbol_disable_effect] + Column() { + Text($r('app.string.SymbolCustomIconAnimation_Text_3')); + SymbolGlyph(this.replaceFlag ? $r('sys.symbol.eye_slash') : $r('sys.symbol.eye')) + // [StartExclude symbol_disable_effect] + .id('3') + // [EndExclude symbol_disable_effect] + .fontSize(96) + .renderingStrategy(this.renderMode) + .symbolEffect(new ReplaceSymbolEffect(EffectScope.LAYER, ReplaceEffectType.SLASH_OVERLAY), + this.triggerValueReplace) + Button('trigger').onClick(() => { + this.replaceFlag = !this.replaceFlag; + this.triggerValueReplace = this.triggerValueReplace + 1; + }) + } + // [End symbol_disable_effect] + } + ComponentCard({ title: $r('app.string.SymbolGlyphSpanCustomIconAnimation_title_4') }) { + // [Start symbol_quick_replacement] + Column() { + Text($r('app.string.SymbolCustomIconAnimation_Text_4')); + SymbolGlyph(this.replaceFlag ? $r('sys.symbol.checkmark_circle') : $r('sys.symbol.repeat_1')) + // [StartExclude symbol_quick_replacement] + .id('4') + // [EndExclude symbol_quick_replacement] + .fontSize(96) + .symbolEffect(new ReplaceSymbolEffect(EffectScope.WHOLE, ReplaceEffectType.CROSS_FADE), + this.triggerValueReplace) + Button('trigger').onClick(() => { + this.replaceFlag = !this.replaceFlag; + this.triggerValueReplace = this.triggerValueReplace + 1; + }) + } + // [End symbol_quick_replacement] } - // [End symbol_effect_2] } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) + .width('100%') + .padding({ left: 12, right: 12 }) + }.id('scroll_') } .backgroundColor('#f1f2f3') .title($r('app.string.SymbolGlyphSpanCustomIconAnimation_title')) diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolSceneExample.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolSceneExample.ets index 618a85afc47e213f8711a3103db39181dc9b3b18..a390156deb9c806ef7852bccd4d414d16ff60fa5 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolSceneExample.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolSceneExample.ets @@ -16,6 +16,7 @@ import { ComponentCard } from '../../common/Card'; import resource from '../../common/resource'; +// [Start symbol_glyph_span_scene_example] @Entry @Component export struct SymbolGlyphSpanSceneExample { @@ -31,10 +32,11 @@ export struct SymbolGlyphSpanSceneExample { @State fontColorValue1: ResourceColor = '#E8E8E8'; build() { + // [StartExclude symbol_glyph_span_scene_example] NavDestination() { Column({ space: 12 }) { ComponentCard({ title: $r('app.string.SymbolGlyphSpanSceneExample_title') }) { - // [Start symbol_glyph_span_scene_example] + // [EndExclude symbol_glyph_span_scene_example] Column({ space: 10 }) { Row() { Text() { @@ -42,13 +44,18 @@ export struct SymbolGlyphSpanSceneExample { .fontSize(20) .fontWeight(FontWeight.Bolder) Span('(101)') - }.id('text1') + } + // [StartExclude symbol_glyph_span_scene_example] + .id('text1') + // [EndExclude symbol_glyph_span_scene_example] } Row() { Row({ space: 5 }) { SymbolGlyph(this.symbolSources[this.symbolSourcesIndex]) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph1') + // [EndExclude symbol_glyph_span_scene_example] .symbolEffect(new ReplaceSymbolEffect(EffectScope.WHOLE), this.triggerValueReplace) .fontSize(20) .fontColor([this.fontColorValue]) @@ -74,19 +81,28 @@ export struct SymbolGlyphSpanSceneExample { SymbolSpan($r('sys.symbol.arrow_down_circle_badge_vip_circle_filled')) .fontColor([this.fontColorValue]) .fontSize(20) - }.id('text2') + } + // [StartExclude symbol_glyph_span_scene_example] + .id('text2') + // [EndExclude symbol_glyph_span_scene_example] Text() { SymbolSpan($r('sys.symbol.heart_badge_plus')) .fontColor([this.fontColorValue]) .fontSize(20) - }.id('text3') + } + // [StartExclude symbol_glyph_span_scene_example] + .id('text3') + // [EndExclude symbol_glyph_span_scene_example] Text() { SymbolSpan($r('sys.symbol.ohos_trash')) .fontColor([this.fontColorValue]) .fontSize(20) - }.id('text4') + } + // [StartExclude symbol_glyph_span_scene_example] + .id('text4') + // [EndExclude symbol_glyph_span_scene_example] } .width('25%') } @@ -99,11 +115,15 @@ export struct SymbolGlyphSpanSceneExample { Row({ space: 5 }) { SymbolGlyph($r('sys.symbol.play_arrow_triangle_2_circlepath')) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph2') + // [EndExclude symbol_glyph_span_scene_example] .fontColor([this.fontColorValue]) .fontSize(20) SymbolGlyph($r('sys.symbol.trash')) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph3') + // [EndExclude symbol_glyph_span_scene_example] .fontColor([this.fontColorValue]) .fontSize(20) } @@ -117,11 +137,15 @@ export struct SymbolGlyphSpanSceneExample { Row({ space: 5 }) { SymbolGlyph($r('sys.symbol.play_arrow_triangle_2_circlepath')) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph4') + // [EndExclude symbol_glyph_span_scene_example] .fontColor([this.fontColorValue]) .fontSize(20) SymbolGlyph($r('sys.symbol.trash')) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph5') + // [EndExclude symbol_glyph_span_scene_example] .fontColor([this.fontColorValue]) .fontSize(20) } @@ -135,11 +159,15 @@ export struct SymbolGlyphSpanSceneExample { Row({ space: 5 }) { SymbolGlyph($r('sys.symbol.play_arrow_triangle_2_circlepath')) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph6') + // [EndExclude symbol_glyph_span_scene_example] .fontColor([this.fontColorValue]) .fontSize(20) SymbolGlyph($r('sys.symbol.trash')) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph7') + // [EndExclude symbol_glyph_span_scene_example] .fontColor([this.fontColorValue]) .fontSize(20) } @@ -153,11 +181,15 @@ export struct SymbolGlyphSpanSceneExample { Row({ space: 5 }) { SymbolGlyph($r('sys.symbol.play_arrow_triangle_2_circlepath')) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph8') + // [EndExclude symbol_glyph_span_scene_example] .fontColor([this.fontColorValue]) .fontSize(20) SymbolGlyph($r('sys.symbol.trash')) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph9') + // [EndExclude symbol_glyph_span_scene_example]s .fontColor([this.fontColorValue]) .fontSize(20) } @@ -171,11 +203,15 @@ export struct SymbolGlyphSpanSceneExample { Row({ space: 5 }) { SymbolGlyph($r('sys.symbol.play_arrow_triangle_2_circlepath')) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph10') + // [EndExclude symbol_glyph_span_scene_example] .fontColor([this.fontColorValue]) .fontSize(20) SymbolGlyph($r('sys.symbol.trash')) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph11') + // [EndExclude symbol_glyph_span_scene_example] .fontColor([this.fontColorValue]) .fontSize(20) } @@ -189,11 +225,15 @@ export struct SymbolGlyphSpanSceneExample { Row({ space: 5 }) { SymbolGlyph($r('sys.symbol.play_arrow_triangle_2_circlepath')) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph12') + // [EndExclude symbol_glyph_span_scene_example] .fontColor([this.fontColorValue]) .fontSize(20) SymbolGlyph($r('sys.symbol.trash')) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph13') + // [EndExclude symbol_glyph_span_scene_example] .fontColor([this.fontColorValue]) .fontSize(20) } @@ -207,11 +247,15 @@ export struct SymbolGlyphSpanSceneExample { Row({ space: 5 }) { SymbolGlyph($r('sys.symbol.play_arrow_triangle_2_circlepath')) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph14') + // [EndExclude symbol_glyph_span_scene_example] .fontColor([this.fontColorValue]) .fontSize(20) SymbolGlyph($r('sys.symbol.trash')) + // [StartExclude symbol_glyph_span_scene_example] .id('symbolGlyph15') + // [EndExclude symbol_glyph_span_scene_example] .fontColor([this.fontColorValue]) .fontSize(20) } @@ -231,14 +275,18 @@ export struct SymbolGlyphSpanSceneExample { left: 10, top: 10 }) - // [End symbol_glyph_span_scene_example] + // [StartExclude symbol_glyph_span_scene_example] } } .width('100%') .height('100%') .padding({ left: 12, right: 12 }) + // [EndExclude symbol_glyph_span_scene_example] } + // [StartExclude symbol_glyph_span_scene_example] .backgroundColor('#f1f2f3') .title($r('app.string.SymbolGlyphSpanSceneExample_title')) + // [EndExclude symbol_glyph_span_scene_example] } -} \ No newline at end of file +} +// [End symbol_glyph_span_scene_example] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolShadowAndColor.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolShadowAndColor.ets new file mode 100644 index 0000000000000000000000000000000000000000..4e6af21624a3f5dbf4f9227b52478a8464f380af --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/SymbolShadowAndColor.ets @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2025 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 { ComponentCard } from '../../common/Card'; + +@Entry +@Component +export struct SymbolShadowAndColor { + scroller: Scroller = new Scroller(); + // [Start shadow_color_1_new] + @State isActive: boolean = true; + + options: ShadowOptions = { + radius: 10.0, + color: Color.Blue, + offsetX: 10, + offsetY: 10, + }; + // [End shadow_color_1_new] + + // [Start shadow_color_2_new] + radialGradientOptions: RadialGradientOptions = { + center: ['50%', '50%'], + radius: '20%', + colors: [[Color.Red, 0.0], [Color.Blue, 0.3], [Color.Green, 0.5]], + repeating: true, + }; + // [End shadow_color_2_new] + + build() { + NavDestination() { + Scroll(this.scroller) { + Column({ space: 12 }) { + ComponentCard({ title: $r('app.string.SymbolShadowAndColor_title_1') }) { + // [Start shadow_color_1] + Column() { + Text($r('app.string.SymbolShadowAndColor_Text_1')); + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .id('1') + .fontSize(96) + .symbolEffect(new HierarchicalSymbolEffect(EffectFillStyle.ITERATIVE), !this.isActive) + .symbolShadow(this.options) + Button(!this.isActive ? $r('app.string.SymbolGlyphSpanCustomIconAnimation_Button_1') : $r('app.string.SymbolGlyphSpanCustomIconAnimation_Button_2')).onClick(() => { + this.isActive = !this.isActive; + }) + } + // [End shadow_color_1] + } + ComponentCard({ title: $r('app.string.SymbolShadowAndColor_title_2') }) { + // [Start shadow_color_2] + Column() { + Text($r('app.string.SymbolShadowAndColor_Text_2')) + .id('2') + .fontSize(18) + .fontColor(0xCCCCCC) + .textAlign(TextAlign.Center) + SymbolGlyph($r('sys.symbol.ohos_folder_badge_plus')) + .fontSize(96) + .shaderStyle([new RadialGradientStyle(this.radialGradientOptions)]) + } + // [End shadow_color_2] + } + } + .width('100%') + .padding({ left: 12, right: 12 }) + }.id('scroll_') + } + .backgroundColor('#f1f2f3') + .title($r('app.string.SymbolShadowAndColor_title')) + } +} \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/index.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/index.ets index 245b218ccdb45068cd51411a692a92a119e3585f..9ffb58db5db83e1920ecdd37de6bc2dbcaaddf3e 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/index.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/symbol/index.ets @@ -22,6 +22,7 @@ import { SymbolGlyphSpanSceneExample } from './SymbolSceneExample'; import { Route } from '../../common/Route'; import resource from '../../common/resource'; +import { SymbolShadowAndColor } from './SymbolShadowAndColor'; export const SYMBOL_GLYPH_SPAN: string = 'symbol'; @@ -41,6 +42,11 @@ const routes: Route[] = [ title: resource.resourceToString($r('app.string.SymbolGlyphSpanCustomIconAnimation_title')), description: $r('app.string.SymbolGlyphSpanCustomIconAnimation_description') }, + { + name: `${SYMBOL_GLYPH_SPAN}/SymbolShadowAndColor`, + title: resource.resourceToString($r('app.string.SymbolShadowAndColor_title')), + description: $r('app.string.SymbolShadowAndColor_description') + }, { name: `${SYMBOL_GLYPH_SPAN}/SymbolGlyphSpanAddEvent`, title: resource.resourceToString($r('app.string.SymbolGlyphSpanAddEvent_title')), @@ -64,8 +70,10 @@ export function SymbolGlyphSpanDestination(name: string) { } else if (name === routes[2].name) { SymbolGlyphSpanCustomIconAnimation(); } else if (name === routes[3].name) { - SymbolGlyphSpanAddEvent(); + SymbolShadowAndColor(); } else if (name === routes[4].name) { + SymbolGlyphSpanAddEvent(); + } else if (name === routes[5].name) { SymbolGlyphSpanSceneExample(); } } diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/DisplayedTogether.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/DisplayedTogether.ets new file mode 100644 index 0000000000000000000000000000000000000000..99c7f910605203658451ac8fcea68e5a5834c927 --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/DisplayedTogether.ets @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start Displayed_Together] +@Entry +@Component +export struct DisplayedTogether { + @State fulltext: string = + 'Hello, I am Text [gin]. Hello, I am [rolling_onthet_floor_laughing] Text, [slightly_stmiling_face] Hello, I am Text [gin]'; + + static classifyTextAndEmojis(input: string): Map { + const emojiRegex = /\[([a-zA-Z_]+)\]/g; // 根据实际情况编写正则表达式 + const resultMap = new Map(); // 用map记录普通文本和表情 + resultMap.set('text', []); + resultMap.set('emojis', []); + + let lastIndex = 0; + let match: RegExpExecArray | null = null; + + while ((match = emojiRegex.exec(input)) !== null) { + // 添加普通文本 + if (match.index > lastIndex) { + resultMap.get('text')?.push(input.substring(lastIndex, match.index)); + } + // 添加匹配到的表情 + resultMap.get('emojis')?.push(match[1]); + lastIndex = match.index + match[0].length; + } + // 添加最后一段文本 + if (lastIndex < input.length) { + resultMap.get('text')?.push(input.substring(lastIndex)); + } + return resultMap; + } + + static getEmojiImg(emojis: string[]): Resource[] { // 根据正则匹配结果返回自定义表情资源 + let emojisImg: Resource[] = [] + // $r('app.media.app_icon')需要替换为开发者所需的资源文件。 + for (let i = 0; i < emojis.length; i++) { + switch (emojis[i]) { + case 'rolling_on_the_floor_laughing': + emojisImg.push($r('app.media.app_icon')) + case 'slightly_smiling_face': + emojisImg.push($r('app.media.app_icon')) + case 'grin': + emojisImg.push($r('app.media.app_icon')) + default: + } + } + return emojisImg + } + + build() { + Column() { + TextInput({ + placeholder: 'The user inputs text with emojis, such as: Hello [grin]' + }) + .width('80%') + .padding(10) + .border({ width: 1, color: '#EEEEEE' }) + .onChange((value: string) => { + // 输入变化时,更新 fulltext + this.fulltext = value; + }); + + Text() { + ForEach(DisplayedTogether.classifyTextAndEmojis(this.fulltext).get('text'), + (item: string, index: number) => { // 展示文本和自定义表情资源 + Span(item) + .fontSize(18) + .fontColor('#666666') + .fontWeight(FontWeight.Regular) + + ImageSpan(DisplayedTogether.getEmojiImg( + DisplayedTogether.classifyTextAndEmojis(this.fulltext).get('emojis'))[index]) + .verticalAlign(ImageSpanAlignment.BOTTOM) + .height(24) + }) + } + .width('80%') + .padding(15) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + .padding(20) + } +} + +// [End Displayed_Together] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/SelectMenu.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/SelectMenu.ets index 252cdf3e947a8c4ed0a54ae863ee21dab05e4f8c..5b5047cdff136bafa6c569e47f17120796c5aa34 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/SelectMenu.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/SelectMenu.ets @@ -21,13 +21,14 @@ import resource from '../../common/resource'; export struct SelectMenu { controller: TextController = new TextController(); options: TextOptions = { controller: this.controller }; - + // [Start Right_Click_Text_CustomMenu] // 定义菜单项 @Builder RightClickTextCustomMenu() { Column() { Menu() { MenuItemGroup() { + // $r('app.media.app_icon')需要替换为开发者所需的资源文件。 MenuItem({ startIcon: $r('app.media.app_icon'), content: 'CustomMenu One', labelInfo: '' }) .onClick(() => { // 使用closeSelectionMenu接口关闭菜单 @@ -39,9 +40,11 @@ export struct SelectMenu { }.backgroundColor('#F0F0F0') } } - + // [End Right_Click_Text_CustomMenu] + // [Start onCreate_Menu] // 定义onCreateMenu,onMenuItemClick onCreateMenu = (menuItems: Array) => { + // $r('app.media.xxx')需要替换为开发者所需的资源文件。 let item1: TextMenuItem = { content: 'customMenu1', icon: $r('app.media.app_icon'), @@ -74,7 +77,7 @@ export struct SelectMenu { } return false; }; - + // [End onCreate_Menu] build() { NavDestination() { Column({ space: 12 }) { diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertFalse.js b/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/TextLong.ets similarity index 57% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertFalse.js rename to ArkUIKit/TextComponent/entry/src/main/ets/pages/text/TextLong.ets index c5008e94f4b2ce13ed35b604811793c76b542347..ee355f859a34de1b0575d6210d284c4fce539184 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertFalse.js +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/TextLong.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -12,12 +12,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start Text_Long] +@Entry +@Component +export struct TextLong { + @State message: string = 'This is an excessively long text'.repeat(50); -function assertFalse(actualValue) { - return { - pass: (actualValue) === false, - message: 'expect false, actualValue is ' + actualValue - }; + build() { + Column() { + Text(this.message) + .height('auto') + .maxLines(3) + } + .height(200) + .width('80%') + .margin('10%') + .borderWidth(1) + .justifyContent(FlexAlign.Center) + } } - -export default assertFalse; +// [End Text_Long] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/TextLongTow.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/TextLongTow.ets new file mode 100644 index 0000000000000000000000000000000000000000..70a3ba0618408abba5f41f591fa1c571600f1883 --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/TextLongTow.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start Text_Long_Tow] +@Entry +@Component +export struct TextLongTow { + @State message: string = 'This is an excessively long text'.repeat(50); + + build() { + Column() { + Scroll() { + Text(this.message) + } + .scrollBar(BarState.Off) + } + .height(200) + .width('80%') + .margin('10%') + .borderWidth(1) + .justifyContent(FlexAlign.Center) + } +} +// [End Text_Long_Tow] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/index.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/index.ets index 9d8cd69853b83d88efe7023264a3d4908f321cae..3130ec76f4697ed8935dddd25bf0678fa5f0d2ac 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/index.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/text/index.ets @@ -38,6 +38,9 @@ import { PrepareMenu } from './PrepareMenu'; import { WordBreakd } from './WordBreakd'; import { HeightAdaptivePolicy } from './HeightAdaptivePolicy'; import { LengthMetric } from './LengthMetric'; +import { DisplayedTogether } from './DisplayedTogether'; +import { TextLong } from './TextLong'; +import { TextLongTow } from './TextLongTow'; export const TEXT_ROUTE_PREFIX: string = 'text'; @@ -151,6 +154,21 @@ const routes: Route[] = [ name: `${TEXT_ROUTE_PREFIX}/LengthMetric`, title: resource.resourceToString($r('app.string.Length_Metric')), description: $r('app.string.Length_Metric_description') + }, + { + name: `${TEXT_ROUTE_PREFIX}/DisplayedTogether`, + title: resource.resourceToString($r('app.string.Displayed_Together')), + description: $r('app.string.Displayed_Together_description') + }, + { + name: `${TEXT_ROUTE_PREFIX}/TextLong`, + title: resource.resourceToString($r('app.string.Text_Long')), + description: $r('app.string.Text_Long_description') + }, + { + name: `${TEXT_ROUTE_PREFIX}/TextLongTow`, + title: resource.resourceToString($r('app.string.Text_Long_Tow')), + description: $r('app.string.Text_Long_Tow_description') } ]; @@ -202,6 +220,12 @@ export function TextDestination(name: string) { HeightAdaptivePolicy(); } else if (name === routes[21].name) { LengthMetric(); + } else if (name === routes[22].name) { + DisplayedTogether(); + } else if (name === routes[23].name) { + TextLong(); + } else if (name === routes[24].name) { + TextLongTow(); } } diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textImageMixedLayout/TextImageAttribute.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textImageMixedLayout/TextImageAttribute.ets new file mode 100644 index 0000000000000000000000000000000000000000..80652211baee07e2d11253e50a2573144148a42f --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textImageMixedLayout/TextImageAttribute.ets @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; +import { LengthMetrics } from '@kit.ArkUI'; +import resource from '../../common/resource'; + +@Entry +@Component +export struct TextImageAttribute { + // [Start textImage_attribute] + @State message: string = 'Hello World'; + imagePixelMap: image.PixelMap | undefined = undefined; + @State imagePixelMap3: image.PixelMap | undefined = undefined; + mutableStr: MutableStyledString = new MutableStyledString('123'); + controller: TextController = new TextController(); + mutableStr2: MutableStyledString = new MutableStyledString('This is set decoration line style to the mutableStr2', [{ + start: 0, + length: 15, + styledKey: StyledStringKey.DECORATION, + styledValue: new DecorationStyle({ + type: TextDecorationType.Overline, + color: Color.Orange, + style: TextDecorationStyle.DOUBLE + }) + }]); + + async aboutToAppear() { + console.info('aboutToAppear initial imagePixelMap'); + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.startIcon')); + } + + private async getPixmapFromMedia(resource: Resource) { + let unit8Array = await this.getUIContext().getHostContext()?.resourceManager?.getMediaContent(resource.id); + let imageSource = image.createImageSource(unit8Array?.buffer?.slice(0, unit8Array?.buffer?.byteLength)); + let createPixelMap: image.PixelMap = await imageSource.createPixelMap({ + desiredPixelFormat: image.PixelMapFormat.RGBA_8888 + }); + await imageSource.release(); + return createPixelMap; + } + + leadingMarginValue: ParagraphStyle = new ParagraphStyle({ + leadingMargin: LengthMetrics.vp(5), + maxLines: 2, + overflow: TextOverflow.Ellipsis, + textVerticalAlign: TextVerticalAlign.BASELINE + }); + //行高样式对象 + lineHeightStyle1: LineHeightStyle = new LineHeightStyle(new LengthMetrics(24)); + //Bold样式 + boldTextStyle: TextStyle = new TextStyle({ fontWeight: FontWeight.Bold }); + //创建含段落样式的对象paragraphStyledString1 + paragraphStyledString1: MutableStyledString = + new MutableStyledString(resource.resourceToString($r('app.string.TextImageAttribute_Content_1')), [ + { + start: 0, + length: 28, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.leadingMarginValue + }, + { + start: 11, + length: 4, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: this.lineHeightStyle1 + } + ]); + paragraphStyledString2: MutableStyledString = new MutableStyledString(resource.resourceToString($r('app.string.TextImageAttribute_Content_2')), [ + { + start: 0, + length: 5, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.leadingMarginValue + }, + { + start: 0, + length: 4, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: new LineHeightStyle(new LengthMetrics(40)) + }, + { + start: 0, + length: 9, + styledKey: StyledStringKey.FONT, + styledValue: this.boldTextStyle + }, + { + start: 1, + length: 9, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontSize: LengthMetrics.vp(20), fontColor: Color.Red }) + }, + { + start: 11, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Grey, fontSize: LengthMetrics.vp(14) }) + } + ]); + paragraphStyledString3: MutableStyledString = new MutableStyledString(resource.resourceToString($r('app.string.TextImageAttribute_Content_3')), [ + { + start: 0, + length: 15, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.leadingMarginValue + }, + { + start: 0, + length: 7, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: new LineHeightStyle(new LengthMetrics(40)) + }, + { + start: 0, + length: 7, + styledKey: StyledStringKey.FONT, + styledValue: this.boldTextStyle + }, + { + start: 1, + length: 1, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontSize: LengthMetrics.vp(18), fontColor: Color.Red }) + }, + { + start: 2, + length: 2, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontSize: LengthMetrics.vp(36), fontColor: Color.Red }) + }, + { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontSize: LengthMetrics.vp(20), fontColor: Color.Red }) + }, + { + start: 7, + length: 9, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Grey, fontSize: LengthMetrics.vp(14) }) + } + ]); + + build() { + NavDestination() { + Row() { + Column({ space: 10 }) { + // [StartExclude textImage_attribute] + Text(undefined, { controller: this.controller }) + .copyOption(CopyOptions.InApp) + .draggable(true) + .backgroundColor('#FFFFFF') + .borderRadius(5) + .width(210) + + Button($r('app.string.textImageMixedLayout_content')) + .onClick(() => { + if (this.imagePixelMap !== undefined) { + this.mutableStr = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 210, height: 190 }, + verticalAlign: ImageSpanAlignment.BASELINE, + objectFit: ImageFit.Fill, + layoutStyle: { + borderRadius: LengthMetrics.vp(5) + } + })); + this.paragraphStyledString1.appendStyledString(this.paragraphStyledString2); + this.paragraphStyledString1.appendStyledString(this.paragraphStyledString3); + this.mutableStr.appendStyledString(this.paragraphStyledString1); + this.controller.setStyledString(this.mutableStr); + } + }) + } + .width('100%') + // [EndExclude textImage_attribute] + } + .height('100%') + .backgroundColor('#F8F8FF') + // [End textImage_attribute] + } + .backgroundColor('#f1f2f3') + .title($r('app.string.TextImage_MixedLayout_Text_2')) + } +} \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textImageMixedLayout/TextImageComponent.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textImageMixedLayout/TextImageComponent.ets new file mode 100644 index 0000000000000000000000000000000000000000..7f6d895545573ec62b62046b899c80905de5a901 --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textImageMixedLayout/TextImageComponent.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2025 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. + */ + +// [Start textImage_component] + +@Entry +@Component +export struct TextImageComponent { + build() { + // [StartExclude textImage_component] + NavDestination() { + // [EndExclude textImage_component] + Text() { + ImageSpan($r('app.media.startIcon')) + .width(50) + .height(30) + .borderRadius(5) + .verticalAlign(ImageSpanAlignment.FOLLOW_PARAGRAPH) + Span($r('app.string.TextImage_MixedLayout_Content_1')) + .fontSize(25) + .fontColor(Color.Red) + Span($r('app.string.TextImage_MixedLayout_Content_2')) + .decoration({ + type: TextDecorationType.LineThrough, + color: Color.Grey, + style: TextDecorationStyle.SOLID + }) + .fontSize(16) + }.textVerticalAlign(TextVerticalAlign.CENTER) + // [StartExclude textImage_component] + } + .backgroundColor('#f1f2f3') + .title($r('app.string.TextImage_MixedLayout_Text_1')) + // [EndExclude textImage_component] + } +} +// [End textImage_component] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textImageMixedLayout/index.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textImageMixedLayout/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..9f9f940fa2e232e2d0f33174a79d4bbdc8ffe5b9 --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textImageMixedLayout/index.ets @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2025 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 { CompletedRoutableCard } from '../../common/Card'; +import { Route } from '../../common/Route'; +import resource from '../../common/resource'; +import { router } from '@kit.ArkUI'; + +export const TEXT_IMAGE_MIXED_LAYOUT: string = 'TextImageMixedLayout'; + +const routes: Route[] = [ + { + name: 'textImageMixedLayout/TextImageComponent', + title: resource.resourceToString($r('app.string.TextImage_MixedLayout_Text_1')), + description: $r('app.string.TextImage_MixedLayout_Component_desc') + }, + { + name: `textImageMixedLayout/TextImageAttribute`, + title: resource.resourceToString($r('app.string.TextImage_MixedLayout_Text_2')), + description: $r('app.string.TextImage_MixedLayout_Attribute_desc') + } +]; + +@Builder +export function TextImageMixedLayoutDestination(name: string) { + if (name === TEXT_IMAGE_MIXED_LAYOUT) { + PropertyStringExample(); + } +} + +@Entry +@Component +struct PropertyStringExample { + goToSample(url: string): void { + router.pushUrl({ + url: url, + }, router.RouterMode.Single, (err) => { + if (err) { + console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`); + return; + } + console.info('pushUrl success'); + }) + } + + build() { + NavDestination() { + List({ space: 12 }) { + ForEach(routes, (route: Route) => { + ListItem() { + CompletedRoutableCard({ title: route.title, description: route.description }) + } + .width('100%') + .onClick(() => { + this.goToSample('pages/' + route.name); + }) + }) + } + .contentStartOffset(56) + .padding({ left: 16, right: 16 }) + } + .backgroundColor('#f1f3f5') + .title('TextImageMixedLayout', { + backgroundBlurStyle: BlurStyle.COMPONENT_THICK, + barStyle: BarStyle.STACK + }) + } +} \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/CreatTextInput.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/CreatTextInput.ets index 6c8f1280d688fe1941892d529e7b214796919139..998db5e650b2900a3437bd370f05d6303917d4eb 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/CreatTextInput.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/CreatTextInput.ets @@ -41,6 +41,13 @@ export struct CreatTextInput { // [End create_text_area_example] } } + + ComponentCard({ title: $r('app.string.CreatTextInput_title_3') }) { + // [Start create_text_input] + Search() + .searchButton($r('app.string.Creat_TextInput_Content')) + // [End create_text_input] + } } .width('100%') .height('100%') diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/CursorAvoidance.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/CursorAvoidance.ets index 57201b815e2837a4699f74711b9cc500c03b1d31..8a36a5caaa707c8f51be2f095b4cd44c95c19c6f 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/CursorAvoidance.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/CursorAvoidance.ets @@ -33,13 +33,16 @@ export struct CursorAvoidance { 'or someone we hardly know. As a result, what we do remember is anything that makes others happy, ' + 'anything that makes ourselves unhappy, totally forgetting that there is something happy in our own life.\ '; - // : string = getResourceString($r('app.string.CursorAvoidance_Button_1')); + // [StartExclude cursor_avoid] @State str1 : string = getContext(this).resourceManager.getStringSync($r('app.string.CursorAvoidance_Button_1')); @State str2 : string = getContext(this).resourceManager.getStringSync($r('app.string.CursorAvoidance_Button_2')); + // [EndExclude cursor_avoid] build() { + // [StartExclude cursor_avoid] NavDestination() { ComponentCard({ title: $r('app.string.CursorAvoidance_title') }) { + // [EndExclude cursor_avoid] Scroll() { Column() { Row() { @@ -60,10 +63,12 @@ export struct CursorAvoidance { .fontSize('20fp') } }.width('100%').height('100%') + // [StartExclude cursor_avoid] } } .backgroundColor('#f1f2f3') .title($r('app.string.CursorAvoidance_title')) + // [EndExclude cursor_avoid] } } // [End cursor_avoid] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/KeyboardAvoidance.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/KeyboardAvoidance.ets index 642e19c958f52a3cb993303b57c30c7cba2bc7be..147cd813b391415d1c8c48a9320b69dd4aa20aca 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/KeyboardAvoidance.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/KeyboardAvoidance.ets @@ -33,6 +33,7 @@ export struct KeyboardAvoidance { ForEach(this.placeHolderArr, (placeholder: string) => { TextInput({ placeholder: 'TextInput ' + placeholder }) .margin(30) + .id(placeholder) }) } } diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/ProhibitSelectMenu/DisableMenuItems.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/ProhibitSelectMenu/DisableMenuItems.ets new file mode 100644 index 0000000000000000000000000000000000000000..0a8773f3bb31d75a22f836c68e2f58e68e103d40 --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/ProhibitSelectMenu/DisableMenuItems.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2025 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. + */ + +// [Start DisableMenuItems] +import { TextMenuController } from '@kit.ArkUI'; + +@Entry +@Component +export struct DisableMenuItems { + aboutToAppear(): void { + // 禁用搜索和翻译 + TextMenuController.disableMenuItems([TextMenuItemId.SEARCH, TextMenuItemId.TRANSLATE]) + } + + aboutToDisappear(): void { + // 页面消失时恢复系统服务菜单项 + TextMenuController.disableMenuItems([]) + } + + build() { + // [StartExclude DisableMenuItems] + NavDestination() { + // [EndExclude DisableMenuItems] + Row() { + Column() { + TextInput({ text: $r('app.string.ProhibitSelectMenu_content') }) + .height(60) + .fontStyle(FontStyle.Italic) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .caretStyle({ width: '4vp' }) + .editMenuOptions({ + onCreateMenu: (menuItems: Array) => { + // menuItems不包含搜索和翻译 + return menuItems; + }, + onMenuItemClick: (menuItem: TextMenuItem, textRange: TextRange) => { + return false + } + }) + }.width('100%') + } + .height('100%') + // [StartExclude DisableMenuItems] + } + .backgroundColor('#f1f2f3') + .title($r('app.string.ProhibitSelectMenu_title_2')) + // [EndExclude DisableMenuItems] + } +} +// [End DisableMenuItems] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/ProhibitSelectMenu/DisableSystemServiceMenuItems.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/ProhibitSelectMenu/DisableSystemServiceMenuItems.ets new file mode 100644 index 0000000000000000000000000000000000000000..4607bc89f7e1dbc18b5af68b3f0043cfe8c87dfc --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/ProhibitSelectMenu/DisableSystemServiceMenuItems.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2025 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. + */ + +// [Start DisableSystemServiceMenuItems] +import { TextMenuController } from '@kit.ArkUI'; + +@Entry +@Component +export struct DisableSystemServiceMenuItems { + aboutToAppear(): void { + // 禁用所有系统服务菜单项 + TextMenuController.disableSystemServiceMenuItems(true) + } + + aboutToDisappear(): void { + // 页面消失时恢复系统服务菜单项 + TextMenuController.disableSystemServiceMenuItems(false) + } + + build() { + // [StartExclude DisableSystemServiceMenuItems] + NavDestination() { + // [EndExclude DisableSystemServiceMenuItems] + Row() { + Column() { + TextInput({ text: $r('app.string.ProhibitSelectMenu_content') }) + .height(60) + .fontStyle(FontStyle.Italic) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .caretStyle({ width: '4vp' }) + .editMenuOptions({ + onCreateMenu: (menuItems: Array) => { + // menuItems不包含被屏蔽的系统菜单项 + return menuItems + }, + onMenuItemClick: (menuItem: TextMenuItem, textRange: TextRange) => { + return false + } + }) + }.width('100%') + } + .height('100%') + // [StartExclude DisableSystemServiceMenuItems] + } + .backgroundColor('#f1f2f3') + .title($r('app.string.ProhibitSelectMenu_title_1')) + // [EndExclude DisableSystemServiceMenuItems] + } +} +// [End DisableSystemServiceMenuItems] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/ProhibitSelectMenu/index.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/ProhibitSelectMenu/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..02745f2782ffa5a6de15e9ac2d22ded4ab920f83 --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/ProhibitSelectMenu/index.ets @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2025 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 { CompletedRoutableCard } from '../../../common/Card'; +import resource from '../../../common/resource'; +import { Route } from '../../../common/Route'; +import { DisableMenuItems } from './DisableMenuItems'; +import { DisableSystemServiceMenuItems } from './DisableSystemServiceMenuItems'; +import { router } from '@kit.ArkUI'; + +export const PROHIBIT_SELECT_MENU_ROUTE: string = 'textInput/ProhibitSelectMenu'; +const routes: Route[] = [ + { + name: `${PROHIBIT_SELECT_MENU_ROUTE}/DisableSystemServiceMenuItems`, + title: resource.resourceToString($r('app.string.ProhibitSelectMenu_title_1')), + description: $r('app.string.ProhibitSelectMenu_description_1') + }, + { + name: `${PROHIBIT_SELECT_MENU_ROUTE}/DisableMenuItems`, + title: resource.resourceToString($r('app.string.ProhibitSelectMenu_title_2')), + description: $r('app.string.ProhibitSelectMenu_description_2') + } +]; + +@Builder +export function ProhibitSelectDestination(name: string) { + if (name === routes[0].name) { + DisableSystemServiceMenuItems(); + } else if (name === routes[1].name) { + DisableMenuItems(); + } +} + +@Entry +@Component +export struct ProhibitSelectionMenu { + @Consume pathStack: NavPathStack; + + goToSample(url: string): void { + router.pushUrl({ + url: url, + }, router.RouterMode.Single, (err) => { + if (err) { + return; + } + }) + } + + build() { + NavDestination() { + Scroll() { + List({ space: 12 }) { + ForEach(routes, (route: Route) => { + ListItem() { + CompletedRoutableCard({ title: route.title, description: route.description }) + } + .width('100%') + .onClick(() => { + this.goToSample('pages/' + route.name); + }) + }) + } + .contentStartOffset(56) + .padding({ left: 16, right: 16 }) + }.id('scroll_') + } + .backgroundColor('#f1f3f5') + .title('app.string.ProhibitSelectionMenu_title', { + backgroundBlurStyle: BlurStyle.COMPONENT_THICK, + barStyle: BarStyle.STACK + }) + } +} + + diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsPending.js b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/SetProperty.ets similarity index 33% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsPending.js rename to ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/SetProperty.ets index 7e2ca2ce14d50c39554fc1157d6d4eb9329d5c39..b4392ee9192d1b317dfde37e1f142225575396bd 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsPending.js +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/SetProperty.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -13,30 +13,42 @@ * limitations under the License. */ -import isPromiseLike from './isPromiseLike'; +import { ComponentCard } from '../../common/Card'; +import { LengthMetrics } from '@kit.ArkUI'; -function assertPromiseIsPending(actualPromise) { - if (!isPromiseLike(actualPromise)) { - return Promise.reject().then(function () { - }, function () { - return {pass: false, message: 'Expected not be called on a promise.'}; - }); +@Entry +@Component +export struct SetProperty { + build() { + NavDestination() { + Column({ space: 12 }) { + ComponentCard({ description: $r('app.string.Set_Omission_Property_description') }) { + // [Start set_omission_property] + TextInput({ text: $r('app.string.Set_Omission_Property_textContent') }) + .textOverflow(TextOverflow.Ellipsis) + .ellipsisMode(EllipsisMode.END) + .style(TextInputStyle.Inline) + .fontSize(30) + .margin(30) + // [End set_omission_property] + } + ComponentCard({ description: $r('app.string.Set_Stroke_Property_description') }) { + // [Start set_stroke_property] + TextInput({ text: 'Text with stroke' }) + .width('100%') + .height(60) + .borderWidth(1) + .fontSize(40) + .strokeWidth(LengthMetrics.px(3.0)) + .strokeColor(Color.Red) + // [End set_stroke_property] + } + } + .width('100%') + .height('100%') + .padding({ left: 12, right: 12 }) } - const helper = {}; - return Promise.race([actualPromise, Promise.resolve(helper)]).then( - function (got) { - return helper === got ? {pass: true, message: 'actualValue is isPending'} - : { - pass: false, - message: 'expect isPending, actualValue is resolve' - }; - }, - function () { - return { - pass: false - , message: 'expect isPending, actualValue is reject' - }; - }); -} - -export default assertPromiseIsPending; \ No newline at end of file + .backgroundColor('#f1f2f3') + .title($r('app.string.Set_Property')) + } +} \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/SetTextInputType.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/SetTextInputType.ets index 566fd00c217e6c4afbe2ca08435d7fbd2b20a1ed..5712edd8eee330502b68684505ccaac934716165 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/SetTextInputType.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/SetTextInputType.ets @@ -24,63 +24,79 @@ export struct SetTextInputType { Grid() { GridItem() { ComponentCard({ title: $r('app.string.SetTextInputType_title_1') }) { - TextInput() + // [Start set_password_input_type_1] + TextInput({ text: 'aaa' }) + // [StartExclude set_password_input_type_1] .id('Normal') + // [EndExclude set_password_input_type_1] .type(InputType.Normal) + // [Start set_password_input_type_1] } }.width('33%') GridItem() { ComponentCard({ title: $r('app.string.SetTextInputType_title_2') }) { - // [Start set_password_input_type] - TextInput() + // [Start set_password_input_type_2] + TextInput({ text: '123' }) + // [StartExclude set_password_input_type_2] .id('Password') + // [EndExclude set_password_input_type_2] .type(InputType.Password) - // [End set_password_input_type] + // [End set_password_input_type_2] } }.width('33%') GridItem() { ComponentCard({ title: $r('app.string.SetTextInputType_title_3') }) { - // [Start set_email_input_type] - TextInput() + // [Start set_email_input_type_3] + TextInput({ text: '123456@example.com' }) + // [StartExclude set_email_input_type_3] .id('Email') + // [EndExclude set_email_input_type_3] .type(InputType.Email) - // [End set_email_input_type] + // [End set_email_input_type_3] } }.width('33%') GridItem() { ComponentCard({ title: $r('app.string.SetTextInputType_title_4') }) { - // [Start set_number_input_type] - TextInput() + // [Start set_number_input_type_4] + TextInput({ text: '123456789' }) + // [StartExclude set_number_input_type_4] .id('Number') + // [EndExclude set_number_input_type_4] .type(InputType.Number) - // [End set_number_input_type] + // [End set_number_input_type_4] } }.width('33%') GridItem() { ComponentCard({ title: $r('app.string.SetTextInputType_title_5') }) { - // [Start set_phonenumber_input_type] - TextInput() + // [Start set_phonenumber_input_type_5] + TextInput({ text: '+86 123-0123-0456' }) + // [StartExclude set_phonenumber_input_type_5] .id('PhoneNumber') + // [EndExclude set_phonenumber_input_type_5] .type(InputType.PhoneNumber) - // [End set_phonenumber_input_type] + // [End set_phonenumber_input_type_5] } }.width('33%') GridItem() { ComponentCard({ title: $r('app.string.SetTextInputType_title_6') }) { - // [Start set_number_decimal_input_type] - TextInput() + // [Start set_number_decimal_input_type_6] + TextInput({ text: '9.15' }) + // [StartExclude set_number_decimal_input_type_6] .id('NUMBER_DECIMAL') + // [EndExclude set_number_decimal_input_type_6] .type(InputType.NUMBER_DECIMAL) - // [End set_number_decimal_input_type] + // [End set_number_decimal_input_type_6] } }.width('33%') GridItem() { ComponentCard({ title: $r('app.string.SetTextInputType_title_7') }) { - // [Start set_url_input_type] + // [Start set_url_input_type_7] TextInput() + // [StartExclude set_url_input_type_7] .id('URL') + // [EndExclude set_url_input_type_7] .type(InputType.URL) - // [End set_url_input_type] + // [End set_url_input_type_7] } }.width('33%') } diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertClose.js b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/SetTextMargin.ets similarity index 40% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertClose.js rename to ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/SetTextMargin.ets index 7e692bd25f1c026640978a042a9c9f64b0e8d5d3..e8f3ce05347328c5fd247c70dcaaaf6f642499b0 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertClose.js +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/SetTextMargin.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -13,28 +13,30 @@ * limitations under the License. */ -function assertClose(actualValue, expected) { - if (actualValue === null && expected[0] === null) { - throw new Error('actualValue and expected can not be both null!!!'); - } - let result; - let diff = Math.abs(expected[0] - actualValue); - let actualAbs = Math.abs(actualValue); - if ((actualAbs - 0) === 0) { - if ((diff - 0) === 0) { - result = true; - } else { - result = false; +import { ComponentCard } from '../../common/Card'; +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +export struct SetTextMargin { + build() { + NavDestination() { + Column({ space: 12 }) { + ComponentCard({ description: $r('app.string.Set_Text_Margin_description') }) { + // [Start SetTextMargin] + TextArea({ + text: 'The line spacing of this TextArea is set to 20_px, and the spacing is effective only between the lines.' + }) + .fontSize(22) + .lineSpacing(LengthMetrics.px(20), { onlyBetweenLines: true }) + // [End SetTextMargin] } - } else if (diff / actualAbs < expected[1]) { - result = true; - } else { - result = false; + } + .width('100%') + .height('100%') + .padding({ left: 12, right: 12 }) } - return { - pass: result, - message: '|' + actualValue + ' - ' + expected[0] + '|/' + actualValue + ' is not less than ' + expected[1] - }; -} - -export default assertClose; + .backgroundColor('#f1f2f3') + .title($r('app.string.Set_Text_Margin')) + } +} \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/TextInputAddEvent.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/TextInputAddEvent.ets index 18a68f293890536c3465e288827b3be359014c71..d25880817bd0ffa9d54a747b7f90aceed8170e42 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/TextInputAddEvent.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/TextInputAddEvent.ets @@ -12,79 +12,96 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -import { ComponentCard } from '../../common/Card'; - +import { hilog } from '@kit.PerformanceAnalysisKit'; +const TAG = '[Sample_Textcomponent]'; +const DOMAIN = 0xF811; +const BUNDLE = 'Textcomponent_'; +// [Start TextInputAddEvent] @Entry @Component export struct TextInputAddEvent { - @State eventText: ResourceStr = $r('app.string.TextInputAddEvent_textContent_1'); - @State inputValue: ResourceStr = $r('app.string.TextInputAddEvent_textContent_2'); + @State text: string = ''; + @State textStr1: string = ''; + @State textStr2: string = ''; + @State textStr3: string = ''; + @State textStr4: string = ''; + @State textStr5: string = ''; + @State textStr6: string = ''; + @State textStr7: string = ''; + @State textStr8: string = ''; + @State textStr9: string = ''; + @State passwordState: boolean = false; controller: TextInputController = new TextInputController(); - passwordState: boolean = false; build() { + // [StartExclude TextInputAddEvent] NavDestination() { - Column({ space: 12 }) { - ComponentCard({ title: $r('app.string.TextInputAddEvent_title_1') }) { - Column({ space: 8 }) { - Text(this.eventText) - Text(this.inputValue) - // [Start add_text_input_event] - TextInput({ - text: $r('app.string.TextInputAddEvent_textContent_2'), - placeholder: 'input your word...', - controller: this.controller + // [EndExclude TextInputAddEvent] + Row() { + Column() { + Text(`${this.textStr1}\n${this.textStr2}\n${this.textStr3} + \n${this.textStr4}\n${this.textStr5}\n${this.textStr6} + \n${this.textStr7}\n${this.textStr8}\n${this.textStr9}`) + .fontSize(20) + TextInput({ text: this.text, placeholder: 'input your word...', controller: this.controller }) + .type(InputType.Password) + .showPassword(this.passwordState) + .onChange((value: string) => { + // 文本内容发生变化时触发该回调 + hilog.info(DOMAIN, TAG, BUNDLE + 'onChange is triggering: ' + value); + this.textStr1 = `onChange is triggering: ${value}`; + }) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + // 按下输入法回车键时触发该回调 + hilog.info(DOMAIN, TAG, BUNDLE + 'onSubmit is triggering: ' + enterKey + event.text); + this.textStr2 = `onSubmit is triggering: ${enterKey} ${event.text}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + // 文本选择的位置发生变化或编辑状态下光标位置发生变化时,触发该回调 + hilog.info(DOMAIN, TAG, BUNDLE + 'onTextSelectionChange is triggering: ' + selectionStart + selectionEnd); + this.textStr3 = `onTextSelectionChange is triggering: ${selectionStart} ${selectionEnd}`; + }) + .onSecurityStateChange((isShowPassword: boolean) => { + // 密码显隐状态切换时,触发该回调 + hilog.info(DOMAIN, TAG, BUNDLE + 'onSecurityStateChange is triggering: ' + isShowPassword); + this.passwordState = isShowPassword; + this.textStr4 = `onSecurityStateChange is triggering: ${isShowPassword}`; + }) + .onWillInsert((info: InsertValue) => { + // 在将要输入时,触发该回调 + hilog.info(DOMAIN, TAG, BUNDLE + 'onWillInsert is triggering: ' + info.insertValue + info.insertOffset); + this.textStr5 = `onWillInsert is triggering: ${info.insertValue} ${info.insertOffset}`; + return true; }) - .type(InputType.Password) - .showPassword(this.passwordState) - .onChange((value: string) => { - // 文本内容发生变化时触发该回调 - this.inputValue = 'onChange is triggering: ' + value; - }) - .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { - // 按下输入法回车键时触发该回调 - this.eventText = 'onSubmit is triggering: ' + enterKey + ' ' + event.text; - }) - .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { - // 文本选择的位置发生变化或编辑状态下光标位置发生变化时,触发该回调 - this.eventText = 'onTextSelectionChange is triggering: ' + selectionStart + ' ' + selectionEnd; - }) - .onSecurityStateChange((isShowPassword: boolean) => { - // 密码显隐状态切换时,触发该回调 - this.eventText = 'onSecurityStateChange is triggering: ' + isShowPassword - this.passwordState = isShowPassword; - }) - .onWillInsert((info: InsertValue) => { - // 在将要输入时,触发该回调 - this.eventText = 'onWillInsert is triggering: ' + info.insertValue + ' ' + info.insertOffset; - return true; - }) - .onDidInsert((info: InsertValue) => { - // 在输入完成时,触发该回调 - this.eventText = 'onDidInsert is triggering: ' + info.insertValue + ' ' + info.insertOffset - }) - .onWillDelete((info: DeleteValue) => { - // 在将要删除时,触发该回调 - this.eventText = 'onWillDelete is triggering: ' + info.deleteValue + ' ' + info.deleteOffset - return true; - }) - .onDidDelete((info: DeleteValue) => { - // 在删除完成时,触发该回调 - this.eventText = 'onDidDelete is triggering: ' + info.deleteValue + ' ' + info.deleteOffset - }) - .onFocus(() => { - this.eventText = $r('app.string.TextInputAddEvent_textContent_3'); - }) - // [End add_text_input_event] - } - } - } - .width('100%') - .height('100%') - .padding({ left: 12, right: 12 }) + .onDidInsert((info: InsertValue) => { + // 在输入完成时,触发该回调 + hilog.info(DOMAIN, TAG, BUNDLE + 'onDidInsert is triggering: ' + info.insertValue + info.insertOffset); + this.textStr6 = `onDidInsert is triggering: ${info.insertValue} ${info.insertOffset}`; + }) + .onWillDelete((info: DeleteValue) => { + // 在将要删除时,触发该回调 + hilog.info(DOMAIN, TAG, BUNDLE + 'onWillDelete is triggering: ' + info.deleteValue + info.deleteOffset); + this.textStr7 = `onWillDelete is triggering: ${info.deleteValue} ${info.deleteOffset}`; + return true; + }) + .onDidDelete((info: DeleteValue) => { + // 在删除完成时,触发该回调 + hilog.info(DOMAIN, TAG, BUNDLE + 'onDidDelete is triggering: ' + info.deleteValue + info.deleteOffset); + this.textStr8 = `onDidDelete is triggering: ${info.deleteValue} ${info.deleteOffset}`; + }) + .onFocus(() => { + // 绑定通用事件,输入框获焦时触发该回调 + hilog.info(DOMAIN, TAG, BUNDLE + 'onFocus is triggering'); + this.textStr9 = `onFocus is triggering`; + }) + }.width('100%') + } + .height('100%') } + // [StartExclude TextInputAddEvent] .backgroundColor('#f1f2f3') .title($r('app.string.TextInputAddEvent_title')) } -} \ No newline at end of file + // [EndExclude TextInputAddEvent] +} +// [End TextInputAddEvent] \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/index.ets b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/index.ets index 91475ab18832a47e42303551cacb889d9784a27c..5b52b89ebc79ea7f6087b24941796a13f8133548 100644 --- a/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/index.ets +++ b/ArkUIKit/TextComponent/entry/src/main/ets/pages/textInput/index.ets @@ -19,14 +19,15 @@ import { Route } from '../../common/Route'; import { CreatTextInput } from './CreatTextInput'; import { CustomTextInputStyle } from './CustomTextInputStyle'; import { KeyboardAvoidance } from './KeyboardAvoidance'; -import { LoginRegisterPage } from './LoginRegisterPage'; import { SetTextInputType } from './SetTextInputType'; import { TextInputAddEvent } from './TextInputAddEvent'; import resource from '../../common/resource'; import { SelectMenu } from './SelectMenu'; import { AutoFill } from './AutoFill'; -import { SetOmissionProperty } from './SetOmissionProperty'; +import { SetProperty } from './SetProperty'; import { CursorAvoidance } from './CursorAvoidance'; +import { ProhibitSelectionMenu } from './ProhibitSelectMenu'; +import { SetTextMargin } from './SetTextMargin'; export const INPUT_ROUTE_PREFIX: string = 'TextInput'; @@ -56,16 +57,26 @@ const routes: Route[] = [ title: resource.resourceToString($r('app.string.SelectionMenu_title')), description: $r('app.string.SelectionMenu_description') }, + { + name: `${INPUT_ROUTE_PREFIX}/ProhibitSelectMenu`, + title: resource.resourceToString($r('app.string.ProhibitSelectionMenu_title')), + description: $r('app.string.ProhibitSelectionMenu_description') + }, { name: `${INPUT_ROUTE_PREFIX}/AutoFill`, title: resource.resourceToString($r('app.string.Auto_Fill')), description: $r('app.string.Auto_Fill_description') }, { - name: `${INPUT_ROUTE_PREFIX}/SetOmissionProperty`, - title: resource.resourceToString($r('app.string.Set_Omission_Property')), + name: `${INPUT_ROUTE_PREFIX}/SetProperty`, + title: resource.resourceToString($r('app.string.Set_Property')), description: $r('app.string.Set_Omission_Property_description') }, + { + name: `${INPUT_ROUTE_PREFIX}/SetTextMargin`, + title: resource.resourceToString($r('app.string.Set_Text_Margin')), + description: $r('app.string.Set_Text_Margin_description') + }, { name: `${INPUT_ROUTE_PREFIX}/KeyboardAvoidance`, title: resource.resourceToString($r('app.string.KeyboardAvoidance_title')), @@ -75,11 +86,6 @@ const routes: Route[] = [ name: `${INPUT_ROUTE_PREFIX}/CursorAvoidance`, title: resource.resourceToString($r('app.string.CursorAvoidance_title')), description: $r('app.string.CursorAvoidance_description') - }, - { - name: `${INPUT_ROUTE_PREFIX}/LoginRegisterPage`, - title: resource.resourceToString($r('app.string.LoginRegisterPage_title')), - description: $r('app.string.LoginRegisterPage_description') } ]; @@ -98,15 +104,17 @@ export function TextInputDestination(name: string) { } else if (name === routes[4].name) { SelectMenu(); } else if (name === routes[5].name) { + ProhibitSelectionMenu(); + }else if (name === routes[6].name) { AutoFill(); - } else if (name === routes[6].name) { - SetOmissionProperty(); } else if (name === routes[7].name) { - KeyboardAvoidance(); + SetProperty(); } else if (name === routes[8].name) { - CursorAvoidance(); + SetTextMargin(); } else if (name === routes[9].name) { - LoginRegisterPage(); + KeyboardAvoidance(); + } else if (name === routes[10].name) { + CursorAvoidance(); } } @@ -139,4 +147,6 @@ struct TextInputExample { barStyle: BarStyle.STACK }) } -} \ No newline at end of file +} + + diff --git a/ArkUIKit/TextComponent/entry/src/main/resources/base/element/string.json b/ArkUIKit/TextComponent/entry/src/main/resources/base/element/string.json index fcd51bd832aa0f5b0be8027ce79e7e82d0ab1e24..7e7ed5fe9ae8d549a7b434c0960886e2d0c28fbc 100644 --- a/ArkUIKit/TextComponent/entry/src/main/resources/base/element/string.json +++ b/ArkUIKit/TextComponent/entry/src/main/resources/base/element/string.json @@ -28,6 +28,14 @@ "name": "pageIndex_PropertyString", "value": "属性字符串(StyledString/MutableStyledString)" }, + { + "name": "pageIndex_TextImageMixedLayout", + "value": "图文混排" + }, + { + "name": "textImageMixedLayout_content", + "value": "点击查看商品详情" + }, { "name": "pageIndex_TextNDKUI", "value": "使用文本(NDK)" @@ -308,10 +316,18 @@ "name": "SelectionMenu_title", "value": "选中菜单" }, + { + "name": "ProhibitSelectionMenu_title", + "value": "禁用系统服务类菜单" + }, { "name": "SelectionMenu_description", "value": "输入框中的文字被选中时会弹出包含剪切、复制、翻译、搜索的菜单" }, + { + "name": "ProhibitSelectionMenu_description", + "value": "从API version 20开始,支持使用disableSystemServiceMenuItems方法屏蔽文本选择菜单中的所有系统服务菜单项。" + }, { "name": "SetSelectionMenu_description", "value": "设置Text被选中时,会弹出包含复制、翻译、搜索以及自定义的菜单" @@ -388,6 +404,26 @@ "name": "CreatTextInput_title", "value": "创建输入框" }, + { + "name": "ProhibitSelectMenu_title_1", + "value": "disableSystemServiceMenuItems" + }, + { + "name": "ProhibitSelectMenu_content", + "value": "这是一个TextInput,长按弹出文本选择菜单" + }, + { + "name": "ProhibitSelectMenu_title_2", + "value": "disableMenuItems" + }, + { + "name": "ProhibitSelectMenu_description_1", + "value": "从API version 20开始,支持使用disableSystemServiceMenuItems方法屏蔽文本选择菜单中的所有系统服务菜单项。" + }, + { + "name": "ProhibitSelectMenu_description_2", + "value": "从API version 20开始,支持使用disableMenuItems方法屏蔽文本选择菜单中指定的系统服务菜单项。" + }, { "name": "CreatTextInput_title_1", "value": "单行输入框" @@ -396,6 +432,10 @@ "name": "CreatTextInput_title_2", "value": "多行输入框" }, + { + "name": "CreatTextInput_title_3", + "value": "搜索框。" + }, { "name": "CreatTextInput_description", "value": "示例通过接口创建文本输入框,其中TextInput为单行输入框、TextArea为多行输入框" @@ -557,17 +597,37 @@ "value": "输入你的邮箱..." }, { - "name": "Set_Omission_Property", - "value": "设置省略属性" + "name": "Set_Text_Margin", + "value": "设置文本行间距" + }, + { + "name": "SetTextMargin_Content", + "value": "The line spacing of this TextArea is set to 20_px, and the spacing is effective only between the lines." + }, + { + "name": "Set_Text_Margin_description", + "value": "从API version 20开始,支持通过lineSpacing设置文本的行间距。如果不配置LineSpacingOptions时,首行上方和尾行下方默认会有行间距。如果onlyBetweenLines设置为true时,行间距仅适用于行与行之间,首行上方无额外行间距。" + }, + { + "name": "Set_Property", + "value": "设置属性" }, { "name": "Set_Omission_Property_description", "value": "输入框可以通过ellipsisMode属性设置省略位置" }, + { + "name": "Set_Stroke_Property_description", + "value": "从API version 20开始,输入框可以通过strokeWidth和strokeColor属性设置文本的描边宽度及颜色。" + }, { "name": "Set_Omission_Property_textContent", "value": "这是一段文本,用来展示省略模式" }, + { + "name": "Set_stroke_Property_textContent", + "value": "Text with stroke" + }, { "name": "Create_RichEditor_Component_title", "value": "创建RichEditor组件" @@ -896,6 +956,18 @@ "name": "StyledStringParagraphStyle_description", "value": "可通过ParagraphStyle设置段落样式布局。" }, + { + "name": "StyledStringParagraphStyleOne_title", + "value": "设置段落样式方法一" + }, + { + "name": "StyledStringReplaceParagraphStyle_title", + "value": "设置段落样式方法二" + }, + { + "name": "StyledStringConvertedToParagraph_title", + "value": "支持将属性字符串转换成Paragraph" + }, { "name": "StyledStringImageAttachment_title", "value": "通过ImageAttachment来添加图片" @@ -924,6 +996,14 @@ "name": "StyledStringHtml_description", "value": "可以通过toHtml、fromHtml接口实现属性字符串与HTML格式字符串的相关转换,当前支持转换的HTML标签范围:

。" }, + { + "name": "StyledStringHtmlOne_title", + "value": "格式转换二" + }, + { + "name": "StyledStringHtmlOne_description", + "value": "将HTML中标签及其style属性中的background-color转换为属性字符串并转回HTML。" + }, { "name": "StyledStringSceneExample_title", "value": "场景示例" @@ -960,6 +1040,14 @@ "name": "SymbolGlyphSpanCustomIconAnimation_description", "value": "相较于effectStrategy属性在启动时即触发动效,可以通过以下两种方式来控制动效的播放状态,以及选择更多样化的动效策略。" }, + { + "name": "SymbolShadowAndColor_title", + "value": "设置阴影和渐变色" + }, + { + "name": "SymbolShadowAndColor_description", + "value": "" + }, { "name": "SymbolGlyphSpanAddEvent_title", "value": "添加事件" @@ -1008,6 +1096,22 @@ "name": "SymbolGlyphSpanCustomIconAnimation_title_2", "value": "通过设置SymbolEffect属性,可以同时指定SymbolGlyph的动画效果策略及其播放触发条件" }, + { + "name": "SymbolGlyphSpanCustomIconAnimation_title_3", + "value": "从API version 20开始,支持通过设置SymbolEffect属性为ReplaceSymbolEffect,设置ReplaceEffectType为ReplaceEffectType.SLASH_OVERLAY,可以指定SymbolGlyph的禁用动画效果及其播放触发条件。" + }, + { + "name": "SymbolGlyphSpanCustomIconAnimation_title_4", + "value": "从API version 20开始,支持通过设置SymbolEffect属性为ReplaceSymbolEffect,设置ReplaceEffectType为ReplaceEffectType.CROSS_FADE,可以指定SymbolGlyph的快速替换动画效果及其播放触发条件。" + }, + { + "name": "SymbolShadowAndColor_title_1", + "value": "从API version 20开始,支持通过symbolShadow接口实现了symbolGlyph组件显示阴影效果。" + }, + { + "name": "SymbolShadowAndColor_title_2", + "value": "从API version 20开始,支持通过shaderStyle接口实现了symbolGlyph组件显示渐变色效果。" + }, { "name": "ListenTextBoxEvents_NDK_title", "value": "输入框文本事件监听" @@ -1112,6 +1216,10 @@ "name": "CreateApply_Text_2", "value": "运动35分钟" }, + { + "name": "CreateApply_Text_3", + "value": "运动45分钟 目标达成" + }, { "name": "StyledStringHtml_Text_1", "value": "属性字符串" @@ -1128,6 +1236,10 @@ "name": "StyledStringParagraphStyle_Text_1", "value": "段落标题\n正文第一段落开始0123456789正文第一段落结束。" }, + { + "name": "StyledStringParagraphStyle_Text_2", + "value": "段落标题\\n正文第一段落开始0123456789正文第一段落结束,通过replaceStyle清空原样式替换新样式。" + }, { "name": "StyledStringSceneExample_Text_1", "value": "您的豪华钻石已过期1天\n续费可继续享受会员专属权益" @@ -1348,6 +1460,14 @@ "name": "SymbolCustomIconAnimation_Text_2", "value": "弹跳动效" }, + { + "name": "SymbolCustomIconAnimation_Text_3", + "value": "禁用动效" + }, + { + "name": "SymbolCustomIconAnimation_Text_4", + "value": "快速替换动效" + }, { "name": "SymbolSceneExample_Text_1", "value": "顺序播放" @@ -1392,6 +1512,14 @@ "name": "SymbolSceneExample_Text_11", "value": "歌曲七" }, + { + "name": "SymbolShadowAndColor_Text_1", + "value": "阴影能力" + }, + { + "name": "SymbolShadowAndColor_Text_2", + "value": "径向渐变" + }, { "name": "SymbolSceneExample_Text_12", "value": "关闭" @@ -1425,6 +1553,45 @@ "value": "自定义选择菜单关闭时触发该回调" }, { + "name": "TextImage_MixedLayout_Text_1", + "value": "使用Span和ImageSpan实现图文混排" + }, + { + "name": "TextImage_MixedLayout_Text_2", + "value": "使用属性字符串实现图文混排" + }, + { + "name": "TextImage_MixedLayout_Component_desc", + "value": "通过Text组件设置textVerticalAlign属性和ImageSpan设置verticalAlign为ImageSpanAlignment.FOLLOW_PARAGRAPH,实现商品价格优惠信息展示的应用场景。" + }, + { + "name": "TextImage_MixedLayout_Attribute_desc", + "value": "通过ImageAttachment添加图片,TextStyle设置多种文本样式,实现商品详情信息展示的应用场景。" + }, + { + "name": "TextImage_MixedLayout_Content_1", + "value": "惊喜价 ¥1299" + }, + { + "name": "TextImage_MixedLayout_Content_2", + "value": "1599" + }, + { + "name": "Creat_TextInput_Content", + "value": "搜索" + }, + { + "name": "TextImageAttribute_Content_1", + "value": "\n高质量冲洗照片,高清冲印3/4/5/6寸包邮塑封,品质保证," + }, + { + "name": "TextImageAttribute_Content_2", + "value": "\n限时直降5.15元 限量增送" + }, + { + "name": "TextImageAttribute_Content_3", + "value": "\n¥22.50 销量400万+" + },{ "name": "Service_MenuItems", "value": "屏蔽文本选择菜单内所有系统服务菜单项" }, @@ -1479,6 +1646,62 @@ { "name": "Length_Metric_description", "value": "如何在文本的前后各添加一个标签,例如“专题”或“Top1”。这些标签的背景样式、尺寸设置需要能够自定义。" + }, + { + "name": "Replace_paragraph_style", + "value": "替换段落样式" + }, + { + "name": "Converted_HTML_to_SpanString", + "value": "Converted HTML to SpanString" + }, + { + "name": "Converted_SpanString_to_HTML", + "value": "Converted SpanString to HTML" + }, + { + "name": "Converted_HTML_back_to_SpanString", + "value": "Converted HTML back to SpanString" + }, + { + "name": "Reset", + "value": "Reset" + }, + { + "name": "Full_text", + "value": "... 全文" + }, + { + "name": "Original_text", + "value": "原文" + }, + { + "name": "After_typesetting", + "value": "排版后" + }, + { + "name": "Displayed_Together", + "value": "Text组件如何实现表情与文字一起显示" + }, + { + "name": "Displayed_Together_description", + "value": "emoji表情有时以表情符号的形式表示。如何将表情符号转换为emoji表情,并在Text组件中与文字一同显示" + }, + { + "name": "Text_Long", + "value": "文本超长时如何展示1" + }, + { + "name": "Text_Long_Tow", + "value": "文本超长时如何展示2" + }, + { + "name": "Text_Long_description", + "value": "Text组件中内容太多,超出父组件容器Column的高度,导致显示混乱。如何让文本显示在父组件容器的区域内" + }, + { + "name": "Text_Long_Tow_description", + "value": "可以把Text组件放在滚动容器Scroll里面,通过手势滑动来浏览全部文本。" } ] } \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/TextComponent/entry/src/main/resources/base/profile/main_pages.json index 2e5e78d67e7c32c013955029202db9008ddb3f08..72b44b12d760e6d9083c26277619531efb2f8a6e 100644 --- a/ArkUIKit/TextComponent/entry/src/main/resources/base/profile/main_pages.json +++ b/ArkUIKit/TextComponent/entry/src/main/resources/base/profile/main_pages.json @@ -7,6 +7,16 @@ "pages/propertyString/StyledStringImageAttachment", "pages/propertyString/StyledStringGestureStyle", "pages/propertyString/StyledStringHtml", - "pages/propertyString/StyledStringSceneExample" + "pages/propertyString/StyledStringSceneExample", + "pages/propertyString/StyledStringTextStyle", + "pages/propertyString/StyledStringTextShadowStyle", + "pages/propertyString/StyledStringDecorationStyle", + "pages/propertyString/StyledStringBaselineOffsetStyle", + "pages/propertyString/StyledStringLineHeightStyle", + "pages/propertyString/StyledStringLetterSpacingStyle", + "pages/propertyString/StyledStringParagraphStyleOne", + "pages/propertyString/StyledStringReplaceParagraphStyle", + "pages/propertyString/StyledStringConvertedToParagraph", + "pages/propertyString/StyledStringHtmlOne" ] } \ No newline at end of file diff --git a/ArkUIKit/TextComponent/entry/src/ohosTest/ets/test/index.test.ets b/ArkUIKit/TextComponent/entry/src/ohosTest/ets/test/index.test.ets index 91d41c84806aaf190eb84bdc6b4393e99da2e43e..a8de22b9fd3bbdc78c9fc39e686acca225cca10c 100644 --- a/ArkUIKit/TextComponent/entry/src/ohosTest/ets/test/index.test.ets +++ b/ArkUIKit/TextComponent/entry/src/ohosTest/ets/test/index.test.ets @@ -17,11 +17,15 @@ import { describe, it, expect, beforeAll, Level } from '@ohos/hypium'; // 导入测试依赖kit import { abilityDelegatorRegistry, Driver, ON, MatchPattern, On, Component } from '@kit.TestKit'; import { UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); const bundleName = abilityDelegatorRegistry.getArguments().bundleName; let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); let want: Want; +const TAG = '[Sample_Textcomponent]'; +const DOMAIN = 0xF811; +const BUNDLE = 'Textcomponent_'; async function getResourceString(resource: Resource): Promise { let manage = abilityDelegator.getAppContext().resourceManager; @@ -41,7 +45,7 @@ export default function IndexTest() { let driver = Driver.create(); await driver.delayMs(1000); const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); + hilog.info(DOMAIN, TAG, BUNDLE + "get top ability"); expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); }) @@ -398,6 +402,7 @@ export default function IndexTest() { done(); }) + /** * @tc.number UiTest_009-1 * @tc.name testSetTextInputType @@ -418,17 +423,14 @@ export default function IndexTest() { let textInput1 = await driver.findComponent(ON.id('Normal')); let textInput2 = await driver.findComponent(ON.id('Password')); let textInput3 = await driver.findComponent(ON.id('Email')); - let textInput4 = await driver.findComponent(ON.id('Number')); expect(textInput1 === null).assertFalse(); expect(textInput2 === null).assertFalse(); expect(textInput3 === null).assertFalse(); - expect(textInput4 === null).assertFalse(); await textInput1.inputText('aaa'); - await textInput2.inputText('aaa'); + await textInput2.inputText('123'); await textInput3.inputText('123456@example.com'); - await textInput4.inputText('123456789'); await driver.pressBack(); await driver.pressBack(); @@ -454,14 +456,17 @@ export default function IndexTest() { expect(sampleButton === null).assertFalse(); await sampleButton.click(); + let textInput4 = await driver.findComponent(ON.id('Number')); let textInput5 = await driver.findComponent(ON.id('PhoneNumber')); let textInput6 = await driver.findComponent(ON.id('NUMBER_DECIMAL')); let textInput7 = await driver.findComponent(ON.id('URL')); + expect(textInput4 === null).assertFalse(); expect(textInput5 === null).assertFalse(); expect(textInput6 === null).assertFalse(); expect(textInput7 === null).assertFalse(); + await textInput4.inputText('123456789'); await textInput5.inputText('+86 123-0123-0456'); await textInput6.inputText('9.15'); await textInput7.inputText('http://www.example.com'); @@ -473,6 +478,31 @@ export default function IndexTest() { done(); }) + /** + * @tc.number UiTest_009-3 + * @tc.name testSetTextInputType + * @tc.desc 测试设置文本输入框类型场景示例 + * @tc.level: Level 1 + */ + it('testSetTextInputType3', Level.LEVEL1, async (done: Function) => { + console.info('uitest: testSetTextInputType3 begin'); + let driver = Driver.create(); + let buttonComponent = await driver.findComponent(ON.text('TextInput', MatchPattern.CONTAINS)); + expect(buttonComponent === null).assertFalse(); + await buttonComponent.click(); + let str = await getResourceString($r('app.string.SetTextInputType_title')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + let textInput7 = await driver.findComponent(ON.id('URL')); + expect(textInput7 === null).assertFalse(); + await textInput7.inputText('http://www.example.com'); + await driver.pressBack(); + await driver.pressBack(); + console.info('uitest: testSetTextInputType3 end'); + done(); + }) + /** * @tc.number UiTest_010 * @tc.name testCustomTextInputStyle @@ -489,7 +519,6 @@ export default function IndexTest() { let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - str = await getResourceString($r('app.string.CustomTextInputStyle_textContent_2')); let textInput = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(textInput === null).assertFalse(); @@ -521,6 +550,9 @@ export default function IndexTest() { let textInput = await driver.findComponent(ON.type('TextInput')); expect(textInput === null).assertFalse(); await textInput.inputText('textInput'); + await textInput.clearText() + + await driver.waitForIdle(2000, 2000); await driver.pressBack(); await driver.pressBack(); console.info('uitest: testTextInputAddEvent end'); @@ -572,23 +604,25 @@ export default function IndexTest() { await sampleButton.click(); await driver.pressBack(); await driver.pressBack(); + await driver.waitForIdle(2000, 2000); + console.info('uitest: testTextInputAutoFill end'); done(); }) /** * @tc.number UiTest_014 - * @tc.name testSetOmissionProperty + * @tc.name testSetProperty * @tc.desc 设置省略属性 * @tc.level: Level 1 */ - it('testSetOmissionProperty', Level.LEVEL1, async (done: Function) => { - console.info('uitest: testSetOmissionProperty begin'); + it('testSetProperty', Level.LEVEL1, async (done: Function) => { + console.info('uitest: testSetProperty begin'); let driver = Driver.create(); let buttonComponent = await driver.findComponent(ON.text('TextInput', MatchPattern.CONTAINS)); expect(buttonComponent === null).assertFalse(); await buttonComponent.click(); - let str = await getResourceString($r('app.string.Set_Omission_Property')); + let str = await getResourceString($r('app.string.Set_Property')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); @@ -600,9 +634,16 @@ export default function IndexTest() { let selectMenuText = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(selectMenuText === null).assertFalse(); + str = await getResourceString($r('app.string.Set_stroke_Property_textContent')); + textInput = await driver.findComponent(ON.type('TextInput', MatchPattern.CONTAINS)); + expect(textInput === null).assertFalse(); + await textInput.click(); + selectMenuText = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(selectMenuText === null).assertFalse(); + await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testSetOmissionProperty end'); + console.info('uitest: testSetProperty end'); done(); }) @@ -618,13 +659,21 @@ export default function IndexTest() { let buttonComponent = await driver.findComponent(ON.text('TextInput', MatchPattern.CONTAINS)); expect(buttonComponent === null).assertFalse(); await buttonComponent.click(); + + let scrollComponent: Component = await driver.waitForComponent(ON.id('scroll_'), 1000); + let scrollCenter = await scrollComponent.getBoundsCenter(); + await driver.swipe(scrollCenter.x, scrollCenter.y + 400, scrollCenter.x, scrollCenter.y - 400, 3000); + await driver.waitForIdle(500, 500); + let str = await getResourceString($r('app.string.KeyboardAvoidance_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let textInput = await driver.findComponent(ON.type('TextInput')); - await textInput.inputText('textInput'); + let symbolSpan1 = await driver.findComponent(ON.id('7')); + expect(symbolSpan1 === null).assertFalse(); + await symbolSpan1.inputText('textInput'); + await driver.pressBack(); await driver.pressBack(); console.info('uitest: testKeyboardAvoidance end'); @@ -643,6 +692,7 @@ export default function IndexTest() { let buttonComponent = await driver.findComponent(ON.text('TextInput', MatchPattern.CONTAINS)); expect(buttonComponent === null).assertFalse(); await buttonComponent.click(); + await driver.waitForIdle(2000, 2000); let scrollComponent: Component = await driver.waitForComponent(ON.id('scroll_'), 1000); let scrollCenter = await scrollComponent.getBoundsCenter(); await driver.swipe(scrollCenter.x, scrollCenter.y + 400, scrollCenter.x, scrollCenter.y - 400, 3000); @@ -651,46 +701,14 @@ export default function IndexTest() { let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let TextArea = await driver.findComponent(ON.type('TextArea')); await TextArea.click(); await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testCursorAvoidance end'); - done(); - }) - - /** - * @tc.number UiTest_017 - * @tc.name testLoginRegisterPage - * @tc.desc 测试登录/注册场景示例 - * @tc.level: Level 1 - */ - it('testLoginRegisterPage', Level.LEVEL1, async (done: Function) => { - console.info('uitest: testLoginRegisterPage begin'); - let driver = Driver.create(); - let buttonComponent = await driver.findComponent(ON.text('TextInput', MatchPattern.CONTAINS)); - expect(buttonComponent === null).assertFalse(); - await buttonComponent.click(); - let scrollComponent: Component = await driver.waitForComponent(ON.id('scroll_'), 1000); - let scrollCenter = await scrollComponent.getBoundsCenter(); - await driver.swipe(scrollCenter.x, scrollCenter.y + 400, scrollCenter.x, scrollCenter.y - 400, 3000); - await driver.waitForIdle(500, 500); - let str = await getResourceString($r('app.string.LoginRegisterPage_title')); - let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); - expect(sampleButton === null).assertFalse(); - await sampleButton.click(); + await driver.waitForIdle(2000, 2000); - let username = await driver.findComponent(ON.id('username')); - let password = await driver.findComponent(ON.id('password')); - expect(username === null).assertFalse(); - expect(password === null).assertFalse(); - await username.inputText('username'); - await password.inputText('password'); - await driver.pressBack(); - await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testLoginRegisterPage end'); + console.info('uitest: testCursorAvoidance end'); done(); }) @@ -1044,7 +1062,7 @@ export default function IndexTest() { * @tc.level: Level 1 */ it('testCreatSymbolGlyph', Level.LEVEL1, async (done: Function) => { - console.info('uitest: testCreatSymbolGlyph begin'); + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testCreatSymbolGlyph begin"); let driver = Driver.create(); let buttonComponent = await driver.findComponent(ON.text('SymbolGlyph', MatchPattern.CONTAINS)); expect(buttonComponent === null).assertFalse(); @@ -1060,7 +1078,7 @@ export default function IndexTest() { await driver.pressBack(); await driver.waitForIdle(2000, 2000); await driver.pressBack(); - console.info('uitest: testCreatSymbolGlyph end'); + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testCreatSymbolGlyph end"); done(); }) @@ -1071,7 +1089,7 @@ export default function IndexTest() { * @tc.level: Level 1 */ it('testSymbolGlyphSpanAddToText', Level.LEVEL1, async (done: Function) => { - console.info('uitest: testSymbolGlyphSpanAddToText begin'); + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testSymbolGlyphSpanAddToText begin"); let driver = Driver.create(); let buttonComponent = await driver.findComponent(ON.text('SymbolGlyph', MatchPattern.CONTAINS)); expect(buttonComponent === null).assertFalse(); @@ -1161,7 +1179,7 @@ export default function IndexTest() { await driver.pressBack(); await driver.pressBack(); - console.info('uitest: testSymbolGlyphSpanAddToText end'); + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testSymbolGlyphSpanAddToText end"); done(); }) @@ -1172,7 +1190,7 @@ export default function IndexTest() { * @tc.level: Level 1 */ it('testSymbolGlyphSpanCustomIconAnimation', Level.LEVEL1, async (done: Function) => { - console.info('uitest: testSymbolGlyphSpanCustomIconAnimation begin'); + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testSymbolGlyphSpanCustomIconAnimation begin"); let driver = Driver.create(); await driver.waitForIdle(500, 500); let buttonComponent = await driver.findComponent(ON.text('SymbolGlyph', MatchPattern.CONTAINS)); @@ -1202,12 +1220,36 @@ export default function IndexTest() { expect(symbolGlyph2 === null).assertFalse(); let button2 = await driver.findComponent(ON.text('trigger')); expect(button2 === null).assertFalse(); - await button1.click(); + await button2.click(); + + str = await getResourceString($r('app.string.SymbolCustomIconAnimation_Text_3')); + let text3 = await driver.findComponent(ON.text(str)); + expect(text3 === null).assertFalse(); + let symbolGlyph3 = await driver.findComponent(ON.id('3')); + expect(symbolGlyph3 === null).assertFalse(); + let button3 = await driver.findComponent(ON.text('trigger')); + expect(button3 === null).assertFalse(); + await button3.click(); + + let scrollComponent: Component = await driver.waitForComponent(ON.id('scroll_'), 1000); + let scrollCenter = await scrollComponent.getBoundsCenter(); + await driver.swipe(scrollCenter.x, scrollCenter.y + 400, scrollCenter.x, scrollCenter.y - 400, 3000); + await driver.waitForIdle(500, 500); + + str = await getResourceString($r('app.string.SymbolCustomIconAnimation_Text_4')); + let text4 = await driver.findComponent(ON.text(str)); + expect(text4 === null).assertFalse(); + let symbolGlyph4 = await driver.findComponent(ON.id('4')); + expect(symbolGlyph4 === null).assertFalse(); + let button4 = await driver.findComponent(ON.text('trigger')); + expect(button4 === null).assertFalse(); + await button4.click(); + await driver.waitForIdle(500, 500); await driver.pressBack(); await driver.delayMs(1000); await driver.pressBack(); - console.info('uitest: testSymbolGlyphSpanCustomIconAnimation end'); + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testSymbolGlyphSpanCustomIconAnimation end"); done(); }) @@ -1218,7 +1260,7 @@ export default function IndexTest() { * @tc.level: Level 1 */ it('testSymbolGlyphSpanAddEvent', Level.LEVEL1, async (done: Function) => { - console.info('uitest: testSymbolGlyphSpanAddEvent begin'); + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testSymbolGlyphSpanAddEvent begin"); let driver = Driver.create(); await driver.waitForIdle(500, 500); let buttonComponent = await driver.findComponent(ON.text('SymbolGlyph', MatchPattern.CONTAINS)); @@ -1237,7 +1279,7 @@ export default function IndexTest() { await driver.pressBack(); await driver.waitForIdle(2000, 2000); await driver.pressBack(); - console.info('uitest: testSymbolGlyphSpanAddEvent end'); + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testSymbolGlyphSpanAddEvent end"); done(); }) @@ -1248,7 +1290,7 @@ export default function IndexTest() { * @tc.level: Level 1 */ it('testSymbolGlyphSpanSceneExample', Level.LEVEL1, async (done: Function) => { - console.info('uitest: testSymbolGlyphSpanSceneExample begin'); + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testSymbolGlyphSpanSceneExample begin"); let driver = Driver.create(); await driver.waitForIdle(500, 500); let buttonComponent = await driver.findComponent(ON.text('SymbolGlyph', MatchPattern.CONTAINS)); @@ -1335,113 +1377,95 @@ export default function IndexTest() { await driver.pressBack(); await driver.waitForIdle(2000, 2000); await driver.pressBack(); - console.info('uitest: testSymbolGlyphSpanSceneExample end'); + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testSymbolGlyphSpanSceneExample end"); done(); }) /** - * @tc.number UiTest_033 - * @tc.name testCreateApply - * @tc.desc 测试创建并应用属性字符串场景示例 + * @tc.number UiTest_040 + * @tc.name testTextDrawingDisplay + * @tc.desc 测试Text组件的文本绘制与显示场景示例 * @tc.level: Level 1 */ - it('testCreateApply', Level.LEVEL1, async (done: Function) => { - console.info('uitest: testCreateApply begin'); + it('testTextDrawingDisplay', Level.LEVEL1, async (done: Function) => { + console.info('uitest: testTextDrawingDisplay begin'); let driver = Driver.create(); - let buttonComponent = await driver.findComponent(ON.text('StyledString', MatchPattern.CONTAINS)); + let buttonComponent = await driver.findComponent(ON.text('NDK', MatchPattern.CONTAINS)); expect(buttonComponent === null).assertFalse(); await buttonComponent.click(); - let str = await getResourceString($r('app.string.Create_Apply_StyledString_MutableStyledString_title')); + let str = await getResourceString($r('app.string.TextDrawingDisplay_NDK_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - str = await getResourceString($r('app.string.CreateApply_Text_1')); - let styledString = await driver.findComponent(ON.text(str)); - expect(styledString === null).assertFalse(); - str = await getResourceString($r('app.string.CreateApply_Text_2')); - let mutableStyledString = await driver.findComponent(ON.text(str)); - expect(mutableStyledString === null).assertFalse(); + let text = await driver.findComponent(ON.type('Text')); + expect(text === null).assertFalse(); await driver.pressBack(); - await driver.waitForIdle(2000, 2000); await driver.pressBack(); - console.info('uitest: testCreateApply end'); + console.info('uitest: testTextDrawingDisplay end'); done(); }) /** - * @tc.number UiTest_034 - * @tc.name testStyledStringStyle - * @tc.desc 测试设置文本样式场景示例 + * @tc.number UiTest_041 + * @tc.name testListenTextBoxEvents + * @tc.desc 测试输入框文本事件监听场景示例 * @tc.level: Level 1 */ - it('testStyledStringStyle', Level.LEVEL1, async (done: Function) => { - console.info('uitest: testStyledStringStyle begin'); + it('testListenTextBoxEvents', Level.LEVEL1, async (done: Function) => { + console.info('uitest: testListenTextBoxEvents begin'); let driver = Driver.create(); - let buttonComponent = await driver.findComponent(ON.text('StyledString', MatchPattern.CONTAINS)); + let buttonComponent = await driver.findComponent(ON.text('NDK', MatchPattern.CONTAINS)); expect(buttonComponent === null).assertFalse(); await buttonComponent.click(); - let str = await getResourceString($r('app.string.StyledStringStyle_title')); + let str = await getResourceString($r('app.string.ListenTextBoxEvents_NDK_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - let mutableStyledString1 = await driver.findComponent(ON.id('1')); - expect(mutableStyledString1 === null).assertFalse(); - let mutableStyledString2 = await driver.findComponent(ON.id('2')); - expect(mutableStyledString2 === null).assertFalse(); - let mutableStyledString3 = await driver.findComponent(ON.id('3')); - expect(mutableStyledString3 === null).assertFalse(); - let mutableStyledString4 = await driver.findComponent(ON.id('4')); - expect(mutableStyledString4 === null).assertFalse(); - let mutableStyledString5 = await driver.findComponent(ON.id('5')); - expect(mutableStyledString5 === null).assertFalse(); - let mutableStyledString6 = await driver.findComponent(ON.id('6')); - expect(mutableStyledString6 === null).assertFalse(); + let textArea = await driver.findComponent(ON.type('TextArea')); + expect(textArea === null).assertFalse(); await driver.pressBack(); - await driver.waitForIdle(2000, 2000); await driver.pressBack(); - console.info('uitest: testStyledStringStyle end'); + console.info('uitest: testListenTextBoxEvents end'); done(); }) /** - * @tc.number UiTest_035 - * @tc.name testStyledStringParagraphStyle - * @tc.desc 测试设置段落样式场景示例 + * @tc.number UiTest_033 + * @tc.name testCreateApply + * @tc.desc 测试创建并应用属性字符串场景示例 * @tc.level: Level 1 */ - it('testStyledStringParagraphStyle', Level.LEVEL1, async (done: Function) => { - console.info('uitest: testStyledStringParagraphStyle begin'); + it('testCreateApply', Level.LEVEL1, async (done: Function) => { + console.info('uitest: testCreateApply begin'); let driver = Driver.create(); let buttonComponent = await driver.findComponent(ON.text('StyledString', MatchPattern.CONTAINS)); expect(buttonComponent === null).assertFalse(); await buttonComponent.click(); - let str = await getResourceString($r('app.string.StyledStringParagraphStyle_title')); + let str = await getResourceString($r('app.string.Create_Apply_StyledString_MutableStyledString_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); - str = await getResourceString($r('app.string.StyledStringParagraphStyle_Text_1')); - let mutableStyledString1 = - await driver.findComponent(ON.text(str)); - expect(mutableStyledString1 === null).assertFalse(); - let button = await driver.findComponent(ON.text('change')); - expect(button === null).assertFalse(); - await button.click(); - await driver.waitForIdle(500, 500); + str = await getResourceString($r('app.string.CreateApply_Text_1')); + let styledString = await driver.findComponent(ON.text(str)); + expect(styledString === null).assertFalse(); + str = await getResourceString($r('app.string.CreateApply_Text_2')); + let mutableStyledString = await driver.findComponent(ON.text(str)); + expect(mutableStyledString === null).assertFalse(); await driver.pressBack(); await driver.waitForIdle(2000, 2000); await driver.pressBack(); - console.info('uitest: testStyledStringParagraphStyle end'); + console.info('uitest: testCreateApply end'); done(); }) /** - * @tc.number UiTest_036 + * @tc.number UiTest_034 * @tc.name testStyledStringImageAttachment * @tc.desc 测试使用图片场景示例 * @tc.level: Level 1 @@ -1452,6 +1476,11 @@ export default function IndexTest() { let buttonComponent = await driver.findComponent(ON.text('StyledString', MatchPattern.CONTAINS)); expect(buttonComponent === null).assertFalse(); await buttonComponent.click(); + await driver.delayMs(1000); + + await driver.swipe(100, 800, 100, 300); + await driver.delayMs(1000); + let str = await getResourceString($r('app.string.StyledStringImageAttachment_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); @@ -1466,14 +1495,15 @@ export default function IndexTest() { expect(text1 === null).assertFalse(); await driver.pressBack(); - await driver.waitForIdle(2000, 2000); + await driver.delayMs(1000); await driver.pressBack(); + await driver.delayMs(1000); console.info('uitest: testStyledStringImageAttachment end'); done(); }) /** - * @tc.number UiTest_037 + * @tc.number UiTest_035 * @tc.name testStyledStringGestureStyle * @tc.desc 测试设置事件场景示例 * @tc.level: Level 1 @@ -1484,6 +1514,11 @@ export default function IndexTest() { let buttonComponent = await driver.findComponent(ON.text('StyledString', MatchPattern.CONTAINS)); expect(buttonComponent === null).assertFalse(); await buttonComponent.click(); + await driver.delayMs(1000); + + await driver.swipe(100, 800, 100, 300); + await driver.delayMs(1000); + let str = await getResourceString($r('app.string.TStyledStringGestureStyle_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); @@ -1493,14 +1528,15 @@ export default function IndexTest() { expect(text1 === null).assertFalse(); await driver.pressBack(); - await driver.waitForIdle(2000, 2000); + await driver.delayMs(1000); await driver.pressBack(); + await driver.delayMs(1000); console.info('uitest: testStyledStringGestureStyle end'); done(); }) /** - * @tc.number UiTest_038 + * @tc.number UiTest_036 * @tc.name testStyledStringHtml * @tc.desc 测试格式转换场景示例 * @tc.level: Level 1 @@ -1511,6 +1547,11 @@ export default function IndexTest() { let buttonComponent = await driver.findComponent(ON.text('StyledString', MatchPattern.CONTAINS)); expect(buttonComponent === null).assertFalse(); await buttonComponent.click(); + await driver.delayMs(1000); + + await driver.swipe(100, 800, 100, 300); + await driver.delayMs(1000); + let str = await getResourceString($r('app.string.StyledStringHtml_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); @@ -1539,14 +1580,15 @@ export default function IndexTest() { expect(text2 === null).assertFalse(); await driver.pressBack(); - await driver.waitForIdle(3000, 3000); + await driver.delayMs(1000); await driver.pressBack(); + await driver.delayMs(1000); console.info('uitest: testStyledStringHtml end'); done(); }) /** - * @tc.number UiTest_039 + * @tc.number UiTest_037 * @tc.name testStyledStringSceneExample * @tc.desc 测试会员过期提示场景示例 * @tc.level: Level 1 @@ -1557,6 +1599,10 @@ export default function IndexTest() { let buttonComponent = await driver.findComponent(ON.text('StyledString', MatchPattern.CONTAINS)); expect(buttonComponent === null).assertFalse(); await buttonComponent.click(); + await driver.delayMs(1000); + + await driver.swipe(100, 800, 100, 100); + await driver.delayMs(1000); let str = await getResourceString($r('app.string.StyledStringSceneExample_title')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); @@ -1569,61 +1615,330 @@ export default function IndexTest() { expect(button === null).assertFalse(); await driver.pressBack(); - await driver.waitForIdle(2000, 2000); + await driver.delayMs(1000); await driver.pressBack(); + await driver.delayMs(1000); console.info('uitest: testStyledStringSceneExample end'); done(); }) /** - * @tc.number UiTest_040 - * @tc.name testTextDrawingDisplay - * @tc.desc 测试Text组件的文本绘制与显示场景示例 + * @tc.number UiTest_038 + * @tc.name testStyledStringTextStyle + * @tc.desc 测试创建及应用文本字体样式对象(TextStyle)示例 * @tc.level: Level 1 */ - it('testTextDrawingDisplay', Level.LEVEL1, async (done: Function) => { - console.info('uitest: testTextDrawingDisplay begin'); + it('testStyledStringTextStyle', Level.LEVEL1, async (done: Function) => { + console.info('uitest: testStyledStringTextStyle begin'); let driver = Driver.create(); - let buttonComponent = await driver.findComponent(ON.text('NDK', MatchPattern.CONTAINS)); + let buttonComponent = await driver.findComponent(ON.text('StyledString', MatchPattern.CONTAINS)); expect(buttonComponent === null).assertFalse(); await buttonComponent.click(); - let str = await getResourceString($r('app.string.TextDrawingDisplay_NDK_title')); + let str = await getResourceString($r('app.string.StyledStringStyle_title_1')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); + await driver.delayMs(1000); - let text = await driver.findComponent(ON.type('Text')); - expect(text === null).assertFalse(); + await driver.pressBack(); + await driver.delayMs(1000); + await driver.pressBack(); + await driver.delayMs(1000); + console.info('uitest: testStyledStringTextStyle end'); + done(); + }) + + /** + * @tc.number UiTest_039 + * @tc.name testStyledStringTextShadowStyle + * @tc.desc 测试创建及应用文本阴影对象(TextShadowStyle)示例 + * @tc.level: Level 1 + */ + it('testStyledStringTextShadowStyle', Level.LEVEL1, async (done: Function) => { + console.info('uitest: testStyledStringTextShadowStyle begin'); + let driver = Driver.create(); + let buttonComponent = await driver.findComponent(ON.text('StyledString', MatchPattern.CONTAINS)); + expect(buttonComponent === null).assertFalse(); + await buttonComponent.click(); + let str = await getResourceString($r('app.string.StyledStringStyle_title_2')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + await driver.delayMs(1000); await driver.pressBack(); + await driver.delayMs(1000); await driver.pressBack(); - console.info('uitest: testTextDrawingDisplay end'); + await driver.delayMs(1000); + console.info('uitest: testStyledStringTextShadowStyle end'); done(); }) /** - * @tc.number UiTest_041 - * @tc.name testListenTextBoxEvents - * @tc.desc 测试输入框文本事件监听场景示例 + * @tc.number UiTest_042 + * @tc.name testStyledStringDecorationStyle + * @tc.desc 测试创建及应用文本装饰线对象(DecorationStyle)示例 * @tc.level: Level 1 */ - it('testListenTextBoxEvents', Level.LEVEL1, async (done: Function) => { - console.info('uitest: testListenTextBoxEvents begin'); + it('testStyledStringDecorationStyle', Level.LEVEL1, async (done: Function) => { + console.info('uitest: testStyledStringDecorationStyle begin'); let driver = Driver.create(); - let buttonComponent = await driver.findComponent(ON.text('NDK', MatchPattern.CONTAINS)); + let buttonComponent = await driver.findComponent(ON.text('StyledString', MatchPattern.CONTAINS)); expect(buttonComponent === null).assertFalse(); await buttonComponent.click(); - let str = await getResourceString($r('app.string.ListenTextBoxEvents_NDK_title')); + let str = await getResourceString($r('app.string.StyledStringStyle_title_3')); let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); expect(sampleButton === null).assertFalse(); await sampleButton.click(); + await driver.delayMs(1000); - let textArea = await driver.findComponent(ON.type('TextArea')); - expect(textArea === null).assertFalse(); + await driver.pressBack(); + await driver.delayMs(1000); + await driver.pressBack(); + await driver.delayMs(1000); + console.info('uitest: testStyledStringDecorationStyle end'); + done(); + }) + + /** + * @tc.number UiTest_043 + * @tc.name testStyledStringBaselineOffsetStyle + * @tc.desc 测试创建及应用文本基线偏移量对象(BaselineOffsetStyle)示例 + * @tc.level: Level 1 + */ + it('testStyledStringBaselineOffsetStyle', Level.LEVEL1, async (done: Function) => { + console.info('uitest: testStyledStringBaselineOffsetStyle begin'); + let driver = Driver.create(); + let buttonComponent = await driver.findComponent(ON.text('StyledString', MatchPattern.CONTAINS)); + expect(buttonComponent === null).assertFalse(); + await buttonComponent.click(); + let str = await getResourceString($r('app.string.StyledStringStyle_title_4')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + await driver.delayMs(1000); await driver.pressBack(); + await driver.delayMs(1000); await driver.pressBack(); - console.info('uitest: testListenTextBoxEvents end'); + await driver.delayMs(1000); + console.info('uitest: testStyledStringBaselineOffsetStyle end'); + done(); + }) + + /** + * @tc.number UiTest_044 + * @tc.name testSymbolShadowAndColor + * @tc.desc 测试设置阴影和渐变色 + * @tc.level: Level 1 + */ + it('testSymbolShadowAndColor', Level.LEVEL1, async (done: Function) => { + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testSymbolShadowAndColor begin"); + let driver = Driver.create(); + await driver.waitForIdle(500, 500); + let buttonComponent = await driver.findComponent(ON.text('SymbolGlyph', MatchPattern.CONTAINS)); + expect(buttonComponent === null).assertFalse(); + await buttonComponent.click(); + let str = await getResourceString($r('app.string.SymbolShadowAndColor_title')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + str = await getResourceString($r('app.string.SymbolShadowAndColor_title_1')); + let text1 = await driver.findComponent(ON.text(str)); + expect(text1 === null).assertFalse(); + let symbolGlyph1 = await driver.findComponent(ON.id('1')); + expect(symbolGlyph1 === null).assertFalse(); + str = await getResourceString($r('app.string.SymbolGlyphSpanCustomIconAnimation_Button_2')); + let button1 = await driver.findComponent(ON.text(str)); + expect(button1 === null).assertFalse(); + await button1.click(); + str = await getResourceString($r('app.string.SymbolGlyphSpanCustomIconAnimation_Button_1')); + expect(await button1.getText() === str).assertTrue(); + str = await getResourceString($r('app.string.SymbolShadowAndColor_title_2')); + let text2 = await driver.findComponent(ON.text(str)); + expect(text2 === null).assertFalse(); + await driver.pressBack(); + await driver.waitForIdle(2000, 2000); + await driver.pressBack(); + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testSymbolShadowAndColor end"); + done(); + }) + + /** + * @tc.number UiTest_045 + * @tc.name testSetTextMargin + * @tc.desc 设置文本行间距 + * @tc.level: Level 1 + */ + it('testSetTextMargin', Level.LEVEL1, async (done: Function) => { + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testSetTextMargin begin"); + let driver = Driver.create(); + let buttonComponent = await driver.findComponent(ON.text('TextInput', MatchPattern.CONTAINS)); + expect(buttonComponent === null).assertFalse(); + await buttonComponent.click(); + let scrollComponent: Component = await driver.waitForComponent(ON.id('scroll_'), 1000); + let scrollCenter = await scrollComponent.getBoundsCenter(); + await driver.swipe(scrollCenter.x, scrollCenter.y + 400, scrollCenter.x, scrollCenter.y - 400, 3000); + await driver.waitForIdle(500, 500); + let str = await getResourceString($r('app.string.Set_Text_Margin')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + str = await getResourceString($r('app.string.SetTextMargin_Content')); + let textInput = await driver.findComponent(ON.type('TextArea', MatchPattern.CONTAINS)); + expect(textInput === null).assertFalse(); + await textInput.click(); + let selectMenuText = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(selectMenuText === null).assertFalse(); + await driver.pressBack(); + await driver.pressBack(); + console.info('uitest: testSetTextMargin end'); + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testSetTextMargin end"); + done(); + }) + + /** + * @tc.number UiTest_046 + * @tc.name testProhibitSelectMenu + * @tc.desc 禁用系统服务类菜单 + * @tc.level: Level 1 + */ + it('testProhibitSelectMenu', Level.LEVEL1, async (done: Function) => { + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testProhibitSelectMenu begin"); + let driver = Driver.create(); + let buttonComponent = await driver.findComponent(ON.text('TextInput', MatchPattern.CONTAINS)); + expect(buttonComponent === null).assertFalse(); + await buttonComponent.click(); + let str = await getResourceString($r('app.string.ProhibitSelectionMenu_title')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + await driver.waitForIdle(2000, 2000); + str = await getResourceString($r('app.string.ProhibitSelectMenu_title_1')); + sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + await driver.waitForIdle(2000, 2000); + str = await getResourceString($r('app.string.ProhibitSelectMenu_content')); + let selectMenuText = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(selectMenuText === null).assertFalse(); + await driver.pressBack(); + await driver.waitForIdle(3000, 4000); + await driver.pressBack(); + await driver.waitForIdle(4000, 4000); + await driver.pressBack(); + await driver.waitForIdle(4000, 4000); + hilog.info(DOMAIN, TAG, BUNDLE + "uitest: testProhibitSelectMenu end"); + done(); + }) + + /** + * @tc.number UiTest_047 + * @tc.name testStyledStringReplaceParagraphStyle + * @tc.desc 测试设置段落样式方法二示例 + * @tc.level: Level 1 + */ + it('testStyledStringReplaceParagraphStyle', Level.LEVEL1, async (done: Function) => { + console.info('uitest: testStyledStringReplaceParagraphStyle begin'); + let driver = Driver.create(); + let buttonComponent = await driver.findComponent(ON.text('StyledString', MatchPattern.CONTAINS)); + expect(buttonComponent === null).assertFalse(); + await buttonComponent.click(); + let str = await getResourceString($r('app.string.StyledStringReplaceParagraphStyle_title')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + let str1 = await getResourceString($r('app.string.Replace_paragraph_style')); + let button = await driver.findComponent(ON.text(str1, MatchPattern.CONTAINS)); + expect(button === null).assertFalse(); + await button.click(); + await driver.delayMs(1000); + + await driver.pressBack(); + await driver.delayMs(1000); + await driver.pressBack(); + await driver.delayMs(1000); + console.info('uitest: testStyledStringReplaceParagraphStyle end'); + done(); + }) + + /** + * @tc.number UiTest_048 + * @tc.name testStyledStringConvertedToParagraph + * @tc.desc 测试支持将属性字符串转换成Paragraph示例 + * @tc.level: Level 1 + */ + it('testStyledStringConvertedToParagraph', Level.LEVEL1, async (done: Function) => { + console.info('uitest: testStyledStringConvertedToParagraph begin'); + let driver = Driver.create(); + let buttonComponent = await driver.findComponent(ON.text('StyledString', MatchPattern.CONTAINS)); + expect(buttonComponent === null).assertFalse(); + await buttonComponent.click(); + await driver.delayMs(1000); + + await driver.swipe(100, 800, 100, 300); + await driver.delayMs(1000); + + let str = await getResourceString($r('app.string.StyledStringConvertedToParagraph_title')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + await driver.delayMs(1000); + + await driver.pressBack(); + await driver.delayMs(1000); + await driver.pressBack(); + await driver.delayMs(1000); + console.info('uitest: testStyledStringConvertedToParagraph end'); + done(); + }) + + /** + * @tc.number UiTest_049 + * @tc.name testStyledStringHtmlOne + * @tc.desc 测试格式转换场景二示例 + * @tc.level: Level 1 + */ + it('testStyledStringHtmlOne', Level.LEVEL1, async (done: Function) => { + console.info('uitest: testStyledStringHtmlOne begin'); + let driver = Driver.create(); + let buttonComponent = await driver.findComponent(ON.text('StyledString', MatchPattern.CONTAINS)); + expect(buttonComponent === null).assertFalse(); + await buttonComponent.click(); + await driver.delayMs(1000); + + await driver.swipe(100, 800, 100, 100); + await driver.delayMs(1000); + + let str = await getResourceString($r('app.string.StyledStringHtmlOne_title')); + let sampleButton = await driver.findComponent(ON.text(str, MatchPattern.CONTAINS)); + expect(sampleButton === null).assertFalse(); + await sampleButton.click(); + await driver.delayMs(1000); + + str = await getResourceString($r('app.string.Converted_HTML_to_SpanString')); + let htmlConvertedSpanStringButton = await driver.findComponent(ON.text(str)); + expect(htmlConvertedSpanStringButton === null).assertFalse(); + await htmlConvertedSpanStringButton.click(); + await driver.waitForIdle(500, 500); + + str = await getResourceString($r('app.string.Converted_SpanString_to_HTML')); + let SpanStringConvertedHtmlButton = await driver.findComponent(ON.text(str)); + expect(SpanStringConvertedHtmlButton === null).assertFalse(); + await SpanStringConvertedHtmlButton.click(); + await driver.waitForIdle(500, 500); + + str = await getResourceString($r('app.string.Converted_HTML_back_to_SpanString')); + let htmlConvertedBackSpanStringButton = await driver.findComponent(ON.text(str)); + expect(htmlConvertedBackSpanStringButton === null).assertFalse(); + await htmlConvertedBackSpanStringButton.click(); + await driver.delayMs(1000); + + await driver.pressBack(); + await driver.delayMs(1000); + await driver.pressBack(); + await driver.delayMs(1000); + console.info('uitest: testStyledStringHtmlOne end'); done(); }) }) diff --git a/ArkUIKit/TextComponent/entry/src/ohosTest/module.json5 b/ArkUIKit/TextComponent/entry/src/ohosTest/module.json5 index c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614..0cf133529e046db31077c07bcd134b70d8078693 100644 --- a/ArkUIKit/TextComponent/entry/src/ohosTest/module.json5 +++ b/ArkUIKit/TextComponent/entry/src/ohosTest/module.json5 @@ -17,10 +17,7 @@ "module": { "name": "entry_test", "type": "feature", - "deviceTypes": [ - "default", - "tablet" - ], + "deviceTypes": [], "deliveryWithInstall": true, "installationFree": false } diff --git a/ArkUIKit/TextComponent/entry/src/ohosTest/syscap.json b/ArkUIKit/TextComponent/entry/src/ohosTest/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..71ed4f89481161d8f97ccbb7e843a71dff5b50c1 --- /dev/null +++ b/ArkUIKit/TextComponent/entry/src/ohosTest/syscap.json @@ -0,0 +1,13 @@ +{ + "devices": { + "general": [], + "custom": [ + { + "xts": [ + "SystemCapability.Account.AppAccount", + "SystemCapability.Account.OsAccount" + ] + } + ] + } +} \ No newline at end of file diff --git a/ArkUIKit/ThemeSkinning/entry/src/main/syscap.json b/ArkUIKit/ThemeSkinning/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..598552fb33d0f5c27fed37e607d9163f836ac5af --- /dev/null +++ b/ArkUIKit/ThemeSkinning/entry/src/main/syscap.json @@ -0,0 +1,24 @@ + +{ + "devices": { + "general": [ + "default" + ] + }, + "production": { + "removedSysCaps": [ + "SystemCapability.HiviewDFX.HiDumper", + "SystemCapability.Security.DeviceAuth", + "SystemCapability.Multimedia.Media.AVTranscoder", + "SystemCapability.Tee.TeeClient", + "SystemCapability.Communication.Bluetooth.Core", + "SystemCapability.ArkUi.Graphics3D", + "SystemCapability.DistributedHardware.DeviceManager", + "SystemCapability.Multimedia.Drm.Core", + "SystemCapability.Advertising.Ads", + "SystemCapability.Customization.EnterpriseDeviceManager", + "SystemCapability.Security.DeviceSecurityLevel", + "SystemCapability.UserIAM.UserAuth.PinAuth" + ] + } +} diff --git a/ArkUIKit/UIContext/entry/src/main/ets/Common/ContextUtils.ets b/ArkUIKit/UIContext/entry/src/main/ets/Common/ContextUtils.ets index 11f781e1669692c1a34b17269cb9da2af9fa0228..6c466d65f0bf0520ffd23d2949740f63814557c6 100644 --- a/ArkUIKit/UIContext/entry/src/main/ets/Common/ContextUtils.ets +++ b/ArkUIKit/UIContext/entry/src/main/ets/Common/ContextUtils.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +// [Start Common_ContextUtils] export class ContextUtils { public static context: Context | undefined; @@ -27,4 +27,5 @@ export class ContextUtils { return ContextUtils.context; } -} \ No newline at end of file +} +// [End Common_ContextUtils] \ No newline at end of file diff --git a/ArkUIKit/UIContext/entry/src/main/ets/Common/UIContext.ets b/ArkUIKit/UIContext/entry/src/main/ets/Common/UIContext.ets index a7ea846fb08505a8621a60324c43ee73851dde18..5f27b8d45df1a7ee16ad394d913ba5cee61d18a2 100644 --- a/ArkUIKit/UIContext/entry/src/main/ets/Common/UIContext.ets +++ b/ArkUIKit/UIContext/entry/src/main/ets/Common/UIContext.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +// [Start Common_UIContext] import { hilog } from '@kit.PerformanceAnalysisKit'; import { display } from '@kit.ArkUI'; @@ -51,4 +51,5 @@ export class PixelUtils { } return _uiContext.lpx2px(lpxValue) } -} \ No newline at end of file +} +// [End Common_UIContext] \ No newline at end of file diff --git a/ArkUIKit/UIContext/entry/src/main/ets/Common/Utils.ets b/ArkUIKit/UIContext/entry/src/main/ets/Common/Utils.ets new file mode 100644 index 0000000000000000000000000000000000000000..4d25f55340942341b4dbda661c91f74048844d1f --- /dev/null +++ b/ArkUIKit/UIContext/entry/src/main/ets/Common/Utils.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start Common_Utils] +// common/Utils.ets +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const DOMAIN = 0x0000; + +export class PixelUtils { + public static uiContext : UIContext | undefined; + static setUIContext(uiContext : UIContext) : void { + PixelUtils.uiContext = uiContext; + } + + static vp2px(vpValue: number, uiContext?: UIContext): number | undefined { + let _uiContext = uiContext??PixelUtils.uiContext; + if (!_uiContext || !_uiContext.isAvailable()) { + hilog.error(DOMAIN, 'testTag', `Can't get UIContext`); + return undefined; + } + return _uiContext.vp2px(vpValue) + } + + static fp2px(fpValue: number, uiContext?: UIContext): number | undefined { + let _uiContext = uiContext??PixelUtils.uiContext; + if (!_uiContext || !_uiContext.isAvailable()) { + hilog.error(DOMAIN, 'testTag', `Can't get UIContext`); + return undefined; + } + return _uiContext.fp2px(fpValue) + } + + lpx2px(lpxValue: number, uiContext?: UIContext): number | undefined { + let _uiContext = uiContext??PixelUtils.uiContext; + if (!_uiContext || !_uiContext.isAvailable()) { + hilog.error(DOMAIN, 'testTag', `Can't get UIContext`); + return undefined; + } + return _uiContext.lpx2px(lpxValue) + } +} +// [End Common_Utils] \ No newline at end of file diff --git a/ArkUIKit/UIContext/entry/src/main/ets/Common/WindowUtils.ets b/ArkUIKit/UIContext/entry/src/main/ets/Common/WindowUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..4f6ee480da3df4e36618533989578af9cdaa3579 --- /dev/null +++ b/ArkUIKit/UIContext/entry/src/main/ets/Common/WindowUtils.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start Common_WindowUtils] +// common/WindowUtils.ets +import { display, window } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const DOMAIN = 0x0000; + +export class WindowUIContextUtils { + public static activeUIContext : UIContext | undefined; + + static registerWindowCallback(windowClass: window.Window) : void { + try { + windowClass.on('windowEvent', (event: window.WindowEventType) => { + if (event === window.WindowEventType.WINDOW_ACTIVE) { + try { + let uiContext = windowClass.getUIContext(); + WindowUIContextUtils.activeUIContext = uiContext; + } catch(exception) { + hilog.error(DOMAIN, 'testTag', `Can't get UIContext, ${exception}`); + } + } + }); + } catch (exception) { + console.error(`Failed to unregister callback. Cause: ${exception}`); + } + } + + static unregisterWindowCallback(windowClass: window.Window): void { + windowClass.off('windowEvent'); + } + + static setActiveUIContext(uiContext: UIContext) : void { + WindowUIContextUtils.activeUIContext = uiContext; + } + + static vp2px(vpValue: number, uiContext?: UIContext): number { + let _uiContext = uiContext??WindowUIContextUtils.activeUIContext; + if (!_uiContext || !_uiContext.isAvailable()) { + let displayClass = display.getDefaultDisplaySync(); + let density = displayClass.densityPixels; + return vpValue * density; + } + + return _uiContext.vp2px(vpValue); + } +} +// [End Common_WindowUtils] \ No newline at end of file diff --git a/ArkUIKit/UIContext/entry/src/main/ets/entryability/EntryAbility.ets b/ArkUIKit/UIContext/entry/src/main/ets/entryability/EntryAbility.ets index 038d9df3b89d1901363b7a8efc04409a483fec0f..736a6a03e7b019b4f158dd9e95a25da86c33b9cf 100644 --- a/ArkUIKit/UIContext/entry/src/main/ets/entryability/EntryAbility.ets +++ b/ArkUIKit/UIContext/entry/src/main/ets/entryability/EntryAbility.ets @@ -13,38 +13,71 @@ * limitations under the License. */ +// [Start Common_UIContext] import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; import { window } from '@kit.ArkUI'; import { ContextUtils } from '../Common/ContextUtils'; +import { WindowUIContextUtils } from '../Common/WindowUtils'; +import { PixelUtils } from '../Common/UIContext'; const DOMAIN = 0x0000; export default class EntryAbility extends UIAbility { - // [Start UIContext] onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); ContextUtils.setContext(this.context); } - //[StartExclude UIContext] + + //[StartExclude Common_UIContext] onDestroy(): void { hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); } - // [EndExclude UIContext] + + // [EndExclude Common_UIContext] onWindowStageCreate(windowStage: window.WindowStage): void { hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); let localStorage = new LocalStorage(); localStorage.setOrCreate('message', 'Message from Storage') + // [Start Common_GetMainWindowSync] + let window = windowStage.getMainWindowSync(); + // [Start Common_RegisterWindowCallback] + WindowUIContextUtils.registerWindowCallback(window); windowStage.loadContent('pages/Index', localStorage, (err) => { if (err.code) { hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); return; } + try { + let uiContext = window.getUIContext(); + // [Start Common_SetUIContext] + PixelUtils.setUIContext(uiContext); + // [End Common_SetUIContext] + WindowUIContextUtils.setActiveUIContext(uiContext) + if (!uiContext) { + hilog.error(DOMAIN, 'testTag', `Can't get UIContext`); + return; + } + let pxValue = uiContext.vp2px(20); + hilog.info(DOMAIN, 'testTag', `20vp equals to ${pxValue}px`); + } catch (e) { + hilog.error(DOMAIN, 'testTag', `Can't get UIContext, ${e}`); + } + // [End Common_GetMainWindowSync] hilog.info(DOMAIN, 'testTag', `loadContent success.`); }); } - //[StartExclude UIContext] + + onWindowStageWillDestroy(windowStage: window.WindowStage) { + let window = windowStage.getMainWindowSync(); + hilog.info(DOMAIN, 'testTag', '%{public}s', `The main window: ${window}`); + // 注销主窗的回调。 + WindowUIContextUtils.unregisterWindowCallback(window); + } + // [End Common_RegisterWindowCallback] + + //[StartExclude Common_UIContext] onWindowStageDestroy(): void { // Main window is destroyed, release UI related resources hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); @@ -59,6 +92,6 @@ export default class EntryAbility extends UIAbility { // Ability has back to background hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); } - // [EndExclude UIContext] - // [End UIContext] -} \ No newline at end of file + // [EndExclude Common_UIContext] +} +// [End Common_UIContext] diff --git a/ArkUIKit/UIContext/entry/src/main/ets/pages/CalendarPickerDialogPage.ets b/ArkUIKit/UIContext/entry/src/main/ets/pages/CalendarPickerDialogPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..328e12341dbf28101a26bfec721c4fc142f9f05b --- /dev/null +++ b/ArkUIKit/UIContext/entry/src/main/ets/pages/CalendarPickerDialogPage.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start Main_CalendarPickerDialogPage] +@Entry +@Component +struct CalendarPickerDialogPage { + private selectedDate: Date = new Date('2025-10-01'); + + build() { + RelativeContainer() { + Button('Show CalendarPicker Dialog') + .alignRules({ + center: { anchor: '__container__', align: VerticalAlign.Center }, + middle: { anchor: '__container__', align: HorizontalAlign.Center } + }) + .onClick(() => { + let uiContext = this.getUIContext(); + uiContext.runScopedTask(() => { + CalendarPickerDialog.show({ + selected: this.selectedDate, + backgroundColor: Color.White, + backgroundBlurStyle: BlurStyle.NONE, + shadow: ShadowStyle.OUTER_FLOATING_SM + }); + }); + }) + } + .height('100%') + .width('100%') + } +} +// [End Main_CalendarPickerDialogPage] \ No newline at end of file diff --git a/ArkUIKit/UIContext/entry/src/main/ets/pages/Index.ets b/ArkUIKit/UIContext/entry/src/main/ets/pages/Index.ets index 50696258513acef8786a6c24dd8ed71e110f5ff9..296b4b4af4699641138972f55299fe114dfe7d9b 100644 --- a/ArkUIKit/UIContext/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/UIContext/entry/src/main/ets/pages/Index.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -// [Start_UIContext] +// [Start Main_UIContext] import { ContextUtils } from '../Common/ContextUtils'; import { hilog } from '@kit.PerformanceAnalysisKit'; import { Router } from '@kit.ArkUI'; @@ -50,4 +50,4 @@ struct Index { .width('100%') } } -// [End_UIContext] \ No newline at end of file +// [End Main_UIContext] \ No newline at end of file diff --git a/ArkUIKit/UIContext/entry/src/main/ets/pages/LocalStoragePage.ets b/ArkUIKit/UIContext/entry/src/main/ets/pages/LocalStoragePage.ets index 834a6bc20975204fa5b49ead3d53c051d7331fe1..5f5aab65a2cedee99805ea29009105f633cf4014 100644 --- a/ArkUIKit/UIContext/entry/src/main/ets/pages/LocalStoragePage.ets +++ b/ArkUIKit/UIContext/entry/src/main/ets/pages/LocalStoragePage.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [Start_LocalStoragePage] +// [Start Main_LocalStoragePage] @Entry({useSharedStorage: true}) @Component struct LocalStoragePage { @@ -40,4 +40,4 @@ struct LocalStoragePage { .width('100%') } } -// [End_LocalStoragePage] \ No newline at end of file +// [End Main_LocalStoragePage] \ No newline at end of file diff --git a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejected.js b/ArkUIKit/UIContext/entry/src/main/ets/pages/NewGlobal.ets similarity index 43% rename from ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejected.js rename to ArkUIKit/UIContext/entry/src/main/ets/pages/NewGlobal.ets index 380075a369a84d6856e7f2db366f704e04302a8d..942ddaaf82c7b5e84ebb19de495a71cb6b9c8a25 100644 --- a/ArkUIKit/StateTrack/oh_modules/.ohpm/@ohos+hypium@1.0.24/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejected.js +++ b/ArkUIKit/UIContext/entry/src/main/ets/pages/NewGlobal.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -12,27 +12,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start Main_NewGlobal] +import { hilog } from '@kit.PerformanceAnalysisKit'; -import isPromiseLike from './isPromiseLike'; +const DOMAIN = 0x0000; -function assertPromiseIsRejected(actualPromise) { - if (!isPromiseLike(actualPromise)) { - return Promise.reject().then(function () { - }, function () { - return {pass: false, message: 'Expected not be called on a promise.'}; - }); +@Entry +@Component +struct Index { + build() { + RelativeContainer() { + Text('Calculate 20vp to px') + .fontWeight(FontWeight.Bold) + .alignRules({ + center: { anchor: '__container__', align: VerticalAlign.Center }, + middle: { anchor: '__container__', align: HorizontalAlign.Center } + }) + .onClick(() => { + let uiContext = this.getUIContext(); + let pxValue = uiContext.vp2px(20); + hilog.info(DOMAIN, 'testTag', `20vp equals to ${pxValue}px`); + }) } - return actualPromise.then( - function (got) { - return { - pass: false, - message: 'expect isRejected, but actualValue is resolve' - }; - }, - function () { - return {pass: true, message: 'actualValue is isRejected'}; - } - ); + .height('100%') + .width('100%') + } } - -export default assertPromiseIsRejected; \ No newline at end of file +// [End Main_NewGlobal] \ No newline at end of file diff --git a/ArkUIKit/UIContext/entry/src/main/ets/pages/WindowTestPage.ets b/ArkUIKit/UIContext/entry/src/main/ets/pages/WindowTestPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..606ea0a5d4620d56f8df82e797a5675215f78563 --- /dev/null +++ b/ArkUIKit/UIContext/entry/src/main/ets/pages/WindowTestPage.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2025 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. + */ +// [Start Main_WindowTestPage] +// pages/WindowTestPage.ets +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { WindowUIContextUtils } from '../Common/WindowUtils'; + +const DOMAIN = 0x0000; + +@Entry +@Component +struct Index { + private subWindow : window.Window | undefined; + + build() { + Column() { + Text('Create SubWindow') + .onClick(() => { + let config: window.Configuration = { + name: 'test', + windowType: window.WindowType.TYPE_DIALOG, + ctx: this.getUIContext().getHostContext() + }; + try { + window.createWindow(config, (err: BusinessError, windowClass: window.Window) => { + const errCode: number = err.code; + if (errCode) { + hilog.error(DOMAIN, 'testTag', `Failed to create the window. Cause: ${errCode}`); + return; + } + // 在窗口创建后注册回调。 + this.subWindow = windowClass; + try { + windowClass.setUIContent('pages/Index', () => { + WindowUIContextUtils.registerWindowCallback(windowClass); + windowClass.resize(500, 1000); + windowClass.showWindow(); + }); + } catch(exception) { + hilog.error(DOMAIN, 'testTag', `Failed to setUIContent. Cause : ${exception}`); + } + }); + } catch (exception) { + hilog.error(DOMAIN, 'testTag', `Failed to create the window. Cause : ${exception}`); + } + }) + Text('Destroy SubWindow') + .onClick(() => { + if (this.subWindow) { + // 在窗口销毁前注销回调。 + WindowUIContextUtils.unregisterWindowCallback(this.subWindow); + this.subWindow.destroyWindow(); + } + }) + } + .height('100%') + .width('100%') + } +} +// [End Main_WindowTestPage] \ No newline at end of file diff --git a/ArkUIKit/UIContext/entry/src/main/resources/base/profile/main_pages.json b/ArkUIKit/UIContext/entry/src/main/resources/base/profile/main_pages.json index 4ffc903c47179642aa7cfb2b26f90204e88a6304..e762c2f66bd67c4be75f822c1bb3b0044813a82a 100644 --- a/ArkUIKit/UIContext/entry/src/main/resources/base/profile/main_pages.json +++ b/ArkUIKit/UIContext/entry/src/main/resources/base/profile/main_pages.json @@ -1,6 +1,9 @@ { "src": [ "pages/Index", - "pages/LocalStoragePage" + "pages/LocalStoragePage", + "pages/NewGlobal", + "pages/WindowTestPage", + "pages/CalendarPickerDialogPage" ] } \ No newline at end of file diff --git a/ArkUIKit/VideoPlayer/entry/src/main/syscap.json b/ArkUIKit/VideoPlayer/entry/src/main/syscap.json new file mode 100644 index 0000000000000000000000000000000000000000..598552fb33d0f5c27fed37e607d9163f836ac5af --- /dev/null +++ b/ArkUIKit/VideoPlayer/entry/src/main/syscap.json @@ -0,0 +1,24 @@ + +{ + "devices": { + "general": [ + "default" + ] + }, + "production": { + "removedSysCaps": [ + "SystemCapability.HiviewDFX.HiDumper", + "SystemCapability.Security.DeviceAuth", + "SystemCapability.Multimedia.Media.AVTranscoder", + "SystemCapability.Tee.TeeClient", + "SystemCapability.Communication.Bluetooth.Core", + "SystemCapability.ArkUi.Graphics3D", + "SystemCapability.DistributedHardware.DeviceManager", + "SystemCapability.Multimedia.Drm.Core", + "SystemCapability.Advertising.Ads", + "SystemCapability.Customization.EnterpriseDeviceManager", + "SystemCapability.Security.DeviceSecurityLevel", + "SystemCapability.UserIAM.UserAuth.PinAuth" + ] + } +} diff --git a/ArkUIKit/arktsobservedandobjectlink/AppScope/app.json5 b/ArkUIKit/arktsobservedandobjectlink/AppScope/app.json5 index aa83725aa674e39d43ebe71278a173638b9a491d..a8676f8f3b0c77caea4a9fae8c67963547629578 100644 --- a/ArkUIKit/arktsobservedandobjectlink/AppScope/app.json5 +++ b/ArkUIKit/arktsobservedandobjectlink/AppScope/app.json5 @@ -14,8 +14,8 @@ */ { "app": { - "bundleName": "com.example.arktsobservedandobjectlink", - "vendor": "example", + "bundleName": "com.samples.arktsobservedandobjectlink", + "vendor": "samples", "versionCode": 1000000, "versionName": "1.0.0", "icon": "$media:layered_image", diff --git a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/Index.ets b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/Index.ets index feb36cd31bd80edff715373740dd940d83cd6802..52eb25e374cb23ee48d256e985504e80dd49b1f6 100644 --- a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/Index.ets @@ -13,8 +13,8 @@ * limitations under the License. */ class CreateRouter{ - public pageName:string; - public routerName:string; + public pageName:string; + public routerName:string; constructor(pageName:string,routerName:string){ this.pageName = pageName; this.routerName = routerName; diff --git a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/ObservedAndObjectLinkFAQs/ComplexMethodsNesting.ets b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/ObservedAndObjectLinkFAQs/ComplexMethodsNesting.ets index 27c7368510b8482b7c82f16b2184e4e8db9cda6c..84560ffd2216542f9bbb297cb43c9dab3eef1f84 100644 --- a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/ObservedAndObjectLinkFAQs/ComplexMethodsNesting.ets +++ b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/ObservedAndObjectLinkFAQs/ComplexMethodsNesting.ets @@ -60,7 +60,7 @@ struct ParentComp { Column() { // [Start Complex_Methods_Nesting] ComplexMethodsNestingCounterComp({ value: this.counter[0] }); // ParentComp组件传递 ParentCounter 给 CounterComp 组件 - // [StartExclude Complex_Methods_Nesting_One] + // [StartExclude Complex_Methods_Nesting] ComplexMethodsNestingCounterComp({ value: this.counter[1] }); ComplexMethodsNestingCounterComp({ value: this.counter[2] }); Divider().height(5) @@ -97,9 +97,9 @@ struct ParentComp { } @Component struct ComplexMethodsNestingCounterComp { - // [EndExclude Complex_Methods_Nesting_One] + // [EndExclude Complex_Methods_Nesting] @ObjectLink value: ParentCounter; // @ObjectLink 接收 ParentCounter - // [StartExclude Complex_Methods_Nesting_Two] + // [StartExclude Complex_Methods_Nesting] build() { Column({ space: 10 }) { @@ -108,10 +108,10 @@ struct ComplexMethodsNestingCounterComp { .onClick(() => { this.value.incrCounter(); }); - // [EndExclude Complex_Methods_Nesting_Two] + // [EndExclude Complex_Methods_Nesting] // CounterChild 是 CounterComp 的子组件,CounterComp 传递 this.value.subCounter 给 CounterChild 组件 ComplexMethodsNestingCounterChild({ subValue: this.value.subCounter }); - // [StartExclude Complex_Methods_Nesting_Three] + // [StartExclude Complex_Methods_Nesting] Divider().height(2) } } @@ -119,7 +119,7 @@ struct ComplexMethodsNestingCounterComp { @Component struct ComplexMethodsNestingCounterChild { - // [EndExclude Complex_Methods_Nesting_Three] + // [EndExclude Complex_Methods_Nesting] @ObjectLink subValue: ComplexMethodsNestingSubCounter; // @ObjectLink 接收 SubCounter // [End Complex_Methods_Nesting] build() { diff --git a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/ObservedAndObjectLinkFAQs/DelayedChange.ets b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/ObservedAndObjectLinkFAQs/DelayedChange.ets index a7ef09fd81c0981f266864c944102cedf16c9417..e96a955a1bff41bb2d2369e56796876f0f7d04b7 100644 --- a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/ObservedAndObjectLinkFAQs/DelayedChange.ets +++ b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/ObservedAndObjectLinkFAQs/DelayedChange.ets @@ -29,9 +29,9 @@ class RenderClass { @Component struct DelayedChangeIndex { @State @Watch('renderClassChange') renderClass: RenderClass = new RenderClass(); - // [StartExclude DelayedChangeIndexContext] + // [StartExclude Delayed_change] private context = this.getUIContext().getHostContext() as common.UIAbilityContext; - // [EndExclude DelayedChangeIndexContext] + // [EndExclude Delayed_change] renderClassChange() { // $r('app.string.renderClass_Change')需要替换为开发者所需的资源文件 hilog.info(DOMAIN,TAG,`${this.context.resourceManager.getStringSync($r('app.string.renderClass_Change').id)}:` + this.renderClass.waitToRender); diff --git a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/ObservedAndObjectLinkFAQs/ObjectLinkDataSourceUpdate.ets b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/ObservedAndObjectLinkFAQs/ObjectLinkDataSourceUpdate.ets index 223fa77fb69c0bcbcfe657503afd7359a76504db..d10717f7a650ba80e8d9b228dfe56f9db19a0e5e 100644 --- a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/ObservedAndObjectLinkFAQs/ObjectLinkDataSourceUpdate.ets +++ b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/ObservedAndObjectLinkFAQs/ObjectLinkDataSourceUpdate.ets @@ -67,9 +67,9 @@ struct ObjectLinkDataSourceUpdateParent { struct ObjectLinkDataSourceUpdateChild { @ObjectLink @Watch('onChange02') per: ObjectLinkDataSourceUpdatePerson; clickEvent?: () => void; - // [StartExclude Data_Source_Update_Parent_Context] + // [StartExclude ObjectLink_Data_source_update_timing] private context = this.getUIContext().getHostContext() as common.UIAbilityContext; - // [EndExclude Data_Source_Update_Parent_Context] + // [EndExclude ObjectLink_Data_source_update_timing] onChange02() { hilog.info(DOMAIN,TAG,`:::onChange02:${this.per.name}`); // 5 }; diff --git a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/objectLinkusagescenarios/TwoDimensionalArray.ets b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/objectLinkusagescenarios/TwoDimensionalArray.ets index dd0379fcd6221559fad7d0f9544035f487e3f818..fb2f9fff26d2041c2a13a5827975b3ffcb2e06f4 100644 --- a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/objectLinkusagescenarios/TwoDimensionalArray.ets +++ b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/objectLinkusagescenarios/TwoDimensionalArray.ets @@ -12,12 +12,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [Start Two_dimensional_array_example] + // [Start Two_dimensional_array] @Observed -class ObservedArray extends Array { +class ObservedArrays extends Array { } // [End Two_dimensional_array] + +// [Start Two_dimensional_array_example] +@Observed +class ObservedArray extends Array { +} @Component struct Item { @ObjectLink itemArr: ObservedArray; diff --git a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/overview/DecoratorDescription.ets b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/overview/DecoratorDescription.ets index 9a5a45b6852d8c072e28a620bf0f8bb6e5bc0e4e..322b7e8e666a2d1d01147c7636a5bc52fc53985c 100644 --- a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/overview/DecoratorDescription.ets +++ b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/overview/DecoratorDescription.ets @@ -73,7 +73,7 @@ struct DecoratorDescriptionHelloWorld { this.parent.child.num = 5; // [End Modify_and_change] - // [ Start Attribute_assignment ] + // [Start Attribute_assignment] // 允许@ObjectLink装饰的数据属性赋值 this.objLink.a = '...' // [End Attribute_assignment] diff --git a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/overview/ObservationChangeInheritance.ets b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/overview/ObservationChangeInheritance.ets index bfdf939ebc3c4fafa06ed7e340bfd74d151fb3fd..623318ac684856b36241fc3f60feb16da0c10970 100644 --- a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/overview/ObservationChangeInheritance.ets +++ b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/overview/ObservationChangeInheritance.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [Start ObservationChangeInheritance] +// [Start Observation_ChangeInheritance] @Observed class DateClass extends Date { constructor(args: number | string) { @@ -69,4 +69,4 @@ struct ObservationChangeInheritance { } } } -// [End ObservationChangeInheritance] \ No newline at end of file +// [End Observation_ChangeInheritance] \ No newline at end of file diff --git a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/restrictiveconditions/ReadOnlyVariable.ets b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/restrictiveconditions/ReadOnlyVariable.ets index 51bf2cf29a1ff41981d05cab8b213de30ce97c06..6dbac8352a63ba602b6cba640aa2fa70379c3f3e 100644 --- a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/restrictiveconditions/ReadOnlyVariable.ets +++ b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/restrictiveconditions/ReadOnlyVariable.ets @@ -27,9 +27,9 @@ class ReadOnlyVariableInfo { @Component struct ReadOnlyVariableChild { @ObjectLink num: ReadOnlyVariableInfo; - // [StartExclude ReadOnlyVariableChildContext] + // [StartExclude variables_decorated_ObjectLink_read_only] private context = this.getUIContext().getHostContext() as common.UIAbilityContext; - // [EndExclude ReadOnlyVariableChildContext] + // [EndExclude variables_decorated_ObjectLink_read_only] build() { Column() { // $r('app.string.value_num')需要替换为开发者所需的资源文件 @@ -46,9 +46,9 @@ struct ReadOnlyVariableChild { @Component struct ReadOnlyVariableParent { @State num: ReadOnlyVariableInfo = new ReadOnlyVariableInfo(10); - // [StartExclude ReadOnlyVariableParentContext] + // [StartExclude variables_decorated_ObjectLink_read_only] private context = this.getUIContext().getHostContext() as common.UIAbilityContext; - // [EndExclude ReadOnlyVariableParentContext] + // [EndExclude variables_decorated_ObjectLink_read_only] build() { Column() { // $r('app.string.value_count')需要替换为开发者所需的资源文件 diff --git a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/restrictiveconditions/RestrictiveConditionsObserved.ets b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/restrictiveconditions/RestrictiveConditionsObserved.ets index dc9b9bf68ca6f39356003f4e4d809a62ea0d102b..86ac7788cca5bd550a82ee5f7c0e4122000bdd86 100644 --- a/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/restrictiveconditions/RestrictiveConditionsObserved.ets +++ b/ArkUIKit/arktsobservedandobjectlink/entry/src/main/ets/pages/restrictiveconditions/RestrictiveConditionsObserved.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [ Start Test_Info_Observed ] +// [Start Test_Info_Observed] @Observed class RestrictiveConditionsObservedInfo { public count: number; diff --git a/ArkUIKit/arktsobservedandobjectlink/entry/src/ohosTest/ets/test/Index.test.ets b/ArkUIKit/arktsobservedandobjectlink/entry/src/ohosTest/ets/test/Index.test.ets index ee25632aef547d28dc565ddb3da4972246f06eff..e802b6366dd7f7dfe075fe9ee867bb99947e8b35 100644 --- a/ArkUIKit/arktsobservedandobjectlink/entry/src/ohosTest/ets/test/Index.test.ets +++ b/ArkUIKit/arktsobservedandobjectlink/entry/src/ohosTest/ets/test/Index.test.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; import { abilityDelegatorRegistry, Driver, ON, MatchPattern } from '@kit.TestKit'; import { UIAbility, Want } from '@kit.AbilityKit'; import hilog from '@ohos.hilog'; @@ -24,6 +24,7 @@ let driver: Driver; const TAG = '[Sample_arktsobservedandobjectlink]'; const DOMAIN = 0xF811; const BUNDLE = 'arktsobservedandobjectlink_'; + export default function IndexTest() { describe('IndexTest', () => { // Defines a test suite. Two parameters are supported: test suite name and test suite function. diff --git a/ArkUIKit/arktsobservedandobjectlink/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/arktsobservedandobjectlink/entry/src/ohosTest/ets/test/List.test.ets index c33c26367bc351efe1b27664b8dd473e2d37fe36..560cb94e9cfec921cd818985ac22034b2a3fd8cd 100644 --- a/ArkUIKit/arktsobservedandobjectlink/entry/src/ohosTest/ets/test/List.test.ets +++ b/ArkUIKit/arktsobservedandobjectlink/entry/src/ohosTest/ets/test/List.test.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import IndexTest from './Index.test' +import IndexTest from './Index.test'; import abilityTest from './Ability.test'; export default function testsuite() { diff --git a/ArkUIKit/arktsobservedv2andtrace/entry/.gitignore b/ArkUIKit/arktsobservedv2andtrace/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/arktsobservedv2andtrace/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/arktsobservedv2andtrace/entry/src/main/ets/pages/Index.ets b/ArkUIKit/arktsobservedv2andtrace/entry/src/main/ets/pages/Index.ets index 9c5926c02a1dbe34f0cb10b922987bf8bdc015f8..4a03ee6608830a74eec86e43e384dcea77abfd00 100644 --- a/ArkUIKit/arktsobservedv2andtrace/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/arktsobservedv2andtrace/entry/src/main/ets/pages/Index.ets @@ -13,8 +13,8 @@ * limitations under the License. */ class CreateRouter{ - public pageName:string; - public routerName:string; + public pageName:string; + public routerName:string; constructor(pageName:string,routerName:string){ this.pageName = pageName; this.routerName = routerName; diff --git a/ArkUIKit/arktsobservedv2andtrace/entry/src/main/ets/pages/usagerestrictions/UiRefreshCannotTriggered.ets b/ArkUIKit/arktsobservedv2andtrace/entry/src/main/ets/pages/usagerestrictions/UiRefreshCannotTriggered.ets index 9d52e45e1d3af8375bd2d27fc7e9112947fbe6ff..18b37e5cbb04cadd1ef9bf96f234d8751515e391 100644 --- a/ArkUIKit/arktsobservedv2andtrace/entry/src/main/ets/pages/usagerestrictions/UiRefreshCannotTriggered.ets +++ b/ArkUIKit/arktsobservedv2andtrace/entry/src/main/ets/pages/usagerestrictions/UiRefreshCannotTriggered.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [Start UiRefreshCannotTriggered] +// [Start UiRefresh_CannotTriggered] @ObservedV2 class TriggeredPerson { // Public property to store the unique identifier @@ -40,4 +40,4 @@ struct UiRefreshCannotTriggered { } } } -// [End UiRefreshCannotTriggered] \ No newline at end of file +// [End UiRefresh_CannotTriggered] \ No newline at end of file diff --git a/ArkUIKit/arktsobservedv2andtrace/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/arktsobservedv2andtrace/entry/src/ohosTest/ets/test/List.test.ets index 560cb94e9cfec921cd818985ac22034b2a3fd8cd..60fdb87685161d6da8b02b6ea5ff03de4fba3af2 100644 --- a/ArkUIKit/arktsobservedv2andtrace/entry/src/ohosTest/ets/test/List.test.ets +++ b/ArkUIKit/arktsobservedv2andtrace/entry/src/ohosTest/ets/test/List.test.ets @@ -17,5 +17,5 @@ import abilityTest from './Ability.test'; export default function testsuite() { abilityTest(); - IndexTest() + IndexTest(); } \ No newline at end of file diff --git a/ArkUIKit/checkpage/entry/.gitignore b/ArkUIKit/checkpage/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/checkpage/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/createCustomComponents/AppScope/app.json5 b/ArkUIKit/createCustomComponents/AppScope/app.json5 index 92dc19cbf564a472953f601dfe04605c6bbfa166..be32f36026ccde203880ca59f27fa636336642de 100644 --- a/ArkUIKit/createCustomComponents/AppScope/app.json5 +++ b/ArkUIKit/createCustomComponents/AppScope/app.json5 @@ -14,8 +14,8 @@ */ { "app": { - "bundleName": "com.example.createcustomcomponents", - "vendor": "example", + "bundleName": "com.samples.createcustomcomponents", + "vendor": "samples", "versionCode": 1000000, "versionName": "1.0.0", "icon": "$media:layered_image", diff --git a/ArkUIKit/createCustomComponents/README_zh.md b/ArkUIKit/createCustomComponents/README_zh.md index 982f0b2fa7a1e5560c04a971f4ee26d307ff4ecb..fff135d664fd506d87d624a799e079031e1043a0 100644 --- a/ArkUIKit/createCustomComponents/README_zh.md +++ b/ArkUIKit/createCustomComponents/README_zh.md @@ -14,14 +14,6 @@ | ![](screenshots/img.png) | ![](screenshots/img_1.png) | -### 具体实现 -1. 组件示例卡片交互实现:先创建主界面入口组件,通过容器布局(如网格、行列布局)搭建组件示例卡片的展示结构。为每个卡片绑定点击事件,点击后可通过命名路由跳转(利用@Entry装饰器的routeName配置)或状态变量控制视图切换,直接定位到对应的组件示例详情页面,实现从入口到具体示例的快速访问。 - -2. 组件参数初始化与跨组件通信实现:子组件提前声明需要外部配置的成员变量,父组件在构建自身 UI 时,创建子组件实例并传入对应参数,按照装饰器的规则完成子组件的初始化。对于跨组件函数调用,父组件将需要被触发的业务函数作为参数传递给子组件,子组件在合适的交互场景(如按钮点击)中调用该函数,实现父子组件间的逻辑联动。 - -3. 自定义组件样式配置实现:自定义组件创建完成后,无需在组件内部单独定义通用样式,而是在父组件中使用该自定义组件时,通过 “.” 链式调用的方式,直接为组件添加尺寸、背景色、边距等通用样式。这些样式实际作用于组件外层的隐形容器,既简化了样式配置流程,又能灵活调整组件在不同场景下的展示效果。 - - ### 使用说明 1. 组件创建与入口配置:创建自定义组件需基于struct结构并添加@Component装饰器,且必须实现build()函数描述 UI 布局;若需作为页面入口,需额外添加@Entry装饰器,单个页面仅能设置一个入口组件,可通过routeName配置命名路由名称。 @@ -63,6 +55,13 @@ entry/src/ohosTest/ | |---index.test.ets // 示例代码测试代码 ``` +### 具体实现 +1. 组件示例卡片交互实现:先创建主界面入口组件,通过容器布局(如网格、行列布局)搭建组件示例卡片的展示结构。为每个卡片绑定点击事件,点击后可通过命名路由跳转(利用@Entry装饰器的routeName配置)或状态变量控制视图切换,直接定位到对应的组件示例详情页面,实现从入口到具体示例的快速访问。 + +2. 组件参数初始化与跨组件通信实现:子组件提前声明需要外部配置的成员变量,父组件在构建自身 UI 时,创建子组件实例并传入对应参数,按照装饰器的规则完成子组件的初始化。对于跨组件函数调用,父组件将需要被触发的业务函数作为参数传递给子组件,子组件在合适的交互场景(如按钮点击)中调用该函数,实现父子组件间的逻辑联动。 + +3. 自定义组件样式配置实现:自定义组件创建完成后,无需在组件内部单独定义通用样式,而是在父组件中使用该自定义组件时,通过 “.” 链式调用的方式,直接为组件添加尺寸、背景色、边距等通用样式。这些样式实际作用于组件外层的隐形容器,既简化了样式配置流程,又能灵活调整组件在不同场景下的展示效果。 + ### 相关权限 不涉及。 diff --git a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/BuildFunction.ets b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/BuildFunction.ets index 375b4c062922e8dbdc923635615c459040a955cb..0abfe9c6a9f1b88846bb29d61a61424675ac72d6 100644 --- a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/BuildFunction.ets +++ b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/BuildFunction.ets @@ -17,6 +17,7 @@ @Component struct MyComponentBuildFunction { build() { + // [StartExclude Declarative_UI_description] Column(){ Text('Hello World') .fontSize(50) @@ -24,6 +25,7 @@ struct MyComponentBuildFunction { } .width('100%') .height('100%') + // [EndExclude Declarative_UI_description] } } // [End Declarative_UI_description] \ No newline at end of file diff --git a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/Entry.ets b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/Entry.ets index f29fdd5a2a5199ddb1c017ab8e0c5012ac7c1975..9283674fff6ab1f8ead548a3c417c6d5f69305fe 100644 --- a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/Entry.ets +++ b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/Entry.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [Start Entry_UI_page +// [Start Entry_UI_page] @Entry @Component struct MyComponentEntry { diff --git a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/FreezeWhenInactive.ets b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/FreezeWhenInactive.ets index 7d432e6b5bf52d3ccc58b941de5957d45dffe0cf..2e23b569ad0bdb022939caebb7bcbe89fe0c369a 100644 --- a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/FreezeWhenInactive.ets +++ b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/FreezeWhenInactive.ets @@ -16,7 +16,7 @@ // [Start freezeWhenInactive_Component] @Component({ freezeWhenInactive: true }) struct MyComponentFreezeWhenInactive { - // [StartExclude freezeWhenInactive_build] + // [StartExclude freezeWhenInactive_Component] build() { Column(){ Text('Hello World') @@ -26,6 +26,6 @@ struct MyComponentFreezeWhenInactive { .width('100%') .height('100%') } - // [EndExclude freezeWhenInactive_build] + // [EndExclude freezeWhenInactive_Component] } // [End freezeWhenInactive_Component] \ No newline at end of file diff --git a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/If.ets b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/If.ets index cfb16ef215f6799b354178460e474548f283b0cd..65a8e55443f5072a1f6b69a86c9a2ca9eb98a56b 100644 --- a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/If.ets +++ b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/If.ets @@ -14,8 +14,8 @@ */ @Entry @Component -struct If { - expression: number = 0; +struct IfPage { + expression: number = 1; // [Start switch_syntax] build() { Column() { diff --git a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/MyComponentBuild.ets b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/MyComponentBuild.ets index c25bb21eaf2ed172371e6d10930440a166ff41cc..ee3751a734d05eddbfcb0c163e703e9a443b3cfa 100644 --- a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/MyComponentBuild.ets +++ b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/MyComponentBuild.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [ Start build_function ] +// [Start build_function] @Entry @Component struct MyComponent { diff --git a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/ParameterSpecification.ets b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/ParameterSpecification.ets index 5fbd20f602d7db8f701c260be605e1e04db695ab..d966beab3ebe7dbb574cab5fcfd015a6ff7be689 100644 --- a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/ParameterSpecification.ets +++ b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/ParameterSpecification.ets @@ -19,10 +19,10 @@ struct MyComponentSpecification { private color: Color = Color.Blue; build() { - // [StartExclude test_specification] + // [StartExclude Parameter_specification] Text('test') .backgroundColor(this.color) - // [EndExclude test_specification] + // [EndExclude Parameter_specification] } } diff --git a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/ParentFunction.ets b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/ParentFunction.ets index 338041b05bb22a545aee8af03eaabfaae2c9be49..951e71562fb49246eec9e15f1458cf509985f917 100644 --- a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/ParentFunction.ets +++ b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/ParentFunction.ets @@ -16,14 +16,15 @@ @Entry @Component struct ParentFunction { - @State cnt: number = 0; + // Counter to record the number of button clicks + @State clickCount: number = 0; submit: () => void = () => { - this.cnt++; + this.clickCount++; }; build() { Column() { - Text(`${this.cnt}`) + Text(`${this.clickCount}`) Son({ submitArrow: this.submit }) } } diff --git a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/StaticCodeV1.ets b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/StaticCodeV1.ets index 1c2665419a9b313a93eca0ad4a8ffc902f897150..267fb3bd895cd6f7af6167b4c59d73133f6a79a9 100644 --- a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/StaticCodeV1.ets +++ b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/StaticCodeV1.ets @@ -21,7 +21,7 @@ struct MyComponentCodeV1 { static { this.a = 'hello world'; }; - // [StartExclude code_V1] + // [StartExclude Static_code_V1] build() { Column(){ // $r('app.string.static_code')需要替换为开发者所需的资源文件 @@ -30,7 +30,7 @@ struct MyComponentCodeV1 { .width('100%') .height('100%') } - // [EndExclude code_V1] + // [EndExclude Static_code_V1] } // [End Static_code_V1] diff --git a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/StaticCodeV2.ets b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/StaticCodeV2.ets index 3e97a1affdcee80b46bf872a13e00fc20020c692..caad45efb49524a6cc2d2245c08c57b317386c49 100644 --- a/ArkUIKit/createCustomComponents/entry/src/main/ets/component/StaticCodeV2.ets +++ b/ArkUIKit/createCustomComponents/entry/src/main/ets/component/StaticCodeV2.ets @@ -21,7 +21,7 @@ struct MyComponentV2 { static { this.a = 'hello world'; }; - // [StartExclude code_V2] + // [StartExclude Static_code_V2] build() { Column(){ Text(MyComponentV2.a) @@ -29,6 +29,6 @@ struct MyComponentV2 { .width('100%') .height('100%') } - // [EndExclude code_V2] + // [EndExclude Static_code_V2] } // [End Static_code_V2] diff --git a/ArkUIKit/createCustomComponents/entry/src/main/ets/managementoverview/stateManagementOverview.ets b/ArkUIKit/createCustomComponents/entry/src/main/ets/managementoverview/stateManagementOverview.ets index dca3de6f4e04c5e7661935c3cb1dce8745bc26e8..18669b987dae40d6e0ab87cc02ce4ae6a5bd98bb 100644 --- a/ArkUIKit/createCustomComponents/entry/src/main/ets/managementoverview/stateManagementOverview.ets +++ b/ArkUIKit/createCustomComponents/entry/src/main/ets/managementoverview/stateManagementOverview.ets @@ -15,16 +15,18 @@ // [Start state_management_overview] @Component struct MyComponentOverview { + // State variable to track the current count value @State count: number = 0; + // Increment step value, determines how much to add to the count each time increaseBy: number = 1; build() { - // [StartExclude management_overview] + // [StartExclude state_management_overview] Column(){ Text(`Count: ${this.count}`) Text(`increaseBy: ${this.increaseBy}`) } - // [EndExclude management_overview] + // [EndExclude state_management_overview] } } diff --git a/ArkUIKit/createCustomComponents/entry/src/main/ets/pages/Index.ets b/ArkUIKit/createCustomComponents/entry/src/main/ets/pages/Index.ets index 07fd286a78a36e58f19e3024b683f3f0b903ca1d..edab381ead3b45fc153f8fd0dc47fa7356855be2 100644 --- a/ArkUIKit/createCustomComponents/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/createCustomComponents/entry/src/main/ets/pages/Index.ets @@ -12,15 +12,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { router } from '@kit.ArkUI' - class CreateRouter{ - public pageName:string - public routerName:string + public pageName:string; + public routerName:string; constructor(pageName:string,routerName:string){ - this.pageName = pageName - this.routerName = routerName - } + this.pageName = pageName; + this.routerName = routerName; + }; }; const createRouterList:CreateRouter[] = [ new CreateRouter('ParentComponentPage','component/ParentComponent'), diff --git a/ArkUIKit/createCustomComponents/entry/src/ohosTest/ets/test/Index.test.ets b/ArkUIKit/createCustomComponents/entry/src/ohosTest/ets/test/Index.test.ets index 306984181f075428f01c17a7c10db8e9e8765746..7e2e756b32a3ca0eda96de808c356ccaf49d15b9 100644 --- a/ArkUIKit/createCustomComponents/entry/src/ohosTest/ets/test/Index.test.ets +++ b/ArkUIKit/createCustomComponents/entry/src/ohosTest/ets/test/Index.test.ets @@ -12,13 +12,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; import { abilityDelegatorRegistry, Driver, ON, MatchPattern } from '@kit.TestKit'; import { UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); const bundleName = abilityDelegatorRegistry.getArguments().bundleName; let want: Want; let driver: Driver; +const TAG = '[Sample_createcustomcomponents]'; +const DOMAIN = 0xF811; +const BUNDLE = 'createcustomcomponents_'; + export default function IndexTest() { describe('IndexTest', () => { beforeAll(async () => { @@ -30,7 +37,7 @@ export default function IndexTest() { driver = Driver.create(); await driver.delayMs(2000); const ability: UIAbility = await delegator.getCurrentTopAbility(); - console.info('get top ability'); + hilog.info(DOMAIN,TAG,BUNDLE + 'get top ability') expect(ability.context.abilityInfo.name).assertEqual('EntryAbility'); }) /** @@ -261,7 +268,7 @@ export default function IndexTest() { * @tc.desc 测试If页面是否显示正常 */ it('IfPageTest', 0, async (done: Function) => { - let targetElement = await driver.findComponent(ON.text('If', MatchPattern.CONTAINS)); + let targetElement = await driver.findComponent(ON.text('IfPage', MatchPattern.CONTAINS)); expect(targetElement === null).assertFalse(); await targetElement!.click(); await driver.delayMs(2000); diff --git a/ArkUIKit/createCustomComponents/entry/src/ohosTest/ets/test/List.test.ets b/ArkUIKit/createCustomComponents/entry/src/ohosTest/ets/test/List.test.ets index c33c26367bc351efe1b27664b8dd473e2d37fe36..60fdb87685161d6da8b02b6ea5ff03de4fba3af2 100644 --- a/ArkUIKit/createCustomComponents/entry/src/ohosTest/ets/test/List.test.ets +++ b/ArkUIKit/createCustomComponents/entry/src/ohosTest/ets/test/List.test.ets @@ -12,10 +12,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import IndexTest from './Index.test' +import IndexTest from './Index.test'; import abilityTest from './Ability.test'; export default function testsuite() { abilityTest(); - IndexTest() + IndexTest(); } \ No newline at end of file diff --git a/ArkUIKit/native_node_sample/entry/.gitignore b/ArkUIKit/native_node_sample/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/ArkUIKit/native_node_sample/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/ArkUIKit/native_node_sample/entry/build-profile.json5 b/ArkUIKit/native_node_sample/entry/build-profile.json5 index 9016ca8c62da83754a0b09bfc58f360872d6ab80..400a41af2decdde064672c31400f59b3ef2c75ef 100644 --- a/ArkUIKit/native_node_sample/entry/build-profile.json5 +++ b/ArkUIKit/native_node_sample/entry/build-profile.json5 @@ -21,8 +21,7 @@ "arguments": "", "cppFlags": "", "abiFilters": [ - "arm64-v8a", - "x86_64" + "armeabi-v7a","arm64-v8a", "x86_64" ] } },