diff --git a/function/ui_compare_rh/README.md b/function/ui_compare_rh/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c4522b53d50850a5eeee1376030ef71e71d67665 --- /dev/null +++ b/function/ui_compare_rh/README.md @@ -0,0 +1,136 @@ +# UI对比测试开发指南 + +## 0、需求(文本用例) + +用例举例,开发如下用例: + +| 用例_名称 | 用例_编号 | 创建版本 |预置条件| 测试步骤|预期结果|自动化类型| +|-----|------|-------|------|------|------|------| +| 文本样式fontColor:Color类型 | SUB_ACE_UI_ATTRIBUTES_FONT_INTERFACE_0010 | OpenHarmony V400R001 |新建eTS页面|1、添加文本组件2、设置fontColor为Color.Blue 3、编译测试demo|3、编译通过,文本显示蓝色|UI对比| + +## 1、编写工程和代码 + +### 1.1 新建或导入已有工程,创建目录和页面 + +以从DevEco导入本目录下的uicompare工程为例: + +在testability目录下创建页面,命名规则,用例编号除数字外,相同的用例在pages下创建一个同名子目录,每个编号的用例创建一个ets文件,文件名采用大驼峰如下: + +![image](figures/1.png) + +### 1.2 创建测试用例目录和文件 + +在test目录下创建用例目录,目录名称和2\.1中的页面相同并在后面加Test,用例文件和页面ets文件相同,后缀多了\.test,如下图: + +![image](figures/2.png) + +### 1.3 编写页面 + +按用例要求编写页面,创建文本组件,并设置颜色为Blue。 + +结构名称和文件名相同,组件需要设置id的,使用本文件名加"_001"按递增使用,避免和别的文件中的id重名。 + +![image](figures/3.png) + +### 1.4 编写用例 + +修改类名,注释,测试套名称,用例名称,和测试用例文件及用例文档中对应,修改调用的页面文件路由,和页面路径对应: + +![image](figures/4.png) + +![image](figures/5.png) + +### 1.5 在List.test.ets中添加测试套和页面路由 +注意:这里的页面是写在ohosTest模块下,不要写到main模块里。 + +![image](figures/6.png) + +![image](figures/7.png) + +## 2、编译运行 +### 2.1 编译 + +因为工程使用了截屏接口,需要系统权限,在SDK的sdk\12\toolchains\lib\UnsgnedReleasedProfileTemplate.json文件中修改应用级别:"apl":"system_core", +"app-feature":"hos_system_app"。 + +在IDE的file -> Project Structure 中自动签名: + +![image](figures/8.png) + +Build-> Rebuild 编译hap: + +![image](figures/9.png) + +### 2.2 执行用例 +右键xxxxx.test.ets 文件执行用例,或右键test目录执行全部用例: + +![image](figures/10.png) + +观察设备是否正常显示测试页面,显示了蓝色的文字: + +![image](figures/11.png) + +测试结果: + +![image](figures/12.png) + +### 2.3 检查截屏图片: + +![image](figures/13.png) + +用hdc从设备拉取截屏图片: + +![image](figures/14.png) + +打开检查截图是否正确: + +![image](figures/15.png) + +用例开发完成,且调试成功。 + +## 3、对比UI图片 + +使用uicompare_tools目录下的python对比工具脚本。 + +使用对比脚本前需要安装python环境,安装依赖包:需安装三个包:openpyxl、numpy、pillow。 + +hdc配置到系统环境变量。 + +### 3.1 将编译的hap包拷贝到ui对比工具的hap目录下 + +![image](figures/16.png) + +![image](figures/17.png) + +### 3.2 在excel表中添加测试用例 + +excel文件名和hap名必须相同,一个excel对应一个hap。 + +![image](figures/18.png) + +![image](figures/19.png) + +### 3.3 生成基线图片: + +![image](figures/20.png) + +![image](figures/21.png) + +### 3.4 对此测试 + +指定基线图片目录和上中路径一致: + +![image](figures/22.png) + +测试显示用例执行通过: + +![image](figures/23.png) + +### 3.5 测试报告 + +![image](figures/24.png) + +![image](figures/25.png) + + + diff --git a/function/ui_compare_rh/figures/1.png b/function/ui_compare_rh/figures/1.png new file mode 100644 index 0000000000000000000000000000000000000000..5424b7902c69330ffe5f6dd97aadefda3091164f Binary files /dev/null and b/function/ui_compare_rh/figures/1.png differ diff --git a/function/ui_compare_rh/figures/10.png b/function/ui_compare_rh/figures/10.png new file mode 100644 index 0000000000000000000000000000000000000000..a3e91a1b1164e13c1a4032e9ec4619944a533e5f Binary files /dev/null and b/function/ui_compare_rh/figures/10.png differ diff --git a/function/ui_compare_rh/figures/11.png b/function/ui_compare_rh/figures/11.png new file mode 100644 index 0000000000000000000000000000000000000000..7dbbbb8680139cc82151b17593d7fd2bd5e42402 Binary files /dev/null and b/function/ui_compare_rh/figures/11.png differ diff --git a/function/ui_compare_rh/figures/12.png b/function/ui_compare_rh/figures/12.png new file mode 100644 index 0000000000000000000000000000000000000000..4ccf7d44417f7d93f94ddda5b18be9517348269f Binary files /dev/null and b/function/ui_compare_rh/figures/12.png differ diff --git a/function/ui_compare_rh/figures/13.png b/function/ui_compare_rh/figures/13.png new file mode 100644 index 0000000000000000000000000000000000000000..2024a8115867c326dee5efaa621ce962521f434a Binary files /dev/null and b/function/ui_compare_rh/figures/13.png differ diff --git a/function/ui_compare_rh/figures/14.png b/function/ui_compare_rh/figures/14.png new file mode 100644 index 0000000000000000000000000000000000000000..633a80c80bc310cd66deb08f2473918db9ba2eb7 Binary files /dev/null and b/function/ui_compare_rh/figures/14.png differ diff --git a/function/ui_compare_rh/figures/15.png b/function/ui_compare_rh/figures/15.png new file mode 100644 index 0000000000000000000000000000000000000000..08c41aa20d552bfaddd2a40e90ea4eafc0fbadc3 Binary files /dev/null and b/function/ui_compare_rh/figures/15.png differ diff --git a/function/ui_compare_rh/figures/16.png b/function/ui_compare_rh/figures/16.png new file mode 100644 index 0000000000000000000000000000000000000000..61a4c79840404a664181de7eaab0637b38c9f9b2 Binary files /dev/null and b/function/ui_compare_rh/figures/16.png differ diff --git a/function/ui_compare_rh/figures/17.png b/function/ui_compare_rh/figures/17.png new file mode 100644 index 0000000000000000000000000000000000000000..b3c346c1220ee4529f0b60752b9996e16485617d Binary files /dev/null and b/function/ui_compare_rh/figures/17.png differ diff --git a/function/ui_compare_rh/figures/18.png b/function/ui_compare_rh/figures/18.png new file mode 100644 index 0000000000000000000000000000000000000000..68d8881e20e301488b1cd85fb33bf3b106dad5c7 Binary files /dev/null and b/function/ui_compare_rh/figures/18.png differ diff --git a/function/ui_compare_rh/figures/19.png b/function/ui_compare_rh/figures/19.png new file mode 100644 index 0000000000000000000000000000000000000000..ac58da7cc49e6f0957fbadc50a1927becfc4e2c9 Binary files /dev/null and b/function/ui_compare_rh/figures/19.png differ diff --git a/function/ui_compare_rh/figures/2.png b/function/ui_compare_rh/figures/2.png new file mode 100644 index 0000000000000000000000000000000000000000..6c3dde1577ddb12f63061e4ddfd380d1f32d167a Binary files /dev/null and b/function/ui_compare_rh/figures/2.png differ diff --git a/function/ui_compare_rh/figures/20.png b/function/ui_compare_rh/figures/20.png new file mode 100644 index 0000000000000000000000000000000000000000..f1168f94ca1a07da6b8d4573040f440e19a37811 Binary files /dev/null and b/function/ui_compare_rh/figures/20.png differ diff --git a/function/ui_compare_rh/figures/21.png b/function/ui_compare_rh/figures/21.png new file mode 100644 index 0000000000000000000000000000000000000000..62c5318d417bd4616d52857c7661c12a768f840e Binary files /dev/null and b/function/ui_compare_rh/figures/21.png differ diff --git a/function/ui_compare_rh/figures/22.png b/function/ui_compare_rh/figures/22.png new file mode 100644 index 0000000000000000000000000000000000000000..03ce77ab89e45415079f6239d53cde66e1bbc37a Binary files /dev/null and b/function/ui_compare_rh/figures/22.png differ diff --git a/function/ui_compare_rh/figures/23.png b/function/ui_compare_rh/figures/23.png new file mode 100644 index 0000000000000000000000000000000000000000..8efdb1a39de83730abec3a4b7f0f5fb740c2389a Binary files /dev/null and b/function/ui_compare_rh/figures/23.png differ diff --git a/function/ui_compare_rh/figures/24.png b/function/ui_compare_rh/figures/24.png new file mode 100644 index 0000000000000000000000000000000000000000..ba25f3a4b3ba91274b7eccf5051a158261b23a55 Binary files /dev/null and b/function/ui_compare_rh/figures/24.png differ diff --git a/function/ui_compare_rh/figures/25.png b/function/ui_compare_rh/figures/25.png new file mode 100644 index 0000000000000000000000000000000000000000..5277cf722abb4f1d7943c2deffaf90e4d33dab39 Binary files /dev/null and b/function/ui_compare_rh/figures/25.png differ diff --git a/function/ui_compare_rh/figures/3.png b/function/ui_compare_rh/figures/3.png new file mode 100644 index 0000000000000000000000000000000000000000..f67097e20179919a3ff91dd8c6c209773538a1cb Binary files /dev/null and b/function/ui_compare_rh/figures/3.png differ diff --git a/function/ui_compare_rh/figures/4.png b/function/ui_compare_rh/figures/4.png new file mode 100644 index 0000000000000000000000000000000000000000..fb62a3cf06c8afe812c7caebef4d2283a3e46e13 Binary files /dev/null and b/function/ui_compare_rh/figures/4.png differ diff --git a/function/ui_compare_rh/figures/5.png b/function/ui_compare_rh/figures/5.png new file mode 100644 index 0000000000000000000000000000000000000000..b728087c47ad5e2f7ef28dc1de3566165b1604ce Binary files /dev/null and b/function/ui_compare_rh/figures/5.png differ diff --git a/function/ui_compare_rh/figures/6.png b/function/ui_compare_rh/figures/6.png new file mode 100644 index 0000000000000000000000000000000000000000..ba08042c823ef71f49e76a4b3e1ea812d5c8432f Binary files /dev/null and b/function/ui_compare_rh/figures/6.png differ diff --git a/function/ui_compare_rh/figures/7.png b/function/ui_compare_rh/figures/7.png new file mode 100644 index 0000000000000000000000000000000000000000..276823adc1fa505f57d4059d768357654fc9d992 Binary files /dev/null and b/function/ui_compare_rh/figures/7.png differ diff --git a/function/ui_compare_rh/figures/8.png b/function/ui_compare_rh/figures/8.png new file mode 100644 index 0000000000000000000000000000000000000000..93d2547bf903a0b37a8b8f6706789558b95bcea2 Binary files /dev/null and b/function/ui_compare_rh/figures/8.png differ diff --git a/function/ui_compare_rh/figures/9.png b/function/ui_compare_rh/figures/9.png new file mode 100644 index 0000000000000000000000000000000000000000..5ab1b3c96fb2d320093889235d364fc651e2238b Binary files /dev/null and b/function/ui_compare_rh/figures/9.png differ diff --git a/function/ui_compare_rh/uicompare/.gitignore b/function/ui_compare_rh/uicompare/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..fbabf771011fe78f9919db0b1195ab6cadffc2b0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/.gitignore @@ -0,0 +1,11 @@ +/node_modules +/oh_modules +/local.properties +/.idea +**/build +/.hvigor +.cxx +/.clangd +/.clang-format +/.clang-tidy +**/.test \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/AppScope/app.json5 b/function/ui_compare_rh/uicompare/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..eabf71557eadee20c8a9913b10b8e25e6e5347a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.uicompare", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/function/ui_compare_rh/uicompare/AppScope/resources/base/element/string.json b/function/ui_compare_rh/uicompare/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c102b07cf38bd502d548f44266affbd1267ade12 --- /dev/null +++ b/function/ui_compare_rh/uicompare/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "uicompare" + } + ] +} diff --git a/function/ui_compare_rh/uicompare/AppScope/resources/base/media/app_icon.png b/function/ui_compare_rh/uicompare/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/function/ui_compare_rh/uicompare/AppScope/resources/base/media/app_icon.png differ diff --git a/function/ui_compare_rh/uicompare/build-profile.json5 b/function/ui_compare_rh/uicompare/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..31e25e18f1ba2ff79c5d612f2fc5491fbc1d0800 --- /dev/null +++ b/function/ui_compare_rh/uicompare/build-profile.json5 @@ -0,0 +1,41 @@ +{ + "app": { + "signingConfigs": [ + { + "name": "default", + "material": { + "certpath": "C:/Users/zheng_jinhua/.ohos/config/openharmony/default_uicompare_PHwGjyBm0pVuVbo5E_nuo08xrgArHo1FMB1X9GbdUs8=.cer", + "storePassword": "0000001B912580E37E16A657994CDB4571D6029022ADB6420083342368D97CDC429DDDBF0E1239E1D38BB1", + "keyAlias": "debugKey", + "keyPassword": "0000001B1F1A68C1FAD2134FEA3203B02A7B4F8139841C7C2851767568A5D1B83AB808DBBBE896874EF4AF", + "profile": "C:/Users/zheng_jinhua/.ohos/config/openharmony/default_uicompare_PHwGjyBm0pVuVbo5E_nuo08xrgArHo1FMB1X9GbdUs8=.p7b", + "signAlg": "SHA256withECDSA", + "storeFile": "C:/Users/zheng_jinhua/.ohos/config/openharmony/default_uicompare_PHwGjyBm0pVuVbo5E_nuo08xrgArHo1FMB1X9GbdUs8=.p12" + } + } + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compileSdkVersion": 12, + "compatibleSdkVersion": 12, + "runtimeOS": "OpenHarmony" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/.gitignore b/function/ui_compare_rh/uicompare/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/build-profile.json5 b/function/ui_compare_rh/uicompare/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f8f03407f77914b43168aeca6bb0929efd6700b4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/build-profile.json5 @@ -0,0 +1,13 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/hvigorfile.ts b/function/ui_compare_rh/uicompare/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/function/ui_compare_rh/uicompare/entry/oh-package.json5 b/function/ui_compare_rh/uicompare/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..225946cb11a2c405c8dc81eea89c22f923556638 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/function/ui_compare_rh/uicompare/entry/src/main/ets/entryability/EntryAbility.ts b/function/ui_compare_rh/uicompare/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..c239c7738e12c1bc2e5a24b151d2ec5842e760ec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,56 @@ +/* + * 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 UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err, data) => { + 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. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/main/ets/pages/Index.ets b/function/ui_compare_rh/uicompare/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e4b0390777d039b0993caeeff4c0deab3384c57 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,32 @@ +/* + * 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. + */ + +@Entry +@Component +struct Index { + @State message: string = 'Hello World' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/main/module.json5 b/function/ui_compare_rh/uicompare/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..9b07af70a189c0165e30b9f4bedc3bfd22b53cda --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/main/module.json5 @@ -0,0 +1,37 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "description": "$string:EntryAbility_desc", + "icon": "$media:icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/main/resources/base/element/color.json b/function/ui_compare_rh/uicompare/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/main/resources/base/element/string.json b/function/ui_compare_rh/uicompare/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f94595515a99e0c828807e243494f57f09251930 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/main/resources/base/media/icon.png b/function/ui_compare_rh/uicompare/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/main/resources/base/media/icon.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/main/resources/base/profile/main_pages.json b/function/ui_compare_rh/uicompare/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/function/ui_compare_rh/uicompare/entry/src/main/resources/en_US/element/string.json b/function/ui_compare_rh/uicompare/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f94595515a99e0c828807e243494f57f09251930 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/main/resources/zh_CN/element/string.json b/function/ui_compare_rh/uicompare/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..597ecf95e61d7e30367c22fe2f8638008361b044 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/2.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/2.png new file mode 100644 index 0000000000000000000000000000000000000000..382ac7dc322871219388ca27f7c637447e8c9e77 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/2.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/cat.jpg b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/cat.jpg new file mode 100644 index 0000000000000000000000000000000000000000..382ac7dc322871219388ca27f7c637447e8c9e77 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/cat.jpg differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/Ability.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/Ability.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..76e140bc60b9e19df3e40c0c70b172198360e76b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/Ability.test.ets @@ -0,0 +1,50 @@ +/* + * 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'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' + +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. + }); + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }); + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }); + afterAll(() => { + // 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); + }); + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..11de16ebb3a3e455b798f2cddc14af0bb33dd4dc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkUITabScrollable() { + + describe('ArkUITabScrollable', () => { + + + /* +* @tc.number ArkUI_Tabs_scrollable_001 +* @tc.name ArkUI_Tabs_scrollable_001 +* @tc.desc 1 、启 动 应 用 + 2、 设置属性scrollable参数为正常值 + 3 、 重 新 设 置 正 常 值 后 重 复 步 骤 1 和2 +*/ + it('ArkUI_Tabs_scrollable_001', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_scrollable_001 start.`); + Settings.createWindow("testability/pages/ArkUITabScrollable/ArkUITabScrollable001") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button1 :Component = await driver.findComponent(ON.id('ArkUITabScrollable001_002')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_scrollable_001 finish.`); + done() + }) + + /* +* @tc.number ArkUI_Tabs_scrollable_002 +* @tc.name ArkUI_Tabs_scrollable_002 +* @tc.desc 1 、启 动 应 用 + 2、 设置属性scrollable参数为正常值 + 3 、 重 新 设 置 正 常 值 后 重 复 步 骤 1 和2 +*/ + it('ArkUI_Tabs_scrollable_002', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_scrollable_002 start.`); + Settings.createWindow("testability/pages/ArkUITabScrollable/ArkUITabScrollable002") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button1 :Component = await driver.findComponent(ON.id('ArkUITabScrollable002_002')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_scrollable_002 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..324f2418e71fb165d4b4f5d9d594d77d6368bcb1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets @@ -0,0 +1,195 @@ +/* + * opyright (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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkUITabsIconStyleSelectedColor() { + + describe('ArkUITabsIconStyleSelectedColor', () => { + + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 + * @tc.desc selectedColor: 0xFFFFFFFFFFFFFFFF + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor027") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_029 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_029 + * @tc.desc selectedColor: null + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_029', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_029 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor029") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_029 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_028 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_028 + * @tc.desc selectedColor: undefined + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_028', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_028 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor028") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_028 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_024 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_024 + * @tc.desc selectedColor: "rgba(255,100,255,0.5)" + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_024', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_024 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor024") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_024 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_026 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_026 + * @tc.desc selectedColor:$r("sys.color.toast_outer_border_color") + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_026', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_026 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor026") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_026 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_025 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_025 + * @tc.desc selectedColor: $r("sys.color.titlebar_title_tertiary_color") + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_025', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_025 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor025") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_025 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_014 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_014 + * @tc.desc selectedColor: 0x808080 + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_014', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_014 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor014") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_014 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_013 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_013 + * @tc.desc selectedColor: 0xa52a2a + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_013', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_013 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor013") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_013 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_001 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_001 + * @tc.desc selectedColor: Color.Black + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_001', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_001 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor001") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_001 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_004 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_004 + * @tc.desc selectedColor: Color.Gray + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_004', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_004 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor004") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_004 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_008 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_008 + * @tc.desc selectedColor: Color.Red + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_008', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_008 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor008") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_008 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_022 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_022 + * @tc.desc selectedColor: “#ff000000" + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_022', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_022 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor022") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_022$ finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..5df21352c8310e8a539de155a98c44ffa69edaa4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets @@ -0,0 +1,181 @@ +/* + * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkUITabsIconStyleUnselectedColor() { + + describe('ArkUITabsIconStyleUnselectedColor', () => { + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 + * @tc.desc unselectedColor:0xFFFFFFFFFFFFFFFF + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor026") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_028 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_028 + * @tc.desc unselectedColor: null + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_028', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_028 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor028") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_028 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_027 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_027 + * @tc.desc unselectedColor: undefined + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_027', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_027 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor027") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_027 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_021 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_021 + * @tc.desc unselectedColor: "#ff000000" + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_021', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_021 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor021") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_021 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_022 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_022 + * @tc.desc unselectedColor: "rgb(255,100,255)" + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_022', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_022 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor022") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_022 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_024 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_024 + * @tc.desc unselectedColor: $r("sys.color.toast_outer_border_color") + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_024', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_024 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor024") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_024 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_014 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_014 + * @tc.desc unselectedColor: 0x008000 + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_014', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_014 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor014") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_014 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_016 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_016 + * @tc.desc unselectedColor: 0xffc0cb + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_016', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_016 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor016") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_016 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_029 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_029 + * @tc.desc unselectedColor: Color.Black + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_029', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_029 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor029") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_029 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_002 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_002 + * @tc.desc unselectedColor: Color.Brown + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_002', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_002 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor002") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_002 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_005 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_005 + * @tc.desc unselectedColor: Color.Orange + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_005', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_005 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor005") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_005 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..a7e6c5f0743669f11d39cf9705f550aa99d237bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets @@ -0,0 +1,469 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkUITabsLabelStyleSelectedColor() { + + describe('ArkUITabsLabelStyleSelectedColor', () => { + + + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_027 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_027 + * @tc.desc 1、启动应用 + 2、设置属性font参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_selectedColor_027', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_027 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor027") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor027_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_027 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_029 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_029 + * @tc.desc 1、启动应用 + 2、设置属性font参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_selectedColor_029', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_029 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor029") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor029_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_029 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_013 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_013 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_selectedColor_013', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_013 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor013") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor013_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_013 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_017 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_017 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 +*/ + it('ArkUI_Tabs_LabelStyle_selectedColor_017', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_017 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor017") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor017_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_017 finish.`); + done() + }) + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_019 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_019 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 +*/ + it('ArkUI_Tabs_LabelStyle_selectedColor_019', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_019 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor019") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor019_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_019 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_001 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_001 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 +*/ + it('ArkUI_Tabs_LabelStyle_selectedColor_001', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_001 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor001") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor001_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_001 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_003 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_003 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_selectedColor_003', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_003 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor003") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor003_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_003 finish.`); + done() + }) + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_005 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_005 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_selectedColor_005', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_005 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor005") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor005_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_005 finish.`); + done() + }) + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_007 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_007 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_selectedColor_007', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_007 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor007") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor007_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_007 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_011 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_011 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_selectedColor_011', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_011 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor011") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor011_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_011 finish.`); + done() + }) + + /* +* @tc.number ArkUI_Tabs_LabelStyle_selectedColor_009 +* @tc.name ArkUI_Tabs_LabelStyle_selectedColor_009 +* @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 +*/ + it('ArkUI_Tabs_LabelStyle_selectedColor_009', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_009 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor009") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor009_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_009 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_028 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_028 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_028', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_028 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor028") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor028_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_028 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_021 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_021 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_021', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_021 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor021") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor021_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_021 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_023 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_023 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_023', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_023 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor023") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor023_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_023 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_024 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_024 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_024', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_024 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor024") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor024_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_024 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_026 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_026 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_026', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_026 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor026") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor026_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_026 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_025 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_025 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_025', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_025 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor025") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor025_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_025 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_012 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_012 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_012', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_012 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor012") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor012_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_012 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_015 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_015 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_015', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_015 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor015") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor015_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_015 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..d7dd0377579ace102aa8506ceea577bf63d48457 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets @@ -0,0 +1,349 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkUITabsLabelStyleUnselectedColor() { + + describe('ArkUITabsLabelStyleUnselectedColor', () => { + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_026 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_026 + * @tc.desc 1、启动应用 + * 2、设置属性unbselectedColor参数为正常值 + 3、重新设置异常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_026', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_026 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor026") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor026_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_026 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_028 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_028 + * @tc.desc 1、启动应用 + * 2、设置属性unbselectedColor参数为正常值 + 3、重新设置异常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_028', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_028 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor028") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor028_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_028 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_027 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_027 + * @tc.desc 1、启动应用 + * 2、设置属性unbselectedColor参数为正常值 + 3、重新设置异常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_027', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_027 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor027") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor027_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_027 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_021 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_021 + * @tc.desc 1、启动应用 + * 2、设置属性unbselectedColor参数为正常值 + 3、重新设置异常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_021', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_021 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor021") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor021_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_021 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_022 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_022 + * @tc.desc 1、启动应用 + * 2、设置属性unbselectedColor参数为正常值 + 3、重新设置异常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_022', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_022 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor022") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor022_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_022 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_025 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_025 + * @tc.desc 1、启动应用 + * 2、设置属性unbselectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_025', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_025 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor025") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor025_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_025 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_011 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_011 + * @tc.desc 1、启动应用 + 2、设置属性unselectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_011', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_011 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor011") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor011_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_011 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_012 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_012 + * @tc.desc 1、启动应用 + 2、设置属性unselectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_012', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_012 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor012") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor012_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_012 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_017 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_017 + * @tc.desc 1、启动应用 + 2、设置属性unselectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_017', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_017 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor017") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor017_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_017 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_001 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_001 + * @tc.desc 1、启动应用 + 2、设置属性unselectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 +*/ + it('ArkUI_Tabs_LabelStyle_unselectedColor_001', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_001 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor001") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor001_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_001 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_005 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_005 + * @tc.desc 1、启动应用 + 2、设置属性unselectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_005', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_005 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor005") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor005_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_005 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_008 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_008 + * @tc.desc 1、启动应用 + 2、设置属性unselectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_008', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_005 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor008") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor008_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_008 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_UNSELECTEDCOLOR_024 + * @tc.name ARKUI_TABS_LABELSTYLE_UNSELECTEDCOLOR_024 + * @tc.desc unselectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_UNSELECTEDCOLOR_024', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_UNSELECTEDCOLOR_024 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor024") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleUnselectedcolor024_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_UNSELECTEDCOLOR_024 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..1279dfa79c2cf91afd023b941364d0ad5a29eda1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets @@ -0,0 +1,386 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkUITabsLabelStylefont() { + + describe('ArkUITabsLabelStylefont', () => { + + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_005 + * @tc.name ArkUI_Tabs_LabelStyle_font_005 + * @tc.desc 1、创建tabs,设置SubTabBarStyle样式 + 2、设置镜像效果 + */ + it('ArkUI_Tabs_LabelStyle_font_005', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_005 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont005") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStylefont005_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_005 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_016 + * @tc.name ArkUI_Tabs_LabelStyle_font_016 + * @tc.desc 1、启动应用 + 2、设置属性font参数为异常值 + 3、重新设置正常值后重复步疆1和2 + */ + it('ArkUI_Tabs_LabelStyle_font_016', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_016 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont016") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStylefont016_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_016 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_015 + * @tc.name ArkUI_Tabs_LabelStyle_font_015 + * @tc.desc 1、启动应用 + 2、设置属性font参数为异常值 + 3、重新设置正常值后重复步疆1和2 + */ + it('ArkUI_Tabs_LabelStyle_font_015', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_015 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont015") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStylefont015_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_015 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_011 + * @tc.name ArkUI_Tabs_LabelStyle_font_011 + * @tc.desc 1、启动应用 + 2、设置属性font参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_font_011', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_011 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont011") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_011 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_007 + * @tc.name ArkUI_Tabs_LabelStyle_font_007 + * @tc.desc 1、启动应用 + 2、设置属性font参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_font_007', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_007 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont007") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_007 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_010 + * @tc.name ArkUI_Tabs_LabelStyle_font_010 + * @tc.desc 1、启动应用 + 2、设置属性font参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_font_010', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_010 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont010") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_010 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_008 + * @tc.name ArkUI_Tabs_LabelStyle_font_008 + * @tc.desc 1、启动应用 + 2、设置属性font参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_font_008', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_008 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont008") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_008 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_009 + * @tc.name ArkUI_Tabs_LabelStyle_font_009 + * @tc.desc 1、启动应用 + 2、设置属性font参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_font_009', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_009 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont009") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_009 finish.`); + done() + }) + + /* +* @tc.number ArkUI_Tabs_LabelStyle_font_020 +* @tc.name ArkUI_Tabs_LabelStyle_font_020 +* @tc.desc 1、启动应用 + 2、设置属性font参数为异常值 + 3、重新设置正常值后重复步骤1和2 +*/ + it('ArkUI_Tabs_LabelStyle_font_020', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_020 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont020") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStylefont020_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_020 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_006 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_006 + * @tc.desc font: {size: -1} + */ + it('ARKUI_TABS_LABELSTYLE_FONT_006', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_006 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont006") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_006 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_019 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_019 + * @tc.desc font: undefined + */ + it('ARKUI_TABS_LABELSTYLE_FONT_019', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_019 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont019") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_019 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_001 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_001 + * @tc.desc font: {size: 20} + */ + it('ARKUI_TABS_LABELSTYLE_FONT_001', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_001 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont001") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont001_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_001 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_003 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_003 + * @tc.desc font: {size: 50%} + */ + it('ARKUI_TABS_LABELSTYLE_FONT_003', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_003 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont003") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont003_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_003 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_004 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_004 + * @tc.desc font: {size: 10} + */ + it('ARKUI_TABS_LABELSTYLE_FONT_004', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_004 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont004") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont004_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_004 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_018 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_018 + * @tc.desc font: {size: 10} + */ + it('ARKUI_TABS_LABELSTYLE_FONT_018', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_018 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont018") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont018_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_018 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_017 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_017 + * @tc.desc style:FontStyle.Normal + */ + it('ARKUI_TABS_LABELSTYLE_FONT_017', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_017 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont017") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont017_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_017 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_013 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_013 + * @tc.desc weight:200 + */ + it('ARKUI_TABS_LABELSTYLE_FONT_013', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_013 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont013") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont013_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_013 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_012 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_012 + * @tc.desc weight: FontTeight.Bolder + */ + it('ARKUI_TABS_LABELSTYLE_FONT_012', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_012 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont012") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont012_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_012 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..50df4505f457169bd9cb023f924b37aae115f956 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets @@ -0,0 +1,87 @@ +/* + * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function ArkUITabsSingleSelectedcolor() { + + describe('ArkUITabsSingleSelectedcolor', () => { + /* + * @tc.number ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 + * @tc.name ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 + * @tc.desc selectedColor: "rgb(255,100,255)" + */ + it('ARKUI_TABS_SINGLE_SELECTEDCOLOR_011', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 start.`); + Settings.createWindow("testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor011") + await Utils.sleep(2000) + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_SINGLE_SELECTEDCOLOR_002 + * @tc.name ARKUI_TABS_SINGLE_SELECTEDCOLOR_002 + * @tc.desc selectedColor: Color.White + */ + it('ARKUI_TABS_SINGLE_SELECTEDCOLOR_002', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_002 start.`); + Settings.createWindow("testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor002") + await Utils.sleep(2000) + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_002 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_SINGLE_SELECTEDCOLOR_005 + * @tc.name ARKUI_TABS_SINGLE_SELECTEDCOLOR_005 + * @tc.desc selectedColor: Color.Green + */ + it('ARKUI_TABS_SINGLE_SELECTEDCOLOR_005', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_005 start.`); + Settings.createWindow("testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor005") + await Utils.sleep(2000) + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_005 finish.`); + done() + }) /* + * @tc.number ARKUI_TABS_SINGLE_SELECTEDCOLOR_008 + * @tc.name ARKUI_TABS_SINGLE_SELECTEDCOLOR_008 + * @tc.desc selectedColor: 0xffffff + */ + it('ARKUI_TABS_SINGLE_SELECTEDCOLOR_008', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_008 start.`); + Settings.createWindow("testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor008") + await Utils.sleep(2000) + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_008 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..cb90a868a6f555e5f0c2f8ac4310ce9d9eb771ff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets @@ -0,0 +1,42 @@ +/* + * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function ArkUITabsSingleUnselectedcolor() { + + describe('ArkUITabsSingleUnselectedcolor', () => { + /* + * @tc.number ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 + * @tc.name ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 + * @tc.desc selectedColor: Color.Transparent + */ + it('ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 start.`); + Settings.createWindow("testability/pages/ArkUITabsSingleUnselectedcolor/ArkUITabsSingleUnselectedcolor003") + await Utils.sleep(2000) + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..60afbf12b9eabdc4f3d0fe3375a6ec0824d79360 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkUITabsVertical() { + + describe('ArkUITabsVertical', () => { + + /* + * @tc.number ArkUI_Tabs_vertical_001 + * @tc.name ArkUI_Tabs_vertical_001 + * @tc.desc 1、启动应用 + 2、设置属性vertical参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_vertical_001', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_vertical_001 start.`); + Settings.createWindow("testability/pages/ArkUITabsVertical/ArkUITabsVertical001") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button1 :Component = await driver.findComponent(ON.id('ArkUITabsVertical001_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_vertical_001 finish.`); + done() + }) + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..e2b67bdc172852aa4e57d4a08a69a6c80abed03b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function FunctionJichuWaterFlow() { + + describe('FunctionJichuWaterFlow', () => { + + + /* + * @tc.number SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350 + * @tc.name SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350 + * @tc.desc 1、安装hap包 + 2、打开应用 + */ + it('SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350 start.`); + Settings.createWindow("testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_FUNCTION_JICHU_WATERFLOW_001806 +* @tc.name SUB_ACE_FUNCTION_JICHU_WATERFLOW_001806 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的参数:设置参数footer +*/ + it('SUB_ACE_FUNCTION_JICHU_WATERFLOW_001806', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_001806 start.`); + Settings.createWindow("testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow001806") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(100) + let refreshListItem0 :Component = await driver.findComponent(ON.id('FunctionJichuWaterFlow001806_001')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y-400) + await Utils.sleep(1000) + await driver.swipe(pos.x,pos.y,pos.x,pos.y-400) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_001806 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..5ddd57d3cee145b8be6a2f0336dfc5530f683841 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets @@ -0,0 +1,85 @@ +/* + * 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 UIComponentNavTabsOnWillShow from './UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test'; +import UIComponentNavTabsContentAdapt from './UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test'; +import ArkUITabScrollable from './ArkUITabScrollableTest/ArkUITabScrollable.test'; +import ArkUITabsLabelStylefont from './ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test'; +import ArkUITabsLabelStyleSelectedColor from './ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test'; +import ArkUITabsLabelStyleUnselectedColor from './ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test'; +import UIComponentListAndGridWaterFlowAdd from './UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test'; +import UIComponentListAndGridWaterSections from './UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test'; +import UIComponentNavModifier from './UIComponentNavModifierTest/UIComponentNavModifier.test'; +import UIComponentNavTabsAction from './UIComponentNavTabsActionTest/UIComponentNavTabsAction.test'; +import UIComponentNavTabsBlurStyle from './UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test'; +import UIComponentNavTabsCachedCount from './UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test'; +import UIComponentNavTabsImproTrace from './UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test'; +import UIComponentNavTabsInterception from './UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test'; +import UIComponentNavTabsInterface from './UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test'; +import UIComponentNavTabsMirror from './UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test'; +import UIComponentTabTabBarSymbol from './UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test'; +import UIComponentOtherRefreshPromptText from './UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test'; +import UIComponentOtherRefreshInterface from './UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test'; +import UIComponentOtherRefreshInterAction from './UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test'; +import UIComponentOtherRefreshAbility from './UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test'; +import FunctionJichuWaterFlow from './FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test'; +import UIComponentNavTabsSubTabbarStyle from './UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test'; +import ArkUITabsVertical from './ArkUITabsVerticalTest/ArkUITabsVertical.test'; +import UIComponentNavTabsHeight from './UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test'; +import UIComponentNavTabsWidth from './UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test'; +import UIComponentNavTabsEdgeeffect from './UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test'; +import UIComponentNavTabsExpandsafearea from './UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test'; +import ArkUITabsIconStyleSelectedColor from './ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test'; +import ArkUITabsIconStyleUnselectedColor from './ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test'; +import ArkUITabsSingleSelectedcolor from './ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test'; +import ArkUITabsSingleUnselectedcolor from './ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test'; + +export default function testsuite() { + + UIComponentNavTabsOnWillShow(); + UIComponentNavTabsContentAdapt(); + ArkUITabScrollable(); + ArkUITabsLabelStylefont(); + ArkUITabsLabelStyleSelectedColor(); + ArkUITabsLabelStyleUnselectedColor(); + UIComponentListAndGridWaterFlowAdd(); + UIComponentListAndGridWaterSections(); + UIComponentNavModifier(); + UIComponentNavTabsAction(); + UIComponentNavTabsBlurStyle(); + UIComponentNavTabsCachedCount(); + UIComponentNavTabsImproTrace(); + UIComponentNavTabsInterception(); + UIComponentNavTabsInterface(); + UIComponentNavTabsMirror(); + UIComponentTabTabBarSymbol(); + UIComponentOtherRefreshPromptText(); + UIComponentOtherRefreshInterface(); + UIComponentOtherRefreshInterAction(); + UIComponentOtherRefreshAbility(); + FunctionJichuWaterFlow(); + UIComponentNavTabsSubTabbarStyle(); + ArkUITabsVertical(); + UIComponentNavTabsHeight(); + UIComponentNavTabsWidth(); + UIComponentNavTabsEdgeeffect(); + UIComponentNavTabsExpandsafearea(); + ArkUITabsIconStyleSelectedColor(); + ArkUITabsIconStyleUnselectedColor(); + ArkUITabsSingleSelectedcolor(); + ArkUITabsSingleUnselectedcolor(); + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceTest/UIAttributeFontInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceTest/UIAttributeFontInterface001.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..4323724a542410ab5407ad756b38c2f9d4048e94 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeFontInterfaceTest/UIAttributeFontInterface001.test.ets @@ -0,0 +1,52 @@ +/* + * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' + +/* + * SUB_ACE_UI_ATTRIBUTES_FONT_INTERFACE_0010:设置文本颜色 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UIAttributeFontInterface001() { + + describe('UIAttributeFontInterface001', () => { + + it('SUB_ACE_UI_ATTRIBUTES_FONT_INTERFACE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_FONT_INTERFACE_0010 start.`); + Settings.createWindow("testability/pages/UIAttributeFontInterface/UIAttributeFontInterface001") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_FONT_INTERFACE_0010 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..60f88eae7f2cd19c24f4b358609875b5c652dbe9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentListAndGridWaterFlowAdd() { + + describe('UIComponentListAndGridWaterFlowAdd', () => { + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0270_011 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0270_011 + * @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性: + .columnsTemplate("1fr 1fr") + .itemConstraintSize({minWidth:'0%',maxWidth:'50%',minHeight:'0%',maxHeight:'100%'}) + 3.编译安装demo + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0270_011', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0270_011 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0270011") + await Utils.sleep(1000) + + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0270_011 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0130_072 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0130_072 + * @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:columnsGap(“”) + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0130_072', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0130_072 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0130072") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0130_072 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0140_666 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0140_666 + * @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:columnsGap(10) + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0140_666', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0140_666 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0140666") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0140_666 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0160_890 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0160_890 + * @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:columnsGap('5vp') +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0160_890', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0160_890 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0160890") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0160_890 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0150_827 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0150_827 + * @tc.desc 1、添加Waterflow组件 + 2、在string.json里设置string: + "name":'width_20","value':“20" + 3、设置Waterflow的属性:columnsGap($r(app.string.width_20')) + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0150_827', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0150_827 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0150827") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0150_827 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0170_444 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0170_444 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:columnsGap("abc") +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0170_444', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0170_444 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0170444") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0170_444 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0280_056 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0280_056 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:rowsGap(“”) +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0280_056', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0280_056 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0280056") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0280_056 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0290_223 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0290_223 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:rowsGap(10) +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0290_223', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0290_223 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0290223") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0290_223 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0300_414 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0300_414 +* @tc.desc 1、添加Waterflow组件 + 2、在string.json里设置string + "name":"height_20°,"value':‘20° + 3、设置Waterflow的属性:rowsGap($r('app.string.height_20')) +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0300_414', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0300_414 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0300414") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0300_414 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0310_330 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0310_330 + * @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:rowsGap('5vp') + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0310_330', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0310_330 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0310330") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0310_330 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0320_534 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0320_534 + * @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:rowsGap('abc') + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0320_534', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0320_534 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0320534") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0320_534 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0080_458 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0080_458 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflov的属性: + columnsTemplate("1fr 1fr") + rowsTemplate("1fr 1fr 1fr') + layoutDirection(FlexDirection.ColumnReverse) +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0080_458', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0080_458 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0080458") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0080_458 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0090_321 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0090_321 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflov的属性: + columnsTemplate("1fr 1fr") + rowsTemplate("1fr 1fr 1fr') + layoutDirection(FlexDirection.Column) +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0090_321', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0090_321 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0090321") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0090_321 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0100_678 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0100_678 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性: + columnsTemplate(”1fr 1fr") + rowsTemplate(“ifr 1fr 1fr”) + layoutDirection(FlexDirection.RowReverse) +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0100_678', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0100_678 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0100678") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0100_678 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0110_972 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0110_972 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性: + columnsTemplate(”1fr 1fr") + rowsTemplate(“ifr 1fr 1fr”) + layoutDirection(FlexDirection.Row) +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0110_972', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0110_972 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0110972") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0110_972 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0120_725 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0120_725 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性: + colunnsTenplate(”1fr 1fr") + rowsTemplate(“1fr lfr 1fr') + 不设置layoutDirection +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0120_725', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0120_725 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0120725") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0120_725 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..0bd9f7c778dbe844413096c0c1d2d53ffcbd3ec4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets @@ -0,0 +1,295 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentListAndGridWaterSections() { + + describe('UIComponentListAndGridWaterSections', () => { + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0560 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0560 + * @tc.desc 1、创建分组瀑布流 + 2、splice方法中替换的分组不设置返回高 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0560', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0560 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0560") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0560_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0560 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0380 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0380 + * @tc.desc 1、创建分组瀑布流 + 2、push进一个分组 + 3、改变分组的columnsGap +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0380', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0380 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0380") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0380_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0380_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0380 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0370 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0370 +* @tc.desc 1、创建分组瀑布流 + 2、push进一个分组 + 3、改变分组的crossCount +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0370', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0370 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0370") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0370_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0370_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0370 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0390 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0390 +* @tc.desc 1、创建分组瀑布流 + 2、push进一个分组 + 3、改变分组的crossCount +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0390', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0390 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0390") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0390_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0390_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0390 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0410 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0410 + * @tc.desc 1、创建分组瀑布流 + 2、push进一个分组 + 3、改变分组的margin +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0410', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0410 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0410") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0410_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0410_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0410 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0400 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0400 + * @tc.desc 1、创建分组瀑布流 + 2、push进一个分组 + 3、改变分组的rowsGap +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0400', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0400 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0400") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0400_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0400_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0400 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0420 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0420 + * @tc.desc 1、创建分组瀑布流 + 2、push进一个分组 + 3、改变分组的返回高度 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0420', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0420 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0420") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0420_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0420_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0420 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0500 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0500 + * @tc.desc 1、创建分组瀑布流,不设置crossCount + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0500', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0500 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0500") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0500 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0510 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0510 + * @tc.desc 创建分组瀑布流,不设置columnsGap + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0510', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0510 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0510") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0510 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0520 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0520 + * @tc.desc 创建分组瀑布流,不设置rowsGap + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0520', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0520 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0520") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0520 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0530 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0530 +* @tc.desc 创建分组瀑布流,不设置margin +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0530', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0530 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0530") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0530 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0540 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0540 + * @tc.desc 1、创建分组瀑布流 + 2、push进一个分组 + 3、改变分组的返回高度 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0540', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0540 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0540") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0540_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0540 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..12e9b46a299fc7bf8c4a3c3f58caf88fc3e9c9d5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets @@ -0,0 +1,484 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentNavModifier() { + + describe('UIComponentNavModifier', () => { + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 + * @tc.desc 1、添加Tabs组件 + 2、分割线设置为0xFF0000 + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier046") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0530 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0530 + * @tc.desc 1、添加Tabs组件 + 2、设置endMargin(-10) + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0530', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0530 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier053") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier053_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0530 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0560 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0560 + * @tc.desc 1、添加Tabs组件 + 2、设置endMargin(-10) + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0560', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0560 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier056") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier056_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0560 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0580 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0580 + * @tc.desc 1、添加Tabs组件 + 2、设置endMargin(-10) + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0580', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0580 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier058") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier058_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0580 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0830 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0830 + * @tc.desc 1、添加Tabs组件 + 2、barWidth设置为Resource + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0830', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0830 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier083") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier083_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0830 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0480 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0480 + * @tc.desc 1、添加Tabs组件 + 2、分割线设置为0xffc0cb + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0480', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0480 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier048") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0480 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0450 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0450 + * @tc.desc 1、添加Tabs组件 + 2、分割线设置为Color.Blue + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0450', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0450 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier045") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0450 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0410 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0410 + * @tc.desc 1、添加Tabs组件 + 2、strokeWidth设置为string类型 + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0410', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0410 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier041") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier041_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0410 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0440 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0440 + * @tc.desc 1、添加Tabs组件 + 2、strokeWidth设置为Resource类 + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0440', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0440 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier044") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier044_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0440 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0430 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0430 +* @tc.desc 1、添加Tabs组件 + 2、分割线设置为Color.Blue +*/ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0430', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0430 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier043") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier043_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0430 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0600 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0600 + * @tc.desc 1、添加Tabs组件 + 2、fadingEdge设置为false + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0600', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0600 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier060") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0600 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0650 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0650 + * @tc.desc 1、添加Tabs组件 + 2、背景色设置为’#ffffff’ + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0650', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0650 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier065") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier065_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0650 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0630 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0630 + * @tc.desc 1、添加Tabs组件 + 2、背景色设置为’#ffffff’ + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0630', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0630 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier063") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier063_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0630 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0660 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0660 + * @tc.desc 1、添加Tabs组件 + 2、背景色设置为’#ffffff’ +*/ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0660', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0660 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier066") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier066_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0660 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0810 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0810 + * @tc.desc 1、添加Tabs组件 + 2、设置barWidth为'100% + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0810', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0810 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0810") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0810 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0770 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0770 + * @tc.desc 1、添加Tabs组件 + 2、设置barWidth为负值 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0770', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0770 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0770") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0770 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0860 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0860 +* @tc.desc 1、添加Tabs组件 + 2、设置barHeight为250 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0860', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0860 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0860") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0860 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0840 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0840 + * @tc.desc 1、添加Tabs组件 + 2、设置barHeight为小于0的数 + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0840', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0840 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0840") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0840 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0900 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0900 + * @tc.desc 1、添加Tabs组件 + 2、设置animationDuration设置为小于0 + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0900', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0900 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0900") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('blue')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2: Component = await driver.findComponent(ON.id('green')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0900 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0920 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0920 + * @tc.desc 1、添加Tabs组件 + 2、设置animationDuration设置为百分比 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0920', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0920 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0920") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('blue')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2: Component = await driver.findComponent(ON.id('green')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0920 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0370 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0370 +* @tc.desc 1、添加Tabs组件 + 2、barGridAlign设置为gutter +*/ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0370', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0370 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0370") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier0370_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavModifier0370_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0370 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0380 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0380 + * @tc.desc barGridAlign设置为sm + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0380 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0380") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0380 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0130 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0130 + * @tc.desc barGridAlign设置为lg + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0400 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0400") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0400 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..9c7a17f444b30e9d3ddceef1830970449312938a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsAction() { + + describe('UIComponentNavTabsAction', () => { + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0011 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0011 + * @tc.desc 1、添加Tabs组件 + 2、设置多个TabContent + 3、多次改变窗口大小,切换前后台 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0011', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0011 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0011") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsAction0011_002')); + await Utils.sleep(200) + await button.click() + await Utils.sleep(200) + await button.click() + await Utils.sleep(1000) + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsAction0011_001')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+100,pos.y,pos.x-300,pos.y) + await Utils.sleep(1000) + let pos1 = await tabsCenter.getBoundsCenter() + await driver.swipe(pos1.x-100,pos1.y,pos1.x+300,pos1.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0011 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0030 + * @tc.desc 1、在pink页面点击 + 2、点击页签切换页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0030") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabBar1:Component = await driver.findComponent(ON.id('Pink')); + await Utils.sleep(100) + await tabBar1.click() + await Utils.sleep(100) + let tabBar2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(100) + await tabBar2.click() + await Utils.sleep(100) + await tabBar1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0030 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0012 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0012 + * @tc.desc 1、添加tabs组件设置100个子组件 + 2、点击页签切换页面 + 3、滑动页面切换 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0012', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0012 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0012") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabBar:Component = await driver.findComponent(ON.id('tab1')); + await Utils.sleep(1000) + await tabBar.click() + await Utils.sleep(1000) + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsAction0012_001')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await Utils.sleep(100) + + await driver.swipe(pos.x-100,pos.y,pos.x+356,pos.y) + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0012 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..e5dabdb4539a51fcdee9aad9e8d08db5c89be36e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets @@ -0,0 +1,1645 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsBlurStyle() { + + describe('UIComponentNavTabsBlurStyle', () => { + + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0016 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0016 +* @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0016', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0016 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0016") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0016 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0015 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0015 +* @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0015', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0015 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0015") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0015 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0014 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0014 +* @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0014', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0014 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0014") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0014 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0013 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0013 +* @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0013', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0013 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0013") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0013 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0012 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0012 + * @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0012', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0012 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0012") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0012 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0017 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0017 + * @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0017', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0017 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0017") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(100) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0017 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0011 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0011 + * @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0011', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0011 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0011") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(100) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0011 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0010 + * @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0010") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(100) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0050 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置barOverlap(true) + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(50) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0050 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0050") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0049 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0049 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置barOverlap(true) + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(100) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0049', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0049 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0049") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0049 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0048 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0048 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度,设置 + TabBar背景颜色为backgroundColor(0xF5F5F5),设置barOverlap(true) + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、设置分割线线宽为strokeWidth(1),颜色为红色 + 4、添加padding设置为10vp + 5、添加按钮Button(“关闭模糊效果),添加点击效果,backgroundBlurStyle参数设置为NONE + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0048', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0048 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0048") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0048_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0048_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0048 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0042 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0042 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Fixed),所有TabBar平均分配barWidth宽度;设置 + SelecteMode =Selectedlode.BOARD + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(50) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0042', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0042 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0042") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0042 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0046 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0046 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Fixed),所有TabBar平均分配barWidth宽度; + * 设置Selectedlode =Selectedlode.BOARD; + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green + 3、添加padding设置为10vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0046', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0046 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0046") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0046 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0043 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0043 + * @tc.desc 1、设置Tabs组件barMode(Barode.Scrollable),使得每一个TabBar均使用实际布局宽度; + 设置Selectedllode =Selectedlode.BOARD,BarMode参数设为Scrollable + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barVidth(80) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0043', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0043 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0043") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0043 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0045 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0045 + * @tc.desc 1、设置Tabs组件barMode(Barode.Scrollable),使得每一个TabBar均使用实际布局宽度;设置Selectedilode =Selectedlode.BOARD; + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green + 3、添加padding设置为10vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0045', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0045 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0045") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0045 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0044 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0044 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度; + * 设置Selectedllode =Selectedllode.BOARD + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barHeight(300) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0044', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0044 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0044") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0044 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0038 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0038 + * @tc.desc 1、设置Tabs组件barMode(Bar)ode.Scrollable),使得每一个TabBar均使用实际布局宽度 + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green + 3、添加padding设置为10vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0038', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0038 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0038") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0038 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0041 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0041 + * @tc.desc 1、设置Tabs组件barMode(BarIode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置barOverlap(true) + * 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(50) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0041', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0041 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0041") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0041 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0040 + * @tc.desc 1、设置Tabs组件barMode(BarIode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置barOverlap(true) + * 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(100) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0040") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0039 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0039 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置barOverlap(true) + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、设置分割线线宽为strokeWidth(1),颜色为红色 + 4、添加padding设置为10vp + 5、添加按钮Button(“关闭模糊效果),添加点击效果,backgroundBlurStyle参数设置为NONE + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0039', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0039 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0039") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0039_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0039_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0039 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0033 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0033 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Fixed),所有TabBar平均分配barWidth宽度; + * 设置Selectedllode =Selectedlode.BOARD + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、YellowBlue、Green、red、blue + 3、TabBar设置barWidth(50) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0033', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0033 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0033") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0033 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0034 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0034 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度; + * 设置Selectedilode =Selectedlode.BOARD,BarMode参数设为Scrollable + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(80) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0034', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0034 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0034") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0034 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0036 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0036 + * @tc.desc 1、设置Tabs组件barMode(Barode.Scrollable),使得每一个TabBar均使用实际布局宽度; + * 设置Selectedllode =Selectedlode.BOARD; + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green + 3、添加padding设置为10vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0036', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0036 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0036") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0036 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0035 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0035 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度; + * 设置Selectedllode =Selectedlode.BOARD + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barHeight(300) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0035', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0035 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0035") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0035 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0032 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0032 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度 + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green + 对Tabs组件添加Magin设置为12vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0032', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0032 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0032") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0032 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0031 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0031 + * @tc.desc 1、设置Tabs组件barMode(Barode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置bar0verlap(true) + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(50) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0031', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0031 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0031") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0031 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0030 + * @tc.desc 1、设置Tabs组件barMode(Barode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置bar0verlap(true) + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(100) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0030") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0029 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0029 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置barOverlap(true) + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、设置分割线线宽为strokeWidth(1),颜色为红色 + 4、添加padding设置为10vp + 5、添加按钮Button(“关闭模糊效果),添加点击效果,backgroundBlurStyle参数设置为NONE + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0029', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0029 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0029") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0029_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0029_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0029 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0018 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0018 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0018', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0018 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0018") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0018_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0018 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0019 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0019 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0019', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0019 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0019") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0019_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0019 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0020 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0020") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0020 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0021 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0021 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0021', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0021 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0021") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0021 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0022 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0022 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0022', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0022 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0022") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0022 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0023 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0023 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0023', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0023 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0023") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0023 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0024 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0024 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0024', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0024 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0024") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0024 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0025 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0025 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0025', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0025 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0025") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0025 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0026") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0027 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0027 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0027', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0027") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0027 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0028 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0028 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0028', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0028 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0028") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0028 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0047 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0047 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0047', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0047 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0047") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0047 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0051 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0051 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0051', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0051 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0051") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0051 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0052 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0052 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0052', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0052 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0052") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0052 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0053 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0053 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0053', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0053 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0053") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0053 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0060 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0060") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0060 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0080 + * @tc.desc nav width +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0080") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0080 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0100 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0100 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0100") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0100 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0110 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0110 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0110 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0110") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0110 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0160 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0160") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0160 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0170 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0170 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0170") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0170 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0180 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0180 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0180") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0180 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0190 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0190 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0190 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0190") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0190 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0200 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0200 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0200', 0, async (done: Function) => { + Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0200 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0200") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0200 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0210 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0210 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0210', 0, async (done: Function) => { + Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0210 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0210") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0210 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0220 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0220 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0220', 0, async (done: Function) => { + Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0220 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0220") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0220 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0230 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0230 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0230 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0230") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0230 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0240 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0240 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0240 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0240") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0240 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0250 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0250 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0250 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0250") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0250 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0260 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0260 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0260 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0260") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0260 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0270 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0270 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0270 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0270") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0270 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0280 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0280 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0280 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0280") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0280 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0290 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0290 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0290 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0290") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0290 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0300 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0300 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0300 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0300") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0300 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0310 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0310 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0310 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0310") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0310 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0320 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0320 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0320 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0320") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0320 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0340 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0340 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0340 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0340") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0340 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0350 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0350 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0350 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0350") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0350 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0360 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0360 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0360 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0360") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0360 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0370 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0370 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0370 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0370") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0370 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0380 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0380 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0380 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0380") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0380 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0390 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0390 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0390 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0390") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0390 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0400 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0400 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0400 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0400") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0400 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..764434b8c2b2c931b4e999d6ff9f380ce62b05fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsCachedCount() { + + describe('UIComponentNavTabsCachedCount', () => { + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 + * @tc.desc 1、创建tabs,设置BarPosition.Start 2、设置preloadItens[1,3] + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount014") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabs014_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150 + * @tc.desc 1、创建tabs,设置BarPosition.End 2、设置preloadItens[1,3] + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabs015_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160 + * @tc.desc 1、创建tabs,设置BarPosition动态改变 + 2、设置preloadItens[1,3] + 3、动态切换BarPosition + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount016") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabs016_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..2cf0a074255dab4bb0c450dc5eb0aca3e305bd01 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets @@ -0,0 +1,699 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsContentAdapt() { + + describe('UIComponentNavTabsContentAdapt', () => { + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0310 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0310 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0310', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0310 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0310") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabBar1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0310_001')); + await Utils.sleep(1000) + await tabBar1.click() + await Utils.sleep(1000) + await tabBar1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0310 finish.`); + done() + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0010 + * @tc.desc 创建横向tabs(BarPosition.Start),设置width为auto,设置每个页面宽度不同 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt001") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0020 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0020 + * @tc.desc 创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt002") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0030 + * @tc.desc 创建横向tabs(BarPosition.End),设置height为auto,设置每个页面高度不同 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt003") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0040 + * @tc.desc 创建横向tabs(BarPosition.End),设置width为auto,设置每个页面宽度不同 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt004") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0100 + * @tc.desc 1、创建纵向tabs(BarPosition.Start),设置width为auto,设置每个页面宽度不同 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0100 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt010") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0100 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0110 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0110 + * @tc.desc 1、创建纵向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0110 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt011") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0110 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0120 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0120 + * @tc.desc 1、创建纵向tabs(BarPosition.End),设置height为auto,设置每个页面高度不同 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt012") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0130 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0130 + * @tc.desc 1、创建纵向tabs(BarPosition.End),设置width为auto,设置每个页面宽度不同 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt013") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0130 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0330 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0330 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同,设置barPosition可以动态切换 + 2、动态切换barPosition属性观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0330', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0330 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt033") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabs033_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0330 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0340 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0340 + * @tc.desc 1、创建纵向tabs(BarPosition.Start),设置width可以动态切换(200、‘auto'、‘100%、-100) + 2、动态切换观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0340', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0340 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt034") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt034_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt034_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + let button3:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt034_003')); + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(1000) + let button4:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt034_004')); + await Utils.sleep(1000) + await button4.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0340 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0350 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0350 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height可以动态切换入参(300、‘auto',50%’、-1) + 2、动态切换观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0350', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0350 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt035") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt035_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button3:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt035_002')); + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(1000) + let button4:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt035_003')); + await Utils.sleep(1000) + await button4.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt035_004')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0350 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0070 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height可以动态切换入参(300、‘auto',50%’、-1) + 2、动态切换观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt007") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt007_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt007_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + let button3:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt007_003')); + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(1000) + let button4:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt007_004')); + await Utils.sleep(1000) + await button4.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0070 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0320 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0320 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置width和height为auto,设置每个页面高度、宽度不同,设置vertical可以动态切换 + 2、动态切换vertical属性观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0320', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0320 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt032") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt032_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0320 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0140 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0140 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同,scrollable属性设置为false + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt014") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0270 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0270 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同,设置divider大小可以动态改变 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0270', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0270 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt027") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt027_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt027_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0270 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0280 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0280 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同, + * 设置divider可以动态改变颜色、前后Margin + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0280', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0280 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt028") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt028_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt028_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + let button3:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt028_003')); + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(1000) + let button4:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt028_004')); + await Utils.sleep(1000) + await button4.click() + await Utils.sleep(1000) + let button5:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt028_005')); + await Utils.sleep(1000) + await button5.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0280 finish.`); + done() + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0300 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0300 +* @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto, + 设置每个页面高度不同,设置barOverlap为true + 2、编译安装查看效果 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0300', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0300 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt030") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0300 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0080 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同;设置border可以改变 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0080") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0080_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0080_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0050 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0050 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同;设置border可以改变 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0050 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0050") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0210 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0210 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto + 2、页签为BottomTabbarStyle样式,动态切换barheight观察自适应情况 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0210', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0210 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0210") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0210_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0210 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0150 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0150 +* @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto + 2、页签为BottomTabbarStyle样式,动态切换barwidth观察自适应情况 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0150") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0150_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0240 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0240 + * @tc.desc 1、创建纵向tabs(BarPosition.Start),设置width为auto + 2、页签为BottomTabbarStyle样式,动态切换barheight观察自适应情况 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0240', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0240 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0240") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0240_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0240 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0180 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0180 + * @tc.desc 1、创建纵向tabs(BarPosition.Start),设置width为auto + 2、页签为BottomTabbarStyle样式,动态切换barwidth观察自适应情况 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0180', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0180 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0180") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0180_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0180 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0220 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0220 + * @tc.desc 横向 tabs(BarPosition.Start), height: auto, change barheight + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0220 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0220") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0220_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0220 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0160 + * @tc.desc 横向 tabs(BarPosition.Start), height: auto, change barwidth + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0160") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0160_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0160 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0250 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0250 + * @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barheight + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0250 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0250") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0250_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0250 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0190 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0190 + * @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barwidth + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0190 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0190") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0190_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0190 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0170 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0170 + * @tc.desc 横向 tabs(BarPosition.Start), height: auto, change barwidth + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0170 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0170") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0170_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0170 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0200 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0200 + * @tc.desc 纵向 tabs(BarPosition.Start), height: auto, change barwidth + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0200 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0200") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0200_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0200 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0230 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0230 + * @tc.desc 横向 tabs(BarPosition.Start), height: auto, change barheight + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0230 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0230") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0230_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0230 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0260 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0260 + * @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barheight + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0260 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0260") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0260_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0260 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..c40fb8c1875d17bc8c262d644cbe1c6663924561 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets @@ -0,0 +1,55 @@ +/* + * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsEdgeeffect() { + + describe('UIComponentNavTabsEdgeeffect', () => { + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0230") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0270 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0270 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0270 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0270") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0270 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..0133ea895f8fb1fdeb9c85e5e9029a6e1ac82585 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets @@ -0,0 +1,198 @@ +/* + * opyright (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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsExpandsafearea() { + + describe('UIComponentNavTabsExpandsafearea', () => { + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0090") + await Utils.sleep(2000) + // let driver: Driver = Driver.create() + // let button: Component = await driver.findComponent(ON.id('UIComponentTabTabbarTabbarsymbol0050_001')) + // await button.click() + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0010") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0120 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0120 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0120") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0120 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0050 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0050 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0050 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0050") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0050 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0080 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0080") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0080 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0070 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0070") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0070 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0060 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0060 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0060 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0060") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0060 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0040 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0040") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0040 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0030 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0030") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0030 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0020 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0020 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0020") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0020 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0100 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0100 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0100") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0100 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0110 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0110 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0110 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0110") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0110 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..aad3189a1be0291fbf0d0170441db0c00781eb86 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsHeight() { + + describe('UIComponentNavTabsHeight', () => { + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 +* @tc.desc 1、创建tabs组件,设置tabs组件height为auto + 2、动态切换观察效果 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsHeight/UIComponentNavTabsHeight001") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..ebabf71df0bd7811fd4ea809df34b7dce2e32766 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets @@ -0,0 +1,354 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsImproTrace() { + + describe('UIComponentNavTabsImproTrace', () => { + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0150 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、使用index切换页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0150") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0150_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0150_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0140 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、使用changeindex切换页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0140") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0140_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0140_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0120 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、更改tabscontent宽高 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0120") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0120_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0120_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0080 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、横竖屏旋转 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0080") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0080_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0080_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0040 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、滑动页签 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0040_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0040_002')); + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+250,pos.x-350,pos.y+250) + await Utils.sleep(1000) + await driver.swipe(pos.x,pos.y+250,pos.x+350,pos.y+250) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0060 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、滑动页签边缘, 触发边缘回弹效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0060") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0060_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0060_002')); + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+250,pos.x+200,pos.y+250) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0070 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、滑动页面切换页签 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0070") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0070_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0070_002')); + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+300,pos.y,pos.x-300,pos.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0030 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、点击不同页签切换页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0030") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0030_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let tabBar:Component = await driver.findComponent(ON.id('2')); + await Utils.sleep(1000) + await tabBar.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0020 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、自定义页签 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0020") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0020 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0160 + * @tc.desc 1、设置不同初始index值 + 2、设置不同的vertical(排列方向)、barMode(布局模式)、barHeight(页签高度)、barGridAlign(栅格)、direction(镜像)等属性 + 3、设置不同的页签样式,包括子页签、底部页签(image、svg、symbol格式)、自定义页签等,设置不同页签属性,如selectedMode、layoutMode、symmetricExtensible等 + 4、进入页面查看 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0160', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0160") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(100) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_002')); + await Utils.sleep(500) + await button2.click() + await Utils.sleep(100) + let button3:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_003')); + await Utils.sleep(500) + await button3.click() + await Utils.sleep(100) + let button4:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_004')); + await Utils.sleep(500) + await button4.click() + await Utils.sleep(100) + let button5:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_005')); + await Utils.sleep(500) + await button5.click() + await Utils.sleep(100) + let button6:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_006')); + await Utils.sleep(500) + await button6.click() + await Utils.sleep(100) + let button7:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_007')); + await Utils.sleep(500) + await button7.click() + await Utils.sleep(100) + let button8:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_008')); + await Utils.sleep(500) + await button8.click() + await Utils.sleep(100) + let button9:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_009')); + await Utils.sleep(500) + await button9.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0160 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0130 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0130 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、镜像测试 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0130") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0130_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0130_002')); + await Utils.sleep(500) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0010 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、首次进入页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0010") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0010 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..e30fe0a5afa1508c0979cc14c8e1a4cf22feb6db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets @@ -0,0 +1,295 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsInterception() { + + describe('UIComponentNavTabsInterception', () => { + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0130 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0130 + * @tc.desc 1、创建纵向Tabs包含5个TabContent,index=0 + 2、设置onContentWil1Change接口,如果comingIndex为3,return false,编译安装 + 3、手指滑动素引2页到素引3页 + 4、手指滑动素引4页到素引3页 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0130") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0130_001')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y,pos.x-56,pos.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0040 + * @tc.desc 1、创建Tabs包合5个TabContent,index=0 + 2、设置onContentVillChange接口,如果comingIndex为3,return false; + 设置TabsController.changeIndex。编译安装 + 3、点击按钮切换到素引3的页签(调用changeIndex) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0040_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0060 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0060 + * @tc.desc 1、创建Tabs包合5个TabContent,index=0 + 2、设置onContentVillChange接口,如果comingIndex为3,return false; + 设置TabsController.changeIndex。编译安装 + 3、点击按钮切换到素引3的页签(调用changeIndex) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0060 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0060") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0060_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0080 + * @tc.desc 1、创建Tabs包合5个TabContent,index=0 + 2、设置onContentVillChange接口,如果comingIndex为3,return false; + 设置TabsController.changeIndex。编译安装 + 3、点击按钮切换到素引3的页签(调用changeIndex) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0080") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabBar:Component = await driver.findComponent(ON.id('我的')); + await Utils.sleep(1000) + await tabBar.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0050 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0050 + * @tc.desc 1、创建Tabs包含5个TabContent,index=0 + 2、设置onContentWillChange接口,如果comingIndex为3,return true; + 设置TabsController.changeIndex。编译安装 + 3、点击按钮切换到素引3的页签(调用changeIndex) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0050 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0050") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0050_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0050 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0070 + * @tc.desc 1、创建Tabs包含5个TabContent,index=0 + 2、设置onContentWillChange接口,如果comingIndex为3,return true; + 设置TabsController.changeIndex。编译安装 + 3、点击按钮切换到素引3的页签(调用changeIndex) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0070") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0070_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0010 + * @tc.desc 1、创建Tabs包含5个TabContent,index=0 + 2、设置onContentWillChange接口,如果currentIndex为2,coningIndex为3,return false,编译安装 + 3、手指滑动索引2页面到素引3页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0010") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0010_002')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0010_001')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+100,pos.y,pos.x-356,pos.y) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0030 + * @tc.desc 1、创建Tabs包含5个TabContent,index=3 + 2、设置onContentVil1Change接口,如果comingIndex为3,return true,编译安装 + 3、手指滑动素引2页到素引3页 + 4、手指滑动素引4页到索引3页 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0030") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0030_002')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0030_001')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x+100,pos.y,pos.x-356,pos.y) + await Utils.sleep(2000) + + let button4:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0030_004')); + await Utils.sleep(1000) + await button4.click() + await Utils.sleep(1000) + + await driver.swipe(pos.x-100,pos.y,pos.x+356,pos.y) + await Utils.sleep(1000) + + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0030 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0150 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0150 + * @tc.desc 1、创建Tabs包含5个TabContent,index=0,设置TabContent可动态改变个数 + 2、设置onContentWil1Change接口,如果comingIndex为3,return false,编译安装 + 3、点击按钮动态减少、增加TabContent + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0150") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0150_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0150_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0090 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0090 + * @tc.desc 1、创建Tabs包含5个TabContent,index=0 + 2、设置onContentWil1Change接口,如果comingIndex为3,return true,编译安装 + 3、点击素引3页的tabbar + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0090', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0090 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0090") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabBar:Component = await driver.findComponent(ON.id('我的')); + await Utils.sleep(1000) + await tabBar.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0090 finish.`); + done() + }) + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..826714182f47bfdb0b6470b6407a34dc0c625ce6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsInterface() { + + describe('UIComponentNavTabsInterface', () => { + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120 + * @tc.desc 1、添加Tabs组件 + 2、设置index:0 + 3、设置TabContent数量为4 + 4、设置barwidth超过容器宽度 + 6、不设置属性fadingEdge + 7、编译安装 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface012") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1190 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1190 + * @tc.desc 1、添加Tabs组件 + 2、添加TabContent + 3、设置选中位置为新添加的位置 + 4、编译安装 + 5、动态增加tab页签个数 + 6、观察选中状态的位置 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1190', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1190 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1190") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterface1190_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1190 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1220 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1220 + * @tc.desc 1、添加Tabs组件 + 2、添加TabContent + 3、第一个tabcontent右滑 + 4、边缘效果未结束前点击返回 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1220', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1220 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1220") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsInterface1220_001')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y,pos.x-100,pos.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1220 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..66e339f31b8f9cc6d50f0b85ff6ea41ee5e74db9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets @@ -0,0 +1,378 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsMirror() { + + describe('UIComponentNavTabsMirror', () => { + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0100 + * @tc.desc 1、创建横向tabs页签位置BarPosition.Start,设置barOverlap属性 + 2、设置direction可以动态改变 + 3、动态切换镜像方向观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0100 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror010") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror010_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0100 finish.`); + done() + }) + + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0070 + * @tc.desc 1、创建tabs布局方向可以动态改变更新转测版本,新建ets页面 + 2、设置direction可以动态改变 + 3、动态切换属性观察效果 + */ + it('SUB_ACE_UI_0OMPONENT_NAV_TABS_MIRROR_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_0OMPONENT_NAV_TABS_MIRROR_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0070") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0070_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_0OMPONENT_NAV_TABS_MIRROR_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0030 + * @tc.desc 1、创建横向tabs页签位置可以动态改变 + 2、设置direction可以动态改变 + 3、动态切换镜像方向观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0030") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0030_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0090 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0090 + * @tc.desc 1、创建横向tabs页签位置BarPosition.Start + 2、设置direction可以动态改变 + 3、动态切换镜像方向观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0090', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0090 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0090") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0090_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0090 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0110 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0110 + * @tc.desc 1、创建tabs,设置SubTabBarStyle样式 + 2、设置镜像效果 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0110 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0110") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0110_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0160 + * @tc.desc 1、创建tabs,设置SubTabBarStyle样式 + 2、设置镜像效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0160', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0160") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0160_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0160 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0120 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0120 + * @tc.desc 1、创建tabs,设置BottomTabBarStyle样式 + 2、设置镜像效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0120") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0120_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0120 finish.`); + done() + }) + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0140 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0140 + * @tc.desc 1、创建tabs,设置BottomTabBarStyle样式 + 2、设置镜像效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0140") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0140_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0130 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0130 + * @tc.desc 1、创建tabs,设置tabbar布局模式设为BarMode.Scrollable + 2、设置镜像效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0130") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0130_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0150 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0150 + * @tc.desc 1、创建tabs,tabbar设置padding动态改变 + 2、设置镜像效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0150") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0150_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0150_002')); + await Utils.sleep(500) + await button2.click() + await Utils.sleep(100) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0260 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0260 + * @tc.desc 1、创建tabs嵌套横向list + 2、设置镜像效果 + 3、切换页签 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0260', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0260 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0260") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabBar0:Component = await driver.findComponent(ON.id('Tab0')); + await Utils.sleep(1000) + await tabBar0.click() + await Utils.sleep(1000) + let tabBar1:Component = await driver.findComponent(ON.id('Tab1')); + await Utils.sleep(1000) + await tabBar1.click() + await Utils.sleep(1000) + await tabBar0.click() + await Utils.sleep(1000) + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0260_001')); + await Utils.sleep(200) + await button.click() + await Utils.sleep(200) + await button.click() + await Utils.sleep(200) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0260 finish.`); + done() + }) + + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0250 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0250 +* @tc.desc 1、创建tabs嵌套web + 2、设置镜像效果 + 3、切换页签 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0250', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0250 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0250") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0250_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0250 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0080 + * @tc.desc 1、创建tabs,设置divider的前后Margin动态改变 + 2、设置direction可以动态改变 + 3、动态切换属性观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror080") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror080_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror080_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + let button3:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror080_003')); + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(1000) + let button4:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror080_004')); + await Utils.sleep(1000) + await button4.click() + await Utils.sleep(1000) + let button5:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror080_005')); + await Utils.sleep(1000) + await button5.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0080 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..acfc595c35a3fcee873ac41bd734968ed43fc563 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsOnWillShow() { + + describe('UIComponentNavTabsOnWillShow', () => { + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0190 + * @tc.desc 1、创建tabs组件,包含子组件TabContent + 2、点击底部页签或侧边页签 +*/ + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0190', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0190 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0190") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('tab2')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('tab_2')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0190 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..577359a2b716e31c682a93610342017ec229f0fc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsSubTabbarStyle() { + + describe('UIComponentNavTabsSubTabbarStyle', () => { + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010 + * @tc.desc 1、创建tabs组件 + 2、页签为SubTabbarStyle样式,页签设置为svg图片+文本 + 3、切换页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsSubTabbarStyle/UIComponentNavTabsSubTabbarStyle0010") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('Pink')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..54b79ec31f3f5ba9066214dd83618a1c419187a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsWidth() { + + describe('UIComponentNavTabsWidth', () => { + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_WIDTH_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_WIDTH_0010 + * @tc.desc 1、创建tabs组件,设置tabs组件width为auto + 2、动态切换观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_WIDTH_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_WIDTH_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsWidth/UIComponentNavTabsWidth001") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_WIDTH_0010 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..a86014eb02d477754646809d0d45533d8da4a822 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentOtherRefreshAbility() { + + describe('UIComponentOtherRefreshAbility', () => { + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0080 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0080 + * @tc.desc 创建Refresh组件,设置refreshOffset(-1),编译安装 +*/ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0080 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0080") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0080 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0070 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0070 + * @tc.desc 创建Refresh组件,设置refreshOffset(0),编译安装 +*/ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0070 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0070") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0090 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0090 + * @tc.desc 创建Refresh组件,组件高度为499,设置refreshOffset(500),编译安装 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0090', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0090 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0090") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0090 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0050 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0050 + * @tc.desc 创建Refresh组件,设置refreshOffset(70),编译安装 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0050 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0050") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0050 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0100 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0100 + * @tc.desc 创建Refresh组件,设置refreshOffset(60.5)编译安装 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0100 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0100") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0100 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0040 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0040 + * @tc.desc 创建Refresh组件,设置pullToRefresh值可以动态修改,编译安装 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0040 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button:Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAbility0040_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0040 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..5982175f3a3a9ba4c186c19b9337d12d3bae81f1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentOtherRefreshInterAction() { + + describe('UIComponentOtherRefreshInterAction', () => { + + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0380 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0380 + * @tc.desc 1、进入list builder不设置宽高页面 + 2、下拉组件刷新 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0380', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0380 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0380") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0380 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0400 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0400 + * @tc.desc 1、进入list设置高度大于刷新区域页面 + 2、下拉组件刷新 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0400', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0400 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0400") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+400) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0400 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0390 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0390 + * @tc.desc 1、进入list固定高度页面 + 2、下拉组件刷新 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0390', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0390 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0390") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+400) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0390 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0410 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0410 + * @tc.desc 1、进入list builder宽高设置百分比 + 2、下拉组件刷新 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0410', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0410 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0410") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+400) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0410 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..5243db1f0b868ca6b54197d73bfb65d499e168e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentOtherRefreshInterface() { + + describe('UIComponentOtherRefreshInterface', () => { + + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0140 + * @tc.desc 1、Refresh的offset参数:string :'0'设置friction:100 + 2、页面下拉 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0140 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0140") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0140 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0170 + * @tc.desc 1、Refresh的offset参数:nunber :-100,设置friction:100 + 2、页面下拉 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0170', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0170 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0170") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0170 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0180 + * @tc.desc 1、Refresh的offset参数:number :0 设置friction:100 + 2、页面下拉 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0180', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0180 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0180") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0180 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1c73b54f9e9d514fe6d425f5bc1449316efd3d7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentOtherRefreshPromptText() { + + describe('UIComponentOtherRefreshPromptText', () => { + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0110 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0110 + * @tc.desc 1、创建refresh,设置自定义文本为Resource类型的混合内容 + 2、下拉刷新 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0110 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0110") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0100 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0100 + * @tc.desc 1、创建refresh,设置自定义文本为Resource类型的特殊字符 + 2、下拉刷新 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0100 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0100") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0100 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0060 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0060 + * @tc.desc 1、创建refresh,设置自定义文本为字符串类型的混合内容 + 2、下拉刷新 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0060 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0060") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0060 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0050 +* @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0050 +* @tc.desc 1、创建refresh,设置自定义文本为字符串类型的特殊字符 + 2、下拉刷新 +*/ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0050 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0050") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0050 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0120 +* @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0120 +* @tc.desc 1、创建refresh,设置自定义文本为字符串类型的超长文本 + 2、下拉刷新 +*/ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0120 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0120") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0120 finish.`); + done() + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0040 +* @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0040 +* @tc.desc 1、创建refresh,设置自定义文本为字符串类型的超长文本 + 2、下拉刷新 +*/ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0040 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0040 finish.`); + done() + }) + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..17371bd33b6103d8cb1a19d02cc62a1ef53345e1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets @@ -0,0 +1,417 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentTabTabBarSymbol() { + + describe('UIComponentTabTabBarSymbol', () => { + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0040 + * @tc.desc 1、创建tabs,使用BottomTabBarStyle样式 + * 2、icon使用TabBarSymbol引入其他资源;selected态传系统Symbol资源 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('Pink')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0090 + * @tc.desc 1、创建tabs,BottomTabBarStyle,icon使用TabBarSymbol + * 2、normal态SymbolGlphlIodifier设置fontSize设置大于vidth和height的值 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0090', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0090 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0090") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0090 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0120 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSyabol + * 2、normal态SymbolGlphlIodifier设置null + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0120 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0120") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0110 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSyabol + * 2、normal态SymbolGlphlIodifier设置undefined + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0110 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0110") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0070 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSyabol + * 2、normal态SymbolGlphlIodifier渲染策略为MULTIPLE_COLOR,设置4个fontcolor属性 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0070 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0070") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0080 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSyabol + * 2、normal态SymbolGlphlIodifier渲染策略为OPACITY,设置4个fontcolor属性 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0080 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0080") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0060 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSyabol + * 2、normal态SymbolGlphlIodifier渲染策略为单色,设置4个fontcolor属性 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0060") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0140 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + * 2、normal态SymbolGlphlIodifier设置可以动态切换入参 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0140 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0140") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentTabTabBarSymbol0140_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0130 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + * 2、nornal态SymbolGlyphModifier设置可以动态切换入 +参 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0130 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0130") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentTabTabBarSymbol0130_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0260 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0260 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + * 2、nornal态SymbolGlyphModifier设置可以动态切换入参 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0260', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0260 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0260") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentTabTabBarSymbol0260_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0260 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0190 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + * 2、nornal态SymbolGlyphModifier设置可以动态切换入参 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0190', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0190 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0190") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentTabTabBarSymbol0190_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0190 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0180 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + * 2、selected态SymbolGlphlIodifier不设置 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0180', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0180 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0180") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0180 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0160 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + * 2、selected态SymbolGlphlIodifier设置null + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0160', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0160 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0160") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0160 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0170 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + * 2、selected态SymbolGlphlIodifier设置undefined + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0170', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0170 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0170") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0170 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0030 + * @tc.desc 1、创建tabs,使用BottomTabBarStyle样式 + 2、icon使用TabBarSymbol引入其他资源 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0030") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0020 + * @tc.desc 1、创建tabs,使用BottomTabBarStyle样式 + * 2、icon使用TabBarSymbol引入系统media资源 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0020") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0010 + * @tc.desc 1、创建tabs,使用BottomTabBarStyle样式 + * 2、icon使用TabBarSymbol引入系统symbol资源 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0010") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0230 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0230', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0230 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0230") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0230 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0150 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSynbol + * 2、normal态SymbolGlphIodifier引入系统symbol资源 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0150") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0150 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0050 + * @tc.desc TabBarSynbol.normal & selected + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0050") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentTabTabbarTabbarsymbol0050_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0050 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0240 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0240 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0050") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0240 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0250 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0250 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0250") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0250 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Logger.ts b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Logger.ts new file mode 100644 index 0000000000000000000000000000000000000000..d8e65ace14fe8912c61a0b31c60ba5c767f116f1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Logger.ts @@ -0,0 +1,45 @@ +/* + * 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'; + +class Logger { + private domain: number; + private prefix: string; + private format: string = "%{public}s, %{public}s"; + + constructor(prefix: string) { + this.prefix = prefix; + this.domain = 0xFF00; + } + + debug(...args: any[]) { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: any[]) { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: any[]) { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: any[]) { + hilog.error(this.domain, this.prefix, this.format, args); + } +} + +export default new Logger('[Screenshot]'); \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets new file mode 100644 index 0000000000000000000000000000000000000000..54e8c1c7a76a15edfd3cd3b024ca61eba51fb7cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets @@ -0,0 +1,320 @@ +/* + * 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 screen from '@ohos.screen'; +import window from '@ohos.window'; +import Logger from './Logger'; +import { GlobalThis } from './globalThis' +import { BusinessError } from '@ohos.base' +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { i18n } from '@kit.LocalizationKit'; +import { router } from '@kit.ArkUI'; + +const TAG: string = '[TEST]'; + +async function sleep(time: number): Promise { + const result: string = await new Promise((resolve: Function) => { + setTimeout(() => { + resolve('sleep ok') + }, time) + }); + console.info(result); +} + +class Settings { + isPhone: boolean = true; + windowClass: window.Window | undefined = undefined + windowCreateType: string = "changeWindow"; + private static DEFAULT_WIDTH: number = 720; + private static DEFAULT_HEIGHT: number = 1280; + private static DEFAULT_DPI: number = 240; + private static DEFAULT_OFFSET_X: number = 0; + private static DEFAULT_OFFSET_Y: number = 60; + private portrait: boolean = true + + changeWindowPosition(windowClass: window.Window, X: number | undefined, Y: number | undefined) { + //为悬浮窗设置位置 + windowClass.moveWindowTo(X, Y, (err) => { + if (err.code) { + Logger.error(TAG, `Failed to move the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info(TAG, 'Succeed moveWindowTo.'); + }) + } + + changeWindowSize(windowClass: window.Window, width: number | undefined, height: number | undefined) { + //为悬浮窗设置大小 + windowClass.resize(width, height, (err) => { + if (err.code) { + Logger.error(TAG, `Failed to change the window size. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info(TAG, 'Succeed changeWindowSize'); + }) + } + + loadContent(windowClass: window.Window, pageURI: string) { + //为悬浮窗加载对应的目标页面 + windowClass.setUIContent(pageURI, (err) => { + if (err.code) { + Logger.error(TAG, `Failed to load the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info(TAG, `Succeeded in loading the content.`); + + //显示悬浮窗 + windowClass.showWindow((err) => { + if (err.code) { + Logger.error(TAG, `Failed to show the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info(TAG, `Succeeded in showing the window.`); + }) + }) + } + + loadContentChange(windowClass: window.Window, pageURI: string) { + //为悬浮窗加载对应的目标页面 + windowClass.setUIContent(pageURI, (err) => { + if (err.code) { + Logger.error(TAG, `Failed to load the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info(TAG, `Succeeded in loading the content.`); + + }) + } + + changeDpi(dpi: number) { + let screenClass: screen.Screen; + screen.getAllScreens((err: BusinessError, data: Array) => { + if (err.code) { + Logger.error(TAG, `Failed to get all screens. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info(TAG, `Succeeded in getting all screens. Data:${JSON.stringify(data)}`); + + screenClass = data[0]; + //设置设备dpi + screenClass.setDensityDpi(dpi, (err: BusinessError) => { + if (err.code) { + Logger.error(TAG, `Failed to set the pixel density. Code : ${JSON.stringify(err)}`) + return; + } + Logger.info(TAG, `Succeeded in setting the pixel density`); + }) + }) + } + + setWindowSystemBarEnable(windowClass: window.Window, names: Array<'status' | 'navigation'>) { + windowClass.setWindowSystemBarEnable(names, (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + Logger.error(TAG, 'Failed to set the system bar to be invisible. Cause:' + JSON.stringify(err)) + return; + } + Logger.info(TAG, `Succeeded in set the system bar to be invisible`); + }); + } + + destroyWindow(windowClass: window.Window) { + if (!this.isPhone) { + //销毁窗口 + windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error(TAG, `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info(TAG, `Succeeded in destroy the window.`); + }) + } + } + + /* + * 窗口页面更新 + * Setting.createWindow(pageURI: String, {X,Y,width,height,dpi}?:{X?:number,Y?:number,width?:number,height?:number,dpi?:number}):void + * 必填: + * pageURI:页面路由 + * 选填: + * X,Y:窗口相对于左上角的位置,默认X=100,Y=100 单位为px + * width,height:窗口宽高,默认width=600,height=1250 可配置范围:[0,2560],单位为vp + * dpi:像素密度,默认dpi=330,可配置范围:80-640 + * */ + + createWindow(pageURI: string, X?: number | undefined, Y?: number | undefined, width?: number | undefined, + height?: number | undefined, dpi?: number | undefined) { + if (!this.isPhone) { + this.windowCreateType = "createWindow" + if (X == undefined) { + X = Settings.DEFAULT_OFFSET_X; + } + if (Y == undefined) { + Y = Settings.DEFAULT_OFFSET_Y; + } + if (width == undefined) { + width = Settings.DEFAULT_WIDTH; + } + if (height == undefined) { + height = Settings.DEFAULT_HEIGHT - Settings.DEFAULT_OFFSET_Y; + } + if (dpi == undefined) { + dpi = Settings.DEFAULT_DPI; + } + Logger.info(TAG, `params,pageURI=${pageURI},X=${X},Y=${Y},width=${width},height=${height},dpi=${dpi}`) + this.changeDpi(dpi) + sleep(1000) + let config: window.Configuration = { + name: "floatWindow", + windowType: window.WindowType.TYPE_FLOAT, + ctx: GlobalThis.getInstance().getContext('context') + }; + + window.createWindow(config, (err, data) => { + if (err.code) { + Logger.error(TAG, `Failed to create the floatWindow. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info(TAG, `Succeeded in creating the floatWindow. Data : ${JSON.stringify(err)}`); + this.windowClass = data; + this.changeWindowPosition(this.windowClass, X, Y); + this.changeWindowSize(this.windowClass, width, height); + this.loadContent(this.windowClass, pageURI) + }) + } else { + try { + router.pushUrl({ + url: pageURI + }) + Logger.info(TAG, `params,pageURI=${pageURI}`) + } catch (e) { + Logger.error(TAG, `params,pageURI=${pageURI} errpr ${e}`) + } + } + } + + async changeWindow(pageURI: string, width?: number | undefined, height?: number | undefined, + dpi?: number | undefined) { + if (!this.isPhone) { + this.windowCreateType = "changeWindow" + if (width == undefined) { + width = Settings.DEFAULT_WIDTH; + } + if (height == undefined) { + height = Settings.DEFAULT_HEIGHT - Settings.DEFAULT_OFFSET_Y; + } + if (dpi == undefined) { + dpi = Settings.DEFAULT_DPI; + } + Logger.info(TAG, `params,pageURI=${pageURI},width=${width},height=${height},dpi=${dpi}`) + this.changeDpi(dpi) + await sleep(500) + window.getLastWindow(GlobalThis.getInstance().getContext('context'), async (err: BusinessError, data) => { + const errCode: number = err.code; + if (errCode) { + Logger.error(TAG, 'Failed to obtain the top Window. Cause : ' + JSON.stringify(err)); + return; + } + Logger.info(TAG, 'succeed to obtain the top Window. Cause : ' + JSON.stringify(err)); + this.windowClass = data; + await sleep(200) + this.loadContent(this.windowClass, pageURI) + await sleep(200) + this.changeWindowSize(this.windowClass, width, height); + await sleep(200) + this.setWindowSystemBarEnable(this.windowClass, []); + }); + } else { + await router.pushUrl({ url: pageURI }) + } + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch Locales,appPreferredLanguage2=${appPreferredLanguage2}`); + } + + /** + * 切换应用内部语言 + */ + switchLocales() { + let currentLanguages = i18n.System.getSystemLanguages(); + let systemLocale: string = i18n.System.getSystemLocale(); // 获取系统当前Locale + let systemRegion: string = i18n.System.getSystemRegion(); // 获取系统当前地区设置 + let appPreferredLanguage: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch Locales,current currentLanguages=${currentLanguages} + ,systemLocale=${systemLocale},systemRegion=${systemRegion},appPreferredLanguage=${appPreferredLanguage}`); + try { + i18n.System.setAppPreferredLanguage('ug-CN'); // 设置系统当前Locale为 "zh-CN" + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch Locales,appPreferredLanguage2=${appPreferredLanguage2}`); + } + + changeOrientation(object?: Object) { + // 获取上下文,使用common模块 + let context = getContext() + let promise = Window.getLastWindow(context); + promise.then((data) => { + let windowClass = data; + if (this.portrait) { + //切换成横屏 + let orientation = Window.Orientation.LANDSCAPE; + windowClass.setPreferredOrientation(orientation, (err) => { + + }); + // windowSnap.snapShot() + this.portrait = !this.portrait + console.info('LANDSCAPE Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } else { + //切换成竖屏 + let orientation = Window.Orientation.PORTRAIT; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait + console.info('PORTRAIT Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } + }).catch((err: BusinessError) => { + console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err)); + }); + } + + setOrientation() { + try { + window.getLastWindow(getContext(this), (err, data) => { // 获取window实例 + if (err.code) { + return; + } + let windowClass = data; + + let orientation = window.Orientation.LANDSCAPE; // 设置窗口方向为传感器自动旋转模式。 + try { + windowClass.setPreferredOrientation(orientation, (err) => { + if (err.code) { + return; + } + }); + } catch (exception) { + } + ; + }); + } catch (exception) { + } + ; + } +} + +export default new Settings() \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets new file mode 100644 index 0000000000000000000000000000000000000000..7f06aa4d872061e0682441fd8f47b33730bc78c1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets @@ -0,0 +1,47 @@ +/* + * 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 {Driver , ON} from '@ohos.UiTest' + +export default class Utils { + + static async sleep(time : number) :Promise { + const result:string = await new Promise((resolve:Function)=>{ + setTimeout(()=> { + resolve('sleep ok') + },time) + }); + console.info(result); + } + static async waitAsync (ms:number):Promise{ + return new Promise((resolve)=>{ + setTimeout(resolve,ms) + }) + + } + + static async clickComponentByKey (componentKey :string){ + let driver = Driver.create(); + let component = await driver.findComponent(ON.id(componentKey)) + await component.click(); + + } + + +} + + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/globalThis.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/globalThis.ets new file mode 100644 index 0000000000000000000000000000000000000000..1fa18fbd244d65f4c78213b89d9d01e29e01eae6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/globalThis.ets @@ -0,0 +1,49 @@ +/* + * 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 common from '@ohos.app.ability.common' + +// 构造单例对象 + +export class GlobalThis { + + private constructor() { + } + + private static instance:GlobalThis; + + private _uiContexts = new Map (); + + public static getInstance():GlobalThis { + + if (!GlobalThis.instance) { + GlobalThis.instance = new GlobalThis(); + + } + + return GlobalThis.instance + + } + getContext(key:string):common.UIAbilityContext | undefined { + + return this._uiContexts.get(key); + } + + setContext(key:string, value:common.UIAbilityContext) :void { + this._uiContexts.set(key,value); + } + + // 其他需要传递的类依次扩展 +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/snapShot.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/snapShot.ets new file mode 100644 index 0000000000000000000000000000000000000000..773f21352336973e8a11bce347632a45bd62dd62 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/snapShot.ets @@ -0,0 +1,268 @@ +/* + * 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 window from '@ohos.window'; +import Logger from './Logger'; +import image from '@ohos.multimedia.image'; +import fs from '@ohos.file.fs'; +import common from '@ohos.app.ability.common' +import { GlobalThis } from './globalThis' +import screenshot from '@ohos.screenshot' +import { BusinessError } from '@ohos.base' +import Settings from './Settings'; +import { Driver } from '@kit.TestKit'; +import { display } from '@kit.ArkUI'; + +const TAG: string = '[TEST]'; + + +class windowSnap { + filePath(suffix: string, pageName ?: string) { + let context: common.UIAbilityContext | undefined = GlobalThis.getInstance().getContext('context') + Logger.info(TAG, 'deleteFile start'); + let pathDir = context ? context.filesDir : "/" + Logger.info(TAG, `deleteFile pathDir = ${pathDir}`) + // let name = pageName ? pageName : "test" + let name = "test" + if (suffix == null) { + suffix = 'webp' + } + let displayName = `IMG_${name}.${suffix}` + let filePath: string = pathDir + "/" + displayName; + Logger.info(TAG, 'createFile filePath = ${filePath}') + return filePath; + + } + + async deleteFile(filePath: string) { + let exists = await fs.access(filePath) + Logger.info(TAG, `oldFile exists = ${exists}`) + if (exists) { + fs.unlinkSync(filePath) + Logger.info(TAG, `remove file succeed`) + } + } + + createFile(filePath: string) { + return fs.openSync(filePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE) + } + + async save(filePath: string, data: image.PixelMap) { + let packOpts: image.PackingOption = { + format: "image/webp", quality: 100 + } + let imagePackerApi = image.createImagePacker() + let arrayBuffer = await imagePackerApi.packing(data, packOpts) + let file: fs.File | null = null; + while (file == null) { + file = this.createFile(filePath) + } + let exists = await fs.access(file.path) + Logger.info(TAG, `createFile exists = ${exists}`) + let fd = file.fd + Logger.info(TAG, `createFile fd = ${fd}`) + imagePackerApi.release() + try { + await fs.write(fd, arrayBuffer) + } catch (err) { + Logger.error(TAG, `write failed code is ${err.code},message is ${err.message}`) + } + fs.closeSync(file) + Logger.info(TAG, `write picture done`) + } + + async saveLog(content: string, name: string) { + let context: common.UIAbilityContext | undefined = GlobalThis.getInstance().getContext('context') + Logger.info(TAG, 'deleteFile start'); + let pathDir = context ? context.filesDir : "/" + Logger.info(TAG, `deleteFile pathDir = ${pathDir}`) + let displayName = `${name}.txt` + let filePath: string = pathDir + "/" + displayName; + let exists = await fs.access(filePath) + Logger.info(TAG, `oldFile exists = ${exists}`) + if (exists) { + fs.unlinkSync(filePath) + Logger.info(TAG, `remove file succeed`) + } + let file: fs.File | null = null; + while (file == null) { + file = this.createFile(filePath) + } + Logger.info(TAG, `createFile exists = ${exists}`) + let fd = file.fd + Logger.info(TAG, `createFile fd = ${fd}`) + try { + await fs.write(fd, content) + } catch (err) { + Logger.error(TAG, `write failed code is ${err.code},message is ${err.message}`) + } + fs.closeSync(file) + Logger.info(TAG, `write picture done`) + } + + /* + * 获取窗口结合&文件保存 + * 入参必填 ability的context + + * snapShot + * save:设备端保存路径:/data/app/el2/100/base/{bundle_name}/haps/entry_test/files/IMG_test.webp + * 查看命令:hdc_st shell ,cd + **/ + async snapShot(pageName?: string) { + Logger.info(TAG, 'start snapshot') + if (Settings.isPhone) { + try { + let filePath = "/data/storage/el2/base/haps/entry_test/files/IMG_test.png" + let webpFilePath = "/data/storage/el2/base/haps/entry_test/files/IMG_test.webp" + await this.deleteFile(filePath); + await this.deleteFile(webpFilePath); + let driver = Driver.create(); + let orientation = display.getDefaultDisplaySync().orientation; + //竖屏 + let captureRes: boolean; + if (orientation == window.Orientation.PORTRAIT || orientation == window.Orientation.UNSPECIFIED) { + captureRes = await driver.screenCapture(filePath, { + left: 0, + top: 100, + right: 1260, + bottom: 2720 + }) + + } else { + //横屏 + captureRes = await driver.screenCapture(filePath, { + left: 0, + top: 0, + right: 2720, + bottom: 1260 + }) + } + if (captureRes) { + Logger.info(TAG, 'Succeed screenCapture.') + } else { + Logger.info(TAG, 'failed screenCapture.') + } + await fs.copyFile(filePath, webpFilePath); + } catch (exception) { + Logger.error(TAG, 'failed to screenCapture .Cause : ' + JSON.stringify(exception)) + } + } else { + if (Settings.windowClass == undefined) { + Logger.info(TAG, 'getWindowClass error') + return; + } + Logger.info(TAG, 'find window success') + let filePath = this.filePath('webp', pageName) + await this.deleteFile(filePath); + Settings.windowClass.snapshot((err, data: image.PixelMap) => { + if (err.code) { + Logger.info('failed to snap window .cause : ' + JSON.stringify(err)) + return; + } + Logger.info(TAG, 'Succeed in saving screenshot. Pixel bytes number: ' + data.getPixelBytesNumber()) + this.save(filePath, data) + data.release(); + }); + } + } + + /* + * 获取窗口结合&文件保存 + * 入参必填 ability的context + * screenShot + * save:设备端保存路径:/data/app/el2/100/base/{bundle_name}/haps/entry_test/files/IMG_test.webp + * 查看命令:hdc_st shell ,cd + **/ + + async screenShot(pageName?: string) { + Logger.info(TAG, 'start screen shot') + if (Settings.isPhone) { + let filePath = "/data/storage/el2/base/haps/entry_test/files/IMG_test.png" + let webpFilePath = "/data/storage/el2/base/haps/entry_test/files/IMG_test.webp" + await this.deleteFile(filePath); + await this.deleteFile(webpFilePath); + let driver = Driver.create(); + try { + let orientation = display.getDefaultDisplaySync().orientation; + //竖屏 + let captureRes: boolean; + if (orientation == window.Orientation.PORTRAIT || orientation == window.Orientation.UNSPECIFIED) { + captureRes = await driver.screenCapture(filePath, { + left: 0, + top: 100, + right: 1260, + bottom: 2720 + }) + + } else { + //横屏 + captureRes = await driver.screenCapture(filePath, { + left: 0, + top: 0, + right: 2720, + bottom: 1260 + }) + } + if (captureRes) { + Logger.info(TAG, 'Succeed screenCapture.') + } else { + Logger.info(TAG, 'failed screenCapture.') + } + await fs.copyFile(filePath, webpFilePath); + } catch (exception) { + Logger.error(TAG, 'failed to screenCapture .Cause : ' + JSON.stringify(exception)) + } + } else { + if (Settings.windowClass == undefined) { + Logger.info(TAG, 'getWindowClass error') + return; + } + Logger.info(TAG, 'find window success') + let filePath = this.filePath('webp', pageName) + await this.deleteFile(filePath) + try { + let properties = Settings.windowClass.getWindowProperties(); + Logger.info(TAG, 'properties.windowRect = ' + JSON.stringify(properties)) + + let screenshotOptions: screenshot.ScreenshotOptions = { + "screenRect": properties.windowRect, + "imageSize": { + "width": properties.windowRect.width, + "height": properties.windowRect.height + } + }; + Logger.info(TAG, 'screenshotOptions: ' + JSON.stringify(screenshotOptions)); + try { + screenshot.save(screenshotOptions, (err: BusinessError, pixelMap: image.PixelMap) => { + if (err) { + Logger.info('failed to save screenshot .Code : ' + JSON.stringify(err)) + return; + } + Logger.info(TAG, 'Succeed in saving screenshot. Pixel bytes number: ' + pixelMap.getPixelBytesNumber()) + this.save(filePath, pixelMap) //pixelMap 保存生成文件 + pixelMap.release(); + }); + } catch (exception) { + Logger.error(TAG, 'failed to : save screenshot. code: ' + JSON.stringify(exception)); + } + + } catch (exception) { + Logger.error(TAG, 'failed to obtain the window properties .Cause : ' + JSON.stringify(exception)) + } + } + } +} + +export default new windowSnap() \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..5b2992dcb24394039f4c71907479c34895c1a73a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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 bundleManager from '@ohos.bundle.bundleManager'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import UIAbility from '@ohos.app.ability.UIAbility'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import hilog from '@ohos.hilog'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../test/List.test'; +import window from '@ohos.window'; +import Logger from '../test/model/Logger' +import { GlobalThis } from '../test/model/globalThis' +import Want from '@ohos.app.ability.Want' +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; + + +const TAG: string = '[TEST]' + +async function sleep(time: number): Promise { + const result: string = await new Promise((resolve: Function) => { + setTimeout(() => { + resolve('sleep ok') + }, time) + }); + console.info(result); +} + +export default class TestAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + let abilityDelegatorArguments: AbilityDelegatorRegistry.AbilityDelegatorArgs + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + GlobalThis.getInstance().setContext("context", this.context) + + windowStage.loadContent('testability/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.'); + }); + } + + onWindowStageDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabScrollable/ArkUITabScrollable001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabScrollable/ArkUITabScrollable001.ets new file mode 100644 index 0000000000000000000000000000000000000000..ce563b90c4e724a4f104d65714b79b980ab56ab3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabScrollable/ArkUITabScrollable001.ets @@ -0,0 +1,56 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabScrollable001 { + @State scrollable: boolean = true; + build() { + Column({ space: 5 }) { + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + } + .vertical(false).scrollable(this.scrollable).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('ArkUITabScrollable001_001') + .width('100%') + .backgroundColor(0xF1F3F5); + + Button('设置').width('50%').margin({ top: 20 }) + .onClick(() => { + this.scrollable = !this.scrollable; + }).id('ArkUITabScrollable001_002'); + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabScrollable/ArkUITabScrollable002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabScrollable/ArkUITabScrollable002.ets new file mode 100644 index 0000000000000000000000000000000000000000..227af26c95835a6b4bb6af9f4ea1a932470f76de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabScrollable/ArkUITabScrollable002.ets @@ -0,0 +1,56 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabScrollable0012 { + @State scrollable: boolean = true; + build() { + Column({ space: 5 }) { + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + } + .vertical(false).scrollable(this.scrollable).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('ArkUITabScrollable002_001') + .width('100%') + .backgroundColor(0xF1F3F5); + + Button('设置').width('50%').margin({ top: 20 }) + .onClick(() => { + this.scrollable = !this.scrollable; + }).id('ArkUITabScrollable002_002'); + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor001.ets new file mode 100644 index 0000000000000000000000000000000000000000..bb8627a2dce1480130aa67c08cdc253782708e37 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor001.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor001 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: Color.Black }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor004.ets new file mode 100644 index 0000000000000000000000000000000000000000..33230a59147f3975f24f3603ec1f7893e5317662 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor004.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor004 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: Color.Gray }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: Color.Gray }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor008.ets new file mode 100644 index 0000000000000000000000000000000000000000..b7e659d37151d474a06f026c894bc423acaa36b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor008.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor008 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: Color.Red }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: Color.Red }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor013.ets new file mode 100644 index 0000000000000000000000000000000000000000..81885689f95d87e504dceb85a967758d6a0d6c68 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor013.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor013 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: 0xa52a2a }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: 0xa52a2a }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor014.ets new file mode 100644 index 0000000000000000000000000000000000000000..526dc72ce4d26c23f54977415ac60f0f1039cacc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor014.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor014 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: 0x808080 }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: 0x808080 }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor022.ets new file mode 100644 index 0000000000000000000000000000000000000000..8bdbf643db4447f2c2867e7ddf9a8b6562035c1a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor022.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor022 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: "#ff000000" }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: "#ff000000" }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor024.ets new file mode 100644 index 0000000000000000000000000000000000000000..d53645f86da7899cb5041b1107a4fab5a70a04f3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor024.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor024 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: "rgba(255,100,255,0.5)" }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: "rgba(255,100,255,0.5)" }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor025.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor025.ets new file mode 100644 index 0000000000000000000000000000000000000000..2e01b109a06668fd66fb3b426888f84df5bfb992 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor025.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor025 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: $r("sys.color.titlebar_title_tertiary_color") }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: $r("sys.color.titlebar_title_tertiary_color") }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor026.ets new file mode 100644 index 0000000000000000000000000000000000000000..245d756fd9edf1296183ec92b2ce7b17f6426116 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor026.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor026 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: $r("sys.color.toast_outer_border_color") }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: $r("sys.color.toast_outer_border_color") }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor027.ets new file mode 100644 index 0000000000000000000000000000000000000000..25d18afa27537b2d0b0e30491962a6dc9fe898f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor027.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor027 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: 0xFFFFFFFFFFFFFFFF }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: 0xFFFFFFFFFFFFFFFF }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor028.ets new file mode 100644 index 0000000000000000000000000000000000000000..35ba4cc2be89f3501c69d426b10f46731770e0b3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor028.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor028 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: undefined }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: undefined }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor029.ets new file mode 100644 index 0000000000000000000000000000000000000000..894d8261d83f94e60be7984185f1277d3be45726 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor029.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor029 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: null }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: null }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor002.ets new file mode 100644 index 0000000000000000000000000000000000000000..2a4d2db019bc0d3d93b465cefa8e098c91dd3ca5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor002.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor002 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: Color.Brown }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: Color.Brown }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor005.ets new file mode 100644 index 0000000000000000000000000000000000000000..308ecaacc1f21bd33660512c798f8ffb1f4d6ca7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor005.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor005 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: Color.Orange }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: Color.Orange }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor014.ets new file mode 100644 index 0000000000000000000000000000000000000000..4ecbc71ea63d93239376fa9c974d1166c45c2bea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor014.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor014 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: 0x008000 }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: 0x008000 }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor016.ets new file mode 100644 index 0000000000000000000000000000000000000000..65a40b9871fa0f47bef4c783db92752631238ba5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor016.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor016 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: 0xffc0cb }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: 0xffc0cb }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor021.ets new file mode 100644 index 0000000000000000000000000000000000000000..2284a438a92220937581b822af538eeff0839891 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor021.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor021 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: "#ff000000" }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: "#ff000000" }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor022.ets new file mode 100644 index 0000000000000000000000000000000000000000..f988abd067cb87f6da9fecb698428247cf4aff67 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor022.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor022 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: "rgb(255,100,255)" }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: "rgb(255,100,255)" }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor024.ets new file mode 100644 index 0000000000000000000000000000000000000000..cd5e60d077f3aeb46a91369c5d9e0085cdcf4a34 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor024.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor024 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: $r("sys.color.toast_outer_border_color") }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: $r("sys.color.toast_outer_border_color") }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor026.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f3c4e3e136fd82a5fefef1487e6f3fed11a57d9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor026.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor026 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: 0xFFFFFFFFFFFFFFFF }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: 0xFFFFFFFFFFFFFFFF }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor027.ets new file mode 100644 index 0000000000000000000000000000000000000000..a334b5c50862bdb667eada21d6054e33dfb525d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor027.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor027 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: undefined }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: undefined }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor028.ets new file mode 100644 index 0000000000000000000000000000000000000000..9fd1583cd146e63b08e79e15e8c146cb67eb0bc0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor028.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor028 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: null }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: null }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor029.ets new file mode 100644 index 0000000000000000000000000000000000000000..c147e8ad505fc52d4204096c343b4b4b814d1eb6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor029.ets @@ -0,0 +1,45 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor029 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: Color.Black }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor001.ets new file mode 100644 index 0000000000000000000000000000000000000000..1613875cecad8683e273e64299f04911230b9722 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor001.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor001 { + @State labelSelectedColor: number = Color.Black; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == Color.Black) { + this.labelSelectedColor = Color.Green; + } + else + { + this.labelSelectedColor = Color.Black; + } + }).id('ArkUITabsLabelStyleSelectedColor001_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor003.ets new file mode 100644 index 0000000000000000000000000000000000000000..3ef507ac66923b2cc463f92088f5d6a565277fe4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor003.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor003 { + @State labelSelectedColor: number = Color.Brown; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == Color.Brown) { + this.labelSelectedColor = Color.Green; + } + else + { + this.labelSelectedColor = Color.Brown; + } + }).id('ArkUITabsLabelStyleSelectedColor003_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor005.ets new file mode 100644 index 0000000000000000000000000000000000000000..9b749e4d54a19f29810bb45707b5f17ed3ea9dd1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor005.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor005 { + @State labelSelectedColor: number = Color.Green; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == Color.Green) { + this.labelSelectedColor = Color.Yellow; + } + else + { + this.labelSelectedColor = Color.Green; + } + }).id('ArkUITabsLabelStyleSelectedColor005_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor007.ets new file mode 100644 index 0000000000000000000000000000000000000000..14e22b1c6a709eb5cdf4528dc1c2b77602f72399 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor007.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor007 { + @State labelSelectedColor: number = Color.Pink; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == Color.Pink) { + this.labelSelectedColor = Color.Yellow; + } + else + { + this.labelSelectedColor = Color.Pink; + } + }).id('ArkUITabsLabelStyleSelectedColor007_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor009.ets new file mode 100644 index 0000000000000000000000000000000000000000..6739639bab6b0fb57e70d83663e61c235fd5f91e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor009.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor009 { + @State labelSelectedColor: number = Color.White; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == Color.White) { + this.labelSelectedColor = Color.Yellow; + } + else + { + this.labelSelectedColor = Color.White; + } + }).id('ArkUITabsLabelStyleSelectedColor009_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor011.ets new file mode 100644 index 0000000000000000000000000000000000000000..54e8c1345996f3ff3a72a72d4091940f06e9315e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor011.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor011 { + @State labelSelectedColor: number = Color.Transparent; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == Color.Transparent) { + this.labelSelectedColor = Color.Yellow; + } + else + { + this.labelSelectedColor = Color.Transparent; + } + }).id('ArkUITabsLabelStyleSelectedColor011_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor012.ets new file mode 100644 index 0000000000000000000000000000000000000000..e39e813c4fed2f64f7bcf8c06545c3771f1f8e01 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor012.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor012 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor = 0x000000; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor012_001') + .onClick(() => { + this.selectedColor = 0xffffff; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor013.ets new file mode 100644 index 0000000000000000000000000000000000000000..929d7feef0bbe548da86be553c034dfbef70ffe9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor013.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor013 { + @State labelSelectedColor: number = 0x00FF00; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == 0x00FF00) { + this.labelSelectedColor = 0xa52a2a; + } + else + { + this.labelSelectedColor = 0x00FF00; + } + }).id('ArkUITabsLabelStyleSelectedColor013_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor015.ets new file mode 100644 index 0000000000000000000000000000000000000000..5acdd9e4200d953ad69cc87fb7e524849db679f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor015.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor015 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor = 0x008000; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor015_001') + .onClick(() => { + this.selectedColor = Color.Black; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor017.ets new file mode 100644 index 0000000000000000000000000000000000000000..3abc891632575a58f7456de37dca83b8cb19ca36 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor017.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor017 { + @State labelSelectedColor: number = 0x00FF00; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == 0x00FF00) { + this.labelSelectedColor = 0xffc0cb; + } + else + { + this.labelSelectedColor = 0x00FF00; + } + }).id('ArkUITabsLabelStyleSelectedColor017_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor019.ets new file mode 100644 index 0000000000000000000000000000000000000000..48f91e0810a544e7cc759ccfe37c754b32452caa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor019.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor019 { + @State labelSelectedColor: number = 0x00FF00; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == 0x00FF00) { + this.labelSelectedColor = 0xffffff; + } + else + { + this.labelSelectedColor = 0x00FF00; + } + }).id('ArkUITabsLabelStyleSelectedColor019_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor021.ets new file mode 100644 index 0000000000000000000000000000000000000000..e627174e33ce0242a451b1e8ef8e1d545b7543bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor021.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor021 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor = '#ffffff'; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor021_001') + .onClick(() => { + this.selectedColor = Color.Black; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor023.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor023.ets new file mode 100644 index 0000000000000000000000000000000000000000..eb707990bb88d38adfe8b6dbfebbe3c4ac3fde5a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor023.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor023 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor = "rgb(255,100,255)"; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor023_001') + .onClick(() => { + this.selectedColor = Color.Black; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor024.ets new file mode 100644 index 0000000000000000000000000000000000000000..39b3424104e8b5a1be0dbb70c301931d34ed4061 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor024.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor024 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor = "rgba(255,100,255,0.5)"; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor024_001') + .onClick(() => { + this.selectedColor = Color.Black; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor025.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor025.ets new file mode 100644 index 0000000000000000000000000000000000000000..7fb514c010eff71e5d92dce7f846e47c3c76de0f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor025.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor025 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor = '#ff0000ff'; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor025_001') + .onClick(() => { + this.selectedColor = Color.Black; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor026.ets new file mode 100644 index 0000000000000000000000000000000000000000..f73061a7eb2772b59a967afeecab893a1380cc7a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor026.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor026 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor = $r('sys.color.titlebar_title_tertiary_color'); + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor026_001') + .onClick(() => { + this.selectedColor = Color.Black; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor027.ets new file mode 100644 index 0000000000000000000000000000000000000000..38310e87969e61309f5489c1bd11ef3cb7375f7a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor027.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor027 { + @State labelSelectedColor: number = 0x0000FF; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == 0x0000FF) { + this.labelSelectedColor = 0xFFFFFFFFFFFFFFFF; + } + else + { + this.labelSelectedColor = 0x0000FF; + } + }).id('ArkUITabsLabelStyleSelectedColor027_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor028.ets new file mode 100644 index 0000000000000000000000000000000000000000..34b2ea5db5b616cc0dcc590e4727ae240d31cb38 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor028.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor028 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor | undefined = undefined; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor028_001') + .onClick(() => { + this.selectedColor = 0xfffffffffffffff; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor029.ets new file mode 100644 index 0000000000000000000000000000000000000000..156a1898f7be046b2e3a0b7386e4be3c70f5b6d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor029.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor029 { + @State labelSelectedColor: string = '#00FF00'; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == '#00FF00') { + this.labelSelectedColor = 'null'; + } + else + { + this.labelSelectedColor = '#00FF00'; + } + }).id('ArkUITabsLabelStyleSelectedColor029_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor001.ets new file mode 100644 index 0000000000000000000000000000000000000000..65ea22a683e9b86a6981228216dec0f503047eaa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor001.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor001 { + @State labelUnselectedColor: number = Color.Blue; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == Color.Blue) { + this.labelUnselectedColor = Color.Red; + } + else + { + this.labelUnselectedColor = Color.Blue; + } + }).id('ArkUITabsLabelStyleUnselectedColor001_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor005.ets new file mode 100644 index 0000000000000000000000000000000000000000..0869713503b40c26d459555c00e3460716b131f3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor005.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor005 { + @State labelUnselectedColor: number = Color.Orange; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == Color.Orange) { + this.labelUnselectedColor = Color.Red; + } + else + { + this.labelUnselectedColor = Color.Orange; + } + }).id('ArkUITabsLabelStyleUnselectedColor005_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor008.ets new file mode 100644 index 0000000000000000000000000000000000000000..190e975d33b19c4edd02219bde199dbb30a8332a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor008.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor008 { + @State labelUnselectedColor: number = Color.White; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == Color.White) { + this.labelUnselectedColor = Color.Red; + } + else + { + this.labelUnselectedColor = Color.White; + } + }).id('ArkUITabsLabelStyleUnselectedColor008_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor011.ets new file mode 100644 index 0000000000000000000000000000000000000000..030351cac742add88a0d44ce51e3c28651ac67c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor011.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor011 { + @State labelUnselectedColor: number = 0x000000; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == 0x000000) { + this.labelUnselectedColor = 0xFF0000; + } + else + { + this.labelUnselectedColor = 0x000000; + } + }).id('ArkUITabsLabelStyleUnselectedColor011_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor012.ets new file mode 100644 index 0000000000000000000000000000000000000000..f7616de76b4419456e8c41383d96ce65f3236fca --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor012.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor012 { + @State labelUnselectedColor: number = 0xa52a2a; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == 0xa52a2a) { + this.labelUnselectedColor = 0xFF0000; + } + else + { + this.labelUnselectedColor = 0xa52a2a; + } + }).id('ArkUITabsLabelStyleUnselectedColor012_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor017.ets new file mode 100644 index 0000000000000000000000000000000000000000..fae35e541b7cd8e1b6fc9df8e305e7b4dbfb63e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor017.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor017 { + @State labelUnselectedColor: number = 0xFF0000; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == 0xFF0000) { + this.labelUnselectedColor = 0x00FF00; + } + else + { + this.labelUnselectedColor = 0xFF0000; + } + }).id('ArkUITabsLabelStyleUnselectedColor017_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor021.ets new file mode 100644 index 0000000000000000000000000000000000000000..846a07903dc9de6799aee48df6ce915ec7b98226 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor021.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor021 { + @State labelUnselectedColor: string = '#ff000000'; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == '#ff000000') { + this.labelUnselectedColor = '#FF0000'; + } + else + { + this.labelUnselectedColor = '#ff000000'; + } + }).id('ArkUITabsLabelStyleUnselectedColor021_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor022.ets new file mode 100644 index 0000000000000000000000000000000000000000..356eb5b358b8a44a58fe7d3865b5eb35bcfa0c4a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor022.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor022 { + @State labelUnselectedColor: string = 'rgb(255,100,255)'; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == 'rgb(255,100,255)') { + this.labelUnselectedColor = 'rgb(255,0,0)'; + } + else + { + this.labelUnselectedColor = 'rgb(255,100,255)'; + } + }).id('ArkUITabsLabelStyleUnselectedColor022_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor024.ets new file mode 100644 index 0000000000000000000000000000000000000000..964205e6c98681a3a2594ac710b6fa30250ee4ba --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor024.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleUnselectedcolor024 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State unselectedColor: ResourceColor = "#ff0000ff"; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('unselectedColor') + .id('ArkUITabsLabelstyleUnselectedcolor024_001') + .onClick(() => { + this.unselectedColor = Color.Red; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: this.unselectedColor }) + ) + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Blue) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Blue') + .labelStyle({ unselectedColor: this.unselectedColor }) + ) + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor025.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor025.ets new file mode 100644 index 0000000000000000000000000000000000000000..977511856933e148dc18fb69c5778fbb26d7f421 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor025.ets @@ -0,0 +1,69 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor025 { + @State resourceColorPink: Resource = $r('app.color.Pink'); + @State resourceColorRed: Resource = $r('app.color.colorRed'); + @State labelUnselectedColor: Resource = $r('app.color.Pink'); + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == this.resourceColorPink) { + console.info("this.labelUnselectedColor is pink") + this.labelUnselectedColor = this.resourceColorRed; + } + else + { + console.info("this.labelUnselectedColor is red") + this.labelUnselectedColor = this.resourceColorPink; + } + }).id('ArkUITabsLabelStyleUnselectedColor025_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor026.ets new file mode 100644 index 0000000000000000000000000000000000000000..fd5eaa7e4727e92927a53f9cfdece5eedc0d225c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor026.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor026 { + @State labelUnselectedColor: number = 0xFFFFFFFFFFFFFFFF; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == 0xFFFFFFFFFFFFFFFF) { + this.labelUnselectedColor = 0xFF0000; + } + else + { + this.labelUnselectedColor = 0xFFFFFFFFFFFFFFFF; + } + }).id('ArkUITabsLabelStyleUnselectedColor026_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor027.ets new file mode 100644 index 0000000000000000000000000000000000000000..11efb2e4f68967d90e67ab1ede8acce2e269c7a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor027.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor027 { + @State labelUnselectedColor: string = 'undefined'; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == 'undefined') { + this.labelUnselectedColor = '#FF0000'; + } + else + { + this.labelUnselectedColor = 'undefined'; + } + }).id('ArkUITabsLabelStyleUnselectedColor027_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor028.ets new file mode 100644 index 0000000000000000000000000000000000000000..26deca367ec3abdce7ce9a5cbe43a1bfebcecbfb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor028.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor028 { + @State labelUnselectedColor: string = 'null'; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == 'null') { + this.labelUnselectedColor = '#FF0000'; + } + else + { + this.labelUnselectedColor = 'null'; + } + }).id('ArkUITabsLabelStyleUnselectedColor028_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont001.ets new file mode 100644 index 0000000000000000000000000000000000000000..52c7ba630bdc7788330ef365f907a777d3317187 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont001.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont001 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State fontSize: Length = '20px'; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('fontSize') + .id('ArkUITabsLabelstyleFont001_001') + .onClick(() => { + this.fontSize = '10px'; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ font: { size: this.fontSize } }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont003.ets new file mode 100644 index 0000000000000000000000000000000000000000..099915a8757ae0ad7bb2a8e2a88fe504b46f200b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont003.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont003 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State fontSize: Length = '50%'; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('fontSize') + .id('ArkUITabsLabelstyleFont003_001') + .onClick(() => { + this.fontSize = '100%'; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ font: { size: this.fontSize } }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont004.ets new file mode 100644 index 0000000000000000000000000000000000000000..a6905b53286393295cc558c7f871f7ef141748f6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont004.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont004 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State fontSize: Length = 10; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('fontSize') + .id('ArkUITabsLabelstyleFont004_001') + .onClick(() => { + this.fontSize = 30; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ font: { size: this.fontSize } }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont005.ets new file mode 100644 index 0000000000000000000000000000000000000000..83d3010d46e178f6e5d773fec623f08d29699c65 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont005.ets @@ -0,0 +1,107 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont005 { + @State message: string = 'Hello World'; + @State labelFontSize: number = 20; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + Button('fontsize设置').width('50%') + .onClick(() => { + if (this.labelFontSize == 20) { + this.labelFontSize = 0; + } + else { + this.labelFontSize = 20; + } + }).id('ArkUITabsLabelStylefont005_001'); + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { size: this.labelFontSize } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { size: this.labelFontSize } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { size: this.labelFontSize } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { size: this.labelFontSize } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont006.ets new file mode 100644 index 0000000000000000000000000000000000000000..9db3b0af02d8ee2673837b8316a704fdca516641 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont006.ets @@ -0,0 +1,38 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont006 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({font: {size: -1}}) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont007.ets new file mode 100644 index 0000000000000000000000000000000000000000..a8b2010de3f33e506bd4439fb0a861db80d31e4a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont007.ets @@ -0,0 +1,97 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont007 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = FontWeight.Lighter; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont008.ets new file mode 100644 index 0000000000000000000000000000000000000000..3ac31dc7ba8311ef44d75597fed98375969d8ee2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont008.ets @@ -0,0 +1,97 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont008 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = FontWeight.Normal; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont009.ets new file mode 100644 index 0000000000000000000000000000000000000000..1a2ac75fc0cc44466320b5f55dff0227894dbf2c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont009.ets @@ -0,0 +1,97 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont009 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = FontWeight.Regular; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont010.ets new file mode 100644 index 0000000000000000000000000000000000000000..aab1b4a317cd4c3de235819400cd6e961b0b9de3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont010.ets @@ -0,0 +1,97 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont010 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = FontWeight.Medium; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont011.ets new file mode 100644 index 0000000000000000000000000000000000000000..60e17336dd1ba18319e33e3ad6fc52c89c160e3e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont011.ets @@ -0,0 +1,97 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont011 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = FontWeight.Bold; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont012.ets new file mode 100644 index 0000000000000000000000000000000000000000..0cc227dbbf1199678bf51d9a117dc503c94a8329 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont012.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont012 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State fontWeight: FontWeight | number | string = FontWeight.Bolder; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('fontSize') + .id('ArkUITabsLabelstyleFont012_001') + .onClick(() => { + this.fontWeight = FontWeight.Lighter; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ font: { weight: this.fontWeight } }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont013.ets new file mode 100644 index 0000000000000000000000000000000000000000..895e7769bf0d98544063cb88f3e10f137f8ec8e2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont013.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont013 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State fontWeight: FontWeight | number | string = 200; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('fontSize') + .id('ArkUITabsLabelstyleFont013_001') + .onClick(() => { + this.fontWeight = 800; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ font: { weight: this.fontWeight } }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont015.ets new file mode 100644 index 0000000000000000000000000000000000000000..e06a6ea5e397765e70a29865c8b62ef813d6df8f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont015.ets @@ -0,0 +1,107 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont015 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = 900; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + Button('fontsize设置').width('50%') + .onClick(() => { + if (this.labelFontWeight == 900) { + this.labelFontWeight = 0; + } + else { + this.labelFontWeight = 900; + } + }).id('ArkUITabsLabelStylefont015_001'); + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont016.ets new file mode 100644 index 0000000000000000000000000000000000000000..4a7345677ccc1340cb57986e605d81db5dc32c08 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont016.ets @@ -0,0 +1,107 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont016 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = 900; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + Button('fontsize设置').width('50%') + .onClick(() => { + if (this.labelFontWeight == 900) { + this.labelFontWeight = -1; + } + else { + this.labelFontWeight = 900; + } + }).id('ArkUITabsLabelStylefont016_001'); + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont017.ets new file mode 100644 index 0000000000000000000000000000000000000000..e6824cd17f99d3cba300c32618ab4a87d9a4c481 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont017.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont017 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State fontStyle: FontStyle = FontStyle.Normal; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('fontSize') + .id('ArkUITabsLabelstyleFont017_001') + .onClick(() => { + this.fontStyle = FontStyle.Italic; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ font: { style: this.fontStyle } }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont018.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont018.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b602d44bbd04002505f706ae81be20aa7295eb4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont018.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont018 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State fontStyle: FontStyle = FontStyle.Italic; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('fontSize') + .id('ArkUITabsLabelstyleFont018_001') + .onClick(() => { + this.fontStyle = FontStyle.Normal; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ font: { style: this.fontStyle } }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont019.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b8069b3591b266ef79b3c7cffdeb592663e2ef6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont019.ets @@ -0,0 +1,38 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont019 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({font: undefined}) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont020.ets new file mode 100644 index 0000000000000000000000000000000000000000..1d8da7d24fc3d7d5beb73e60a212573602856d75 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont020.ets @@ -0,0 +1,106 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont020 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = 1000; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + Button('字体改变').width('50%') + .onClick(() => { + if (this.labelFontWeight == 1000) { + this.labelFontWeight = 900; + } + else { + this.labelFontWeight = 1000; + } + }).id('ArkUITabsLabelStylefont020_001'); + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor002.ets new file mode 100644 index 0000000000000000000000000000000000000000..355101f513b88d95722448faa4527fa908036a02 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor002.ets @@ -0,0 +1,38 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsSingleSelectedcolor002 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: Color.White }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor005.ets new file mode 100644 index 0000000000000000000000000000000000000000..f3a4758fb974b0b014c8be942e43e6ac83c2f39b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor005.ets @@ -0,0 +1,38 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsSingleSelectedcolor005 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: Color.Green }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor008.ets new file mode 100644 index 0000000000000000000000000000000000000000..79c717ec19c850fea4f1e934b6aa104e5bbb24bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor008.ets @@ -0,0 +1,38 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsSingleSelectedcolor008 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: 0xffffff }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor011.ets new file mode 100644 index 0000000000000000000000000000000000000000..45353e1e50a3db2e08b5d7571d6e13af6545c637 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor011.ets @@ -0,0 +1,38 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsSingleSelectedcolor011 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: "rgb(255,100,255)" }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleUnselectedcolor/ArkUITabsSingleUnselectedcolor003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleUnselectedcolor/ArkUITabsSingleUnselectedcolor003.ets new file mode 100644 index 0000000000000000000000000000000000000000..a0dcbb665844f9be501fa1157dc7c5ce9ea50b17 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleUnselectedcolor/ArkUITabsSingleUnselectedcolor003.ets @@ -0,0 +1,38 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsSingleUnselectedcolor003 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: Color.Transparent }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsVertical/ArkUITabsVertical001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsVertical/ArkUITabsVertical001.ets new file mode 100644 index 0000000000000000000000000000000000000000..094e80c7c9993379ebd817364002af569976109b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsVertical/ArkUITabsVertical001.ets @@ -0,0 +1,55 @@ +/* + * 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. + */ +@Entry +@Component +struct ArkUITabsVertical001 { + @State vertical: boolean = false; + build() { + Column({ space: 5 }) { + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + } + .vertical(this.vertical).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + Button('设置').width('50%').margin({ top: 20 }) + .onClick(() => { + this.vertical = !this.vertical; + }).id('ArkUITabsVertical001_001') + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow001806.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow001806.ets new file mode 100644 index 0000000000000000000000000000000000000000..72e2fb54e7d6c1a14a8134666054eeda7c622a01 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow001806.ets @@ -0,0 +1,273 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 20; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +} +@Builder function MyGlobalBuilderFunction() +{ + Column({ space: 2 }) { + Text("WaterFlow End...").fontSize(12).height('16') + } +} +@Entry +@Component +struct FunctionJichuWaterFlow001806 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + footer: CustomBuilder = MyGlobalBuilderFunction + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 20] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 20 + } + } + lastSection: SectionOptions = { + itemsCount: 20, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 20] + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (this.dataCount - count < 20) { + this.lastSection.itemsCount = this.dataCount - count + sectionOptions.push(this.lastSection) + break; + } + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + WaterFlow({ footer: this.footer, scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + .id('FunctionJichuWaterFlow001806_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..2d6b4ed40209d5bb3be0bd480f09376a3092a693 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350.ets @@ -0,0 +1,283 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +} +@Builder function MyGlobalBuilderFunction() +{ + +} +@Entry +@Component +struct FunctionJichuWaterFlow0350 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + footer: CustomBuilder = MyGlobalBuilderFunction + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + } + lastSection: SectionOptions = { + itemsCount: 20, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (this.dataCount - count < 20) { + this.lastSection.itemsCount = this.dataCount - count + sectionOptions.push(this.lastSection) + break; + } + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + WaterFlow({ footer: this.footer, scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + .onScrollIndex((first: number, last: number) => { + // 即将触底时提前增加数据 + if (last + 20 >= this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + // 更新数据源后同步更新sections,修改最后一个section的FlowItem数量 + const sections: Array = this.sections.values(); + let newSection: SectionOptions = sections[this.sections.length() - 1]; + newSection.itemsCount += 100; + this.sections.update(-1, newSection); + } + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/Index.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e4b0390777d039b0993caeeff4c0deab3384c57 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/Index.ets @@ -0,0 +1,32 @@ +/* + * 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. + */ + +@Entry +@Component +struct Index { + @State message: string = 'Hello World' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterface/UIAttributeFontInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterface/UIAttributeFontInterface001.ets new file mode 100644 index 0000000000000000000000000000000000000000..9b6f1257fb95498aedb65d501865e5757c963c1e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterface/UIAttributeFontInterface001.ets @@ -0,0 +1,35 @@ +/* + * 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. + */ + + +@Entry +@Component +struct UIAttributeFontInterface001 { + @State message: string = 'Hello' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + .key('UIAttributeFontInterface001_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0080458.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0080458.ets new file mode 100644 index 0000000000000000000000000000000000000000..f45455ea2c8a3e22f1b0b5570eb4b44463fd865a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0080458.ets @@ -0,0 +1,231 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 12; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0080458 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 12]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutDirection(FlexDirection.ColumnReverse) + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0080458_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0090321.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0090321.ets new file mode 100644 index 0000000000000000000000000000000000000000..703225beaec89ee618342032004bac9960877524 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0090321.ets @@ -0,0 +1,231 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 12; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0090321 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 12]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutDirection(FlexDirection.Column) + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0090321_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0100678.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0100678.ets new file mode 100644 index 0000000000000000000000000000000000000000..5a0eb84c881cf451caa1de106e3d4013e8bcbebe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0100678.ets @@ -0,0 +1,231 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 12; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0100678 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 12]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutDirection(FlexDirection.RowReverse) + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0100678_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0110972.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0110972.ets new file mode 100644 index 0000000000000000000000000000000000000000..6f21d3552baffe9e2e18a20f4092ef0478fa7891 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0110972.ets @@ -0,0 +1,231 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 12; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0110972 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 12]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutDirection(FlexDirection.Row) + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0110972_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0120725.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0120725.ets new file mode 100644 index 0000000000000000000000000000000000000000..e43a0859b668c69953669809b9c12d20dc537544 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0120725.ets @@ -0,0 +1,230 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 12; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0120725 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 12]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0120725_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0130072.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0130072.ets new file mode 100644 index 0000000000000000000000000000000000000000..90f9858bdf8be045a2d710ef921965b14b76d0b1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0130072.ets @@ -0,0 +1,240 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 20; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0130072 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap('') + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0270011_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0140666.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0140666.ets new file mode 100644 index 0000000000000000000000000000000000000000..dbc72c657192fcd875218d35f2cbf4aa55dbdf9b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0140666.ets @@ -0,0 +1,239 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 20; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0140666 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0270011_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0150827.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0150827.ets new file mode 100644 index 0000000000000000000000000000000000000000..a45ca8edba761cface9c0190677459270ea27120 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0150827.ets @@ -0,0 +1,230 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0150827 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap($r('app.string.width_20')) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0150827_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0160890.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0160890.ets new file mode 100644 index 0000000000000000000000000000000000000000..227b4f395acfb9ebd9d95aac58773c0b8e33ce5d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0160890.ets @@ -0,0 +1,239 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 20; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0160890 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap('5vp') + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0270011_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0170444.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0170444.ets new file mode 100644 index 0000000000000000000000000000000000000000..09f64e0225caa049ebec998df73bf2cee0bf2a8c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0170444.ets @@ -0,0 +1,230 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0170444 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap('abc') + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0170444_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0270011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0270011.ets new file mode 100644 index 0000000000000000000000000000000000000000..2f3589e478e76b8f6c4ac740d91a3f549f332f99 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0270011.ets @@ -0,0 +1,240 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 20; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0270011 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .itemConstraintSize({minWidth:'0%',maxWidth:'50%',minHeight:'0%',maxHeight:'100%'}) + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0270011_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0280056.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0280056.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f3ae95bcf262c1cb3464e1e0d6c767eb95dce7f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0280056.ets @@ -0,0 +1,230 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0280056 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap('abc') + .rowsGap('') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0280056_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0290223.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0290223.ets new file mode 100644 index 0000000000000000000000000000000000000000..57622af02ddd5dac7b1fac4ccb14e56b22c6c0ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0290223.ets @@ -0,0 +1,230 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0290223 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap('abc') + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0290223_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0300414.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0300414.ets new file mode 100644 index 0000000000000000000000000000000000000000..f46d210ac0ac0e8fb227e769dd18b0111e8902ba --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0300414.ets @@ -0,0 +1,230 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0300414 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap('abc') + .rowsGap($r('app.string.height_20')) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0300414_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0310330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0310330.ets new file mode 100644 index 0000000000000000000000000000000000000000..d59903784248888bbaefbd43d1e4d88c84dbad4d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0310330.ets @@ -0,0 +1,230 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0310330 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap('abc') + .rowsGap('5vp') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0310330_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0320534.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0320534.ets new file mode 100644 index 0000000000000000000000000000000000000000..9d8f77ccc1d74d3bbda12d587b4700339caf3d97 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0320534.ets @@ -0,0 +1,230 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0320534 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0320534_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f41441aa330ba51c442b73d3a0fe6f737389132 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0370.ets @@ -0,0 +1,287 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0370 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + @State newCrossCount: number = 3 + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 2, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount: 2, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('push') + .height('5%') + .onClick(() => { + let newSection: SectionOptions = { + itemsCount: 6, + crossCount: this.newCrossCount, + columnsGap: 15, + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + this.dataSource.addItem(this.oneColumnSection.itemsCount) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 1) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 2) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 3) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 5) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 6) + const result: boolean = this.sections.push(newSection) + }) + .id('UIComponentListAndGridWaterSections0370_001'); + Button('改变crossCount') + .height('5%') + .onClick(() => { + this.newCrossCount = this.newCrossCount+1 + }).id('UIComponentListAndGridWaterSections0370_002'); + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..1ecfd41bf3812d4d5806de866eea688d333e92fd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0380.ets @@ -0,0 +1,286 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0380 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + @State newColumnsGap: number = 15 + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 2, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount: 2, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('push') + .height('5%') + .onClick(() => { + let newSection: SectionOptions = { + itemsCount: 6, + crossCount: 3, + columnsGap: this.newColumnsGap, + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + this.dataSource.addItem(this.oneColumnSection.itemsCount) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 1) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 2) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 3) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 5) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 6) + const result: boolean = this.sections.push(newSection) + }) + .id('UIComponentListAndGridWaterSections0380_001'); + Button('改变ColumnsGap') + .height('5%') + .onClick(() => { + this.newColumnsGap = this.newColumnsGap+10 + }).id('UIComponentListAndGridWaterSections0380_002'); + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..5288f7e0841fa758293967bae3e7503b39409aaf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0390.ets @@ -0,0 +1,286 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0390 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + @State newItemsCount: number = 6 + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 2, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount: 2, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('push') + .height('5%') + .onClick(() => { + let newSection: SectionOptions = { + itemsCount: this.newItemsCount, + crossCount: 3, + columnsGap: 15, + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + this.dataSource.addItem(this.oneColumnSection.itemsCount) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 1) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 2) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 3) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 5) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 6) + const result: boolean = this.sections.push(newSection) + }) + .id('UIComponentListAndGridWaterSections0390_001'); + Button('改变itemsCount') + .height('5%') + .onClick(() => { + this.newItemsCount = this.newItemsCount+1 + }).id('UIComponentListAndGridWaterSections0390_002'); + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..2a80a15fa33e1867d64d26ec45f863adeaa4df2e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0400.ets @@ -0,0 +1,286 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0400 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + @State newRowsGap: number = 10 + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 2, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount: 2, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('push') + .height('5%') + .onClick(() => { + let newSection: SectionOptions = { + itemsCount: 6, + crossCount: 3, + columnsGap: 15, + rowsGap: this.newRowsGap, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + this.dataSource.addItem(this.oneColumnSection.itemsCount) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 1) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 2) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 3) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 5) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 6) + const result: boolean = this.sections.push(newSection) + }) + .id('UIComponentListAndGridWaterSections0400_001'); + Button('改变rowsGap') + .height('5%') + .onClick(() => { + this.newRowsGap = this.newRowsGap + 10 + }).id('UIComponentListAndGridWaterSections0400_002'); + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..439beee8020525a019844fa8e9f6873626879438 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0410.ets @@ -0,0 +1,285 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0410 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 2, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount: 2, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('push') + .height('5%') + .onClick(() => { + let newSection: SectionOptions = { + itemsCount: 6, + crossCount: 3, + columnsGap: 15, + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + this.dataSource.addItem(this.oneColumnSection.itemsCount) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 1) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 2) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 3) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 5) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 6) + const result: boolean = this.sections.push(newSection) + }) + .id('UIComponentListAndGridWaterSections0410_001'); + Button('改变Margin') + .height('5%') + .onClick(() => { + this.sectionMargin = { top: 20, left: 10, bottom: 20, right: 10 } + }).id('UIComponentListAndGridWaterSections0410_002'); + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0420.ets new file mode 100644 index 0000000000000000000000000000000000000000..dccde5cb602befbd15b6e311757d74974bfab34e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0420.ets @@ -0,0 +1,290 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0420 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 2, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount: 2, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('push') + .height('5%') + .onClick(() => { + let newSection: SectionOptions = { + itemsCount: 6, + crossCount: 3, + columnsGap: 15, + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + this.dataSource.addItem(this.oneColumnSection.itemsCount) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 1) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 2) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 3) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 5) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 6) + for (let i = 10; i < 16; i++) { + this.itemHeightArray.push(this.getSize()) + } + const result: boolean = this.sections.push(newSection) + }) + .id('UIComponentListAndGridWaterSections0420_001'); + Button('改变itemHeigh') + .height('5%') + .onClick(() => { + for (let i = 0; i < 16; i++) { + this.itemHeightArray.push(30) + } + }).id('UIComponentListAndGridWaterSections0420_002'); + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0500.ets new file mode 100644 index 0000000000000000000000000000000000000000..673aaef1d6c54623ccc107ee4778f85a909692fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0500.ets @@ -0,0 +1,254 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0500 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0510.ets new file mode 100644 index 0000000000000000000000000000000000000000..149782f8f14af53d4fd0e41857106ffedb0ca68a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0510.ets @@ -0,0 +1,255 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0510 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount:2, + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount:2, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(20) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0520.ets new file mode 100644 index 0000000000000000000000000000000000000000..30f972ba9483f8a21087273cc0b4c8cf325e679f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0520.ets @@ -0,0 +1,252 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0520 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount:2, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount:2, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .rowsGap(20) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0530.ets new file mode 100644 index 0000000000000000000000000000000000000000..d18fcd31c65c262690f8db24675baaccc1681b56 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0530.ets @@ -0,0 +1,252 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0530 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 0, left: 0, bottom: 0, right: 0 } + oneColumnSection: SectionOptions = { + itemsCount: 5, + crossCount:2, + onGetItemMainSizeByIndex: (index: number) => { + return 50; + } + } + twoColumnSection: SectionOptions = { + itemsCount: 5, + crossCount:2, + margin:this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return 50; + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .rowsGap(20) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0540.ets new file mode 100644 index 0000000000000000000000000000000000000000..9d1ac7b374f0598883283bafdc0601ced6f28778 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0540.ets @@ -0,0 +1,260 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} + +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0540 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + @State newPadding: number = 0; + sectionMargin: Margin = { top: 0, left: 0, bottom: 0, right: 0 } + oneColumnSection: SectionOptions = { + itemsCount: 5, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 50; + } + } + twoColumnSection: SectionOptions = { + itemsCount: 5, + crossCount: 2, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return 50; + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Button('改变padding') + .height('5%') + .onClick(() => { + this.newPadding = 20 + }).id('UIComponentListAndGridWaterSections0540_001'); + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .rowsGap(20) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .padding(this.newPadding) + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0560.ets new file mode 100644 index 0000000000000000000000000000000000000000..988ec7c9f482da38a801107464e3865f3fce231a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0560.ets @@ -0,0 +1,269 @@ +/* + * 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. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0560 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .height('5%') + .onClick(() => { + // 将所有分组替换成一个新分组,注意保证LazyForEach中数据数量和新分组itemsCount保持一致 + let totalCount: number = this.dataSource.totalCount() + let newSection: SectionOptions = { + itemsCount: totalCount, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + let oldLength: number = this.sections.length() + this.sections.splice(0, oldLength, [newSection]) + }) + .id('UIComponentListAndGridWaterSections0560_001') + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..430529e918ebabe14c0a966dc108b7ed967c80c8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0370.ets @@ -0,0 +1,66 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier0370 { + private controller: TabsController = new TabsController(); + @State gridGutter: number = 10; + + build() { + Column() { + Row() { + Button("gridGutter+10 " + this.gridGutter) + .width('47%') + .height(50) + .margin({ top: 5 }) + .onClick((event?: ClickEvent) => { + this.gridGutter += 10; + }).id('UIComponentNavModifier0370_001') + .margin({ right: '6%', bottom: '12vp' }); + Button("gridGutter-10 " + this.gridGutter) + .width('47%') + .height(50) + .margin({ top: 5 }) + .onClick((event?: ClickEvent) => { + this.gridGutter -= 10; + }).id('UIComponentNavModifier0370_002') + .margin({ bottom: '12vp' }); + } + + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(BottomTabBarStyle.of($r("sys.media.ohos_app_icon"), "1")); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(BottomTabBarStyle.of($r("sys.media.ohos_app_icon"), "2")); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(BottomTabBarStyle.of($r("sys.media.ohos_app_icon"), "3")); + } + .width('350vp') + .animationDuration(300) + .height('60%') + .barGridAlign({ sm: 2, margin: 10, gutter: this.gridGutter }) + .backgroundColor(0xf1f3f5); + } + .width('100%') + .height(500) + .margin({ top: 5 }) + .padding('10vp'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..78c6dcf16b22a7d1fdf7f4d844ed0446369ca9a8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0380.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiComponentNavModifier0380 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barGridAlign( + { + lg:10 + } + ) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..9b203df82efb3c9439b3b1a645b60e12222ed49d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0400.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiComponentNavModifier0400 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barGridAlign( + { + sm:10 + } + ) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier041.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier041.ets new file mode 100644 index 0000000000000000000000000000000000000000..fa5fb4106d504b2e93c5d0b295f45f28333bd164 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier041.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier041 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'blue'; + @State strokeWidth: Resource = ($r('app.float.strokewidth_10')); + @State isVisible: boolean = false; + @State startMargin: number = 0; + @State endMargin: number = 0; + @State nullFlag: boolean = false; + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red'); + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }); + + Button('设置').width('50%').margin({ top: 20 }) + .onClick(() => { + this.isVisible = !this.isVisible; + }).id('UIComponentNavModifier041_001') + if (this.isVisible) { + Text($r('app.float.strokewidth_10')).fontSize(30); + } + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier043.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier043.ets new file mode 100644 index 0000000000000000000000000000000000000000..55ac82a7786286c9883c653a0585b3ca3271101e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier043.ets @@ -0,0 +1,84 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier043 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'blue' + @State strokeWidth: number = -10 + @State strokeWidthDefaultWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + aboutToAppear(): void { + console.log(`gzc+${this.strokeWidth}`) + if(this.strokeWidth < 0) + { + this.strokeWidth = this.strokeWidthDefaultWidth + } + } + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + Button('设置').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.strokeWidth < 0) + { + this.strokeWidth = this.strokeWidthDefaultWidth + } + }).id('UIComponentNavModifier043_001') + + Text(this.strokeWidth + '').fontSize(30) + + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier044.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier044.ets new file mode 100644 index 0000000000000000000000000000000000000000..fca54e6b2e4b1f07f1f2aa80fa5ba773a5a0b4f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier044.ets @@ -0,0 +1,77 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier044 { + private controller1: TabsController = new TabsController(); + @State dividerColor: string = 'blue'; + @State strokeWidth: string = '50'; + @State startMargin: number = 0; + @State endMargin: number = 0; + @State nullFlag: boolean = false; + @State isVisible: boolean = false; + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red'); + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }); + Button('设置').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.isVisible = !this.isVisible; + }).id('UIComponentNavModifier044_001'); + + if (this.isVisible) { + Text(this.strokeWidth).fontSize(30); + } + + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier045.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier045.ets new file mode 100644 index 0000000000000000000000000000000000000000..e939be39f2ffd613918dd9cf0a65112116aa4b30 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier045.ets @@ -0,0 +1,68 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier045 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'blue' + @State strokeWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier046.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier046.ets new file mode 100644 index 0000000000000000000000000000000000000000..cc364cabf459fb94e19e9ad57700becf5cb65989 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier046.ets @@ -0,0 +1,68 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier046 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = '#FF0000' + @State strokeWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier048.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier048.ets new file mode 100644 index 0000000000000000000000000000000000000000..edfa0002f0625fd71ac98e0cffb758369f942bbb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier048.ets @@ -0,0 +1,68 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier048 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = '#FFC0CB' + @State strokeWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier053.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier053.ets new file mode 100644 index 0000000000000000000000000000000000000000..2d75c1617fb5f4238940333ec6209facdc6a6407 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier053.ets @@ -0,0 +1,72 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier053 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'red' + @State strokeWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + + Button('设置startMargin').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.startMargin = -10 + }).id('UIComponentNavModifier053_001') + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier056.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier056.ets new file mode 100644 index 0000000000000000000000000000000000000000..7e1bdbc9fd0e032a58f7e682755eff9df7d9ec9c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier056.ets @@ -0,0 +1,73 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier056 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'red' + @State strokeWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State tabHeight: number = 200 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height(this.tabHeight) + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + + Button('设置endMargin').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.endMargin = this.tabHeight * 0.8 + }).id('UIComponentNavModifier056_001') + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier058.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier058.ets new file mode 100644 index 0000000000000000000000000000000000000000..e881db5f3c0066fb11139da4ae27c8b6fc98ea75 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier058.ets @@ -0,0 +1,72 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier058 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'red' + @State strokeWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + + Button('设置endMargin').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.endMargin = -10 + }).id('UIComponentNavModifier058_001') + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier060.ets new file mode 100644 index 0000000000000000000000000000000000000000..a738a3ae6c2c23df3bd9d18b0a787faa9133b066 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier060.ets @@ -0,0 +1,81 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier060 { + @State message: string = 'Hello World' + private controller: TabsController = new TabsController() + private controller1: TabsController = new TabsController() + @State selfFadingFade: boolean = false; + + build() { + Column() { + Button('子页签设置渐隐').width('100%').margin({ bottom: '12vp' }) + .onClick((event?: ClickEvent) => { + this.selfFadingFade = true; + }) + Button('子页签设置不渐隐').width('100%').margin({ bottom: '12vp' }) + .onClick((event?: ClickEvent) => { + this.selfFadingFade = false; + }) + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Scrollable) + .barHeight(80) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .fadingEdge(this.selfFadingFade) + .height('30%') + .width('100%') + + } + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier063.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier063.ets new file mode 100644 index 0000000000000000000000000000000000000000..18a669509f6f7166692c8573c6c8680c1d3c3297 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier063.ets @@ -0,0 +1,117 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier063 { + @State fontColor: string = '#182431' + @State bgColor: number = 0xff0000 + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(190) + .barBackgroundColor(this.bgColor) + .margin({ top: 38 }) + Button('设置背景色').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.bgColor = 0xffffff + }).id('UIComponentNavModifier063_001') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier065.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier065.ets new file mode 100644 index 0000000000000000000000000000000000000000..5d92d9403ed2f0a03810c9829679646e9956d7b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier065.ets @@ -0,0 +1,117 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier065 { + @State fontColor: string = '#182431' + @State bgColor: string = '#ff0000' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(190) + .backgroundColor(this.bgColor) + .margin({ top: 38 }) + Button('设置背景色').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.bgColor = '#ffffff' + }).id('UIComponentNavModifier065_001') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier066.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier066.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac1406f41c47e908cf15c09b90c64ebb7e161504 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier066.ets @@ -0,0 +1,117 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier066 { + @State fontColor: string = '#182431' + @State bgColor: Resource = $r('app.color.yellow') + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(190) + .backgroundColor(this.bgColor) + .margin({ top: 38 }) + Button('设置背景色').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.bgColor = $r('app.color.blue') + }).id('UIComponentNavModifier066_001') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0770.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0770.ets new file mode 100644 index 0000000000000000000000000000000000000000..159e306ef28a9e20e1605eac288ff64ee4dba77e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0770.ets @@ -0,0 +1,75 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier0770 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? $r("app.media.magnifier") : $r("app.media.tick")) + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + } + }.tabBar(this.tabBuilder(0)).backgroundColor(Color.Red) + + TabContent() { + Column() { + Text('Tab2') + } + }.tabBar(this.tabBuilder(1)).backgroundColor(Color.Green) + + TabContent() { + Column() { + Text('Tab3') + } + }.tabBar(this.tabBuilder(2)).backgroundColor(Color.Yellow) + + TabContent() { + Column() { + Text('Tab4') + } + }.tabBar(this.tabBuilder(3)).backgroundColor(Color.Green) + } + .vertical(false) + .barHeight(56) + .barWidth(-300) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0810.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0810.ets new file mode 100644 index 0000000000000000000000000000000000000000..77c4d706fadd7103f5c3e527cc1cd20673f7e103 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0810.ets @@ -0,0 +1,75 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier0810 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? $r("app.media.magnifier") : $r("app.media.tick")) + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + } + }.tabBar(this.tabBuilder(0)).backgroundColor(Color.Red) + + TabContent() { + Column() { + Text('Tab2') + } + }.tabBar(this.tabBuilder(1)).backgroundColor(Color.Green) + + TabContent() { + Column() { + Text('Tab3') + } + }.tabBar(this.tabBuilder(2)).backgroundColor(Color.Yellow) + + TabContent() { + Column() { + Text('Tab4') + } + }.tabBar(this.tabBuilder(3)).backgroundColor(Color.Green) + } + .vertical(false) + .barHeight(250) + .barWidth('100%') + .width(360) + .height(300) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier083.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier083.ets new file mode 100644 index 0000000000000000000000000000000000000000..368cfe7807adc9c396986c90feb2a315b1f3009e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier083.ets @@ -0,0 +1,123 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier083{ + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State tabBarHeight: number = 0 + @State tabBarHeight2: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? $r("sys.media.ohos_app_icon") : $r("sys.media.ohos_app_icon")) + //.width(24) + //.height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => { + this.tabBarHeight = newValue.height as number + }) + } + + build() { + Column({space:10}) { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + Button('设置').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.tabBarHeight2 = this.tabBarHeight + }).id('UIComponentNavModifier083_001') + + Text('barWidth为'+this.tabBarHeight2 + '').fontSize(30) + }.width('100%') + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0840.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0840.ets new file mode 100644 index 0000000000000000000000000000000000000000..f96cc0728fc4772c8018e22dbbe6ff7c0ac1a3b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0840.ets @@ -0,0 +1,75 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier0840 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? $r("app.media.magnifier") : $r("app.media.tick")) + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + } + }.tabBar(this.tabBuilder(0)).backgroundColor(Color.Red) + + TabContent() { + Column() { + Text('Tab2') + } + }.tabBar(this.tabBuilder(1)).backgroundColor(Color.Green) + + TabContent() { + Column() { + Text('Tab3') + } + }.tabBar(this.tabBuilder(2)).backgroundColor(Color.Yellow) + + TabContent() { + Column() { + Text('Tab4') + } + }.tabBar(this.tabBuilder(3)).backgroundColor(Color.Green) + } + .vertical(false) + .barHeight(-100) + .barWidth('100%') + .width(360) + .height(300) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0860.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0860.ets new file mode 100644 index 0000000000000000000000000000000000000000..37f47718e4a30dd0071b3c027461ee86ec21c162 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0860.ets @@ -0,0 +1,75 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier0860 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? $r("app.media.magnifier") : $r("app.media.tick")) + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + } + }.tabBar(this.tabBuilder(0)).backgroundColor(Color.Red) + + TabContent() { + Column() { + Text('Tab2') + } + }.tabBar(this.tabBuilder(1)).backgroundColor(Color.Green) + + TabContent() { + Column() { + Text('Tab3') + } + }.tabBar(this.tabBuilder(2)).backgroundColor(Color.Yellow) + + TabContent() { + Column() { + Text('Tab4') + } + }.tabBar(this.tabBuilder(3)).backgroundColor(Color.Green) + } + .vertical(false) + .barHeight(250) + .barWidth('100%') + .width(360) + .height(300) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0900.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0900.ets new file mode 100644 index 0000000000000000000000000000000000000000..9304ac5dff09e3135b391a85c3474da479ffb69a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0900.ets @@ -0,0 +1,73 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier0900 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + private controller: TabsController = new TabsController(); + + @Builder tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.selectedIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }); + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.selectedIndex === index ? 1 : 0); + }.width('100%').id(name); + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')); + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(56) + .animationDuration(-100) + .onChange((index: number) => { + this.currentIndex = index + this.selectedIndex = index + }) + .width(360) + .height(296) + .margin({ top: 52 }) + .backgroundColor('#F1F3F5'); + }.width('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0920.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0920.ets new file mode 100644 index 0000000000000000000000000000000000000000..93ce0e74846d5976cb34cddc8341a2df19164795 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0920.ets @@ -0,0 +1,73 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavModifier0920 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + private controller: TabsController = new TabsController(); + + @Builder tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.selectedIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }); + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.selectedIndex === index ? 1 : 0); + }.width('100%').id(name); + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')); + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(56) + .animationDuration(30/100) + .onChange((index: number) => { + this.currentIndex = index + this.selectedIndex = index + }) + .width(360) + .height(296) + .margin({ top: 52 }) + .backgroundColor('#F1F3F5'); + }.width('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0011.ets new file mode 100644 index 0000000000000000000000000000000000000000..02c3b142a40fabacb4735b0d1461a6d66f867a10 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0011.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsAction0011 { + @State height1: number = 200; + @State width1: number = 200; + build() { + Column({ space: 5 }) { + + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('UIComponentNavTabsAction0011_001') + .width(this.width1) + .height(this.height1) + .backgroundColor(0xF1F3F5); + + Button('增加宽高').width('50%').margin({ top: 20 }) + .onClick(() => { + if(this.height1 == 200) + { + this.height1 = 250 + } + else + { + this.height1 = 200 + } + if(this.width1 == 200) + { + this.width1 = 250 + } + else + { + this.width1 = 200 + } + }).id('UIComponentNavTabsAction0011_002'); + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0012.ets new file mode 100644 index 0000000000000000000000000000000000000000..25dbe57b19c88c7be22ca87ab9aa4d000fbe6aa3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0012.ets @@ -0,0 +1,69 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsAction0012 { + @State simpleList: Array = ['tab0','tab1','tab2','tab3','tab4','tab5','tab6','tab7','tab8','tab9', + 'tab10','tab11','tab12','tab13','tab14','tab15','tab16','tab17','tab18','tab19', + 'tab20','tab21','tab22','tab23','tab24','tab25','tab26','tab27','tab28','tab29', + 'tab30','tab31','tab32','tab33','tab34','tab35','tab36','tab37','tab38','tab39', + 'tab40','tab41','tab42','tab43','tab44','tab45','tab46','tab47','tab48','tab49', + 'tab50','tab51','tab52','tab53','tab54','tab55','tab56','tab57','tab58','tab59', + 'tab60','tab61','tab62','tab63','tab64','tab65','tab66','tab67','tab68','tab69', + 'tab70','tab71','tab72','tab73','tab74','tab75','tab76','tab77','tab78','tab79', + 'tab80','tab81','tab82','tab83','tab84','tab85','tab86','tab87','tab88','tab89', + 'tab90','tab91','tab92','tab93','tab94','tab95','tab96','tab97','tab98','tab99'] + @State currentIndex: number = 0 + @Builder tabBuilder(title: string) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`).fontSize(50) + } + }.tabBar(this.tabBuilder(item)) + }, (item: string) => item) + } + .vertical(false) + .id('UIComponentNavTabsAction0012_001') + //.barMode(BarMode.Scrollable) + .barWidth(400) + .barHeight(120) + .animationDuration(0) + .width(400) + .height(400) + .backgroundColor('#FF0000') + .scrollable(true) + + } + .width('100%') + .height('100%') + + } + .height('100%') + .backgroundColor(0xF1F3F5) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..fb4018de3cdc9be404d64bb413ca21c41f3418c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0030.ets @@ -0,0 +1,122 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsAction0030 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(index == 0 ? 'Pink' : + (index == 1 ? 'Yellow' : + (index == 2 ? 'Green' : 'Blue'))) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(index == 0 ? 'Pink' : + (index == 1 ? 'Yellow' : + (index == 2 ? 'Green' : 'Blue'))) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .id('UIComponentNavTabsAction0030_001') + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..6dfef64945256f56baf7c336fc7bae73de8511d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0010.ets @@ -0,0 +1,132 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0010 { + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + + + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode) + ) + } + .vertical(false) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0010_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0010_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0010_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0010_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0010_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0010_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0010_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0010_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0010_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0010_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0010_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0010_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0010_013') + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0011.ets new file mode 100644 index 0000000000000000000000000000000000000000..cfe17f97526c997f18a446b924bd65853892dfb1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0011.ets @@ -0,0 +1,132 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0011 { + @State selectedMode: SelectedMode = SelectedMode.BOARD; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + + + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode) + ) + } + .vertical(false) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0011_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0011_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0011_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0011_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0011_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0011_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0011_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0011_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0011_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0011_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0011_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0011_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0011_013') + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0012.ets new file mode 100644 index 0000000000000000000000000000000000000000..0ef5fd10155ef2be71cf089e1256ad676aa7c375 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0012.ets @@ -0,0 +1,132 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0012 { + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + + + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode) + ) + } + .vertical(true) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0012_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0012_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0012_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0012_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0012_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0012_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0012_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0012_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0012_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0012_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0012_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0012_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0012_013') + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0013.ets new file mode 100644 index 0000000000000000000000000000000000000000..3b6c3e637e225ffcd7c10e3c3ded2b69b9525a97 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0013.ets @@ -0,0 +1,132 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0013 { + @State selectedMode: SelectedMode = SelectedMode.BOARD; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + + + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode) + ) + } + .vertical(true) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0013_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0013_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0013_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0013_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0013_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0013_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0013_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0013_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0013_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0013_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0013_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0013_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0013_013') + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0014.ets new file mode 100644 index 0000000000000000000000000000000000000000..c8e8b277a37dedd88646ca72f83dd7c90c5ea7df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0014.ets @@ -0,0 +1,132 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0014 { + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + + + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode) + ) + } + .vertical(true) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0014_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0014_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0014_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0014_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0014_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0014_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0014_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0014_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0014_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0014_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0014_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0014_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0014_013') + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0015.ets new file mode 100644 index 0000000000000000000000000000000000000000..674c4c6106ca1b751127a50a6616cd7be80e577e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0015.ets @@ -0,0 +1,131 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0015 { + @State selectedMode: SelectedMode = SelectedMode.BOARD; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + + + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode) + ) + } + .vertical(true) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0015_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0015_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0015_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0015_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0015_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0015_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0015_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0015_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0015_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0015_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0015_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0015_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0015_013') + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0016.ets new file mode 100644 index 0000000000000000000000000000000000000000..ee751d148045155516b6d580afd4c3c587724a17 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0016.ets @@ -0,0 +1,132 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0016 { + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + + + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode) + ) + } + .vertical(false) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0016_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0016_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0016_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0016_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0016_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0016_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0016_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0016_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0016_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0016_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0016_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0016_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0016_013') + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0017.ets new file mode 100644 index 0000000000000000000000000000000000000000..d213b086c62bf81e23e307be9ee005d8c51ca9da --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0017.ets @@ -0,0 +1,129 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0017 { + @State selectedMode: SelectedMode = SelectedMode.BOARD; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + } + .vertical(false) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0017_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0017_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0017_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0017_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0017_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0017_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0017_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0017_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0017_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0017_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0017_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0017_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0017_013') + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0018.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0018.ets new file mode 100644 index 0000000000000000000000000000000000000000..9fe44d5cc0502b3cedf9d1df97ce6ac71cb7bb50 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0018.ets @@ -0,0 +1,78 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0018 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Button('关闭模糊效果') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }) + .id('UIComponentNavTabsBlurStyle0018_001') + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1, 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3, 'Green')) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + .margin({ top: 52 }) + .backgroundColor('#F1F3F5') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0019.ets new file mode 100644 index 0000000000000000000000000000000000000000..fe049ee2b226cb338440e79c52684cc522364955 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0019.ets @@ -0,0 +1,90 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0019 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Button('关闭模糊效果') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }) + .id('UIComponentNavTabsBlurStyle0019_001') + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1, 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3, 'Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(this.tabBuilder(3, 'Red')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(3, 'Blue')) + } + .divider({ + strokeWidth: 1, + color: Color.Red + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + .margin({ top: 52 }) + .backgroundColor('#F1F3F5') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..7009d34e8a4e7284621a2dac5a8336ade2596b87 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0020.ets @@ -0,0 +1,83 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0020 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1, 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3, 'Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(this.tabBuilder(3, 'Red')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(3, 'Blue')) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .barPosition(BarPosition.Start) + .vertical(false) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(296) + .margin({ top: 52 }) + .backgroundColor('#F1F3F5') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0021.ets new file mode 100644 index 0000000000000000000000000000000000000000..2a06849ae2ccbc8cece6043851a255e45e32ee84 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0021.ets @@ -0,0 +1,80 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0021 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1, 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3, 'Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(this.tabBuilder(3, 'Red')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(3, 'Blue')) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barHeight(50) + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + .margin({ top: 52 }) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0022.ets new file mode 100644 index 0000000000000000000000000000000000000000..dbd8d98e887b71a51f07308f5acb65bf69ea0b18 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0022.ets @@ -0,0 +1,69 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0022 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1, 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3, 'Green')) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barMode(BarMode.Scrollable) + .margin('12vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0023.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0023.ets new file mode 100644 index 0000000000000000000000000000000000000000..555c6bd41f25a594ac0bbf8bd13902aa43a99f86 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0023.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0023 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('pink') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(SubTabBarStyle.of('Yellow') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(SubTabBarStyle.of('Red') + .selectedMode(SelectedMode.BOARD) + ) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Fixed) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + .margin({ top: 52 }) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0024.ets new file mode 100644 index 0000000000000000000000000000000000000000..27501c81cb4a57960e58e7a3d9b766b9c1a8797e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0024.ets @@ -0,0 +1,68 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0024 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('Pink') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + } + .tabBar(SubTabBarStyle.of('Yellow') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + } + .tabBar(SubTabBarStyle.of('Green') + .selectedMode(SelectedMode.BOARD) + ) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(80) + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + .margin({ top: 52 }) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0025.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0025.ets new file mode 100644 index 0000000000000000000000000000000000000000..6878c233291b169b067f02521c4e1d77d35eca9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0025.ets @@ -0,0 +1,98 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0025 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('Pink') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + } + .tabBar(SubTabBarStyle.of('Yellow') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + } + .tabBar(SubTabBarStyle.of('Green') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('Red') + .selectedMode(SelectedMode.BOARD) + ) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barHeight(300) + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + .margin({ top: 52 }) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0026.ets new file mode 100644 index 0000000000000000000000000000000000000000..3097bcb9f7ae0b82a42e5aa93bfc7762a7135c67 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0026.ets @@ -0,0 +1,83 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0026 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('Pink') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + } + .tabBar(SubTabBarStyle.of('Yellow') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + } + .tabBar(SubTabBarStyle.of('Green') + .selectedMode(SelectedMode.BOARD) + ) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Fixed) + .padding('10vp') + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0027.ets new file mode 100644 index 0000000000000000000000000000000000000000..74e17628891a1ead97b44f3754c4f43c1c501e63 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0027.ets @@ -0,0 +1,133 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0027 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State indicatorColor: ResourceColor = Color.Blue; + @State indicatorHeight: number = 30; + @State indicatorWidth: number = 70; + private controller: TabsController = new TabsController(); + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Button('下划线颜色变化') + .onClick(() => { + this.getUIContext()?.animateTo( + { + duration: 1000, + curve: Curve.Linear, + delay: 200, + iterations: 1, + playMode: PlayMode.Normal + }, () => { + if (this.indicatorColor === Color.Red) { + this.indicatorColor = Color.Yellow; + } else { + this.indicatorColor = Color.Red; + } + }) + }) + Button('下划线高度变化') + .onClick(()=>{ + this.getUIContext()?.animateTo( + { + duration: 1000, + curve: Curve.Linear, + delay: 200, + iterations: 1, + playMode: PlayMode.Normal + }, () => { + if (this.indicatorHeight === 20) { + this.indicatorHeight = 10; + } else { + this.indicatorHeight = 20; + } + }) + }) + Button('下划线宽度变化') + .onClick(()=>{ + this.getUIContext()?.animateTo( + { + duration: 1000, + curve: Curve.Linear, + delay: 200, + iterations: 1, + playMode: PlayMode.Normal + }, () => { + if (this.indicatorWidth === 30) { + this.indicatorWidth = 50; + } else { + this.indicatorWidth = 30; + } + }) + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('pink') + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(SubTabBarStyle.of('Yellow') + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue') + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green') + ) + } + .divider({ + strokeWidth: this.indicatorWidth, + color: this.indicatorColor, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Fixed) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0028.ets new file mode 100644 index 0000000000000000000000000000000000000000..817aa9e99a4fe9ea141b7024c13956e58397a2ba --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0028.ets @@ -0,0 +1,72 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0028 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1, 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3, 'Green')) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.End) + .vertical(false) + .width(360) + .height(296) + .margin({ top: 52 }) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0029.ets new file mode 100644 index 0000000000000000000000000000000000000000..03638c4ca11ceff0911239e5de9d0eaeb33f8f03 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0029.ets @@ -0,0 +1,92 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0029 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.NONE + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(300) + .barHeight(300) + .vertical(false) + .padding('10vp') + .width('auto') + .height(396) + .fadingEdge(true) + Button('打开模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0029_001') + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0029_002') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..f25db1a6153b44d204f68b38a80536ce350cd907 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0030.ets @@ -0,0 +1,89 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0030 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .barHeight(300) + .vertical(false) + .margin('10vp') + .width('auto') + .height(396) + .fadingEdge(true) + /* + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0030_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0031.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0031.ets new file mode 100644 index 0000000000000000000000000000000000000000..7437b83260d10b3c9fec02610738c58d33a35ecb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0031.ets @@ -0,0 +1,89 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0031 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(50) + .barHeight(300) + .vertical(false) + .margin('10vp') + .width('auto') + .height(396) + .fadingEdge(true) +/* + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0031_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0032.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0032.ets new file mode 100644 index 0000000000000000000000000000000000000000..72efc2ae8dd2ab9625d4e20aae5a7f9b88b2ce98 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0032.ets @@ -0,0 +1,89 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0032 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + /* + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + */ + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth('auto') + .barHeight(300) + .vertical(false) + .margin('10vp') + .width('auto') + .height(396) + .fadingEdge(true) +/* + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0032_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0033.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0033.ets new file mode 100644 index 0000000000000000000000000000000000000000..a76433e9979d1c0fb5026a02797f52f2f72e8f96 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0033.ets @@ -0,0 +1,87 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0033 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Fixed) + .barWidth(50) + .barHeight(100) + .vertical(false) + .width('auto') + .height(396) + .fadingEdge(true) + /* + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0033_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0034.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0034.ets new file mode 100644 index 0000000000000000000000000000000000000000..8dbe91fb99e388d21e0b474f6041eef68da01cea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0034.ets @@ -0,0 +1,87 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0034 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(80) + .barHeight(100) + .vertical(false) + .width('auto') + .height(396) + .fadingEdge(true) + /* + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0034_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0035.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0035.ets new file mode 100644 index 0000000000000000000000000000000000000000..5fc82a7c9246606e43cbbedd14e5b8415f92247a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0035.ets @@ -0,0 +1,88 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0035 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth('auto') + .barHeight(300) + .vertical(false) + .padding('10vp') + .width('auto') + .height(396) + .fadingEdge(true) + /* + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0035_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0036.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0036.ets new file mode 100644 index 0000000000000000000000000000000000000000..79b2ecdb55389c395b033f4ec147fac682f9a00c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0036.ets @@ -0,0 +1,88 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0036 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + /* + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode))*/ + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth('auto') + .barHeight(100) + .vertical(false) + .padding('10vp') + .width('auto') + .height(396) + .fadingEdge(true) + + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0036_001') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0038.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0038.ets new file mode 100644 index 0000000000000000000000000000000000000000..651fc16fab4f56a158e891dc96d4f43fc5f1a869 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0038.ets @@ -0,0 +1,72 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0038 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(80) + .barHeight(300) + .vertical(true) + .padding(('10vp')) + .width(360) + .height(396) + .fadingEdge(true) + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0039.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0039.ets new file mode 100644 index 0000000000000000000000000000000000000000..2cf9c48c29940e8b0625b3b979ae9685d133bce3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0039.ets @@ -0,0 +1,91 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0039 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.NONE + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .barHeight(300) + .vertical(true) + .padding(('10vp')) + .width(360) + .height(396) + .fadingEdge(true) + Button('打开模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0039_001') + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0039_002') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..c7a2d4a8ffb40c719201cc6c09daaf3eb94e2e31 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0040.ets @@ -0,0 +1,88 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0040 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .barHeight(300) + .vertical(true) + .padding(('10vp')) + .width(360) + .height(396) + .fadingEdge(true) + + /*Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0040_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0041.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0041.ets new file mode 100644 index 0000000000000000000000000000000000000000..fd23edf3a68f5f501717aa62023f5c0c258a2db8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0041.ets @@ -0,0 +1,88 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0041 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(50) + .barHeight(300) + .vertical(true) + .padding(('10vp')) + .width(360) + .height(396) + .fadingEdge(true) + + /*Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0041_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0042.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0042.ets new file mode 100644 index 0000000000000000000000000000000000000000..98e26ea385a1148f0806dfb4abaa88271f247608 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0042.ets @@ -0,0 +1,82 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0042 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Fixed) + .barWidth(50) + .vertical(true) + .width(360) + .height(396) + .fadingEdge(true) + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0043.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0043.ets new file mode 100644 index 0000000000000000000000000000000000000000..242b6fdaf95dba25210d7db1fad3e9ede7d8e26e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0043.ets @@ -0,0 +1,83 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0043 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Blur') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(80) + //.padding('10vp') + .vertical(true) + .width(360) + .height(396) + .fadingEdge(true) + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0044.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0044.ets new file mode 100644 index 0000000000000000000000000000000000000000..53551f1cafd911429e3aed466868e698ee56bc8c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0044.ets @@ -0,0 +1,84 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0044 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(80) + .barHeight(300) + .vertical(true) + .width(360) + .height(396) + .fadingEdge(true) + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0045.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0045.ets new file mode 100644 index 0000000000000000000000000000000000000000..d61e9c1a5415ef1c0a9b9c33c388f43b51ce8eda --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0045.ets @@ -0,0 +1,72 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0045 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(80) + .padding('10vp') + .vertical(true) + .width(360) + .height(396) + .fadingEdge(true) + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0046.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0046.ets new file mode 100644 index 0000000000000000000000000000000000000000..96e991bf7f173f86c39c6da412a91b296bf9a7b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0046.ets @@ -0,0 +1,72 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0046 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Fixed) + .barWidth(50) + .padding('10vp') + .vertical(true) + .width(360) + .height(396) + .fadingEdge(true) + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0047.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0047.ets new file mode 100644 index 0000000000000000000000000000000000000000..d6da2636e1cb258e26017bad4bfb1b303239134e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0047.ets @@ -0,0 +1,71 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0047 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1, 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3, 'Green')) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.End) + .vertical(true) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0048.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0048.ets new file mode 100644 index 0000000000000000000000000000000000000000..f741e52440aa4e80d51e5a541b7aaa608f9f2716 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0048.ets @@ -0,0 +1,93 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0048 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.NONE + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + .backgroundBlurStyle(this.blurStyle) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.End) + .vertical(true) + .width(360) + .height(196) + .fadingEdge(true) + Button('打开模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0048_001') + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0048_002') + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0049.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0049.ets new file mode 100644 index 0000000000000000000000000000000000000000..2f173a8ed52e5aa4471b5da70ba3737e898a7d95 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0049.ets @@ -0,0 +1,78 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0049 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.End) + .vertical(true) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..d873edf84dd67bc7f6a0e0a32712b39611bc5940 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0050.ets @@ -0,0 +1,78 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0050 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(50) + .padding('10vp') + .barPosition(BarPosition.End) + .vertical(true) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0051.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0051.ets new file mode 100644 index 0000000000000000000000000000000000000000..6937152cd39cdda5733ca18401c53dc547ea90ce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0051.ets @@ -0,0 +1,80 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0051 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('Pink') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + } + .tabBar(SubTabBarStyle.of('Yellow') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + } + .tabBar(SubTabBarStyle.of('Green') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('Red') + .selectedMode(SelectedMode.BOARD) + ) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Fixed) + .barWidth(50) + .barPosition(BarPosition.End) + .vertical(true) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0052.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0052.ets new file mode 100644 index 0000000000000000000000000000000000000000..ce25afd9115e5bfa1e7c9602de07a2d014b1a749 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0052.ets @@ -0,0 +1,96 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0052 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('Pink') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + } + .tabBar(SubTabBarStyle.of('Yellow') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + } + .tabBar(SubTabBarStyle.of('Green') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('Red') + .selectedMode(SelectedMode.BOARD) + ) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barHeight(300) + .barPosition(BarPosition.End) + .vertical(true) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0053.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0053.ets new file mode 100644 index 0000000000000000000000000000000000000000..dedd3f028ac0fdfcaa746f125c4012f639dcc7fc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0053.ets @@ -0,0 +1,82 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0053 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('Pink') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + } + .tabBar(SubTabBarStyle.of('Yellow') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + } + .tabBar(SubTabBarStyle.of('Green') + .selectedMode(SelectedMode.BOARD) + ) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .padding('10vp') + .barPosition(BarPosition.End) + .vertical(true) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..a5c8a6910d19899fafb18bf044220a25a13d8ef2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0060.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0060 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%') + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width('100%').height('100%') + } + .tabBar(SubTabBarStyle.of('2')) + + } + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..9c187a58c379547f19df5871287b7514fdd31a7d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0080.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0080 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..fdf750c12980ef4ff215e841d5d5ae193945ea31 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0100.ets @@ -0,0 +1,43 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0100 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + } + .opacity(0.6) + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + } + .opacity(0.6) + .tabBar(SubTabBarStyle.of('2')) + + } + .opacity(0.6) + .barOverlap(true) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..c3393cbbbbbd30ab17c541f77c068c579adbcfe0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0110.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0110 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barWidth('50%') + .barOverlap(true) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..c82db6f7b8fbc156f4bfcfb6e5de9b2a5f520a04 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0160.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0160 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barOverlap(true) + .height(296) + .margin(10) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..cbad1cf46ecfab96ed3cb29df4f15856f9885323 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0170.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0170 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barOverlap(true) + .height(296) + .padding(10) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..254ad5afce511b7f419fe63d6c31605e7c594e5b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0180.ets @@ -0,0 +1,40 @@ +/* + * 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. + */@Entry +@Component +struct UIComponentNavTabsBlurStyle0180 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Red) + } + .opacity(0) + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .opacity(0) + .tabBar(SubTabBarStyle.of('2')) + + } + .barOverlap(true) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..581d2831d705024ec667f55be57b681fcb70c880 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0190.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0190 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Red) + } + .opacity(0.6) + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .opacity(0.6) + .tabBar(SubTabBarStyle.of('2')) + + } + .barOverlap(true) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..1710160ec671acfa1a44d844c6c03f6ffd9bd783 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0200.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0200 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .opacity(0.6) + .barOverlap(true) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..08693368cda518a72ec12a91b2f59f52bfcdcc79 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0210.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0210 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .opacity(0) + .barOverlap(true) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d28c9a1c19af2b192fdcde6aefb73be1916f158 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0220.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0220 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(this.blurStyle) + .divider({ + strokeWidth: 10, + color: Color.Red }) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..76dc54c84fc148787a0fda03d1cbef4fc3ee7141 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0230.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0230 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor('#ff0000') + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..e34491b12a60215c191a4df58ca6b74c33257724 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0240.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0240 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor('#ffffff') + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..77f2db72b2da824752064724d9b5f641995cf0d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0250.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0250 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor(0xff0000) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..8753255d9ed8d93196c67005961da5df873a3eac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0260.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0260 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor(0xffff00) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..aad861ede37e675a7888aa0f93c95df8245b2337 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0270.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0270 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor(Color.Blue) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..e79cbfe2600a841fa80eb064f840d5cf7fc11d5a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0280.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0280 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor(Color.Yellow) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..4a148ed267973de16604b0faab72e27c44e8b457 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0290.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0290 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor($r('app.color.start_window_background')) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1c10b0815834a6d7ac21ffe3c8c5451f8b1f85c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0300.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0300 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor('rgb(255,255,0)') + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..ca812e5062171d02f2baad0d7f4b9a4b0c5ea42c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0310.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0310 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor('rgba(255,0,0,0.5)') + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..f2b863e8785fc24ae95403576b52eb56a1aac46b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0320.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0320 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor('abc') + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..783cb4fefe9e764f73b6d499bf42f8a5e48c78a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0340.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0340 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Green) + } + .tabBar(SubTabBarStyle.of('tab1')) + + TabContent() { + Column().width(500).height('100%') + } + .tabBar(SubTabBarStyle.of('tab2')).backgroundColor(Color.Red) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..6f305f9f2322bee3a4d6ce5b6fe03a59f3e4c397 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0350.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0350 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor(Color. Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..19ce03d1ef56d2898f0a5e53436d434880af830f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0360.ets @@ -0,0 +1,43 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0360 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor(Color. Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .opacity(0.6) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..4d03eec2be34fe0dbbe0105d8a5db90f73d03422 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0370.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0370 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barWidth('150%') + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..5d37b7e1d857987ca80e7667a2ce7ce9452031f6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0380.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0380 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barHeight('100%') + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..e64126db2481805f715a5301d4cf92f355356f3b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0390.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0390 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barHeight('150%') + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f396c2104fb0da446ffdd2ad1dbe604d7269319 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0400.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0400 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barHeight('20%') + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount014.ets new file mode 100644 index 0000000000000000000000000000000000000000..0a9b2b6dac4bc4348365dfeaa880fa66686b7c47 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount014.ets @@ -0,0 +1,84 @@ +/* + * 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 { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount014 { + @State currentIndex: number = 0 + private tabsController: TabsController = new TabsController() + + build() { + Column() { + Tabs({ index: this.currentIndex, barPosition: BarPosition.Start, controller: this.tabsController }) { + 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')) + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .onChange((index: number) => { + this.currentIndex = index + }) + + Button('preload items: [1, 3]') + .margin(5) + .onClick(() => { + // 预加载第1、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabsController.preloadItems([1, 3]) + .then(() => { + console.info('preloadItems success.') + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + }) + }) + .id('UIComponentNavTabs014_001') + } + } +} + +@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) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015.ets new file mode 100644 index 0000000000000000000000000000000000000000..57f6ee4c8128606f7a91c98774151a39f7e319a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015.ets @@ -0,0 +1,84 @@ +/* + * 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 { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount015 { + @State currentIndex: number = 0 + private tabsController: TabsController = new TabsController() + + build() { + Column() { + Tabs({ index: this.currentIndex, barPosition: BarPosition.End, controller: this.tabsController }) { + 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')) + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .onChange((index: number) => { + this.currentIndex = index + }) + + Button('preload items: [1, 3]') + .margin(5) + .onClick(() => { + // 预加载第1、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabsController.preloadItems([1, 3]) + .then(() => { + console.info('preloadItems success.') + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + }) + }) + .id('UIComponentNavTabs015_001') + } + } +} + +@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) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount016.ets new file mode 100644 index 0000000000000000000000000000000000000000..4989f8dabb7a0c66a3c9b87587fa61a16e322691 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount016.ets @@ -0,0 +1,96 @@ +/* + * 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 { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount016 { + @State currentIndex: number = 0 + @State barPosition: BarPosition = BarPosition.Start // 新增状态以动态改变 barPosition + private tabsController: TabsController = new TabsController() + + build() { + Column() { + // Tabs 组件,使用动态 barPosition + Tabs({ index: this.currentIndex, barPosition: this.barPosition, controller: this.tabsController }) { + 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')) + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .onChange((index: number) => { + this.currentIndex = index + }) + + Button('preload items: [1, 3]') + .margin(5) + .onClick(() => { + // 预加载第1、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabsController.preloadItems([1, 3]) + .then(() => { + console.info('preloadItems success.') + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + }) + }) + .id('UIComponentNavTabs016_001') + + // 按钮用于切换 barPosition + Button('Toggle Bar Position') + .margin(5) + .onClick(() => { + // 切换 barPosition + this.barPosition = this.barPosition === BarPosition.Start ? BarPosition.End : BarPosition.Start; + console.info('Bar position changed to: ' + this.barPosition); + }) + .id('UIComponentNavTabs016_002') + } + } +} + +@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) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt001.ets new file mode 100644 index 0000000000000000000000000000000000000000..38dc88331734f88d757c9855df5f410cd8735c3a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt001.ets @@ -0,0 +1,112 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt001 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barWidth('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height(400) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt002.ets new file mode 100644 index 0000000000000000000000000000000000000000..978133ebb0ae3f3f9976786ccd459484175bc86f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt002.ets @@ -0,0 +1,112 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt002 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width(500) + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt003.ets new file mode 100644 index 0000000000000000000000000000000000000000..3a480b85cc3741a557ed52423bbe9d202c6c165b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt003.ets @@ -0,0 +1,112 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt003 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width(500) + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt004.ets new file mode 100644 index 0000000000000000000000000000000000000000..8bc1098ddda6fb6bfa9e606e3a3d57bb04924d64 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt004.ets @@ -0,0 +1,112 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt004 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barWidth('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height(400) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..7e7ab58e5cf0e4e6cf88b65de127c8c33eb72486 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0050.ets @@ -0,0 +1,54 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0500 { + private controller: TabsController = new TabsController() + @State subTabBorderRadius: number = 10; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height(50).backgroundColor(Color.Pink).borderRadius(this.subTabBorderRadius) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height(60).backgroundColor(Color.Yellow).borderRadius(this.subTabBorderRadius) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height(70).backgroundColor(Color.Blue).borderRadius(this.subTabBorderRadius) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height(80).backgroundColor(Color.Green).borderRadius(this.subTabBorderRadius) + }.tabBar('green') + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Scrollable) + .barHeight(140) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .backgroundColor(0xF5F5F5) + .height('auto') + + }.width('100%').height(250).padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt007.ets new file mode 100644 index 0000000000000000000000000000000000000000..88974097360926137ed7ee8f5e1b58c855f40cf6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt007.ets @@ -0,0 +1,135 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt007 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State tabPadding: string = 'auto' + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width(500) + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + .padding(this.tabPadding) + + Button('tab.padding设置为10').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabPadding = '10' + }).id('UIComponentNavTabsContentAdapt007_001') + + Button('tab.padding设置为20').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabPadding = '20' + }).id('UIComponentNavTabsContentAdapt007_002') + + Button('tab.padding设置为30').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabPadding = '30' + }).id('UIComponentNavTabsContentAdapt007_003') + + Button('tab.padding设置为auto').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabPadding = 'auto' + }).id('UIComponentNavTabsContentAdapt007_004') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..a595bf5629810e2144fa68fdc18a05c2a4197052 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0080.ets @@ -0,0 +1,64 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0080 { + private controller: TabsController = new TabsController() + @State subTabBorderRadius: number = 10; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height(50).backgroundColor(Color.Pink).borderRadius(this.subTabBorderRadius) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height(60).backgroundColor(Color.Yellow).borderRadius(this.subTabBorderRadius) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height(70).backgroundColor(Color.Blue).borderRadius(this.subTabBorderRadius) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height(80).backgroundColor(Color.Green).borderRadius(this.subTabBorderRadius) + }.tabBar('green') + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Scrollable) + .barHeight(140) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .backgroundColor(0xF5F5F5) + .height('auto') + + Button('addBorderRadius').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.subTabBorderRadius = 20 + }).id('UIComponentNavTabsContentAdapt0080_001') + + Button('resetBorderRadius').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.subTabBorderRadius = 10 + }).id('UIComponentNavTabsContentAdapt0080_002') + + }.width('100%').height(250).padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt010.ets new file mode 100644 index 0000000000000000000000000000000000000000..d226bfc2c8d907d9537d0675c9317de92b3d08f0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt010.ets @@ -0,0 +1,110 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt010 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text('Tab') + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(50) + }.tabBar(this.tabBuilder(0)) + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(100) + }.tabBar(this.tabBuilder(1)) + TabContent(){ + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(150) + }.tabBar(this.tabBuilder(2)) + TabContent(){ + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(true) + .barWidth(96) + .barHeight(414) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height(414) + .backgroundColor('#F1F3F5') + .margin({ top: 52 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt011.ets new file mode 100644 index 0000000000000000000000000000000000000000..5d4994b3976c0292a2f28079f9d852ba65324a4c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt011.ets @@ -0,0 +1,110 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt011 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text('Tab') + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50) + }.tabBar(this.tabBuilder(0)) + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100) + }.tabBar(this.tabBuilder(1)) + TabContent(){ + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150) + }.tabBar(this.tabBuilder(2)) + TabContent(){ + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(400) + }.tabBar(this.tabBuilder(3)) + } + .vertical(true) + .barWidth(96) + .barHeight(200) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(300) + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 52 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt012.ets new file mode 100644 index 0000000000000000000000000000000000000000..5ea70d1d46db3afc654963ff58ef0acce6ec9834 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt012.ets @@ -0,0 +1,110 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt012 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text('Tab') + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50) + }.tabBar(this.tabBuilder(0)) + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100) + }.tabBar(this.tabBuilder(1)) + TabContent(){ + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150) + }.tabBar(this.tabBuilder(2)) + TabContent(){ + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(400) + }.tabBar(this.tabBuilder(3)) + } + .vertical(true) + .barWidth(96) + .barHeight(200) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(300) + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 52 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt013.ets new file mode 100644 index 0000000000000000000000000000000000000000..495b06153678a4f67745fb6deaeb1f51b280f773 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt013.ets @@ -0,0 +1,110 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt013 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text('Tab') + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(50) + }.tabBar(this.tabBuilder(0)) + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(100) + }.tabBar(this.tabBuilder(1)) + TabContent(){ + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(150) + }.tabBar(this.tabBuilder(2)) + TabContent(){ + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(true) + .barWidth(96) + .barHeight(414) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height(414) + .backgroundColor('#F1F3F5') + .margin({ top: 52 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt014.ets new file mode 100644 index 0000000000000000000000000000000000000000..4422d4d9a7ff0046616207ea64fe2f5f571933e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt014.ets @@ -0,0 +1,115 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt014 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50).width(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100).width(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150).width(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(200).width(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .scrollable(false) + .barHeight('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + .padding('auto') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..7274559e79bcab2e40b8482ebaa08c9db13f0ef1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0150.ets @@ -0,0 +1,66 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0150 { + @State barWidth: number = 300; + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')); + } + .vertical(false) + .scrollable(true) + .barHeight('auto') + .barWidth(this.barWidth) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()); + }) + .width('400') + .height('auto') + .backgroundColor(0xF1F3F5); + Button('宽度改变').width('50%') + .onClick(() => { + if (this.barWidth == 300) { + this.barWidth = 400; + } + else { + this.barWidth = 300; + } + }).id('UIComponentNavTabsContentAdapt0150_001'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..57cfb440c28f8e9eb4cd84631705b16e64094fe5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0160.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0160 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barWidth: number = 200; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barWidth') + .id('UIComponentNavTabsContentadapt0160_001') + .onClick(() => { + this.barWidth += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('auto') + .barWidth(this.barWidth) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..9ffae16a4e9a399ca596d3b68771a3d2f558cd4d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0170.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0170 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barWidth: number = 200; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barWidth') + .id('UIComponentNavTabsContentadapt0170_001') + .onClick(() => { + this.barWidth += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('auto') + .barWidth(this.barWidth) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..15c96d9b15834e7a280e52fd26cdeae492e931c7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0180.ets @@ -0,0 +1,59 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0180 { + @State barWidth: number = 200; + build() { + Column({ space: 5 }) { + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')); + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('auto') + .barWidth(this.barWidth) + .backgroundColor(0xF1F3F5); + + Button('宽度改变').width('50%') + .onClick(() => { + this.barWidth -= 50; + if (this.barWidth <= 100) { + this.barWidth = 200; + } + }).id('UIComponentNavTabsContentAdapt0180_001'); + + }.width('400').height('400'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac565f2f779f2d27a252d44306323323d92e2480 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0190.ets @@ -0,0 +1,50 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0190 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barWidth: number = 200; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barWidth') + .id('UIComponentNavTabsContentadapt0190_001') + .onClick(() => { + this.barWidth += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .vertical(true) + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .width('auto') + .barWidth(this.barWidth) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f4db990807104330cd3d210c269385f35643e74 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0200.ets @@ -0,0 +1,50 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0200 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barWidth: number = 200; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barWidth') + .id('UIComponentNavTabsContentadapt0200_001') + .onClick(() => { + this.barWidth += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .vertical(true) + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('auto') + .barWidth(this.barWidth) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..26fb7de5a70ad77dd6aa6e4d40623cb4f8b317cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0210.ets @@ -0,0 +1,63 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0210 { + @State barHeight: number = 100; + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')); + } + .vertical(false) + .scrollable(true) + .barHeight(this.barHeight) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()); + }) + .width('100%') + .height('auto') + .backgroundColor(0xF1F3F5); + Button('高度改变').width('50%') + .onClick(() => { + this.barHeight += 50; + if (this.barHeight >= 200) { + this.barHeight = 100; + } + }).id('UIComponentNavTabsContentAdapt0210_001'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..61c778abaa031aea5d7508cc4b277a4921b2e4f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0220.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0220 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barHeight: number = 100; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barheight') + .id('UIComponentNavTabsContentadapt0220_001') + .onClick(() => { + this.barHeight += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('auto') + .barHeight(this.barHeight) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..bd0c8fc2afb56965f602f6981974cf11fd4689fd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0230.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0230 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barHeight: number = 200; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barHeight') + .id('UIComponentNavTabsContentadapt0230_001') + .onClick(() => { + this.barHeight += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('auto') + .barHeight(this.barHeight) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..9be0ffc85c8266ca2e182cb784ad107c0da2f9a8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0240.ets @@ -0,0 +1,59 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0240 { + @State barHeight: number = 400; + build() { + Column({ space: 5 }) { + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')); + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('auto') + .barHeight(this.barHeight) + .backgroundColor(0xF1F3F5); + + Button('高度改变').width('50%') + .onClick(() => { + this.barHeight -= 50; + if (this.barHeight <= 300) { + this.barHeight = 400; + } + }).id('UIComponentNavTabsContentAdapt0240_001'); + + }.width('100%').height(400); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..7bb6a5df18b52c6395ce1fbb2dc98b00b7ee2c2d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0250.ets @@ -0,0 +1,50 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0250 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barHeight: number = 100; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barheight') + .id('UIComponentNavTabsContentadapt0250_001') + .onClick(() => { + this.barHeight += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .vertical(true) + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .width('auto') + .barHeight(this.barHeight) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f786fc593f799773b07f8dd03bd8e7e023331b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0260.ets @@ -0,0 +1,50 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0260 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barHeight: number = 200; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barHeight') + .id('UIComponentNavTabsContentadapt0260_001') + .onClick(() => { + this.barHeight += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .vertical(true) + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .width('auto') + .barHeight(this.barHeight) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt027.ets new file mode 100644 index 0000000000000000000000000000000000000000..9e1ab4d5e947f835f8342df33a356262606d1cc6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt027.ets @@ -0,0 +1,77 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt027 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'red' + @State strokeWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller1 }) { + TabContent() { + Column().width('100%').height(50).backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height(80).backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height(100).backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height(120).backgroundColor(Color.Green) + }.tabBar('green') + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth('auto') + .barHeight('auto') + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('auto') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + + Button('增加Divider').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.nullFlag = false; + this.strokeWidth += 2; + this.dividerColor = 'red'; + this.startMargin = 0; + this.endMargin = 0; + }).id('UIComponentNavTabsContentAdapt027_001') + Button('复位Divider').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.nullFlag = false + this.strokeWidth = 2; + }).id('UIComponentNavTabsContentAdapt027_002') + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt028.ets new file mode 100644 index 0000000000000000000000000000000000000000..dd92e42c203db554e3ef40ce6ba805b5b280c34a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt028.ets @@ -0,0 +1,94 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt028 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'blue' + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller1 }) { + TabContent() { + Column().width('100%').height(50).backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height(70).backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height(80).backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height(100).backgroundColor(Color.Green) + }.tabBar('green') + + } + .vertical(false) + .direction(Direction.Ltr) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth('auto') + .barHeight('auto') + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('auto') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: 2, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + Button('上边距增加').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.startMargin += 2 + }).id('UIComponentNavTabsContentAdapt028_001') + + Button('上边距减少').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + if (this.startMargin > 2) { + this.startMargin -= 2 + } + }).id('UIComponentNavTabsContentAdapt028_002') + + Button('下边距增加').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.endMargin += 2 + }).id('UIComponentNavTabsContentAdapt028_003') + + Button('下边距减少').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + if (this.endMargin > 2) { + this.endMargin -= 2 + } + }).id('UIComponentNavTabsContentAdapt028_004') + + Button('颜色变为红色').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.dividerColor = 'red' + }).id('UIComponentNavTabsContentAdapt028_005') + + + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt030.ets new file mode 100644 index 0000000000000000000000000000000000000000..fcb001cd536778fb1e758d54297ff479d4ed2728 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt030.ets @@ -0,0 +1,64 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt030 { + private controller: TabsController = new TabsController() + @State barOverlap: boolean = true; + @State barBackgroundColor: string = '#88888888'; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, index: 2, controller: this.controller }) { + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(200) + .backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "1")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(300) + .backgroundColor(Color.Yellow) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "2")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(400) + .backgroundColor(Color.Green) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "3")) + } + .vertical(false) + .barMode(BarMode.Fixed) + .height('60%') + .barOverlap(true) + .scrollable(true) + .animationDuration(10) + .barBackgroundColor(this.barBackgroundColor) + } + .height(500) + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..8fb27f96eda57ecc929133e7570ef8f7332ec922 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0310.ets @@ -0,0 +1,56 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0310 { + @State vertical: boolean = false; + build() { + Column({ space: 5 }) { + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height(100).backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + + TabContent() { + Column().width('100%').height(110).backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + + TabContent() { + Column().width('100%').height(120).backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + + TabContent() { + Column().width('100%').height(130).backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + } + .vertical(this.vertical).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .height('auto') + .backgroundColor(0xF1F3F5); + + Button('设置').width('50%').margin({ top: 20 }) + .onClick(() => { + this.vertical = !this.vertical; + }).id('UIComponentNavTabsContentAdapt0310_001') + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt032.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt032.ets new file mode 100644 index 0000000000000000000000000000000000000000..79e66eecc76efc97d41a84272fcb36e898da7140 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt032.ets @@ -0,0 +1,119 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt032 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State tabVertical: boolean = false + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Button('tab.vertical设置为true').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabVertical = !this.tabVertical + }).id('UIComponentNavTabsContentAdapt032_001') + + Tabs({ barPosition: BarPosition.Start, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50).width(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100).width(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150).width(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(200).width(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(this.tabVertical) + .barHeight('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + .padding('auto') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt033.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt033.ets new file mode 100644 index 0000000000000000000000000000000000000000..d41ad152cd890ae101acae668c26f50906c7a4aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt033.ets @@ -0,0 +1,132 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct Index { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')); + @State symbolModifier3: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.dot_video')); + @State symbolModifier4: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.exposure')); + + @State barPosition: BarPosition = BarPosition.Start // 新增状态以动态改变 barPosition + + build() { + Column({space: 5}) { + Text("底部页签样式") + Column(){ + Tabs({barPosition: this.barPosition}) { + TabContent() { + Column(){ + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 0, bottom: 6.5 }) + }.width('100%').height('auto').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column(){ + Text('Tab_222') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 10, bottom: 16.5 }) + }.width('100%').height('auto').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier2, + }, 'Orange')) + .onWillShow(() => { + console.info("Orange will show") + }) + .onWillHide(() => { + console.info("Orange will hide") + }) + + TabContent() { + Column(){ + Text('Tab_333333') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 20, bottom: 26.5 }) + }.width('100%').height('auto').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier3, + }, 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column(){ + Text('Tab_444444444') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 36.5 }) + }.width('100%').height('auto').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier4, + }, 'Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index:number)=>{ + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + // 按钮用于切换 barPosition + Button('Toggle Bar Position') + .margin(5) + .onClick(() => { + // 切换 barPosition + this.barPosition = this.barPosition === BarPosition.Start ? BarPosition.End : BarPosition.Start; + console.info('Bar position changed to: ' + this.barPosition); + }) + .id('UIComponentNavTabs033_001') + + }.width('100%').height(200) + + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt034.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt034.ets new file mode 100644 index 0000000000000000000000000000000000000000..80b50767a09985ab43a5ccea6172a025717e8773 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt034.ets @@ -0,0 +1,131 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt034 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State tabWidth: string = 'auto' + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text('Tab') + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(50) + }.tabBar(this.tabBuilder(0)) + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(100) + }.tabBar(this.tabBuilder(1)) + TabContent(){ + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(150) + }.tabBar(this.tabBuilder(2)) + TabContent(){ + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(250) + }.tabBar(this.tabBuilder(3)) + } + .vertical(true) + .barWidth(96) + .barHeight(414) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(this.tabWidth) + .height(414) + .backgroundColor('#F1F3F5') + .margin({ top: 52 }) + + Button('宽度设置为200').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabWidth = '200' + }).id('UIComponentNavTabsContentAdapt034_001') + + Button('宽度设置为-100').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabWidth = '-100' + }).id('UIComponentNavTabsContentAdapt034_002') + + Button('宽度设置为100%').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabWidth = '100%' + }).id('UIComponentNavTabsContentAdapt034_003') + + Button('宽度设置为auto').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabWidth = 'auto' + }).id('UIComponentNavTabsContentAdapt034_004') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt035.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt035.ets new file mode 100644 index 0000000000000000000000000000000000000000..5dcf876c5d12a30d0faab26b66ff3ff7200996b4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt035.ets @@ -0,0 +1,134 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt035 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State tabHeight: string = 'auto' + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width(500) + .height(this.tabHeight) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + + Button('高度设置为200').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabHeight = '300' + }).id('UIComponentNavTabsContentAdapt035_001') + + Button('高度设置为-1').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabHeight = 'auto' + }).id('UIComponentNavTabsContentAdapt035_002') + + Button('高度设置为50%').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabHeight = '50%' + }).id('UIComponentNavTabsContentAdapt035_003') + + Button('高度设置为auto').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabHeight = '-1' + }).id('UIComponentNavTabsContentAdapt035_004') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..9334f81c220304e132da8284a679c7826f7b6e4e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0230.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct UIComponentNavTabsEdgeeffect0230 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..1c64ab4c43cc61f6e4b18410b5ef08ee5888b7d5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0270.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct UIComponentNavTabsEdgeeffect0270 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..0808204633b216e23ecf5fe08e1399e099f21eb1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0010.ets @@ -0,0 +1,48 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0010 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..35d1fef1941d615d8cab70a9727cf7dab76e1cef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0020.ets @@ -0,0 +1,50 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0020 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..e1d2f616bd2343404c36a111c415ce8b87791562 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0030.ets @@ -0,0 +1,51 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0030 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + .expandSafeArea([SafeAreaType.SYSTEM],[SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..ff48b607b89a795f46db31607058d0a17acede64 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0040.ets @@ -0,0 +1,51 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0040 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + .expandSafeArea([SafeAreaType.SYSTEM],[SafeAreaEdge.TOP]) + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..0ee9a1f71bfb24c77ad75eca91f0fd61accebb8a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0050.ets @@ -0,0 +1,51 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0050 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + .expandSafeArea([SafeAreaType.SYSTEM],[SafeAreaEdge.BOTTOM]) + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..f710671495671a7aa49d52ce282e84f179fe5567 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0060.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0060 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + .expandSafeArea([SafeAreaType.SYSTEM],[SafeAreaEdge.START, SafeAreaEdge.END]) + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..4734872858c1f98f60ce77ffd60b4713f7620281 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0070.ets @@ -0,0 +1,51 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0070 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + .expandSafeArea([SafeAreaType.SYSTEM],[SafeAreaEdge.START]) + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..5ae164c12507b374332ba16f96c7f37a9b7c8e84 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0080.ets @@ -0,0 +1,51 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0080 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + .expandSafeArea([SafeAreaType.SYSTEM],[SafeAreaEdge.END]) + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..0beed254fd0af7ad61dc3d0313330f6661e75eef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0090.ets @@ -0,0 +1,50 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0090 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..ee5f15fa71642245f4c01e3fbd496b6d7ee8f0c1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0100.ets @@ -0,0 +1,78 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0100 { + @State currentIndex: number = 0 + @State simpleList: Array = ['1','2']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + }.tabBar(this.tabBuilder(item, 1)) + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(200) + .backgroundColor('#F1F3F5') + .scrollable(true) + + Button('addTabs').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 2000; i++) { + console.log("addTabs=%d",i); + this.simpleList.push('a'); + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0140_001') + + Button('changeTabIndex').width('50%').margin({ top: 20 }) + .onClick(() => { + this.currentIndex = 3 + }).id('UIComponentNavTabsImproTrace0140_002') + } + .width('100%') + .height('100%') + + } + .height('100%') + .backgroundColor(0xF1F3F5) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..876dd6b45632ec1539afefa5a111cd998040ef63 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0110.ets @@ -0,0 +1,50 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0110 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..e2ffde3c8b9b30199a882c7480834ed11838205a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0120.ets @@ -0,0 +1,50 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0120 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Text('文本') + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + Text('文本') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..89ec3d1955ff60b46576815957a74f495a3c3d41 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0130.ets @@ -0,0 +1,50 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0130 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..b16e21ce8c7b1882336453ba5372f4a12aaf716f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0140.ets @@ -0,0 +1,50 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0140 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..bdffe6177f6382145ac106316667333ddbef1e34 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0150.ets @@ -0,0 +1,50 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0150 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..1944bb99cf365dfb00c70412356f806e16485d3a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0160.ets @@ -0,0 +1,56 @@ +/* + * opyright (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. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0160 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + @State tabsHeight: number = 1000 + + build() { + Column() { + Button() + .id('UIComponentNavTabsExpandsafearea0160_001') + .onClick(() => { + this.tabsHeight = this.tabsHeight - 20 + }) + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height(this.tabsHeight) + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsHeight/UIComponentNavTabsHeight001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsHeight/UIComponentNavTabsHeight001.ets new file mode 100644 index 0000000000000000000000000000000000000000..fa19b6d2bcb65dee0931a81670f606d2d697dec9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsHeight/UIComponentNavTabsHeight001.ets @@ -0,0 +1,112 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsHeight001 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width(500) + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..359b549b677bb6570272722ae8dbd928122db907 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0010.ets @@ -0,0 +1,75 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0010 { + @State currentIndex: number = 0; + @State tabVertical: boolean = false; + @State direction1: Direction = Direction.Rtl; + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController(); + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + aboutToAppear(): void { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(100) + .width(100) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(true) + .barMode(BarMode.Fixed) + .barWidth(60) + .barHeight(360) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index; + }) + .width(200) + .height('auto') + .backgroundColor('#F1F3F5') + .scrollable(true) + .direction(this.direction1); + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..fef0a00a2e8fa3a28b1a38fe4962ba55b8ae3649 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0020.ets @@ -0,0 +1,80 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0020 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + @State simpleList: Array = [1]; + private controller: TabsController = new TabsController(); + + @Builder + tabBuilder(index: number) { + Column() { + Image(this.selectedIndex === index ? $r("app.media.magnifier") : $r("app.media.tick")) + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 5; i++) { + this.simpleList.push(i); + } + }).id('UIComponentNavTabsImproTrace0020_001'); + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + ForEach(this.simpleList, (item: number) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(200) + .width(200) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder(item)); + + }, (item: string) => item); + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + this.selectedIndex = targetIndex + 1 + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..327c620bc6798c7623960f20c5579f08a6947eda --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0030.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0030 { + @State currentIndex: number = 0 + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0030_001'); + + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(200) + .width(200) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barWidth(260) + .barMode(BarMode.Fixed) + .barHeight(100) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height('300') + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('UIComponentNavTabsImproTrace0030_002'); + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..ce06fb0e8eee2ad1360326e71fa0aa724169a321 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0040.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0040 { + @State currentIndex: number = 0 + + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0040_001'); + + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(400) + .width(400) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barWidth(360) + .barMode(BarMode.Scrollable) + .barHeight(100) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height('500') + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('UIComponentNavTabsImproTrace0040_002'); + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..d94c02ea8164afa36792f6573cc94664e6f757b9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0060.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0060 { + @State currentIndex: number = 0 + + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0060_001'); + + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(400) + .width(400) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barWidth(360) + .barMode(BarMode.Scrollable) + .barHeight(100) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height('500') + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('UIComponentNavTabsImproTrace0060_002'); + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..436587898f127487dc6f28ac84128a28bfc48461 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0070.ets @@ -0,0 +1,75 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0070 { + @State currentIndex: number = 0 + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0070_001'); + + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(200) + .width(200) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barWidth(260) + .barMode(BarMode.Scrollable) + .barHeight(100) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height('300') + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('UIComponentNavTabsImproTrace0070_002'); + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..67062e5ba94b9863c8cd62ed5a9795bd3a721720 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0080.ets @@ -0,0 +1,88 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0080 { + @State currentIndex: number = 0 + @State barWidth: string = '360' + @State barHeight: string = '60' + @State tabWidth: string = 'auto' + @State tabHeight: string = '200' + @State tabVertical: boolean = false + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0080_001'); + + Button('横纵向切换').width('50%').margin({ top: 20 }) + .onClick(() => { + this.barWidth = '60' + this.barHeight = '360' + this.tabWidth = '200' + this.tabHeight = 'auto' + this.tabVertical = !this.tabVertical + }).id('UIComponentNavTabsImproTrace0080_002'); + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(100) + .width(100) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(this.tabVertical) + .barMode(BarMode.Fixed) + .barWidth(this.barWidth) + .barHeight(this.barHeight) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(this.tabWidth) + .height(this.tabHeight) + .backgroundColor('#F1F3F5') + .scrollable(true) + + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..1c0bb5553cd7e487e8e7617a7eaca8f29200d77a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0120.ets @@ -0,0 +1,82 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0120 { + @State currentIndex: number = 0 + @State tabContentWidth: number = 60 + @State tabContentHeight: number = 60 + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(this.tabContentHeight) + .width(this.tabContentWidth) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height(200) + .backgroundColor('#F1F3F5') + .scrollable(true) + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0120_001'); + + Button('增加宽和高').width('50%').margin({ top: 20 }) + .onClick(() => { + this.tabContentHeight = this.tabContentHeight + 10; + this.tabContentWidth = this.tabContentWidth + 10; + }).id('UIComponentNavTabsImproTrace0120_002'); + + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..bfc06f4d5c93b1a76217531b4b3e1df93e3431c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0130.ets @@ -0,0 +1,86 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0130 { + @State currentIndex: number = 0 + @State tabVertical: boolean = false + @State direction1: Direction = Direction.Rtl + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0130_001'); + + Button('镜像切换').width('50%').margin({ top: 20 }) + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl; + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr; + } + }).id('UIComponentNavTabsImproTrace0130_002'); + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(100) + .width(100) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(true) + .barMode(BarMode.Fixed) + .barWidth(60) + .barHeight(360) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(200) + .height('auto') + .backgroundColor('#F1F3F5') + .scrollable(true) + .direction(this.direction1); + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..1491994ee5f65bada5d2593385f96ea7ad159c52 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0140.ets @@ -0,0 +1,75 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0140 { + @State currentIndex: number = 0 + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(200) + .backgroundColor('#F1F3F5') + .scrollable(true); + + Button('addTabs').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0140_001'); + + Button('changeTabIndex').width('50%').margin({ top: 20 }) + .onClick(() => { + this.controller.changeIndex(3) + }).id('UIComponentNavTabsImproTrace0140_002'); + } + .width('100%') + .height('100%'); + + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..daa7375ed74e7b2b71bab7bc696aaff19dcc1be2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0150.ets @@ -0,0 +1,75 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0150 { + @State currentIndex: number = 0 + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(200) + .backgroundColor('#F1F3F5') + .scrollable(true); + + Button('addTabs').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0150_001'); + + Button('changeTabIndex').width('50%').margin({ top: 20 }) + .onClick(() => { + this.currentIndex = 3 + }).id('UIComponentNavTabsImproTrace0150_002'); + } + .width('100%') + .height('100%'); + + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..e02ef7cf11bb9e3ccd7b2c884f0d8956313cec33 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0160.ets @@ -0,0 +1,235 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentNavTabsImproTrace0160 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State tarBarMode: BarMode = BarMode.Scrollable + @State currentIndex: number = 0 + @State tarVertical: boolean = false + @State direction1: Direction = Direction.Rtl + @State gridMargin: number = 10 + @State gridGutter: number = 10 + @State sm: number = -2 + @State selectedIndex: number = 0 + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State symmetricExtensible: boolean = false; + @State layoutMode: LayoutMode = LayoutMode.VERTICAL; + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')); + @State symbolModifier3: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.dot_video')); + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? $r("app.media.magnifier") : $r("app.media.tick")) + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + @Builder + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({normal: this.symbolModifier1,}, "3") + .layoutMode(this.layoutMode) + .symmetricExtensible(this.symmetricExtensible)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({normal: this.symbolModifier2,}, "4") + .layoutMode(this.layoutMode) + .symmetricExtensible(this.symmetricExtensible)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({normal: this.symbolModifier3,}, "4") + .layoutMode(this.layoutMode) + .symmetricExtensible(this.symmetricExtensible)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(this.tarBarMode) + .barWidth(200) + .barHeight(200) + .vertical(this.tarVertical) + .margin('10vp') + .width('auto') + .height(396) + .fadingEdge(true) + .barGridAlign({ sm: this.sm, margin: this.gridMargin, gutter: this.gridGutter }) + .direction(this.direction1); + + Button('index改变').width('50%') + .onClick(() => { + this.currentIndex++; + if (this.currentIndex >= 6) { + this.currentIndex = 0; + } + }).id('UIComponentNavTabsImproTrace0160_001'); + + Button('方向改变').width('50%') + .onClick(() => { + this.tarVertical = !this.tarVertical + }).id('UIComponentNavTabsImproTrace0160_002'); + + Button('barMode改变').width('50%') + .onClick(() => { + if (this.tarBarMode == BarMode.Scrollable) { + this.tarBarMode = BarMode.Fixed + } + else { + this.tarBarMode = BarMode.Scrollable + } + }).id('UIComponentNavTabsImproTrace0160_003'); + Button('镜像改变').width('50%') + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsImproTrace0160_004') + + Button('barGridAlign改变').width('50%') + .onClick(()=>{ + this.gridMargin += 10 + }).id('UIComponentNavTabsImproTrace0160_005') + + Button('gridGutter改变').width('50%') + .onClick(()=>{ + this.gridGutter += 10 + }).id('UIComponentNavTabsImproTrace0160_006') + + Button('sm改变').width('50%') + .onClick(()=>{ + this.sm += 2; + if(this.sm>=8) + { + this.sm = -2; + } + }).id('UIComponentNavTabsImproTrace0160_007') + + Button('symmetricExtensible改变').width('50%') + .onClick(()=>{ + this.symmetricExtensible = !this.symmetricExtensible + }).id('UIComponentNavTabsImproTrace0160_008') + + Button('layoutMode改变').width('50%') + .onClick(()=>{ + if(this.layoutMode == LayoutMode.VERTICAL) + { + this.layoutMode = LayoutMode.HORIZONTAL; + } + else if(this.layoutMode == LayoutMode.HORIZONTAL) + { + this.layoutMode = LayoutMode.VERTICAL; + } + }).id('UIComponentNavTabsImproTrace0160_009') + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..e00858bd04c108002142b1ff5227d43098021cfe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0010.ets @@ -0,0 +1,97 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0010 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .id('UIComponentNavTabsInterception0010_001') + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (currentIndex == 2 && comingIndex == 3) + { + return false + } + else + { + return true + } + + }) + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.currentIndex==0) { + this.currentIndex = 2 + } + else + { + this.currentIndex = 0 + } + }).id('UIComponentNavTabsInterception0010_002') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..f7c811d771f6a257435f978ab68bab2ce7255642 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0030.ets @@ -0,0 +1,96 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0030 { + @State currentIndex: number = 3 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .id('UIComponentNavTabsInterception0030_001') + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) + { + return true + } + else + { + return true + } + + }) + Button('changeIndex2').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = 2 + }).id('UIComponentNavTabsInterception0030_002') + + Button('changeIndex4').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = 4 + }).id('UIComponentNavTabsInterception0030_004') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..27cbd8dc307247f5c10b49f8120d74052e93dd07 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0040.ets @@ -0,0 +1,85 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0040 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return false + } + return true + }) + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.controller.changeIndex(3) + }).id('UIComponentNavTabsInterception0040_001') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..bea663c90c10540c3bdf03963a59d666638df0e4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0050.ets @@ -0,0 +1,85 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0050 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return true + } + return true + }) + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.controller.changeIndex(3) + }).id('UIComponentNavTabsInterception0050_001') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..009cf1a3db59cb7afdec681edf85467ca2383462 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0060.ets @@ -0,0 +1,85 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0060 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return false + } + return true + }) + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = 3 + }).id('UIComponentNavTabsInterception0060_001') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..8c1fb94e4652f02871ad13d38ee118bebd52e5ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0070.ets @@ -0,0 +1,85 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0070 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return true + } + return true + }) + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = 3 + }).id('UIComponentNavTabsInterception0070_001') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..792b4b18dbe054ebafaa9dfef262f89c68dc5bca --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0080.ets @@ -0,0 +1,82 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0080 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + console.error(`onChange() this.currentIndex = ${index}`); + this.currentIndex = index + }).id('UIComponentNavTabsInterception0080_001') + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return false + } + return true + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..2aada3d3a46f26a7c5fd63ad47da963d404abd3d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0090.ets @@ -0,0 +1,82 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0090 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + console.error(`onChange() this.currentIndex = ${index}`); + this.currentIndex = index + }).id('UIComponentNavTabsInterception0090_001') + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return true + } + return true + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b28ef290e6a7abb891e85670c3b22f50c186781 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0130.ets @@ -0,0 +1,86 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0130 { + @State currentIndex: number = 2 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + + .justifyContent(FlexAlign.Center) + + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return false + } + return true + }).id('UIComponentNavTabsInterception0130_001') + + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..48d7cabb7219f9a084aac78b3c7ba2bfc762f74f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0150.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0150 { + @State simpleList: Array = ['one', 'two', 'three', 'four', 'five']; + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + }.tabBar(item) + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return false; + } + return true; + }) + .width(360) + .height(200) + .backgroundColor('#F1F3F5') + .scrollable(true) + + Button('delTabContent').width('50%').margin({ top: 20 }) + .onClick(() => { + this.simpleList.pop(); + }).id('UIComponentNavTabsInterception0150_001') + + Button('addTabContent').width('50%').margin({ top: 20 }) + .onClick(() => { + this.simpleList.push('five'); + }).id('UIComponentNavTabsInterception0150_002') + } + .width('100%') + .height('100%') + + } + .height('100%') + .backgroundColor(0xF1F3F5) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface012.ets new file mode 100644 index 0000000000000000000000000000000000000000..5dd52beb9843462626275c30d9d34886da78a360 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface012.ets @@ -0,0 +1,57 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsInterface012 { + @State message: string = 'Hello World' + private controller: TabsController = new TabsController() + private controller1: TabsController = new TabsController() + + build() { + Column() { + + Tabs({ barPosition: BarPosition.End, index: 0, controller: this.controller }) { + TabContent() { + Column().width(200).height('100%').backgroundColor(Color.Pink) + }.tabBar('pink111111111111111111111111111111111111111') + + TabContent() { + Column().width(250).height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow222222222222222222222222222222') + + TabContent() { + Column().width(300).height('100%').backgroundColor(Color.Blue) + }.tabBar('blue33333333333333333333333333333333') + + TabContent() { + Column().width(300).height('100%').backgroundColor(Color.Green) + }.tabBar('green444444444444444444444444444') + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Scrollable) + .barHeight(80) + .barWidth(400) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('30%') + .width(200) + + } + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1190.ets new file mode 100644 index 0000000000000000000000000000000000000000..c8255774796c58dc178ea44e150d80391b7fe90c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1190.ets @@ -0,0 +1,72 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsInterface1190 { + @State currentIndex: number = 0; + @State seq: number = 1; + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(200) + .backgroundColor('#F1F3F5') + .scrollable(true); + + Button('addTabar').width('50%').margin({ top: 20 }) + .onClick(() => { + this.seq += 1 + this.simpleList.push(this.seq.toString()); + this.currentIndex = this.simpleList.length - 1 + }).id('UIComponentNavTabsInterface1190_001'); + + } + .width('100%') + .height('100%'); + + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1220.ets new file mode 100644 index 0000000000000000000000000000000000000000..46241a0517e676a44c00ffcc13f77b991d88c8c9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1220.ets @@ -0,0 +1,116 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsInterface1220 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.id('UIComponentNavTabsInterface1220_001').width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..e960dc29d5c137de73f5db286d54a5a47ca2b06c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0030.ets @@ -0,0 +1,77 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0030 { + private controller: TabsController = new TabsController() + @State barOverlap: boolean = true; + @State barBackgroundColor: string = '#88888888'; + @State direction1: Direction = Direction.Rtl + build() { + Column() { + Button('方向改变').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0030_001') + Tabs({ barPosition: BarPosition.Start, index: 2, controller: this.controller }) { + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(200) + .backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "1")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(300) + .backgroundColor(Color.Yellow) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "2")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(400) + .backgroundColor(Color.Green) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "3")) + } + .vertical(true) + .barMode(BarMode.Fixed) + .height('60%') + .barOverlap(true) + .scrollable(true) + .direction(this.direction1) + .animationDuration(10) + .barBackgroundColor(this.barBackgroundColor) + } + .height(500) + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..596ee6eabb0f1ba160da3a58212c2b80b659a6d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0070.ets @@ -0,0 +1,77 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0070 { + private controller: TabsController = new TabsController() + @State barOverlap: boolean = true; + @State barBackgroundColor: string = '#88888888'; + @State direction1: Direction = Direction.Rtl + build() { + Column() { + Button('方向改变').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0070_001') + Tabs({ barPosition: BarPosition.Start, index: 2, controller: this.controller }) { + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(200) + .backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "1")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(300) + .backgroundColor(Color.Yellow) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "2")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(400) + .backgroundColor(Color.Green) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "3")) + } + .vertical(true) + .barMode(BarMode.Fixed) + .height('60%') + .barOverlap(true) + .scrollable(true) + .direction(this.direction1) + .animationDuration(10) + .barBackgroundColor(this.barBackgroundColor) + } + .height(500) + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..8ad90cd1637f6687e2960a6c99c8b0e33afacc1e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0090.ets @@ -0,0 +1,77 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0090 { + private controller: TabsController = new TabsController() + @State barOverlap: boolean = true; + @State barBackgroundColor: string = '#88888888'; + @State direction1: Direction = Direction.Rtl + build() { + Column() { + Button('方向改变').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0090_001') + Tabs({ barPosition: BarPosition.Start, index: 2, controller: this.controller }) { + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(200) + .backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "1")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(300) + .backgroundColor(Color.Yellow) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "2")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(400) + .backgroundColor(Color.Green) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "3")) + } + .vertical(false) + .barMode(BarMode.Fixed) + .height('60%') + .barOverlap(true) + .scrollable(true) + .direction(this.direction1) + .animationDuration(10) + .barBackgroundColor(this.barBackgroundColor) + } + .height(500) + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror010.ets new file mode 100644 index 0000000000000000000000000000000000000000..3df89e54dd175a855ba73c7e556c22466001b52a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror010.ets @@ -0,0 +1,77 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsMirror010 { + private controller: TabsController = new TabsController() + @State barOverlap: boolean = true; + @State barBackgroundColor: string = '#88888888'; + @State direction1: Direction = Direction.Rtl + build() { + Column() { + Button('方向改变').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror010_001') + Tabs({ barPosition: BarPosition.Start, index: 2, controller: this.controller }) { + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(200) + .backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "1")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(300) + .backgroundColor(Color.Yellow) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "2")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(400) + .backgroundColor(Color.Green) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "3")) + } + .vertical(true) + .barMode(BarMode.Fixed) + .height('60%') + .barOverlap(true) + .scrollable(true) + .direction(this.direction1) + .animationDuration(10) + .barBackgroundColor(this.barBackgroundColor) + } + .height(500) + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..6730b9725b256994b65a0fd64f85be999cf27511 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0110.ets @@ -0,0 +1,87 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentNavTabsMirror0110 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State tarBarMode: BarMode = BarMode.Scrollable + @State currentIndex: number = 0 + @State tarVertical: boolean = false + @State direction1: Direction = Direction.Rtl + @State selectedIndex: number = 0 + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + build() { + Column() { + Button('镜像改变').width('50%') + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0110_001') + + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)); + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(this.tarBarMode) + .barWidth(200) + .barHeight(200) + .vertical(true) + .margin('10vp') + .width('auto') + .height(396) + .fadingEdge(true) + .direction(this.direction1); + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..b6fb793b6e444c537de799824603da65f0874100 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0120.ets @@ -0,0 +1,64 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0120 { + @State direction1: Direction = Direction.Rtl; + + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')); + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()); + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .direction(this.direction1); + Button('镜像改变').width('50%') + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl; + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr; + } + }).id('UIComponentNavTabsMirror0120_001'); + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..02c75d2fd97d01eb5efb3ef308708cb1b603be95 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0130.ets @@ -0,0 +1,90 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0130 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + @State direction1: Direction = Direction.Rtl; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(20) + .fontWeight(500) + .lineHeight(200) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('TabContent0') + }.width('100%') + } + .tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('TabContent1') + }.width('100%') + } + .tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('TabContent2') + }.width('100%') + } + .tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('TabContent3') + }.width('100%') + } + .tabBar(this.tabBuilder(3)) + } + .vertical(true) + .barWidth(200) + .barHeight(200) + .barMode(BarMode.Scrollable) + .scrollable(true) + .direction(this.direction1) + .width(400) + .height(200) + .backgroundColor('#F1F3F5') + .margin({ top: 52 }); + + Button('镜像改变').width('50%') + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl; + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr; + } + }).id('UIComponentNavTabsMirror0130_001'); + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..d7466e405898b713790c8a1d8f4697925084bb07 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0140.ets @@ -0,0 +1,64 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0140 { + @State direction1: Direction = Direction.Rtl; + + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')); + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()); + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .direction(this.direction1); + Button('镜像改变').width('50%') + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl; + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr; + } + }).id('UIComponentNavTabsMirror0140_001'); + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..82ff2997f66f12f9783850fba6efc68dc375137e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0150.ets @@ -0,0 +1,70 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0150 { + @State direction1: Direction = Direction.Rtl; + @State tabPadding: number = 0; + + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column({ space: 5 }) { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').padding(this.tabPadding)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').padding(this.tabPadding)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').padding(this.tabPadding)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').padding(this.tabPadding)); + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .direction(this.direction1) + .backgroundColor(0xF1F3F5); + + Button('镜像改变').width('50%') + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl; + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr; + } + }).id('UIComponentNavTabsMirror0150_001'); + + Button('padding改变').width('50%') + .onClick(() => { + this.tabPadding = this.tabPadding+5; + }).id('UIComponentNavTabsMirror0150_002'); + }.width('100%').height(400); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..5e46741b68f6fde3d9ce5a8f27a95f80e0c0f60a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0160.ets @@ -0,0 +1,65 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0160 { + @State direction1: Direction = Direction.Rtl; + + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .direction(this.direction1); + + Button('镜像改变').width('50%') + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0160_001'); + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..371a56d47e3357783d9e204f027907c7038069e1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0250.ets @@ -0,0 +1,106 @@ +/* + * 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 { webview } from '@kit.ArkWeb'; +@Entry +@Component +struct UIComponentNavTabsMirror0250 { + controller: webview.WebviewController = new webview.WebviewController(); + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + @State direction1: Direction = Direction.Rtl; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + + @Builder tabBuilder(index: number) { + Column() { + Text(`Tab${index}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.id(`Tab${index}`).width('100%') + } + + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column() { + Text('www.sohu.com'); + Web({ src: 'www.sohu.com', controller: this.controller }) + .fileAccess(true); + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0)); + + TabContent() { + Column() { + Text('www.sina.com'); + Web({ src: 'www.sina.com', controller: this.controller }) + .fileAccess(true); + }.width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1)); + + TabContent() { + Column() { + Text('www.baidu.com'); + Web({ src: 'www.baidu.com', controller: this.controller }) + .fileAccess(true); + }.width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2)); + + TabContent() { + Column() { + Text('www.jd.com'); + Web({ src: 'www.jd.com', controller: this.controller }) + .fileAccess(true); + }.width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3)); + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .direction(this.direction1); + + Button('镜像改变').width('50%') + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0250_001') + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..575ea27731195f477618d307737074224233c258 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0260.ets @@ -0,0 +1,180 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0260 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + @State direction1: Direction = Direction.Rtl; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + + @Builder tabBuilder(index: number) { + Column() { + Text(`Tab${index}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.id(`Tab${index}`).width('100%') + } + + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column() { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0)); + + TabContent() { + Column() { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + }.width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1)); + + TabContent() { + Column() { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + }.width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2)); + + TabContent() { + Column() { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + }.width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3)); + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .direction(this.direction1); + + Button('镜像改变').width('50%') + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0260_001') + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror080.ets new file mode 100644 index 0000000000000000000000000000000000000000..4975aa80546b9184b23669b74447d9511537669f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror080.ets @@ -0,0 +1,108 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsMirror080 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'blue' + @State strokeWidth: number = -10 + @State strokeWidthDefaultValue: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + @State direction1: Direction = Direction.Ltr + aboutToAppear(): void { + this.strokeWidth = (this.strokeWidth < 0? this.strokeWidthDefaultValue : this.strokeWidth) + } + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .direction(this.direction1) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + Button('上边距增加').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.startMargin += 2 + }).id('UIComponentNavTabsMirror080_001') + + Button('上边距减少').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + if (this.startMargin > 2) { + this.startMargin -= 2 + } + }).id('UIComponentNavTabsMirror080_002') + + Button('下边距增加').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.endMargin += 2 + }).id('UIComponentNavTabsMirror080_003') + Button('下边距减少').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + if (this.endMargin > 2) { + this.endMargin -= 2 + } + }).id('UIComponentNavTabsMirror080_004') + + Button('方向改变').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror080_005') + + + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..149dfdd8f96a321c7099312ff9def05cbc490a03 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0190.ets @@ -0,0 +1,121 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsOnWillShow0190 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + + @Builder tabBuilder1(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + + build() { + Column({ space: 5 }) { + + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder('tab1',0)) + .onWillShow(() => { + console.info("Pink will show"); + }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder('tab2',1)) + .onWillShow(() => { + console.info("Yellow will show"); + }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder('tab3',2)) + .onWillShow(() => { + console.info("Blue will show"); + }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder('tab4',3)) + .onWillShow(() => { + console.info("Green will show"); + }); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200) + Text("侧边页签样式"); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder1('tab_1',0)) + .onWillShow(() => { + console.info("Pink will show") + }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder1('tab_2',1)) + .onWillShow(() => { + console.info("Yellow will show") + }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder1('tab_3',2)) + .onWillShow(() => { + console.info("Blue will show") + }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder1('tab_4',3)) + .onWillShow(() => { + console.info("Green will show") + }); + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(400); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsSubTabbarStyle/UIComponentNavTabsSubTabbarStyle0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsSubTabbarStyle/UIComponentNavTabsSubTabbarStyle0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..e6ee291f625658c4946071d72b12480934805835 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsSubTabbarStyle/UIComponentNavTabsSubTabbarStyle0010.ets @@ -0,0 +1,52 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsSubTabbarStyle0010 { + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue').id('Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('UIComponentNavTabsSubTabbarStyle0010_001') + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsWidth/UIComponentNavTabsWidth001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsWidth/UIComponentNavTabsWidth001.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f78971fd60cb4e8f817097ffa1ab28cf5b7206e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsWidth/UIComponentNavTabsWidth001.ets @@ -0,0 +1,110 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentNavTabsWidth001 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text('Tab') + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(50) + }.tabBar(this.tabBuilder(0)) + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(100) + }.tabBar(this.tabBuilder(1)) + TabContent(){ + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(150) + }.tabBar(this.tabBuilder(2)) + TabContent(){ + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(true) + .barWidth(96) + .barHeight(414) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height(414) + .backgroundColor('#F1F3F5') + .margin({ top: 52 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..71ebe99e134e707e2761cbf5eeed2a5a8d8d7d54 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0040.ets @@ -0,0 +1,68 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0040 { + @State isRefreshing: boolean = false; + @State refreshOffset: number = 60; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Button('addRefreshOffset').width('50%').margin({ top: 20 }) + .onClick(() => { + this.refreshOffset =+ 100; + }).id('UIComponentOtherRefreshAbility0040_001'); + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(this.refreshOffset) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..16fe4f557debeff0cb84c531f031b21a6fc9b64e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0050.ets @@ -0,0 +1,61 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0050 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(70) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..85d5d1ce8d3db497b8440620fe897765c06d7a2c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0070.ets @@ -0,0 +1,61 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0070 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(0) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..6bd7bd78409e80f6aaa9847a3f6a0b7bb2daade1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0080.ets @@ -0,0 +1,61 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0080 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(-1) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..ddb5eaeedbb72ba22fe50cb44b168a2325a063be --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0090.ets @@ -0,0 +1,61 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0090 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(499).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(500) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..52dfb3efb9bdeede271ed401db45fb5366d4189b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0100.ets @@ -0,0 +1,61 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0100 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(60.5) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..fa737a0a1018ff9cbdd6703e18967352cf7e2821 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0380.ets @@ -0,0 +1,64 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0380 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + + @Builder refreshbBuilder(name: string) { + Column() { + Text(name) .fontSize(30).margin(10) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + }.width('100%').id('' + name) + } + + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + this.refreshbBuilder(item) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..04944c2555ddc04aa8b4bf6729a619404eb91ca8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0390.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0390 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({left:20}) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height(100) + } + .align(Alignment.Center) + .clip(true) + .height(200) + .backgroundColor(Color.Red) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing,builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..1fce4eb054fea38f4b8cb3da5b5a0c2ce3f14e1a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0400.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0400 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({left:20}) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height(100) + } + .align(Alignment.Center) + .clip(true) + .height(200) + .backgroundColor(Color.Red) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing,builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..f6cd0aaa97f5a72c329304edcf90e9ceda4d756a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0410.ets @@ -0,0 +1,78 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0410 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({left:20}) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height('50%') + .width('50%') + } + .align(Alignment.Center) + .clip(true) + .height('50%') + .width('50%') + .backgroundColor(Color.Red) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing,builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..b05f550841c136a04ca5073faeacb7fe834f1be3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0140.ets @@ -0,0 +1,61 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0140 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(0) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..07269db1e9cc607229127091680bb03d6a3223cf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0170.ets @@ -0,0 +1,61 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0170 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(-100) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..49240b52287bb14d925011ab51f2c888b8192bf2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0180.ets @@ -0,0 +1,61 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0180 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(0) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..9de367744979f3369f8692121aadf9538c6d41ac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0040.ets @@ -0,0 +1,59 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0040 { + @State isRefreshing: boolean = false; + @State promptText: string = ' '; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..d764547497cf7ced227abab3ad79ec49f4f6c015 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0050.ets @@ -0,0 +1,59 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0050 { + @State isRefreshing: boolean = false; + @State promptText: string = "+-*<>!@#$"; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..96fc953b157f5416525c1ca51655468cede0b03c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0060.ets @@ -0,0 +1,59 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0060 { + @State isRefreshing: boolean = false; + @State promptText: string = "中英文abc"; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..b782efe41ecb1556eb9d04bbd1bb139a6df50b64 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0100.ets @@ -0,0 +1,59 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0100 { + @State isRefreshing: boolean = false; + @State promptText: Resource = $r("app.string.specifalRefreshText"); + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..fe4c34ff54fd708ffee9afe3b27c9291e0f1ff5e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0110.ets @@ -0,0 +1,59 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0110 { + @State isRefreshing: boolean = false; + @State promptText: Resource = $r("app.string.mixRefreshText"); + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..2d05b80d984fcbd7eb1128469f5a9d39a16b4550 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0120.ets @@ -0,0 +1,59 @@ +/* + * 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. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0120 { + @State isRefreshing: boolean = false; + @State promptText: string = 'openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234'; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..89c89a752e3a34463117729acd757dd82d2c76db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0010.ets @@ -0,0 +1,63 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0010 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..704f5cce1be4ba7c83f5a10823296b1b5388c718 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0020.ets @@ -0,0 +1,63 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0020 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.media.ohos_app_icon')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..e780d6fe4c9132b5349b501d65efd69341823ba4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0030.ets @@ -0,0 +1,63 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0030 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.magnifier')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..9c53f6d1326d477665c4d1ee42ba8a93b9e4fa16 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0040.ets @@ -0,0 +1,94 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0040 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')); + @State symbolModifier3: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.dot_video')); + @State symbolModifier4: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.exposure')); + @State normalIcocn: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.media.ohos_app_icon')); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.normalIcocn, + selected: this.symbolModifier1 + }, 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.normalIcocn, + selected: this.symbolModifier2 + }, 'Orange').id('Orange')) + .onWillShow(() => { + console.info("Orange will show") + }) + .onWillHide(() => { + console.info("Orange will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.normalIcocn, + selected: this.symbolModifier3 + }, 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.normalIcocn, + selected: this.symbolModifier4 + }, 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c50776dd365be60e70195e4b2d0c2a66f4a886e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0060.ets @@ -0,0 +1,69 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0060 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')).fontColor([Color.Pink]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier3: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.dot_video')).fontColor([Color.Yellow]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier4: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.exposure')).fontColor([Color.Green]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier2, + }, 'Orange')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier3, + }, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier4, + }, 'Green')) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..ebba57020c7685af3170b4d1c1eb1a559db72b5a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0070.ets @@ -0,0 +1,69 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0070 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_COLOR); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')).fontColor([Color.Pink]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_COLOR); + @State symbolModifier3: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.dot_video')).fontColor([Color.Yellow]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_COLOR); + @State symbolModifier4: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.exposure')).fontColor([Color.Green]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_COLOR); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier2, + }, 'Orange')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier3, + }, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier4, + }, 'Green')) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..acb4ca1ef302840dca2480b86c483e7c324e9355 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0080.ets @@ -0,0 +1,69 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0080 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')).fontColor([Color.Pink]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY); + @State symbolModifier3: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.dot_video')).fontColor([Color.Yellow]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY); + @State symbolModifier4: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.exposure')).fontColor([Color.Green]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier2, + }, 'Orange')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier3, + }, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier4, + }, 'Green')) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..ce9e706b2fea0be07c34835610972d49d4788902 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0090.ets @@ -0,0 +1,62 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0090 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontSize(160); + build() { + Column({space: 5}) { + Text("底部页签样式") + Column(){ + Tabs({barPosition: BarPosition.End}) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Pink').id('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Orange').id('Orange')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Blue').id('Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Green').id('Green')) + } + .vertical(false) + .scrollable(true) + .barHeight(150) + .barMode(BarMode.Fixed) + .onChange((index:number)=>{ + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(500) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..470879273e9a42c88ff16ff609143f5a158d4715 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0110.ets @@ -0,0 +1,60 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0110 { + build() { + Column({space: 5}) { + Text("底部页签样式") + Column(){ + Tabs({barPosition: BarPosition.End}) { + TabContent() { + Column().width(70).height(70).backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: undefined, + }, 'Pink')) + + TabContent() { + Column().width(80).height(80).backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: undefined, + }, 'Orange')) + + TabContent() { + Column().width(90).height(90).backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: undefined, + }, 'Blue')) + + TabContent() { + Column().width(100).height(100).backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: undefined, + }, 'Green')) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index:number)=>{ + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(300) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c180d42357ac69048ff24c2b499137bfc95cb0d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0120.ets @@ -0,0 +1,60 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0120 { + build() { + Column({space: 5}) { + Text("底部页签样式") + Column(){ + Tabs({barPosition: BarPosition.End}) { + TabContent() { + Column().width(70).height(70).backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: null, + }, 'Pink')) + + TabContent() { + Column().width(80).height(80).backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: null, + }, 'Orange')) + + TabContent() { + Column().width(90).height(90).backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: null, + }, 'Blue')) + + TabContent() { + Column().width(100).height(100).backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: null, + }, 'Green')) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index:number)=>{ + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(300) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..dd586880c2059147ae6b210babfff43cfb482fe0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0130.ets @@ -0,0 +1,72 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0130 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')).fontColor([Color.Pink]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State flag: boolean = true; + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier1 : this.symbolModifier2), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier1 : this.symbolModifier2), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier1 : this.symbolModifier2), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier1 : this.symbolModifier2), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + + Button('样式切换').width('50%') + .onClick(() => { + this.flag = !this.flag + }).id('UIComponentTabTabBarSymbol0130_001'); + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..9f0655de6ec8aa7733916d4d87a1d45c677b4c1b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0140.ets @@ -0,0 +1,76 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0140 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')).fontColor([Color.Pink]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier3: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.dot_video')).fontColor([Color.Yellow]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier4: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.exposure')).fontColor([Color.Green]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State flag: boolean = true; + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier1 : undefined), + }, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier2 : undefined), + }, 'Orange')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier3 : undefined), + }, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier4 : undefined), + }, 'Green')) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('样式切换').width('50%') + .onClick(() => { + this.flag = !this.flag + }).id('UIComponentTabTabBarSymbol0140_001') + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..5057fc0c275745a2d8daf2c0d2477e01a70a6dea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0150.ets @@ -0,0 +1,65 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0150 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State flag: boolean = false; + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#66000000') + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#66000000') + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#66000000') + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#66000000') + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..da3faed1ac6cf034b741298e4a39cfe6900be86d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0160.ets @@ -0,0 +1,68 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0160 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: null + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: null + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: null + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: null + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..877fe9c773a5c546a25a650279770d78581215e3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0170.ets @@ -0,0 +1,68 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0170 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: undefined + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: undefined + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: undefined + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: undefined + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..b3218bd606deefbe6d6363d9aadbc370ecc3cbb7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0180.ets @@ -0,0 +1,63 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0180 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..d4656f896edc2dc7f9ed8b129ba93a5a76972d82 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0190.ets @@ -0,0 +1,79 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0190 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')).fontColor([Color.Pink]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State flag: boolean = false; + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + //normal: (this.flag ? this.symbolModifier1 : undefined), + normal: this.symbolModifier1, + selected: (this.flag ? this.symbolModifier2 : undefined), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + //normal: (this.flag ? this.symbolModifier1 : undefined), + normal: this.symbolModifier1, + selected: (this.flag ? this.symbolModifier2 : undefined), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + //normal: (this.flag ? this.symbolModifier1 : undefined), + normal: this.symbolModifier1, + selected: (this.flag ? this.symbolModifier2 : undefined), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + //normal: (this.flag ? this.symbolModifier1 : undefined), + normal: this.symbolModifier1, + selected: (this.flag ? this.symbolModifier2 : undefined), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + Button('样式切换').width('50%') + .onClick(() => { + this.flag = !this.flag + }).id('UIComponentTabTabBarSymbol0190_001'); + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..f0b4156df4cb238856fcecd9e2cdeb190da62e7e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0230.ets @@ -0,0 +1,63 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0230 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..fa8235c7731a6373e4e4c46c8676500a39f1b581 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0260.ets @@ -0,0 +1,69 @@ +/* + * 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0260 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State flag: boolean = true; + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + Button('样式切换').width('50%') + .onClick(() => { + this.flag = !this.flag + }).id('UIComponentTabTabBarSymbol0260_001'); + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..afd3436bca671cd84fa0040435b57e494ba1ee86 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0050.ets @@ -0,0 +1,64 @@ +/* + * 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 { SymbolGlyphModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentTabTabbarTabbarsymbol0050 { + @State isModifier: boolean = true; + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State symbolModifier: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.openeye')); + @State symbolModifiers: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.icon')); + @State symbolModifierSelect: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.closeeye')); + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('isModifier') + .id('UIComponentTabTabbarTabbarsymbol0050_001') + .onClick(() => { + this.isModifier = !this.isModifier; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle({ + normal: this.isModifier ? this.symbolModifier : this.symbolModifiers, + selected: this.symbolModifierSelect + }, 'Black') + .iconStyle({ unselectedColor: this.isModifier ? Color.Red : Color.Pink, selectedColor: Color.Green })) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle({ + normal: this.isModifier ? this.symbolModifier : this.symbolModifiers, + selected: this.symbolModifierSelect + }, 'Pink')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barGridAlign( + { + lg: 10 + } + ) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..7ead2fcc8f5f7ca3ac05ee77d358e2ed5927e38e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0240.ets @@ -0,0 +1,53 @@ +/* + * 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 { SymbolGlyphModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentTabTabbarTabbarsymbol0240 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + @State symbolModifier: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.icon')) + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier + }, 'Black')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier + }, 'Pink')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barGridAlign( + { + lg:10 + } + ) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..8bb31d6822ed36badf3534ef196eceb7fea73000 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0250.ets @@ -0,0 +1,56 @@ +/* + * 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 { SymbolGlyphModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentTabTabbarTabbarsymbol0250 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State symbolModifier: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.openeye')) + @State symbolModifierSelect: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.closeeye')) + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier, + selected: this.symbolModifierSelect + }, 'Black')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier, + selected: this.symbolModifierSelect + }, 'Black')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barGridAlign( + { + lg: 10 + } + ) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..c26fa1d9efb5d54d5e6b7e39ca0f440e53f4db12 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,64 @@ +/* + * 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'; +import TestRunner from '@ohos.application.testRunner'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +async function onAbilityCreateCallback() { + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..e58bd507f3ecff51931c351ebcabf6603cd5c40c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 @@ -0,0 +1,54 @@ +{ + "module": { + "name": "entry_test", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "requestPermissions": [ + { + "name": "ohos.permission.WRITE_MEDIA" + }, + { + "name": "ohos.permission.READ_MEDIA" + }, + { + "name":"ohos.permission.UPDATE_CONFIGURATION" + }, + { + "name":"ohos.permission.RUNNING_LOCK" + }, + { + "name":"ohos.permission.INTERNET" + } + ], + "abilities": [ + { + "name": "TestAbility", + "srcEntry": "./ets/testability/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "exported": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/color.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..03d835fb48e435eb83f00da8336d83c20986a115 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/color.json @@ -0,0 +1,24 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "Pink", + "value": "#ffc0cb" + }, + { + "name": "yellow", + "value": "#FFCFA613" + }, + { + "name": "blue", + "value": "#0000ff" + }, + { + "name": "colorRed", + "value": "#FF0000" + } + ] +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/float.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..4038f619b6a75b6e28b75700455d382845eeaec6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/float.json @@ -0,0 +1,16 @@ +{ + "float": [ + { + "name": "boardSize_10", + "value": "10" + }, + { + "name": "strokewidth_10", + "value": "10" + }, + { + "name": "bbb", + "value": "5" + } + ] +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/integer.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/integer.json new file mode 100644 index 0000000000000000000000000000000000000000..6d4e4892ee5e79ab56cb0ad3e5f4f4ede5fef036 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/integer.json @@ -0,0 +1,42 @@ +{ + "integer":[ + { + "name": "0", + "value": 0 + }, + { + "name": "20", + "value": 20 + },{ + "name": "50", + "value": 50 + },{ + "name": "integer30", + "value": 30 + },{ + "name": "integer100", + "value": 100 + },{ + "name": "string30", + "value": 30 + },{ + "name": "30", + "value": 30 + },{ + "name": "15", + "value": 15 + }, + { + "name": "100", + "value": 100 + }, + { + "name": "negative30", + "value": -30 + }, + { + "name": "integer333", + "value": 333 + } + ] +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..cfa9a8b79768aa71f5572e30179859691081f600 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json @@ -0,0 +1,188 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + }, + { + "name": "Font_size", + "value": "5vp" + }, + { + "name": "Font_pristina", + "value": "pristina" + }, + { + "name": "color_yellow", + "value": "#FFDDD52F" + }, + { + "name": "size_30", + "value": "30vp" + }, + { + "name": "boardSize_10", + "value": "0vp" + }, + { + "name": "fontfamily_1", + "value": "HarmonyOS Sans" + }, + { + "name": "span", + "value": "span" + }, + { + "name": "test_value", + "value": "-10" + }, + { + "name": "TestAbility_label_p", + "value": "100%" + }, + { + "name": "abc", + "value": "abc" + }, + { + "name": "attributeUpdater", + "value": "resource font" + }, + { + "name": "dsfsfsf", + "value": "dsfsfsf" + }, + { + "name": "empty", + "value": "" + }, + { + "name": "string100", + "value": "100px" + }, + { + "name": "string_200px", + "value": "200px" + }, + { + "name": "string_24", + "value": "24%" + }, + { + "name": "apple", + "value": "苹果" + }, + { + "name": "fruit", + "value": "水果" + }, + { + "name": "appliance", + "value": "家电" + }, + { + "name": "banana", + "value": "香蕉" + }, + { + "name": "tv", + "value": "电视" + }, + { + "name": "computer", + "value": "电脑" + }, + { + "name": "string_300px", + "value": "300px" + }, + { + "name": "string_60", + "value": "60%" + }, + { + "name": "Hyperlink_address", + "value": "https://www.openharmony.cn/mainPlay" + }, + { + "name": "popup_width", + "value": "30px" + }, + { + "name": "popup_arrow_offset", + "value": "205%" + }, + { + "name": "popup_target_space", + "value": "30px" + }, + { + "name": "popup_offset_x", + "value": "30px" + }, + { + "name": "popup_radius", + "value": "100vp" + }, + { + "name": "popup_negative_radius", + "value": "-30px" + }, + { + "name": "popup_font_family", + "value": "'HarmonyOS Sans'" + }, + { + "name": "string1", + "value": "30vp" + }, + { + "name": "50_percent", + "value": "50%" + }, + { + "name": "24_percent", + "value": "24%" + }, + { + "name": "lineHeightSize", + "value": "60fp" + }, + { + "name": "popup_font_time_picker", + "value": "Arial,HarmonyOS Sans" + }, + { + "name": "time_picker_10vp", + "value": "10vp" + }, + { + "name": "time_picker_10fp", + "value": "10fp" + }, + { + "name": "mixRefreshText", + "value": "中英文abc" + }, + { + "name": "specifalRefreshText", + "value": "+-*<>!@#$" + }, + { + "name": "width_20", + "value": "20" + }, + { + "name": "height_20", + "value": "20" + } + ] +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/big_icon.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/big_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..7a32b59293c29076b7ff37af37dc09318aa26462 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/big_icon.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/cat.jpg b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/cat.jpg new file mode 100644 index 0000000000000000000000000000000000000000..382ac7dc322871219388ca27f7c637447e8c9e77 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/cat.jpg differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/closeeye.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/closeeye.png new file mode 100644 index 0000000000000000000000000000000000000000..c59a90fb37dd9cea9724d9e1b953767416981efc Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/closeeye.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/color.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/color.json new file mode 100644 index 0000000000000000000000000000000000000000..5e2848dc24cef89cfce3d8a902fc57706fa3eb22 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/color.json @@ -0,0 +1,12 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "Pink", + "value": "#FFC0CB" + } + ] +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/icon.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/icon.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/img2.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/img2.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/img2.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/magnifier.svg b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/magnifier.svg new file mode 100644 index 0000000000000000000000000000000000000000..a8e61ed1727ca0731eba11de69342da854ce3452 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/magnifier.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_search_filled + + + + + + + + + + \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/openeye.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/openeye.png new file mode 100644 index 0000000000000000000000000000000000000000..e1bedb18a67926d59141af2726ce804a93b313db Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/openeye.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/tick.svg b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/tick.svg new file mode 100644 index 0000000000000000000000000000000000000000..74490ce3029b43130497e0efbba02cda2de6edf7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/tick.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_select all + + + + + + + + + + \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/waterFlowTest.jpg b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/waterFlowTest.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e7134f381c8218491244fb6c34fcc608d4dd65e9 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/waterFlowTest.jpg differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..4b6331d774823da6d42bfb5d906f3c4eae139325 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -0,0 +1,383 @@ +{ + "src": [ + "testability/pages/Index", + "testability/pages/UIAttributeFontInterface/UIAttributeFontInterface001", + + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0310", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt001", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt002", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt003", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt004", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0050", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt007", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0080", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt010", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt011", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt012", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt013", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt014", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0150", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0180", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0210", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0240", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt027", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt028", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt030", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt032", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt033", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt034", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt035", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0160", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0190", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0220", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0250", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0170", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0200", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0230", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0260", + + "testability/pages/ArkUITabScrollable/ArkUITabScrollable001", + "testability/pages/ArkUITabScrollable/ArkUITabScrollable002", + + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont005", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont007", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont008", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont009", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont010", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont011", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont015", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont016", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont020", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont001", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont003", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont004", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont006", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont012", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont013", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont017", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont018", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont019", + + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor001", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor003", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor005", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor007", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor009", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor011", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor013", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor017", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor019", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor027", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor029", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor012", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor015", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor021", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor023", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor024", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor025", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor026", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor028", + + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor001", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor005", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor008", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor011", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor012", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor017", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor021", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor022", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor025", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor026", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor027", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor028", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor024", + + "testability/pages/ArkUITabsVertical/ArkUITabsVertical001", + + "testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow001806", + "testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350", + + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0080458", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0090321", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0100678", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0110972", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0120725", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0130072", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0140666", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0150827", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0160890", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0170444", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0270011", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0280056", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0290223", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0300414", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0310330", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0320534", + + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0370", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0380", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0390", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0400", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0410", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0420", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0500", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0510", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0520", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0530", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0540", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0560", + + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0370", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0380", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0400", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier041", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier043", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier044", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier045", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier046", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier048", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier053", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier056", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier058", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier060", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier063", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier065", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier066", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0770", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0810", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier083", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0840", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0860", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0900", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0920", + + "testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0011", + "testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0012", + "testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0030", + + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0010", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0011", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0012", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0013", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0014", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0015", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0016", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0017", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0029", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0030", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0031", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0032", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0033", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0034", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0035", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0036", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0038", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0039", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0040", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0041", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0042", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0043", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0044", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0045", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0046", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0048", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0049", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0050", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0018", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0019", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0020", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0021", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0022", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0023", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0024", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0025", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0026", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0027", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0028", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0047", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0051", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0052", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0053", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0060", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0080", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0100", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0110", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0160", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0170", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0180", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0190", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0200", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0210", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0220", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0230", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0240", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0250", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0260", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0270", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0280", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0290", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0300", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0310", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0320", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0340", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0350", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0360", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0370", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0380", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0390", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0400", + + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount014", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount016", + + "testability/pages/UIComponentNavTabsHeight/UIComponentNavTabsHeight001", + + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0010", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0020", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0030", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0040", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0060", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0070", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0080", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0120", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0130", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0140", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0150", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0160", + + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0010", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0030", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0040", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0050", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0060", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0070", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0080", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0090", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0130", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0150", + + "testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface012", + "testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1190", + "testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1220", + + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0030", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0070", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0090", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror010", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0110", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0120", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0130", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0140", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0150", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0160", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0250", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0260", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror080", + + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0190", + + "testability/pages/UIComponentNavTabsSubTabbarStyle/UIComponentNavTabsSubTabbarStyle0010", + + "testability/pages/UIComponentNavTabsWidth/UIComponentNavTabsWidth001", + + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0040", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0050", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0070", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0080", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0090", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0100", + + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0380", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0390", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0400", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0410", + + "testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0140", + "testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0170", + "testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0180", + + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0040", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0050", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0060", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0100", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0110", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0120", + + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0010", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0020", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0030", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0040", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0060", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0070", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0080", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0090", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0110", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0120", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0130", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0140", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0150", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0160", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0170", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0180", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0190", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0230", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0260", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0050", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0240", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0250", + + "testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0230", + "testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0270", + + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0090", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0010", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0120", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0130", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0140", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0150", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0160", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0050", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0080", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0070", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0060", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0040", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0030", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0020", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0100", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0110", + + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor001", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor004", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor008", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor013", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor014", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor022", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor024", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor025", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor026", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor027", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor028", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor029", + + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor002", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor005", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor014", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor016", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor021", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor022", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor024", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor026", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor027", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor028", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor029", + + "testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor002", + "testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor005", + "testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor008", + "testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor011", + + "testability/pages/ArkUITabsSingleUnselectedcolor/ArkUITabsSingleUnselectedcolor003" + + ] +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/cat.jpg b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/cat.jpg new file mode 100644 index 0000000000000000000000000000000000000000..382ac7dc322871219388ca27f7c637447e8c9e77 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/cat.jpg differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/font/own.ttf b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/font/own.ttf new file mode 100644 index 0000000000000000000000000000000000000000..aeddad7edaf7ec4d01f12a74b88a8ab20b9a068c Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/font/own.ttf differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/font/own1.ttf b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/font/own1.ttf new file mode 100644 index 0000000000000000000000000000000000000000..d8bf101deb779b9436f6d5ebb756757942ac84ed Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/font/own1.ttf differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/font/own2.TTF b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/font/own2.TTF new file mode 100644 index 0000000000000000000000000000000000000000..7e41fddd46e867ad55f7033ade8bb3bc26a5e21b Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/font/own2.TTF differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/string.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/string.json new file mode 100644 index 0000000000000000000000000000000000000000..d1049d56ac4487a3f44a6e5e0b26117519e7ea43 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "rawfile_string", + "value": "10vp" + } + ] +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/hvigor/hvigor-config.json5 b/function/ui_compare_rh/uicompare/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..0b5647c97e634a2746cae72de8f7b6a26692fd87 --- /dev/null +++ b/function/ui_compare_rh/uicompare/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "4.0.2", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "4.0.2" + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/hvigor/hvigor-wrapper.js b/function/ui_compare_rh/uicompare/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..372eae8eb4a124095936f9cd78df5c6756746f3f --- /dev/null +++ b/function/ui_compare_rh/uicompare/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("path"),D=require("os"),e=require("fs"),t=require("crypto"),r=require("child_process"),n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={},C={},F=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(C,"__esModule",{value:!0}),C.maxPathLength=C.isMac=C.isLinux=C.isWindows=void 0;const E=F(D),A="Windows_NT",o="Darwin";function a(){return E.default.type()===A}function c(){return E.default.type()===o}C.isWindows=a,C.isLinux=function(){return"Linux"===E.default.type()},C.isMac=c,C.maxPathLength=function(){return c()?1016:a()?259:4095},function(e){var t=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),r=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),i=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&t(D,u,e);return r(D,u),D};Object.defineProperty(e,"__esModule",{value:!0}),e.WORK_SPACE=e.HVIGOR_PROJECT_WRAPPER_HOME=e.HVIGOR_PROJECT_ROOT_DIR=e.HVIGOR_PROJECT_CACHES_HOME=e.HVIGOR_PNPM_STORE_PATH=e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=e.PROJECT_CACHES=e.HVIGOR_WRAPPER_TOOLS_HOME=e.HVIGOR_USER_HOME=e.DEFAULT_PACKAGE_JSON=e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=e.PNPM=e.HVIGOR=e.NPM_TOOL=e.PNPM_TOOL=e.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const F=i(D),E=i(u),A=C;e.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",e.PNPM_TOOL=(0,A.isWindows)()?"pnpm.cmd":"pnpm",e.NPM_TOOL=(0,A.isWindows)()?"npm.cmd":"npm",e.HVIGOR="hvigor",e.PNPM="pnpm",e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",e.DEFAULT_PACKAGE_JSON="package.json",e.HVIGOR_USER_HOME=E.resolve(F.homedir(),".hvigor"),e.HVIGOR_WRAPPER_TOOLS_HOME=E.resolve(e.HVIGOR_USER_HOME,"wrapper","tools"),e.PROJECT_CACHES="project_caches",e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=E.resolve(e.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",e.PNPM_TOOL),e.HVIGOR_PNPM_STORE_PATH=E.resolve(e.HVIGOR_USER_HOME,"caches"),e.HVIGOR_PROJECT_CACHES_HOME=E.resolve(e.HVIGOR_USER_HOME,e.PROJECT_CACHES),e.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),e.HVIGOR_PROJECT_WRAPPER_HOME=E.resolve(e.HVIGOR_PROJECT_ROOT_DIR,e.HVIGOR),e.WORK_SPACE="workspace"}(i);var s={},l={};Object.defineProperty(l,"__esModule",{value:!0}),l.logInfoPrintConsole=l.logErrorAndExit=void 0,l.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)},l.logInfoPrintConsole=function(u){console.log(u)};var B=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),d=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),f=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&B(D,u,e);return d(D,u),D};Object.defineProperty(s,"__esModule",{value:!0});var _=s.executeBuild=void 0;const p=f(e),O=f(u),h=l;_=s.executeBuild=function(u){const D=O.resolve(u,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const u=p.realpathSync(D);require(u)}catch(e){(0,h.logErrorAndExit)(`Error: ENOENT: no such file ${D},delete ${u} and retry.`)}};var P={},v={};!function(u){var D=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(u,"__esModule",{value:!0}),u.hashFile=u.hash=u.createHash=void 0;const r=D(t),i=D(e);u.createHash=(u="MD5")=>r.default.createHash(u);u.hash=(D,e)=>(0,u.createHash)(e).update(D).digest("hex");u.hashFile=(D,e)=>{if(i.default.existsSync(D))return(0,u.hash)(i.default.readFileSync(D,"utf-8"),e)}}(v);var g={},m={},R={};Object.defineProperty(R,"__esModule",{value:!0}),R.Unicode=void 0;class y{}R.Unicode=y,y.SPACE_SEPARATOR=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,y.ID_START=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,y.ID_CONTINUE=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Object.defineProperty(m,"__esModule",{value:!0}),m.JudgeUtil=void 0;const I=R;m.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&I.Unicode.SPACE_SEPARATOR.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||I.Unicode.ID_START.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||I.Unicode.ID_CONTINUE.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var N=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(g,"__esModule",{value:!0}),g.parseJsonText=g.parseJsonFile=void 0;const b=N(e),S=N(D),w=N(u),H=m;var x;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(x||(x={}));let M,T,V,G,j,J,W="start",U=[],L=0,$=1,k=0,K=!1,z="default",q="'",Z=1;function X(u,D=!1){T=String(u),W="start",U=[],L=0,$=1,k=0,G=void 0,K=D;do{M=Q(),nu[W]()}while("eof"!==M.type);return G}function Q(){for(z="default",j="",q="'",Z=1;;){J=Y();const u=Du[z]();if(u)return u}}function Y(){if(T[L])return String.fromCodePoint(T.codePointAt(L))}function uu(){const u=Y();return"\n"===u?($++,k=0):u?k+=u.length:k++,u&&(L+=u.length),u}g.parseJsonFile=function(u,D=!1,e="utf-8"){const t=b.default.readFileSync(w.default.resolve(u),{encoding:e});try{return X(t,D)}catch(D){if(D instanceof SyntaxError){const e=D.message.split("at");if(2===e.length)throw new Error(`${e[0].trim()}${S.default.EOL}\t at ${u}:${e[1].trim()}`)}throw new Error(`${u} is not in valid JSON/JSON5 format.`)}},g.parseJsonText=X;const Du={default(){switch(J){case"/":return uu(),void(z="comment");case void 0:return uu(),eu("eof")}if(!H.JudgeUtil.isIgnoreChar(J)&&!H.JudgeUtil.isSpaceSeparator(J))return Du[W]();uu()},start(){z="value"},beforePropertyName(){switch(J){case"$":case"_":return j=uu(),void(z="identifierName");case"\\":return uu(),void(z="identifierNameStartEscape");case"}":return eu("punctuator",uu());case'"':case"'":return q=J,uu(),void(z="string")}if(H.JudgeUtil.isIdStartChar(J))return j+=uu(),void(z="identifierName");throw Eu(x.Char,uu())},afterPropertyName(){if(":"===J)return eu("punctuator",uu());throw Eu(x.Char,uu())},beforePropertyValue(){z="value"},afterPropertyValue(){switch(J){case",":case"}":return eu("punctuator",uu())}throw Eu(x.Char,uu())},beforeArrayValue(){if("]"===J)return eu("punctuator",uu());z="value"},afterArrayValue(){switch(J){case",":case"]":return eu("punctuator",uu())}throw Eu(x.Char,uu())},end(){throw Eu(x.Char,uu())},comment(){switch(J){case"*":return uu(),void(z="multiLineComment");case"/":return uu(),void(z="singleLineComment")}throw Eu(x.Char,uu())},multiLineComment(){switch(J){case"*":return uu(),void(z="multiLineCommentAsterisk");case void 0:throw Eu(x.Char,uu())}uu()},multiLineCommentAsterisk(){switch(J){case"*":return void uu();case"/":return uu(),void(z="default");case void 0:throw Eu(x.Char,uu())}uu(),z="multiLineComment"},singleLineComment(){switch(J){case"\n":case"\r":case"\u2028":case"\u2029":return uu(),void(z="default");case void 0:return uu(),eu("eof")}uu()},value(){switch(J){case"{":case"[":return eu("punctuator",uu());case"n":return uu(),tu("ull"),eu("null",null);case"t":return uu(),tu("rue"),eu("boolean",!0);case"f":return uu(),tu("alse"),eu("boolean",!1);case"-":case"+":return"-"===uu()&&(Z=-1),void(z="numerical");case".":case"0":case"I":case"N":return void(z="numerical");case'"':case"'":return q=J,uu(),j="",void(z="string")}if(void 0===J||!H.JudgeUtil.isDigitWithoutZero(J))throw Eu(x.Char,uu());z="numerical"},numerical(){switch(J){case".":return j=uu(),void(z="decimalPointLeading");case"0":return j=uu(),void(z="zero");case"I":return uu(),tu("nfinity"),eu("numeric",Z*(1/0));case"N":return uu(),tu("aN"),eu("numeric",NaN)}if(void 0!==J&&H.JudgeUtil.isDigitWithoutZero(J))return j=uu(),void(z="decimalInteger");throw Eu(x.Char,uu())},zero(){switch(J){case".":case"e":case"E":return void(z="decimal");case"x":case"X":return j+=uu(),void(z="hexadecimal")}return eu("numeric",0)},decimalInteger(){switch(J){case".":case"e":case"E":return void(z="decimal")}if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},decimal(){switch(J){case".":j+=uu(),z="decimalFraction";break;case"e":case"E":j+=uu(),z="decimalExponent"}},decimalPointLeading(){if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalFraction");throw Eu(x.Char,uu())},decimalFraction(){switch(J){case"e":case"E":return j+=uu(),void(z="decimalExponent")}if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},decimalExponent(){switch(J){case"+":case"-":return j+=uu(),void(z="decimalExponentSign")}if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalExponentInteger");throw Eu(x.Char,uu())},decimalExponentSign(){if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalExponentInteger");throw Eu(x.Char,uu())},decimalExponentInteger(){if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},hexadecimal(){if(H.JudgeUtil.isHexDigit(J))return j+=uu(),void(z="hexadecimalInteger");throw Eu(x.Char,uu())},hexadecimalInteger(){if(!H.JudgeUtil.isHexDigit(J))return eu("numeric",Z*Number(j));j+=uu()},identifierNameStartEscape(){if("u"!==J)throw Eu(x.Char,uu());uu();const u=ru();switch(u){case"$":case"_":break;default:if(!H.JudgeUtil.isIdStartChar(u))throw Eu(x.Identifier)}j+=u,z="identifierName"},identifierName(){switch(J){case"$":case"_":case"‌":case"‍":return void(j+=uu());case"\\":return uu(),void(z="identifierNameEscape")}if(!H.JudgeUtil.isIdContinueChar(J))return eu("identifier",j);j+=uu()},identifierNameEscape(){if("u"!==J)throw Eu(x.Char,uu());uu();const u=ru();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!H.JudgeUtil.isIdContinueChar(u))throw Eu(x.Identifier)}j+=u,z="identifierName"},string(){switch(J){case"\\":return uu(),void(j+=function(){const u=Y(),D=function(){switch(Y()){case"b":return uu(),"\b";case"f":return uu(),"\f";case"n":return uu(),"\n";case"r":return uu(),"\r";case"t":return uu(),"\t";case"v":return uu(),"\v"}return}();if(D)return D;switch(u){case"0":if(uu(),H.JudgeUtil.isDigit(Y()))throw Eu(x.Char,uu());return"\0";case"x":return uu(),function(){let u="",D=Y();if(!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());if(u+=uu(),D=Y(),!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());return u+=uu(),String.fromCodePoint(parseInt(u,16))}();case"u":return uu(),ru();case"\n":case"\u2028":case"\u2029":return uu(),"";case"\r":return uu(),"\n"===Y()&&uu(),""}if(void 0===u||H.JudgeUtil.isDigitWithoutZero(u))throw Eu(x.Char,uu());return uu()}());case'"':case"'":if(J===q){const u=eu("string",j);return uu(),u}return void(j+=uu());case"\n":case"\r":case void 0:throw Eu(x.Char,uu());case"\u2028":case"\u2029":!function(u){console.warn(`JSON5: '${Fu(u)}' in strings is not valid ECMAScript; consider escaping.`)}(J)}j+=uu()}};function eu(u,D){return{type:u,value:D,line:$,column:k}}function tu(u){for(const D of u){if(Y()!==D)throw Eu(x.Char,uu());uu()}}function ru(){let u="",D=4;for(;D-- >0;){const D=Y();if(!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());u+=uu()}return String.fromCodePoint(parseInt(u,16))}const nu={start(){if("eof"===M.type)throw Eu(x.EOF);iu()},beforePropertyName(){switch(M.type){case"identifier":case"string":return V=M.value,void(W="afterPropertyName");case"punctuator":return void Cu();case"eof":throw Eu(x.EOF)}},afterPropertyName(){if("eof"===M.type)throw Eu(x.EOF);W="beforePropertyValue"},beforePropertyValue(){if("eof"===M.type)throw Eu(x.EOF);iu()},afterPropertyValue(){if("eof"===M.type)throw Eu(x.EOF);switch(M.value){case",":return void(W="beforePropertyName");case"}":Cu()}},beforeArrayValue(){if("eof"===M.type)throw Eu(x.EOF);"punctuator"!==M.type||"]"!==M.value?iu():Cu()},afterArrayValue(){if("eof"===M.type)throw Eu(x.EOF);switch(M.value){case",":return void(W="beforeArrayValue");case"]":Cu()}},end(){}};function iu(){const u=function(){let u;switch(M.type){case"punctuator":switch(M.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=M.value}return u}();if(K&&"object"==typeof u&&(u._line=$,u._column=k),void 0===G)G=u;else{const D=U[U.length-1];Array.isArray(D)?K&&"object"!=typeof u?D.push({value:u,_line:$,_column:k}):D.push(u):D[V]=K&&"object"!=typeof u?{value:u,_line:$,_column:k}:u}!function(u){if(u&&"object"==typeof u)U.push(u),W=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=U[U.length-1];W=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Cu(){U.pop();const u=U[U.length-1];W=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function Fu(u){const D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){const D=u.charCodeAt(0).toString(16);return`\\x${`00${D}`.substring(D.length)}`}return u}function Eu(u,D){let e="";switch(u){case x.Char:e=void 0===D?`JSON5: invalid end of input at ${$}:${k}`:`JSON5: invalid character '${Fu(D)}' at ${$}:${k}`;break;case x.EOF:e=`JSON5: invalid end of input at ${$}:${k}`;break;case x.Identifier:k-=5,e=`JSON5: invalid identifier character at ${$}:${k}`}const t=new Au(e);return t.lineNumber=$,t.columnNumber=k,t}class Au extends SyntaxError{}var ou={},au=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),cu=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),su=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&au(D,u,e);return cu(D,u),D},lu=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(ou,"__esModule",{value:!0}),ou.isFileExists=ou.offlinePluginConversion=ou.executeCommand=ou.getNpmPath=ou.hasNpmPackInPaths=void 0;const Bu=r,du=lu(e),fu=su(u),_u=i,pu=l;ou.hasNpmPackInPaths=function(u,D){try{return require.resolve(u,{paths:[...D]}),!0}catch(u){return!1}},ou.getNpmPath=function(){const u=process.execPath;return fu.join(fu.dirname(u),_u.NPM_TOOL)},ou.executeCommand=function(u,D,e){0!==(0,Bu.spawnSync)(u,D,e).status&&(0,pu.logErrorAndExit)(`Error: ${u} ${D} execute failed.See above for details.`)},ou.offlinePluginConversion=function(u,D){return D.startsWith("file:")||D.endsWith(".tgz")?fu.resolve(u,_u.HVIGOR,D.replace("file:","")):D},ou.isFileExists=function(u){return du.default.existsSync(u)&&du.default.statSync(u).isFile()};var Ou=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),hu=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),Pu=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&Ou(D,u,e);return hu(D,u),D},vu=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(P,"__esModule",{value:!0});var gu=P.initProjectWorkSpace=void 0;const mu=Pu(e),Ru=vu(D),yu=Pu(u),Iu=v,Nu=i,bu=g,Su=l,wu=ou;let Hu,xu,Mu;function Tu(u,D,e){return void 0!==e.dependencies&&(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,D.dependencies[u])===yu.normalize(e.dependencies[u])}function Vu(){const u=yu.join(Mu,Nu.WORK_SPACE);if((0,Su.logInfoPrintConsole)("Hvigor cleaning..."),!mu.existsSync(u))return;const D=mu.readdirSync(u);if(!D||0===D.length)return;const e=yu.resolve(Mu,"node_modules","@ohos","hvigor","bin","hvigor.js");mu.existsSync(e)&&(0,wu.executeCommand)(process.argv[0],[e,"--stop-daemon"],{});try{D.forEach((D=>{mu.rmSync(yu.resolve(u,D),{recursive:!0})}))}catch(D){(0,Su.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${u}.`)}}gu=P.initProjectWorkSpace=function(){if(Hu=function(){const u=yu.resolve(Nu.HVIGOR_PROJECT_WRAPPER_HOME,Nu.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);mu.existsSync(u)||(0,Su.logErrorAndExit)(`Error: Hvigor config file ${u} does not exist.`);return(0,bu.parseJsonFile)(u)}(),Mu=function(u){let D;D=function(u){let D=u.hvigorVersion;if(D.startsWith("file:")||D.endsWith(".tgz"))return!1;const e=u.dependencies,t=Object.getOwnPropertyNames(e);for(const u of t){const D=e[u];if(D.startsWith("file:")||D.endsWith(".tgz"))return!1}if(1===t.length&&"@ohos/hvigor-ohos-plugin"===t[0])return D>"2.5.0";return!1}(u)?function(u){let D=`${Nu.HVIGOR_ENGINE_PACKAGE_NAME}@${u.hvigorVersion}`;const e=u.dependencies;if(e){Object.getOwnPropertyNames(e).sort().forEach((u=>{D+=`,${u}@${e[u]}`}))}return(0,Iu.hash)(D)}(u):(0,Iu.hash)(process.cwd());return yu.resolve(Ru.default.homedir(),".hvigor","project_caches",D)}(Hu),xu=function(){const u=yu.resolve(Mu,Nu.WORK_SPACE,Nu.DEFAULT_PACKAGE_JSON);return mu.existsSync(u)?(0,bu.parseJsonFile)(u):{dependencies:{}}}(),!(0,wu.hasNpmPackInPaths)(Nu.HVIGOR_ENGINE_PACKAGE_NAME,[yu.join(Mu,Nu.WORK_SPACE)])||(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.hvigorVersion)!==xu.dependencies[Nu.HVIGOR_ENGINE_PACKAGE_NAME]||!function(){function u(u){const D=null==u?void 0:u.dependencies;return void 0===D?0:Object.getOwnPropertyNames(D).length}const D=u(Hu),e=u(xu);if(D+1!==e)return!1;for(const u in null==Hu?void 0:Hu.dependencies)if(!(0,wu.hasNpmPackInPaths)(u,[yu.join(Mu,Nu.WORK_SPACE)])||!Tu(u,Hu,xu))return!1;return!0}()){Vu();try{!function(){(0,Su.logInfoPrintConsole)("Hvigor installing...");for(const u in Hu.dependencies)Hu.dependencies[u]&&(Hu.dependencies[u]=(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.dependencies[u]));const u={dependencies:{...Hu.dependencies}};u.dependencies[Nu.HVIGOR_ENGINE_PACKAGE_NAME]=(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.hvigorVersion);const D=yu.join(Mu,Nu.WORK_SPACE);try{mu.mkdirSync(D,{recursive:!0});const e=yu.resolve(D,Nu.DEFAULT_PACKAGE_JSON);mu.writeFileSync(e,JSON.stringify(u))}catch(u){(0,Su.logErrorAndExit)(u)}(function(){const u=["config","set","store-dir",Nu.HVIGOR_PNPM_STORE_PATH],D={cwd:yu.join(Mu,Nu.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,wu.executeCommand)(Nu.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,D)})(),function(){const u=["install"],D={cwd:yu.join(Mu,Nu.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,wu.executeCommand)(Nu.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,D)}(),(0,Su.logInfoPrintConsole)("Hvigor install success.")}()}catch(u){Vu()}}return Mu};var Gu={};!function(t){var C=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),F=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),E=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&C(D,u,e);return F(D,u),D},A=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.executeInstallPnpm=t.isPnpmInstalled=t.environmentHandler=t.checkNpmConifg=t.PNPM_VERSION=void 0;const o=r,a=E(e),c=A(D),s=E(u),B=i,d=l,f=ou;t.PNPM_VERSION="7.30.0",t.checkNpmConifg=function(){const u=s.resolve(B.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),D=s.resolve(c.default.homedir(),".npmrc");if((0,f.isFileExists)(u)||(0,f.isFileExists)(D))return;const e=(0,f.getNpmPath)(),t=(0,o.spawnSync)(e,["config","get","prefix"],{cwd:B.HVIGOR_PROJECT_ROOT_DIR});if(0!==t.status||!t.stdout)return void(0,d.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const r=s.resolve(`${t.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,f.isFileExists)(r)||(0,d.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},t.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},t.isPnpmInstalled=function(){return!!a.existsSync(B.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,f.hasNpmPackInPaths)("pnpm",[B.HVIGOR_WRAPPER_TOOLS_HOME])},t.executeInstallPnpm=function(){(0,d.logInfoPrintConsole)(`Installing pnpm@${t.PNPM_VERSION}...`);const u=(0,f.getNpmPath)();!function(){const u=s.resolve(B.HVIGOR_WRAPPER_TOOLS_HOME,B.DEFAULT_PACKAGE_JSON);try{a.existsSync(B.HVIGOR_WRAPPER_TOOLS_HOME)||a.mkdirSync(B.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const D={dependencies:{}};D.dependencies[B.PNPM]=t.PNPM_VERSION,a.writeFileSync(u,JSON.stringify(D))}catch(D){(0,d.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,f.executeCommand)(u,["install","pnpm"],{cwd:B.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,d.logInfoPrintConsole)("Pnpm install success.")}}(Gu),function(){Gu.checkNpmConifg(),Gu.environmentHandler(),Gu.isPnpmInstalled()||Gu.executeInstallPnpm();const D=gu();_(u.join(D,i.WORK_SPACE))}(); \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/hvigorfile.ts b/function/ui_compare_rh/uicompare/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/hvigorw b/function/ui_compare_rh/uicompare/hvigorw new file mode 100644 index 0000000000000000000000000000000000000000..54aadd226b453397860013d328fd01031648fc31 --- /dev/null +++ b/function/ui_compare_rh/uicompare/hvigorw @@ -0,0 +1,48 @@ +#!/bin/bash + +# ---------------------------------------------------------------------------- +# Hvigor startup script, version 1.0.0 +# +# Required ENV vars: +# ------------------ +# NODE_HOME - location of a Node home dir +# or +# Add /usr/local/nodejs/bin to the PATH environment variable +# ---------------------------------------------------------------------------- + +HVIGOR_APP_HOME=$(dirname $(readlink -f $0)) +HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js +warn() { + echo "" + echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" +} + +error() { + echo "" + echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" +} + +fail() { + error "$@" + exit 1 +} + +# Determine node to start hvigor wrapper script +if [ -n "${NODE_HOME}" ];then + EXECUTABLE_NODE="${NODE_HOME}/bin/node" + if [ ! -x "$EXECUTABLE_NODE" ];then + fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed" + fi +else + EXECUTABLE_NODE="node" + which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path" +fi + +# Check hvigor wrapper script +if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then + fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}" +fi + +# start hvigor-wrapper script +exec "${EXECUTABLE_NODE}" \ + "${HVIGOR_WRAPPER_SCRIPT}" "$@" diff --git a/function/ui_compare_rh/uicompare/hvigorw.bat b/function/ui_compare_rh/uicompare/hvigorw.bat new file mode 100644 index 0000000000000000000000000000000000000000..6861293e47dfd0186da380321b73be9033507e24 --- /dev/null +++ b/function/ui_compare_rh/uicompare/hvigorw.bat @@ -0,0 +1,64 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Hvigor startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js +set NODE_EXE=node.exe + +goto start + +:start +@rem Find node.exe +if defined NODE_HOME goto findNodeFromNodeHome + +%NODE_EXE% --version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. +echo. +echo Please set the NODE_HOME variable in your environment to match the +echo location of your NodeJs installation. + +goto fail + +:findNodeFromNodeHome +set NODE_HOME=%NODE_HOME:"=% +set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE% + +if exist "%NODE_EXE_PATH%" goto execute +echo. +echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. +echo. +echo Please set the NODE_HOME variable in your environment to match the +echo location of your NodeJs installation. + +goto fail + +:execute +@rem Execute hvigor +"%NODE_EXE%" %WRAPPER_MODULE_PATH% %* + +if "%ERRORLEVEL%" == "0" goto hvigorwEnd + +:fail +exit /b 1 + +:hvigorwEnd +if "%OS%" == "Windows_NT" endlocal + +:end diff --git a/function/ui_compare_rh/uicompare/oh-package-lock.json5 b/function/ui_compare_rh/uicompare/oh-package-lock.json5 new file mode 100644 index 0000000000000000000000000000000000000000..333dfd9a95b468c3e2086a8686011ec29793ee70 --- /dev/null +++ b/function/ui_compare_rh/uicompare/oh-package-lock.json5 @@ -0,0 +1,14 @@ +{ + "lockfileVersion": 3, + "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", + "specifiers": { + "@ohos/hypium@1.0.16": "@ohos/hypium@1.0.16" + }, + "packages": { + "@ohos/hypium@1.0.16": { + "integrity": "sha512-PC3jpwKERg68V+4dmKU+SLjNps9i5JcQH57rQriaTsh62NBgVZs4SceMmNOtrIOyldbEJ5mXSwoZwiG/nkRmTw==", + "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.16.har", + "registryType": "ohpm" + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/oh-package.json5 b/function/ui_compare_rh/uicompare/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..e9c1666457f6b9c0b559b1e7098db3085e4a5d9d --- /dev/null +++ b/function/ui_compare_rh/uicompare/oh-package.json5 @@ -0,0 +1,13 @@ +{ + "modelVersion": "5.0.0", + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.16" + }, + "author": "", + "name": "uicompare", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare_tools/UiCompareTools_progress.py b/function/ui_compare_rh/uicompare_tools/UiCompareTools_progress.py new file mode 100644 index 0000000000000000000000000000000000000000..302b217295d95e40893b54bec91a21af0d66958e --- /dev/null +++ b/function/ui_compare_rh/uicompare_tools/UiCompareTools_progress.py @@ -0,0 +1,2823 @@ +#!/usr/bin/env python +# -*- coding:utf-8 -*- +# 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 os + +import sys + +import time + +import json + +import openpyxl + +import threading + +import subprocess + +import filecmp + +import shutil + +from multiprocessing import Manager, Pool, Process + +import numpy as np + +from datetime import datetime + +from PIL import Image + +from PIL import ImageChops + +from itertools import product + + + +import argparse + +parser = argparse.ArgumentParser(description='manual to this script') + +parser.add_argument("--type", type=str) + +parser.add_argument("--excel", type=str) + +parser.add_argument("--dir", type=str) + +parser.add_argument("--hap", type=str) + +parser.add_argument("--json", type=str) + +args = parser.parse_args() + +mode = args.type + +excel_path = args.excel + +base_path = args.dir + +hap_path = args.hap + +json_path = args.json + + + +new_time = time.strftime('%Y%m%d_%H%M%S', time.localtime(time.time())) + +now_time = str(new_time) + +dir_path = os.path.dirname(os.path.abspath(__file__)) + +reports_path = os.path.join(dir_path, "reports") + +html_path = "./mode.html" + +run_json_path = os.path.join(reports_path, "run_json_" + now_time) + +run_report_path = os.path.join(reports_path, "run_report_{}.html".format(now_time)) + +diff_report_path = os.path.join(reports_path, "diff_report_{}.html".format(now_time)) + +device_list = [] + +image_size_diff = [] + + + +def get_file_list(file_path, file_key): + + # 返回指定文件夹file_path下所有的特定文件名列表 + + file_list = [] + + if os.path.isdir(file_path) == False: + + print("当前路径{}非文件夹,请重新输入正确的文件夹路径后重试".format(file_path)) + + return [] + + elif os.path.exists(file_path) == False: + + print("当前路径{}不存在,请重新输入正确的文件夹路径后重试".format(file_path)) + + return [] + + for file in os.listdir(file_path): + + if file.endswith(file_key): + + file_list.append(file) + + return file_list + + + + + +def write_report_html(data, mode="0", image_path=""): + + if os.path.exists(html_path) == False: + + print("模板html不存在,未生成html报告") + + return + + if mode == "0": + + shutil.copy(html_path, run_report_path) + + module_data = "" + + total_data = "" + + print("report_data: ", data) + + for key, value in data.items(): + + if key == "Total_data": + + with open(run_report_path, "a") as f: + + f.write("""Save Image Path: + + + + + + + + + + + + + + + + + +
""" + image_path + """
Test Start/ End Time:""" + value["start_end_time"] + """Execution Time:""" + value["run_time"] + """
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MOUDULESTOTAL_TESTSPASSCASE_FAILGET_FAILPASS_RATE
""" + value["moudle_count"] + """""" + value["Total"] + """""" + value["Pass"] + """""" + value["Case_fail"] + """""" + value["Get_fail"] + """""" + value["Pass_rate"] + """
+ + + +""") + + else: + + if isinstance(value, int): + + continue + + total_data += """ + + + + """ + key + """ + + """ + str(value["Total"]) + """ + + """ + str(value["Pass"]) + """ + + """ + str(value["Case_fail"]) + """ + + """ + str(value["Get_fail"]) + """ + + """ + value["Pass_rate"] + """ + + + +""" + + title_flag = True + + for case_name, run_result, use_time in value["result_list"]: + + if run_result == "PASS": + + # 仅展示执行失败用例,执行成功的用例不展示 + + continue + + elif title_flag == True: + + module_data += """ + + + + + + + + + +
+ + """ + key + """ + +
+ + + + + + + + + + + + + + + + """ + + title_flag = False + + module_data += """ + + + + + + + + + + """ + + if title_flag == False: + + module_data += """ + +
ModuleTestsuiteTestcaseResult
""" + key + """""" + value["module_name"] + """""" + case_name + """""" + run_result + """
""" + + module_data += """ + + + + + + + +""" + + total_data += "" + + with open(run_report_path, "a") as f: + + f.write(total_data + module_data) + + print("获取图片报告已生成:", run_report_path) + + elif mode == "1": + + shutil.copy(html_path, diff_report_path) + + module_data = "" + + total_data = "" + + for key, value in data.items(): + + if key == "Total_data": + + with open(diff_report_path, "a") as f: + + f.write("""Diff Image Path: + + + + + + + + + + + + + + + + + +
""" + image_path + """
Test Start/ End Time:""" + value["start_end_time"] + """Execution Time:""" + value["run_time"] + """
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MOUDULESTOTAL_TESTSPASSCASE_FAILGET_FAILBASE_IMAGECOMPARE_FAILPASS_RATE
""" + value["moudle_count"] + """""" + value["Total"] + """""" + value["Pass"] + """""" + value["Case_fail"] + """""" + value["Get_fail"] + """""" + value["Base_image_fail"] + """""" + value["Compare_fail"] + """""" + value["Pass_rate"] + """
+ + """) + + else: + + if isinstance(value, int): + + continue + + total_data += """ + + + + """ + key + """ + + """ + str(value["Total"]) + """ + + """ + str(value["Pass"]) + """ + + """ + str(value["Case_fail"]) + """ + + """ + str(value["Get_fail"]) + """ + + """ + str(value["Base_image_fail"]) + """ + + """ + str(value["Compare_fail"]) + """ + + """ + value["Pass_rate"] + """ + + + +""" + + add_flag = True + + for case_name, run_result, use_time in value["result_list"]: + + if run_result == "PASS": + + # 仅展示对比失败用例,对比图片相同的用例不展示 + + continue + + else: + + if add_flag == True: + + # 仅在有对比失败用例时,才写入标题栏 + + module_data += """ + + + + + + + + + +
+ + """ + key + """ + +
+ + + + + + + + + + + + + + """ + + add_flag = False + + module_data += """ + + + + + + + + """ + + if add_flag == False: + + module_data += """ + +
ModuleTestcaseResult
""" + key + """""" + case_name + """""" + run_result + """
""" + + module_data += """ + + + + + + + + """ + + total_data += "" + + with open(diff_report_path, "a") as f: + + f.write(total_data + module_data) + + print("对比图片报告已生成:", diff_report_path) + + + + + +def run_cmd(command): + + # 执行cmd命令,返回执行日志 + + p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) + + out, err = p.communicate() + + # print("out: ", out) + + # print("err: ", err) + + if err is None: + + return out.decode('utf-8') + + return err.decode('utf-8') + + + + + +def checkResult(command, keyword="", case_name=""): + + # 检查设备是否连接成功或用例执行成功 + + start_time = datetime.timestamp(datetime.now()) + + out = run_cmd(command) + + end_time = datetime.timestamp(datetime.now()) + + use_time = round(end_time - start_time, 3) + + if "#" not in command: + + # 批量执行,计算平均耗时 + + use_time = int(use_time / len(out.splitlines())) + + print("{0} run use_time: {1}s".format(case_name, use_time)) + + if "error: get bundle info failed" in out: + + print("【ERROR】测试应用hap未安装,请成功安装后重试\n", out) + + return "测试hap未安装" + + elif keyword in command: + + # 检查设备是否连接成功 + + if "[Empty]" in out: + + # 设备未连接时,显示“[Empty]” + + print("设备未连接,请连接设备或检查线路连接是否正常,UI工具将开始尝试重连") + + return case_name + " Devices connect fail" + + elif out == "": + + # 无hdc.exe + + return "不支持hdc命令, 仅支持hdc_std命令" + + elif len(out) > 15: + + return "设备已连接,可正常使用" + + elif "execute timeout" in out: + + return "timeout" + + elif "Not found entry_test/ets/" in out: + + return True + + elif "stream=Tests run: 0" in out: + + return False + + elif keyword != "list targets": + + image_name_list = [] + + error_case_list = [] + + command_list = [] + + # 获取用例名和失败用例名 + + index_flag = 0 + + for line_data in out.splitlines(): + + # print(index_flag, line_data) + + # 用例执行成功 + + if "OHOS_REPORT_STATUS_CODE: 0" in line_data: + + # 当前用例名 + + case_name = out.splitlines()[index_flag - 1].split("=")[1] + + image_name_list.append([case_name, "PASS", use_time]) + + print(case_name, " run succ !!!\n") + + elif "OHOS_REPORT_STATUS_CODE: -1" in line_data or "TestFinished-ResultCode: -1" in line_data: + + # 用例执行失败 + + if "TestFinished-ResultCode: -1" in line_data and index_flag >= 3: + + # 当前用例名 + + case_name = out.splitlines()[index_flag - 3].split("test=")[1] + + error_info = out.splitlines()[index_flag + 1].split(":")[1] + + print(out.splitlines()[index_flag + 1]) + + image_name_list.append([case_name, "CASE_FAIL: " + error_info, use_time]) + + elif "OHOS_REPORT_STATUS_CODE: -1" in line_data and index_flag >= 2: + + case_name = out.splitlines()[index_flag - 1].split("test=")[1] + + # 执行失败原因 + + error_info = out.splitlines()[index_flag - 2] + + print(case_name, " CASE_FAIL: " + error_info) + + image_name_list.append([case_name, "CASE_FAIL: " + error_info, use_time]) + + if "#" in command: + + # 单条用例 + + error_case_list.append((command, case_name)) + + elif command not in command_list: + + # 多条用例,只添加一次即可(因为多条用例无法执行单用例) + + error_case_list.append((command, case_name)) + + # 仅用来判断多用例执行失败情况 + + command_list.append(command) + + print(case_name, " run fail !!!\n") + + elif keyword in line_data: + + # 解析用例执行总结果 + + print(line_data) + + index_flag += 1 + + # print("image_name_list: ", image_name_list) + + return image_name_list, error_case_list + + else: + + return False + + + + + +def delete_pictures(bundle_name): + + # 删除设备中应用原有截图 + + app_list = run_cmd("hdc shell cd /data/app/el2/100/base/;ls") + + if bundle_name in app_list.split("\r\n"): + + # 删除指定应用文件夹内截图 + + app_path = "/data/app/el2/100/base/{}/haps/entry_test/files/".format(bundle_name) + + print(app_path) + + run_cmd("hdc shell rm -rf {}*".format(app_path)) + + time.sleep(1) + + out = run_cmd("hdc shell cd {};du -sk".format(app_path)).split(".")[0].strip() + + print(out) + + if "/bin/sh" in out: + + print("设备中不存在待删除图片!!!") + + return + + print("当前{0}文件夹内存(KB):{1}".format(bundle_name, out)) + + count = 0 + + while int(out) > 10 and count <= 30: + + out = run_cmd("hdc shell cd {};du -sk".format(app_path)).split(".")[0].strip() + + print("当前{0}文件夹内存(KB):{1}".format(bundle_name, out)) + + count += 1 + + time.sleep(5) + + print("设备中原有用例截图已全部删除!!!") + + else: + + print("设备中不存在待删除图片!!!") + + + + + +class UiCompareTools(): + + """ + + UI对比工具 + + """ + + def run_testcases(self, sn, data, base_path, excel_path, report_path, excel_name, mode='0'): + + # 遍历执行Execl用例,并将设备端webp文件保存至本地 + + # 设备解锁:兼容部分版本执行完用例设备会锁屏 + + # run_cmd('hdc -t {} shell uinput -T -m 1280 800 1280 800 1000'.format(sn)) + + # run_cmd('hdc -t {} shell uinput -T -m 500 2000 500 500 600'.format(sn)) + + print("excel_path: ", excel_path) + + install_flag = False + + bundle_name = "" + + class_name = "" + + result_list = [] + + pass_count = 0 + + case_fail = 0 + + get_fail = 0 + + run_flag = False + + for case in data: + + try: + + class_name = case[0] + + case_name = case[1] + + bundle_name = case[2] + + if case_name is None: + + run_flag = True + + else: + + run_flag = False + + # 先卸载该应用,避免设备上存在已安装同名应用导致测试hap无法安装 + + if install_flag == False: + + # 卸载、安装仅在执行第一条用例前执行一次 + + install_flag = True + + # 卸载hap + + if bundle_name is not None: + + run_cmd("hdc -t {0} uninstall {1}".format(sn, bundle_name)) + + # 安装hap + + hap_install_path = os.path.join(hap_path, excel_name + ".hap") + + print("hap_install_path: ", hap_install_path) + + if os.path.exists(hap_install_path) == False: + + # hap包路径不存在 + + for case in data: + + case_fail += 1 + + result_list.append( + + [case[1], "CASE_FAIL: The HAP path dose not exist: " + hap_install_path, "0"]) + + print("{}组件hap包{}安装路径不存在:{}".format(excel_name, bundle_name, hap_install_path)) + + break + + out = run_cmd("hdc -t {0} install {1}".format(sn, hap_install_path)) + + print("Install result: ", out) + + if "install failed" in out: + + # hap包安装失败 + + for case in data: + + case_fail += 1 + + result_list.append( + + [case[1], "CASE_FAIL: Failed to install the HAP: " + hap_install_path, "0"]) + + print("{}组件hap包{}安装失败: {}".format(excel_name, bundle_name, hap_install_path)) + + break + + + + # 单条执行 + + command = "hdc -t {3} shell aa test -b {0} -m entry_test -s unittest /ets/testrunner/OpenHarmonyTestRunner -s class {1}#{2} -w 180000 -s timeout 15000".format(case[2], case[0], case[1], sn) + + # 批量执行 + + if case_name is None: + + run_flag = True + + # 删除设备中图片 + + delete_pictures(bundle_name) + + command = "hdc -t {2} shell aa test -b {0} -m entry_test -s unittest /ets/testrunner/OpenHarmonyTestRunner -s class {1} -w 180000 -s timeout 15000".format(case[2], case[0], sn) + + result = checkResult(command, "stream=Tests run:", case_name) + + + + if result == True: + + command = command.replace("/ets/testrunner/OpenHarmonyTestRunner", "OpenHarmonyTestRunner") + + print("new command1: ", command) + + result = checkResult(command, "stream=Tests run:", case_name) + + + + if result == True: + + command = command.replace("OpenHarmonyTestRunner", "/ets/Testrunner/OpenHarmonyTestRunner") + + print("new command2: ", command) + + result = checkResult(command, "stream=Tests run:", case_name) + + + + count = 1 + + while result == "timeout" and count < 6: + + # 若用例执行超时,延长超时的时间5秒,最长延长至30秒,若仍超时,则判定用例执行失败 + + command = command.replace(str(15000 + 5000 * (count - 1)), str(15000 + 5000 * count)) + + print("new command3: ", command) + + result = checkResult(command, "stream=Tests run:", case_name) + + count += 1 + + + + # 存在失败用例,重新执行 + + count_error = 1 + + while run_flag == False and count_error <= 5: + + # 若执行失败,重试5次 + + if type(result) == tuple: + + if len(result) == 2 and len(result[1]) >= 1: + + print("重新执行失败用例:", result[1]) + + with open(report_path, "a") as file: + + for error_info in result[1]: + + file.write(class_name + ": " + error_info[1] + " run fail\n") + + # if run_flag == True: + + # # 删除设备中图片 + + # delete_pictures(bundle_name) + + result = checkResult(command, "stream=Tests run:", case_name) + + count_error += 1 + + else: + + break + + else: + + break + + + + if result == True or result == False: + + print("用例执行失败:{}".format(command)) + + result = [[[case_name, "CASE_FAIL: testcase not run", "0"]], []] + + elif result == "测试hap未安装": + + result = [[[case_name, "CASE_FAIL: Failed to install the HAP or The bundle name in the Excel is inconsistent with that in the HAP", "0"]], []] + + + + # 批量循环取图 + + if class_name and (case_name is None): + + row_num = 1 + + data_list = [] + + for case_name1, case_result, run_time in result[0]: + + # 用例执行成功,将设备中webp文件保存至本地 + + if case_result == "PASS": + + # 用例执行成功,才会创建保存图片的文件夹 + + if os.path.exists(base_path) == False: + + os.makedirs(base_path) + + print('base_path: ', base_path) + + webp_path = os.path.join(base_path, "IMG_%s.webp" % case_name1) + + device_webp = "data/app/el2/100/base/{0}/haps/entry_test/files/".format(case[2]) + + device_path = device_webp + "IMG_%s.webp" % case_name1 + + out_content2 = run_cmd("hdc -t %s file recv %s %s" % (sn, device_path, webp_path)) + + print(out_content2) + + if "FileTransfer finish" in out_content2: + + pass_count += 1 + + print("%s.webp文件保存成功\n" % case_name1) + + elif "no such file" in out_content2: + + get_fail += 1 + + file_path = out_content2.split("path:")[1] + + # 取图失败,更新用例执行结果数据 + + result[0][row_num - 1][1] = "GET_FAIL: save image fail: {}".format(file_path) + + print("设备中 %s 文件不存在,保存本地失败\n" % file_path) + + with open(report_path, "a") as file: + + file.write("%s: %s save fail: 设备中该文件不存在\n" % (class_name, case_name1)) + + else: + + count = 0 + + while count <= 30: + + # 增加延时,确保webp文件成功保存至本地 + + time.sleep(1) + + count += 1 + + if "FileTransfer finish" in out_content2: + + break + + else: + + case_fail += 1 + + # 数据存储至列表 + + data_list.append([row_num, class_name, case_name1, case[2], case_result]) + + row_num += 1 + + # 取完图后,删除设备中所有图片 + + delete_pictures(bundle_name) + + try: + + # 将用例执行结果写入Excel + + self.write_excel_data(excel_path, sheet_name=case[0], result_data=data_list) + + except Exception as e: + + print("【ERROR】write_excel_data: %s" % str(e)) + + + + # 执行单条取图 + + elif class_name and case_name: + + # 用例执行成功才从设备中取资源保存至本地 + + # 将用例执行结果写入Excel + + # try: + + # self.write_excel_data(excel_path, result_data=result[0], compare=2) + + # except Exception as e: + + # print("【ERROR】write_excel_data: %s" % str(e)) + + + + run_result = "" + + if type(result) == tuple: + + try: + + run_result = result[0][0][1] + + except: + + result[0][0] = [case_name, "CASE_FAIL: run testcase fail", "0"] + + run_result = result[0][0][1] + + # print("run_result: ", run_result) + + # 若用例执行成功,将设备中webp文件保存至本地 + + if run_result == "PASS": + + # 用例执行成功,才会创建保存图片的文件夹 + + if os.path.exists(base_path) == False: + + os.makedirs(base_path) + + # run_count = 2 + + # while run_count <= 2: + + # txt_path = os.path.join(base_path, case_name + ".txt") + + # remote_txt = "/storage/media/100/local/files/Documents/TXT_test.txt" + + # out_content2 = run_cmd("hdc -t %s file recv %s %s" % (sn, remote_txt, txt_path)) + + webp_path = os.path.join(base_path, case_name + ".webp") + + remote_webp = "data/app/el2/100/base/{0}/haps/entry_test/files/IMG_test.webp".format(case[2]) + + out_content2 = run_cmd("hdc -t %s file recv %s %s" % (sn, remote_webp, webp_path)) + + print(out_content2) + + if "FileTransfer finish" in out_content2: + + # 累加执行用例成功且成功取图的用例个数 + + pass_count += 1 + + print("%s: %s.webp文件保存成功\n" % (sn, case_name)) + + elif "no such file" in out_content2: + + # 取图失败,重新执行用例后再取图三次 + + print("设备中 %s 文件不存在,保存本地失败\n" % remote_webp) + + result = checkResult(command, "stream=Tests run:", case_name) + + if result == "PASS": + + # 用例执行成功再取图片 + + count = 0 + + while count < 3: + + time.sleep(5) + + out_content2 = run_cmd("hdc -t %s file recv %s %s" % (sn, remote_webp, webp_path)) + + print(out_content2) + + if "FileTransfer finish" in out_content2: + + pass_count += 1 + + print("%s: %s.webp文件保存成功\n" % (sn, case_name)) + + break + + count += 1 + + else: + + # 用例执行失败 + + case_fail += 1 + + else: + + count = 0 + + while count <= 30: + + # 增加延时,确保webp文件成功保存至本地 + + time.sleep(1) + + count += 1 + + if "FileTransfer finish" in out_content2: + + pass_count += 1 + + print("%s: %s.webp文件保存成功\n" % (sn, case_name)) + + break + + if "no such file" in out_content2: + + get_fail += 1 + + file_path = out_content2.split("path:")[1] + + # 取图失败,更新用例执行结果数据 + + result[0][0][1] = "GET_FAIL: save image fail: {}".format(file_path) + + print("设备%s中 %s 文件不存在,保存本地失败\n" % (sn, file_path)) + + with open(report_path, "a") as file: + + file.write("%s: %s save fail: 设备%s中该文件不存在\n" % (class_name, case_name, sn)) + + else: + + case_fail += 1 + + if len(result[0]) == 1: + + result_list.append(result[0][0]) + + except Exception as e: + + print("[ERROR] Get Image fail: ", str(e)) + + time.sleep(5) + + # 用例执行结束,卸载hap + + if bundle_name is not None: + + run_cmd("hdc -t %s uninstall %s" % (sn, bundle_name)) + + time.sleep(2) + + if mode == "0": + + print("{}.xlsx 中所有用例均已执行,基线图源均已获取".format(excel_name)) + + elif mode == "1": + + print("{}.xlsx 中所有用例均已执行,对比图源均已获取".format(excel_name)) + + if pass_count != len(result_list) - case_fail - get_fail: + + pass_count = len(result_list) - case_fail - get_fail + + if len(result_list) <= 0: + + total_num = case_fail + get_fail + + else: + + total_num = len(result_list) + + result_data = {"Total": total_num, + + "Pass": pass_count, + + "Case_fail": case_fail, + + "Get_fail": get_fail, + + "Pass_rate": str(int((pass_count/len(data))*100)) + "%", + + "result_list": result_list, + + "module_name": class_name} + + # print("result_data: ", result_data) + + return result_data + + + + def read_excel_data(self, excel_path): + + # 读取Excel表中类名和用例名 + + if os.path.exists(excel_path) == False: + + print("当前Excel路径不存在: %s" % excel_path) + + return False + + else: + + data_list = [] + + try: + + wb = openpyxl.load_workbook(excel_path) + + # 默认取第一张表 + + sheet = wb.worksheets[0] + + rows = sheet.max_row + + + + for row in range(1, rows): + + # 获取第二列的数据:类名 + + class_name = sheet.cell(row + 1, 2).value + + if class_name is None: + + print("Excel表中有效数据行数: ", row - 1) + + break + + # 获取第三列的数据:用例名 + + case_name = sheet.cell(row + 1, 3).value + + # 获取第四列的数据:bundle_name + + bundle_name = sheet.cell(row + 1, 4).value + + data_list.append((class_name, case_name, bundle_name)) + + print('data_list: ', data_list) + + except Exception as e: + + print(str(e)) + + return data_list + + + + def write_excel_data(self, report_path, sheet_name="Sheet1", result_data=[], x=1, compare=0): + + # 将执行报告数据写入Excel表中 + + if os.path.exists(excel_path) == False: + + print("当前Excel路径不存在: %s" % excel_path) + + return False + + print("write_excel_data: ", excel_path) + + # 读取Excel表数据 + + try: + + wb = openpyxl.load_workbook(excel_path) + + if compare == 2: + + # 默认取第一张表(执行单条用例) + + sheet = wb.worksheets[0] + + elif sheet_name in wb.sheetnames: + + sheet = wb[sheet_name] + + else: + + # 若sheet页不存在,创建新的sheet页 + + sheet = wb.create_sheet(sheet_name) + + print("add sheet %s succ" % sheet_name) + + if compare == 0: + + sheet.append(["序号", "类名", "用例名", "bundle name", "生成图片结果"]) + + print("标题写入完成") + + elif compare == 1: + + sheet.append(["用例名", "对比结果", "耗时"]) + + for testcase in result_data: + + sheet.append(testcase) + + print("对比结果写入完成") + + wb.save(excel_path) + + # 写入result数据 + + rows = sheet.max_row + + cols = sheet.max_column + + if compare == 0 or compare == 2: + + if result_data == []: + + print("[ERROR] write excel data error") + + elif len(result_data) == 1: + + # 单条用例 + + for num in range(1, rows + 1): + + # print("num: ", num) + + if sheet.cell(num, 3).value == result_data[0][0]: + + for i in range(5, 100): + + if sheet.cell(num, i).value is None: + + sheet.cell(num, i, result_data[0][1]) + + if num == 2: + + print("单条用例:报告时间写入完成") + + sheet.cell(1, i, now_time) + + break + + break + + else: + + # 多条用例 + + if sheet.cell(x + 1, 1).value is None: + + # 首次写入 + + for data in result_data: + + sheet.append([data[0], data[1], data[2], data[3], data[4]]) + + print("write %s succ" % data[2]) + + else: + + # 非首次写入 + + if sheet.cell(rows, cols + 1).value is None: + + sheet.cell(1, cols + 1, now_time) + + print("多条用例:报告时间写入完成") + + cols += 1 + + for data in result_data: + + sheet.cell(data[0] + 1, cols, data[4]) + + print("add write %s succ" % data[2]) + + wb.save(excel_path) + + if sheet.cell(2, 1).value is None: + + # 删除空行 + + sheet.delete_rows(2) + + # 保存Excel文件 + + wb.save(excel_path) + + print('result_data: %s succ' % result_data) + + except Exception as e: + + with open(report_path, "a") as r1: + + r1.write("write Excel data error: {}\n".format(excel_path)) + + print(str(e), type(e)) + + if "Permission denied" in str(e): + + print("【ERROR】请先关闭本地已打开的Excel表格,再重新执行") + + + + def get_diff_files(self, excel_path, base_path, compare_path, run_result, now_time): + + # 比较两个文件夹中所有的webp文件,返回所有不同的文件名 + + base_path_exists = True + + if os.path.isdir(base_path) == False: + + base_path_exists = False + + print("{}基线图源文件夹路径不存在".format(base_path)) + + report_diff_list = [] + + case_fail_count = 0 + + get_fail_count = 0 + + base_image_fail = 0 + + compare_fail = 0 + + pass_count = 0 + + for case_name, case_result, use_time in run_result["result_list"]: + + if case_result == "PASS": + + baseImage_path = os.path.join(base_path, case_name + ".webp") + + compareImage_path = os.path.join(compare_path, case_name + ".webp") + + print("baseImage_path: ", baseImage_path) + + print("compareImage_path: ", compareImage_path) + + use_time = "0" + + if base_path_exists == False: + + # 基线图源文件夹路径不存在 + + base_image_fail += 1 + + case_result = "BASE_IMAGE: BaseImage moudle path does not exist: {}".format(base_path) + + elif os.path.exists(baseImage_path) == False: + + # 基线图源文件不存在 + + base_image_fail += 1 + + case_result = "BASE_IMAGE: BaseImage does not exist: {}".format(baseImage_path) + + elif os.path.exists(compareImage_path) == False: + + # 对比图片文件不存在 + + get_fail_count += 1 + + case_result = "GET_FAIL: Save image fail: {}".format(compareImage_path) + + else: + + start_time = datetime.timestamp(datetime.now()) + + # 对比图片,不同时会生成差异图 + + if self.compare_files(baseImage_path, compareImage_path) == False: + + case_result = "COMPARE_FAIL" + + compare_fail += 1 + + else: + + case_result = "PASS" + + pass_count += 1 + + end_time = datetime.timestamp(datetime.now()) + + use_time = str(round(end_time - start_time, 3)) + + elif "CASE_FAIL" in case_result: + + case_fail_count += 1 + + elif "GET_FAIL" in case_result: + + get_fail_count += 1 + + # 将用例执行结果数据保存至列表 + + report_diff_list.append([case_name, case_result, use_time]) + + + + # 将对比执行结果写入Excel + + # self.write_excel_data(excel_path, sheet_name="diff_%s" % now_time, result_data=report_diff_list, compare=1) + + case_count = run_result["Total"] + + if case_count == 0: + + pass_rate = 0 + + else: + + # 防止除数为0,导致异常 + + pass_rate = int(pass_count / case_count * 100) + + if pass_count != case_count - case_fail_count - get_fail_count - base_image_fail - compare_fail: + + pass_count = case_count - case_fail_count - get_fail_count - base_image_fail - compare_fail + + result_data = {"Total": case_count, + + "Pass": pass_count, + + "Case_fail": case_fail_count, + + "Get_fail": get_fail_count, + + "Base_image_fail": base_image_fail, + + "Compare_fail": compare_fail, + + "Pass_rate": str(pass_rate) + "%", + + "result_list": report_diff_list} + + print(result_data) + + return result_data + + + + def modify_image_color(self, num, height_unit, width, img_array, dst): + + # 修改图片像素颜色 + + height_1 = num * height_unit + + height_2 = (num + 1) * height_unit + + for h, w in product(range(height_1, height_2), range(width)): + + (b, g, r) = img_array[h, w] + + if (b, g, r) == (0, 0, 0): # 黑色 + + img_array[h, w] = (255, 255, 255) # 白色 + + else: + + img_array[h, w] = (255, 0, 0) # 剩余差异部分红色显示 + + dst[h, w] = img_array[h, w] + + return dst + + + + def compare_files(self, file1, file2): + + # 比较两个webp文件,如果它们相同则返回True,否则返回False + + if os.path.exists(file1) == False: + + print("当前文件路径不存在,请确认后重试:", file1) + + return False + + if os.path.exists(file2) == False: + + print("当前文件路径不存在,请确认后重试:", file2) + + return False + + # if filecmp.cmp(file1, file2) == True: + + if self.compare_file(file1, file2) == True: + + print("两张图片内容:完全相同") + + return True + + else: + + """ + + 比较图片,如果有不同则生成展示不同的图片 + + @参数一: file1: 基线图片的路径 + + @参数二: file2: 对比图片的路径 + + """ + + module_name = file1.split("\\")[-2] + + diff_path = os.path.join(reports_path, "diff_" + now_time, module_name) + + print("diff_path: ", diff_path) + + if os.path.exists(diff_path) == False: + + os.makedirs(diff_path) + + try: + + image_one = Image.open(file1) + + image_two = Image.open(file2) + + except Exception as e: + + print(str(e)) + + return False + + size1 = image_one.size + + size2 = image_two.size + + print("BaseImage size: {}\nCompareImage size: {}".format(size1, size2)) + + if size1 != size2: + + # 两张图片大小不一致, 无需对比,且不会生成差异图 + + if module_name not in image_size_diff: + + image_size_diff.append(module_name) + + path = os.path.join(reports_path, module_name + ".txt") + + with open(path, "a") as file: + + file.write("截图大小不一致组件列表: %s !!!\n" % str(image_size_diff)) + + with open(report_path, "a") as file: + + file.write("截图大小不一致组件列表: %s !!!\n" % str(image_size_diff)) + + return False + + try: + + diff = ImageChops.difference(image_one, image_two) + + if diff.getbbox() is None: + + # 两张图片相同 + + return True + + img_array = np.array(diff) # 把图像转成数组格式img = np.asarray(image) + + shape = img_array.shape + + height = shape[0] + + width = shape[1] + + dst = np.zeros((height, width, 3)) + + # for h, w in product(range(height), range(width)): + + # (b, g, r) = img_array[h, w] + + # if (b, g, r) == (0, 0, 0): # 黑色 + + # img_array[h, w] = (255, 255, 255) # 白色 + + # else: + + # img_array[h, w] = (255, 0, 0) # 剩余差异部分红色显示 + + # dst[h, w] = img_array[h, w] + + black_pixels = np.where( + + (img_array[:, :, 0] == 0) & (img_array[:, :, 1] == 0) & (img_array[:, :, 2] == 0)) + + dst[black_pixels] = [255, 255, 255] + + other_pixels = np.where( + + (img_array[:, :, 0] != 0) | (img_array[:, :, 1] != 0) | (img_array[:, :, 2] != 0)) + + dst[other_pixels] = [255, 0, 0] + + diff_image = Image.fromarray(np.uint8(dst)) + + print("【+】We are the not same!") + + # 保存差异图、基线图和对比图到diff_path下,命名规则:用例名_diff,用例名_base,用例名_compare + + case_name = file1.split("\\")[-1].split(".")[0] + + diff_save_path = os.path.join(diff_path, case_name + '_diff.webp') + + base_image_path = os.path.join(diff_path, case_name + '_base.webp') + + compare_image_path = os.path.join(diff_path, case_name + '_compare.webp') + + diff_image.save(diff_save_path) + + shutil.copy(file1, base_image_path) + + shutil.copy(file2, compare_image_path) + + except ValueError as e: + + text = ("表示图片大小和box对应的宽度不一致,参考API说明:Pastes another image into this image." + + "The box argument is either a 2-tuple giving the upper left corner, a 4-tuple defining the left, upper, " + + "right, and lower pixel coordinate, or None (same as (0, 0)). If a 4-tuple is given, the size of the pasted " + + "image must match the size of the region.使用2纬的box避免上述问题") + + print("【{0}】{1}".format(e, text)) + + print("两张图片内容:存在差异") + + return False + + + + def compare_file(self, file1, file2): + + with open(file1, "rb") as f1: + + data1 = f1.read() + + with open(file2, "rb") as f2: + + data2 = f2.read() + + return data1 == data2 + + + + def generate_report(self, different_files, report_path): + + # 生成报告显示具体哪个webp文件不同 + + if len(different_files) == 0: + + print("两个文件夹中的所有webp文件都相同。") + + return + + + + report = "以下图片在两个文件夹中存在差异:\n" + + for file in different_files: + + report += f"{file}\n" + + with open(report_path, "w") as r1: + + r1.write(report) + + print("webp文件比对完成,已生成报告:", report_path) + + + + + +def connect_device(device_list): + + # 检查设备是否成功连接 + + time.sleep(3) + + result = run_cmd("hdc list targets") + + now_device_list = result.split("\r\n")[-1] + + print("应连接设备 %d 台" % len(device_list)) + + + + # 先循环等待是否全部连接成功 + + count = 0 + + while len(device_list) != len(now_device_list) and count < 5: + + time.sleep(2) + + count += 1 + + + + # 获取未连接设备sn号 + + disconnect_device = [] + + if len(device_list) != len(now_device_list): + + for device in device_list: + + if device not in now_device_list: + + disconnect_device.append(device) + + else: + + print("设备均已成功连接PC") + + + + # 重试拉起未连接设备hdc,再查询 + + if len(disconnect_device) >= 1: + + print("设备连接异常, 开始重连设备") + + for sn in disconnect_device: + + for i in range(1, 16): + + SN = run_cmd("hdc -t {} shell power-shell setmode 602".format(sn)) + + time.sleep(2) + + # print("SN: ", SN) + + if "[Fail]" in SN: + + print("重连第 %d 次" % i) + + continue + + else: + + break + + run_cmd("hdc -t {} shell power-shell display -s 0".format(sn)) + + if len(device_list) == len(run_cmd("hdc list targets").split("\r\n")[-1]): + + print("设备均已成功连接PC") + + else: + + # 更新设备列表 + + device_list = run_cmd("hdc list targets").split("\r\n")[-1] + + return device_list + + + + + +def delete_and_reboot(sn): + + # 跑用例前删包,重启操作 + + run_cmd("hdc -t {} shell mount -o remount,rw /sys_prod".format(sn)) + + run_cmd("hdc -t {} shell rm -rf /sys_prod/app/SystemResourcesOverlay".format(sn)) + + # 重启设备 + + #run_cmd("hdc -t {} shell reboot".format(sn)) + + #print("设备 {} 重启中,请耐心等待50秒......".format(sn)) + + #time.sleep(50) + + # 当前设备类型 + + device = run_cmd('hdc -t {} shell param get const.product.model'.format(sn)) + + if "Fail" in device: + + # 设备断连,尝试重连 + + connect_device(device_list) + + else: + + print("当前设备类型:", device) + + # 解锁设备 + + if "WGR" in device: + + # 若是WGR需点击屏幕中间才可解锁 + + run_cmd('hdc -t {} shell uinput -T -m 1280 800 1280 800 1000'.format(sn)) + + elif "NOH" in device: + + # 手机:滑动界面即可解锁 + + run_cmd('hdc -t {} shell uinput -T -m 500 2000 500 500 600'.format(sn)) + + else: + + # 设备断连,尝试重连 + + connect_device([sn]) + + run_cmd('hdc -t {} shell uinput -T -m 1280 800 1280 800 1000'.format(sn)) + + run_cmd('hdc -t {} shell uinput -T -m 500 2000 500 500 600'.format(sn)) + + # 设置设备常亮 + + out = run_cmd('hdc -t {} shell power-shell setmode 602'.format(sn)) + + if "Mode Success" in out: + + print("当前设备 {} 已设置常亮!!!".format(sn)) + + # 调低亮度,确保有足够电量进行测试 + + run_cmd('hdc -t {} shell power-shell display -s 0'.format(sn)) + + else: + + print("当前设备 {} 连接异常,请成功连接设备后重新执行".format(sn)) + + + + + +def run_get_image(args): + + # 获取基线图 + + # device_dict, excel_path, excel_name, report_path, base_path, now_time, dir_path + + global device_dict + + device_dict = args[0] + + excel_path = args[1] + + excel_name = args[2] + + report_path = args[3] + + now_time = args[5] + + dir_path = args[6] + + print(excel_name, " before run device_dict: ", device_dict) + + if len(device_dict) == 1: + + for key, value in device_dict.items(): + + sn = key + + elif len(device_dict) > 1: + + sn = device_dict.keys()[0] + + # print("sn: ", sn) + + run_flag = False + + if device_dict[sn] == True: + + # 有空闲设备时,占用并更新设备状态不可用(False) + + tmp = device_dict + + tmp[sn] = False + + device_dict = tmp + + print(excel_name, " running device_dict: ", device_dict) + + elif device_dict[sn] == False: + + index = 0 + + # 单个组件执行用例超过50分钟,可能该设备已闲置,启用该设备 + + while run_flag == False and index < 50 * 60: + + for device, status in device_dict.items(): + + # 监测到有空闲设备时 + + if status == True: + + # 有空闲设备时,占用并更新设备状态不可用(False) + + tmp = device_dict + + tmp[device] = False + + device_dict = tmp + + sn = device + + run_flag = True + + print(excel_name, " running device_dict: ", device_dict) + + break + + if run_flag == True: + + # 有空闲设备时,退出循环,开始执行用例 + + break + + # 等待直到出现空闲设备 + + time.sleep(1) + + index += 1 + + global base_path + + base_path = os.path.join(dir_path, "BaseImages_" + now_time) + + print('base_path: ', base_path) + + # 实例化对象 + + uiTools = UiCompareTools() + + data = uiTools.read_excel_data(excel_path) + + result_dict = {} + + if data != False: + + save_image_path = os.path.join(base_path, excel_name) + + try: + + case_result = uiTools.run_testcases(sn, data, save_image_path, excel_path, report_path, excel_name, mode="0") + + result_dict[excel_name] = case_result + + # 将本次执行结果保存至json文件中,确保遇到异常中断,仍可生成总的html报告 + + if os.path.exists(run_json_path) == False: + + os.makedirs(run_json_path) + + json_data_path = os.path.join(run_json_path, excel_name + ".json") + + with open(json_data_path, "w") as f: + + json.dump(result_dict, f) + + # print("成功写入json文件:", result_dict) + + except Exception as e: + + print("[ERROR] get BaseImage fail: ", str(e)) + + print("result_dict: ", result_dict) + + # 用例执行完,更新当前设备状态为可用(True) + + device_dict[sn] = True + + print(excel_name, " after run device_dict: ", device_dict) + + else: + + print("[ERROR] The Excel path does not exist !!!") + + return device_dict, result_dict + + + + + +def run_compare_image(args): + + # 获取对比图,并对比图片 + + # device_dict, excel_path, excel_name, report_path, base_path, now_time, dir_path + + global device_dict + + device_dict = args[0] + + excel_path = args[1] + + excel_name = args[2] + + report_path = args[3] + + base_path = args[4] + + now_time = args[5] + + dir_path = args[6] + + print(excel_name, " before run device_dict: ", device_dict) + + if len(device_dict) == 1: + + for key, value in device_dict.items(): + + sn = key + + elif len(device_dict) > 1: + + sn = device_dict.keys()[0] + + # print("sn: ", sn) + + run_flag = False + + if device_dict[sn] == True: + + # 有空闲设备时,占用并更新设备状态不可用(False) + + tmp = device_dict + + tmp[sn] = False + + device_dict = tmp + + print(excel_name, " running device_dict: ", device_dict) + + elif device_dict[sn] == False: + + index = 0 + + # 单个组件执行用例超过50分钟,可能该设备已闲置,启用该设备 + + while run_flag == False and index < 50*60: + + for device, status in device_dict.items(): + + # 监测到有空闲设备时 + + if status == True: + + # 有空闲设备时,占用并更新设备状态不可用(False) + + tmp = device_dict + + tmp[device] = False + + device_dict = tmp + + sn = device + + run_flag = True + + print(excel_name, " running device_dict: ", device_dict) + + break + + if run_flag == True: + + # 有空闲设备时,退出循环,开始执行用例 + + break + + # 等待直到出现空闲设备 + + time.sleep(1) + + index += 1 + + + + compare_path = os.path.join(dir_path, "CompareImages_" + now_time) + + print('compare_path: ', compare_path) + + count = 0 + + # 校验基线图片路径是否合法 + + while os.path.isdir(base_path) == False or os.path.exists(base_path) == False: + + if os.path.isdir(base_path) == False: + + base_path = input("路径非文件夹,请重新输入基线图源文件夹所在路径:") + + elif os.path.exists(base_path) == False: + + base_path = input("路径不存在,请重新输入基线图源文件夹所在路径:") + + count += 1 + + if os.path.isdir(base_path) == True and os.path.exists(base_path) == True: + + # 路径输入正确,跳出循环继续往下执行 + + break + + if count == 3: + + # 输入三次非法参数,程序退出 + + sys.exit(0) + + + + # 实例化对象 + + uiTools = UiCompareTools() + + data = uiTools.read_excel_data(excel_path) + + diff_dict = {} + + if data != False: + + # 基线图片路径 + + base_image_path = os.path.join(base_path, excel_name) + + # 对比图片路径 + + save_image_path = os.path.join(compare_path, excel_name) + + # 执行生成对比图片用例,并将执行和保存图片的结果写入Excel表中 + + uiTools = UiCompareTools() + + try: + + case_result = uiTools.run_testcases(sn, data, save_image_path, excel_path, report_path, excel_name, mode="1") + + # 用例执行完,更新当前设备状态为可用(True) + + device_dict[sn] = True + + # 开始对比图片,并将对比结果写入Excel表中,有差异时生成差异图保存至reports\diff_XXX\module_name\XXX.webp + + different_files = uiTools.get_diff_files(excel_path, base_image_path, save_image_path, case_result, now_time) + + # 将执行用例的结果、保存图片的结果与对比图片的结果合并,得到最终展示至报告中的结果 + + # 更新该模块用例总数 + + if different_files["Total"] < len(different_files["result_list"]): + + different_files["Total"] = len(different_files["result_list"]) + + # 将该模块数据添加至字典 + + diff_dict[excel_name] = different_files + + # 将本次执行结果保存至json文件中,确保遇到异常中断,仍可生成总的html报告 + + if os.path.exists(run_json_path) == False: + + os.makedirs(run_json_path) + + json_data_path = os.path.join(run_json_path, excel_name + "_diff.json") + + with open(json_data_path, "w") as f: + + json.dump(diff_dict, f) + + print("成功写入json文件:", result_dict) + + + + # 生成对比报告 + + report_diff_path = os.path.join(reports_path, "report_diff_{0}.txt".format(now_time)) + + uiTools.generate_report(different_files["result_list"], report_diff_path) + + except Exception as e: + + print("[ERROR] run Compare fail: ", str(e)) + + print("{}.xlsx 中所有用例图片均已对比完成".format(excel_name)) + + print("diff_dict: ", diff_dict) + + else: + + print("[ERROR] The Excel path does not exist !!!") + + print(excel_name, " after run device_dict: ", device_dict) + + return device_dict, diff_dict + + + + + +if __name__ == '__main__': + + # 程序入口 + + # 1小时后开始生成基线图 + + # time.sleep(1 * 60 * 60) + + start_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())) + + start_time_second = datetime.timestamp(datetime.now()) + + # 创建reports文件夹 + + if os.path.exists(reports_path) == False: + + os.makedirs(reports_path) + + result_list = [] + + if mode == "0" or mode == "1": + + # 判断用例数据的Excel所在文件夹内是否包含有效数据(必须为xlsx格式的Excel) + + count = 0 + + while os.path.exists(excel_path) == False: + + excel_path = input("路径不存在,请重新输入Excel所在文件夹路径:") + + count += 1 + + if os.path.exists(excel_path) == False and count == 3: + + # 尝试三次错误输入后,退出程序 + + sys.exit(0) + + + + # 获取所有Excel表的全路径 + + excel_name_list = [] + + excel_path_list = [] + + if os.path.exists(excel_path) == True: + + excel_name_list = get_file_list(excel_path, ".xlsx") + + count = 0 + + # 路径无效时,尝试三次输入 + + while len(excel_name_list) == 0: + + excel_path = input("路径中不存在xlsx格式的Excel文件,请检查后重新输入Excel所在文件夹路径:") + + excel_name_list = get_file_list(excel_path, ".xlsx") + + count += 1 + + if len(excel_name_list) == 0 and count == 3: + + # 尝试三次错误输入后,退出程序 + + sys.exit(0) + + # 路径有效时,获取全路径列表 + + for excel_name in excel_name_list: + + excel_full_path = os.path.join(excel_path, excel_name) + + excel_name = excel_name.split(".")[0] + + excel_path_list.append((excel_full_path, excel_name)) + + + + flag = 0 + + func_name = "" + + while flag < 3: + + if mode == "0": + + # 获取基线图 + + func_name = run_get_image + + break + + elif mode == "1": + + # 对比图片 + + func_name = run_compare_image + + break + + else: + + mode = input("您输入有误,请重新输入(输入0可获取基线图源,输入1可对比图片):") + + flag += 1 + + if flag == 3: + + # 错输三次,退出程序 + + sys.exit(0) + + report_path = os.path.join(reports_path, "reports_run_%s.txt" % now_time) + + + + # 兼容本地无hdc.exe的情况 + + content = run_cmd("hdc list targets") + + print("当前设备SN号: \n", content) + + if content == "": + + position = run_cmd("where hdc_std") + + print("本地hdc_std.exe所在路径: ", position) + + position = position.splitlines()[0] + + print("本地hdc_std.exe所在第一个路径: ", position) + + shutil.copy(position, position.replace("hdc_std.exe", "hdc.exe")) + + content = run_cmd("hdc list targets") + + + + device_list = content.split("\r\n")[:-1] + + print("device_list: ", device_list) + + # 最大进程数,即连接设备数 + + process_num = len(device_list) + + # 跑用例前删包,重启操作 + + if process_num == 1: + + # 单台设备 + + delete_and_reboot(device_list[0]) + + print("单设备执行") + + elif process_num > 1: + + # 多设备、多进程 + + print("多设备、多进程执行") + + with Pool(process_num) as p: + + outputs = p.map(delete_and_reboot, device_list) + + # 关闭进程池 + + p.terminate() + + # 检查设备是否成功连接,若连接异常尝试重连 + + connect_device(device_list) + + + + # 利用进程池Pool自动帮我们管理子进程 + + excel_num = len(excel_path_list) + + device_num = len(device_list) + + print("excel_path_list: ", excel_path_list) + + dir_path = os.path.join(dir_path) + + + + if mode == "0": + + base_path = "" + + + + if device_num == 1: + + # 仅连接单台设备时 + + device_dict = {device_list[0]: True} + + for excel_path, excel_name in excel_path_list: + + result_data = [] + + if mode == "0": + + result_data = run_get_image((device_dict, excel_path, excel_name, report_path, base_path, now_time, dir_path)) + + elif mode == "1": + + result_data = run_compare_image( + + (device_dict, excel_path, excel_name, report_path, base_path, now_time, dir_path)) + + else: + + print("您输入的type有误,请您重新输入!") + + sys.exit(0) + + result_list.append(result_data) + + elif device_num > 1: + + # 连接多台设备时 + + # 未执行用例前,所有设备均可用(True) + + device_dict = Manager().dict() + + for device in device_list: + + device_dict[device] = True + + # 最大进程数:PC已连接的设备数 + + p = Pool(device_num) + + res_l = [] + + excel_index = 0 + + for excel_path, excel_name in excel_path_list: + + res = p.apply_async(func_name, ((device_dict, excel_path, excel_name, report_path, base_path, now_time, dir_path),)) + + res_l.append(res) + + excel_index += 1 + + p.close() + + p.join() + + + + for res in res_l: + + # 汇总用例执行结果 + + result_list.append(res.get()) + + # 关闭进程池 + + p.terminate() + + if mode == "2": + + # 获取所有的json路径 + + all_json_path = [] + + json_name_list = get_file_list(json_path, ".json") + + if "_diff.json" in json_name_list[0]: + + mode = "1" + + else: + + mode = "0" + + base_path = "" + + for json_name in json_name_list: + + all_json_path.append(os.path.join(json_path, json_name)) + + print("all_json_path: ", all_json_path) + + for json_data_path in all_json_path: + + with open(json_data_path, "r") as f: + + data = json.loads(f.read()) + + # print("解析后json文件:", data) + + result_list.append(({}, data)) + + + + end_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())) + + end_time_second = datetime.timestamp(datetime.now()) + + run_time = end_time_second - start_time_second + + moudle_count = len(result_list) + + total_count = 0 + + pass_count = 0 + + case_fail_count = 0 + + get_fail_count = 0 + + + + if mode == "0": + + # 获取基线图 + + result_dict = {} + + for run_dict in result_list: + + for key, value in run_dict[1].items(): + + result_dict[key] = value + + total_count += value["Total"] + + pass_count += value["Pass"] + + case_fail_count += value["Case_fail"] + + get_fail_count += value["Get_fail"] + + if total_count == 0: + + pass_rate = 0 + + else: + + pass_rate = int(pass_count / total_count * 100) + + # if pass_count != total_count - case_fail_count - get_fail_count: + + # pass_count = total_count - case_fail_count - get_fail_count + + result_dict["Total_data"] = {"moudle_count": str(moudle_count), + + "Total": str(total_count), + + "Pass": str(pass_count), + + "Case_fail": str(case_fail_count), + + "Get_fail": str(get_fail_count), + + "Pass_rate": str(pass_rate) + "%", + + "start_end_time": str(start_time) + "/ " + str(end_time), + + "run_time": str(time.strftime("%H:%M:%S", time.gmtime(run_time))) + + } + + # 生成获取基线图的html报告 + + write_report_html(result_dict, mode="0", image_path=base_path) + + print("获取图片结束,result_dict: ", result_dict) + + elif mode == "1": + + # 与基线图对比,并生成差异图和报告 + + base_image_fail_count = 0 + + compare_fail_count = 0 + + diff_dict = {} + + for run_dict in result_list: + + for key, value in run_dict[1].items(): + + diff_dict[key] = value + + # 累加获取各状态总数 + + total_count += value["Total"] + + pass_count += value["Pass"] + + case_fail_count += value["Case_fail"] + + get_fail_count += value["Get_fail"] + + base_image_fail_count += value["Base_image_fail"] + + compare_fail_count += value["Compare_fail"] + + if total_count == 0: + + pass_rate = 0 + + else: + + pass_rate = int(pass_count / total_count * 100) + + diff_dict["Total_data"] = {"moudle_count": str(moudle_count), + + "Total": str(total_count), + + "Pass": str(pass_count), + + "Case_fail": str(case_fail_count), + + "Get_fail": str(get_fail_count), + + "Base_image_fail": str(base_image_fail_count), + + "Compare_fail": str(compare_fail_count), + + "Pass_rate": str(pass_rate) + "%", + + "start_end_time": str(start_time) + "/ " + str(end_time), + + "run_time": str(time.strftime("%H:%M:%S", time.gmtime(run_time)))} + + diff_path = os.path.join(reports_path, "diff_" + str(now_time)) + + # 生成对比图片后的html报告 + + write_report_html(diff_dict, mode="1", image_path=diff_path) + + print("对比图片结束,diff_dict: ", diff_dict) + diff --git a/function/ui_compare_rh/uicompare_tools/excel/actionSheet.xlsx b/function/ui_compare_rh/uicompare_tools/excel/actionSheet.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..d8c3be79f5bf717b930196cf91fe131ad3c18ad6 Binary files /dev/null and b/function/ui_compare_rh/uicompare_tools/excel/actionSheet.xlsx differ diff --git a/function/ui_compare_rh/uicompare_tools/excel/uicompare.xlsx b/function/ui_compare_rh/uicompare_tools/excel/uicompare.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..8d0255136e1831e0437d42d19471ca5fdf3733c4 Binary files /dev/null and b/function/ui_compare_rh/uicompare_tools/excel/uicompare.xlsx differ diff --git a/function/ui_compare_rh/uicompare_tools/mode.html b/function/ui_compare_rh/uicompare_tools/mode.html new file mode 100644 index 0000000000000000000000000000000000000000..c56f5b11a876b0ac7afc98f4b4895e32baacc4a9 --- /dev/null +++ b/function/ui_compare_rh/uicompare_tools/mode.html @@ -0,0 +1,432 @@ + + + + + <!--{title_name}--> + + + + + + + + +
+ + + + + + + + + + + + + +
Test Summary
Platform:PhoneTest Type:Test
Device Name:7001005458*************e1c8933900 + \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare_tools/run.bat b/function/ui_compare_rh/uicompare_tools/run.bat new file mode 100644 index 0000000000000000000000000000000000000000..3fe200aa702522de563d3a9f63384ace127aca21 --- /dev/null +++ b/function/ui_compare_rh/uicompare_tools/run.bat @@ -0,0 +1,37 @@ +@ECHO OFF +echo /* +echo * Copyright (C) 2024 Huawei Device Co., Ltd. +echo * Licensed under the Apache License, Version 2.0 (the 'License') +echo * you may not use this file except in compliance with the License. +echo * You may obtain a copy of the License at +echo * +echo * http://www.apache.org/licenses/LICENSE-2.0 +echo * +echo * Unless required by applicable law or agreed to in writing, software +echo * distributed under the License is distributed on an 'AS IS' BASIS, +echo * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +echo * See the License for the specific language governing permissions and +echo * limitations under the License. +echo */ +echo. + +reg add HKEY_CURRENT_USER\Console /v QuickEdit /t REG_DWORD /d 00000000 /f +echo "======使用说明======" +echo "--type: 输入0:获取基线图,输入1:对比生成差异图,输入2:生成总html报告" +echo "--excel: 用例数据的Excel所在文件夹路径(Excel仅支持xlsx格式)" +echo "--dir: 基础图源文件夹所在路径(type=1时必填)" +echo "--hap: 用例hap文件夹所在路径(必填)" +echo "--json: 执行用例生成的 json文件所在文件夹路径(type=2时必填)" +echo "入参范例:--type0--excel D:\UI\All_Excel\--hap D:\UI\hap" +echo "入参范例:--type1--excel D:\UI\All_Excel\--dir D:\UI\BaseImages_20230504_174004 --hap D:\UI\hap" +echo "入参范例:--type2--json D:\UI\run_json_20230810_163907\" +echo "温馨提示:执行用例前,请先确保已关闭上述路径中所有的Excel表,否则将会导致用例结果写入Excel后保存失败" +echo "======使用说明======" + + +set /p param= 输入入参: + + +python UiCompareTools_progress.py %param% + +pause