diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/.gitignore b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/.gitignore index 270857cbfe294064aaafdebfcf1d00c5f69f3925..d2ff20141ceed86d87c0ea5d99481973005bab2b 100644 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/.gitignore +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/.gitignore @@ -1,8 +1,12 @@ /node_modules +/oh_modules /local.properties /.idea **/build -**/.preview /.hvigor -/package-lock.json -/entry/package-lock.json \ No newline at end of file +.cxx +/.clangd +/.clang-format +/.clang-tidy +**/.test +/.appanalyzer \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/AppScope/app.json5 b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7c0f5a53fafff6a4eac34e24e04e0394353c6409 --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/AppScope/app.json5 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "app": { + "bundleName": "com.samples.etsdefiningpagelayoutandconnection", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/AppScope/resources/base/element/string.json b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..4d2d92b96dbe546bdf79092690982e39c5a76afb --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "DefiningPageLayoutAndConnection" + } + ] +} diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/AppScope/resources/base/media/app_icon.png b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a39445dc87828b76fed6d2ec470dd455c45319e3 Binary files /dev/null and b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/AppScope/resources/base/media/app_icon.png differ diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/README_zh.md b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/README_zh.md index 0e793352747a09dbaa2d5bfa685941403416eb5e..c4ee62552140c4879597fe26930fba0858df4bd6 100644 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/README_zh.md +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/README_zh.md @@ -36,7 +36,7 @@ entry/src/main/ets/MainAbility ### 具体实现 -* 创建定义数据类型文件,源码参考:[FoodData.ets](entry/src/main/ets/MainAbility/model/FoodData.ets) +* 创建定义数据类型文件,源码参考:[FoodData.ets](entry/src/main/ets/model/FoodData.ets) * List布局:创建食物数据模型,ForEach循环渲染ListItem。 @@ -62,7 +62,9 @@ Grid:网格容器,由“行”和“列”分割的单元格所组成,通 1.本示例仅支持在标准系统上运行。 -2.本示例需要使用DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022)才可编译运行。 +2.本示例已适配API version 14版本SDK,版本号:5.0.2.123。 + +3.本示例需要使用DevEco Studio 5.0.2 Release (Build Version: 5.0.7.210 构建 2025年2月11日)及以上版本才可编译运行。 ### 下载 diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/build-profile.json5 b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/build-profile.json5 index 956b202bee75f50ae79d7ff01ce70751673429bd..f07ffc0ed42908c2b44ff970d54fb567858942e1 100644 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/build-profile.json5 +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/build-profile.json5 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,12 +16,27 @@ { "app": { "signingConfigs": [], - "compileSdkVersion": 9, - "compatibleSdkVersion": 9, "products": [ { "name": "default", "signingConfig": "default", + "compileSdkVersion": 14, + "compatibleSdkVersion": 14, + "runtimeOS": "OpenHarmony", + "buildOption": { + "strictMode": { + "caseSensitiveCheck": true, + "useNormalizedOHMUrl": true + } + } + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" } ] }, @@ -39,4 +54,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/code-linter.json5 b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/code-linter.json5 new file mode 100644 index 0000000000000000000000000000000000000000..fd3a092a5908803aa814ee753280091f1d3d1106 --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/code-linter.json5 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "files": [ + "**/*.ets" + ], + "ignore": [ + "**/src/ohosTest/**/*", + "**/src/test/**/*", + "**/src/mock/**/*", + "**/node_modules/**/*", + "**/oh_modules/**/*", + "**/build/**/*", + "**/.preview/**/*" + ], + "ruleSet": [ + "plugin:@performance/recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "@security/no-unsafe-aes": "error", + "@security/no-unsafe-hash": "error", + "@security/no-unsafe-mac": "warn", + "@security/no-unsafe-dh": "error", + "@security/no-unsafe-dsa": "error", + "@security/no-unsafe-ecdsa": "error", + "@security/no-unsafe-rsa-encrypt": "error", + "@security/no-unsafe-rsa-sign": "error", + "@security/no-unsafe-rsa-key": "error", + "@security/no-unsafe-dsa-key": "error", + "@security/no-unsafe-dh-key": "error", + "@security/no-unsafe-3des": "error" + } +} \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/.gitignore b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/build-profile.json5 b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/build-profile.json5 index 7521210f9b9aa60604097972a15fd0979b30b2b8..fdb6b039a9aa223ed835a8b277dfb3f6d7740a47 100644 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/build-profile.json5 +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/build-profile.json5 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,15 +14,30 @@ */ { - "apiType": 'faMode', + "apiType": "stageMode", "buildOption": { }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], "targets": [ { - "name": "default", + "name": "default" }, { "name": "ohosTest", } ] -} +} \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/hvigorfile.js b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/hvigorfile.js deleted file mode 100644 index bcec4c99653062cbf17702c40a2dd2a7b809b81a..0000000000000000000000000000000000000000 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/hvigorfile.js +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -module.exports = require('@ohos/hvigor-ohos-plugin').legacyHapTasks diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/TestAbility/app.ets b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/hvigorfile.ts similarity index 46% rename from code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/TestAbility/app.ets rename to code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/hvigorfile.ts index 79e2cb81a3437b0deda0807f981e7b7b7e62f0d1..e47e6ece2e96c1eae4231a9db6a59997376799cb 100644 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/TestAbility/app.ets +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/hvigorfile.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,21 +13,9 @@ * limitations under the License. */ -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; export default { - onCreate() { - console.info('Application onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/obfuscation-rules.txt b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..272efb6ca3f240859091bbbfc7c5802d52793b0b --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/obfuscation-rules.txt @@ -0,0 +1,23 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/oh-package.json5 b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..cfc94f42f4a89690f661f37f28124351d8600aa1 --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/oh-package.json5 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/package.json b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/package.json deleted file mode 100644 index db08bbf9d7439623fcfa4093ab7f013633c62d48..0000000000000000000000000000000000000000 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "license": "ISC", - "devDependencies": {}, - "name": "entry", - "ohos": { - "org": "huawei", - "directoryLevel": "module", - "buildTool": "hvigor" - }, - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": {} -} \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/config.json b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/config.json deleted file mode 100644 index 82a9dd0a72b03bc71b0a7c1688bb6cf200a03da6..0000000000000000000000000000000000000000 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/config.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "app": { - "bundleName": "ohos.samples.etsdefiningpagelayoutandconnection", - "vendor": "samples", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "ohos.samples.etsdefiningpagelayoutandconnection", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "deviceType": [ - "default", - "tablet" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:Logo", - "description": "$string:mainability_description", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/FoodCategoryList", - "pages/FoodDetail" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/entryability/EntryAbility.ets b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..d9f55306606ce64fab419876a347a1a28d53551e --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +const DOMAIN = 0x0000; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/FoodCategoryList', (err) => { + if (err.code) { + hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); + return; + } + hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); + } +} \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/TestAbility/pages/index.ets b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets similarity index 43% rename from code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/TestAbility/pages/index.ets rename to code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets index f5fb09a91c20dca2bf9721e0d3d286261499ea20..a0203fe63f8f53b71d200a8855466e9f0cef7525 100644 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/TestAbility/pages/index.ets +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,40 +13,19 @@ * limitations under the License. */ -import router from '@system.router' +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; -@Entry -@Component -struct Index { - aboutToAppear() { - console.info('TestAbility index aboutToAppear') - } +const DOMAIN = 0x0000; - @State message: string = 'Hello World' +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(DOMAIN, 'testTag', 'onBackup ok'); + await Promise.resolve(); + } - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - } - .type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(() => { - }) - } - .width('100%') - } - .height('100%') + async onRestore(bundleVersion: BundleVersion) { + hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + await Promise.resolve(); } } \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/model/FoodData.ets b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/model/FoodData.ets similarity index 96% rename from code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/model/FoodData.ets rename to code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/model/FoodData.ets index 3507f35acc12ccf9db1cde864dcfbf8eb4fc15c2..aa1da2c52df5eb03a457642d20245bb9a409ba6f 100644 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/model/FoodData.ets +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/model/FoodData.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/model/FoodDataModels.ets b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/model/FoodDataModels.ets similarity index 90% rename from code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/model/FoodDataModels.ets rename to code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/model/FoodDataModels.ets index fd6fa8304ea7b7d9ed7c26fb95d0101b801b4338..81b36920b758fb8219f146d0017e82940c2887e6 100644 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/model/FoodDataModels.ets +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/model/FoodDataModels.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,7 +15,18 @@ import { FoodData, Category } from './FoodData' -const FoodComposition: any[] = [ +export interface FoodCompositionType { + name: string, + image: Resource, + category: Category, + calories: number, + protein: number, + fat: number, + carbohydrates: number, + vitaminC: number +} + +const FoodComposition: FoodCompositionType[] = [ { 'name': 'Tomato', 'image': $r('app.media.Tomato'), 'category': Category.Vegetable, 'calories': 17, 'protein': 0.9, 'fat': 0.2, 'carbohydrates': 3.9, 'vitaminC': 17.8 }, { 'name': 'Walnut', 'image': $r('app.media.Walnut'), 'category': Category.Nut, 'calories': 654 , 'protein': 15, 'fat': 65, 'carbohydrates': 14, 'vitaminC': 1.3 }, { 'name': 'Cucumber', 'image': $r('app.media.Cucumber'), 'category': Category.Vegetable, 'calories': 30, 'protein': 3, 'fat': 0, 'carbohydrates': 1.9, 'vitaminC': 2.1 }, diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/pages/FoodCategoryList.ets b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/pages/FoodCategoryList.ets similarity index 79% rename from code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/pages/FoodCategoryList.ets rename to code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/pages/FoodCategoryList.ets index 969f1c5cbb073455d6738974f6b2c6d4f82278bd..a4d394f959a03b35916aee8a53bfab68c7d6a10b 100644 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/pages/FoodCategoryList.ets +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/pages/FoodCategoryList.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,80 +13,80 @@ * limitations under the License. */ -import router from '@ohos.router' -import { Category, FoodData } from '../model/FoodData' -import { initializeOnStartup } from '../model/FoodDataModels' +import router from '@ohos.router'; +import { Category, FoodData } from '../model/FoodData'; +import { initializeOnStartup } from '../model/FoodDataModels'; -class BasicDataSource implements IDataSource { - private listeners: DataChangeListener[] = [] +class BasicDataSource implements IDataSource { + private listeners: DataChangeListener[] = []; public totalCount(): number { - return 0 + return 0; } - public getData(index: number): any { - return undefined + public getData(index: number): T | undefined { + return undefined; } registerDataChangeListener(listener: DataChangeListener): void { if (this.listeners.indexOf(listener) < 0) { - this.listeners.push(listener) + this.listeners.push(listener); } } unregisterDataChangeListener(listener: DataChangeListener): void { const pos = this.listeners.indexOf(listener); if (pos >= 0) { - this.listeners.splice(pos, 1) + this.listeners.splice(pos, 1); } } notifyDataReload(): void { this.listeners.forEach(listener => { - listener.onDataReloaded() + listener.onDataReloaded(); }) } notifyDataAdd(index: number): void { this.listeners.forEach(listener => { - listener.onDataAdded(index) + listener.onDataAdded(index); }) } notifyDataChange(index: number): void { this.listeners.forEach(listener => { - listener.onDataChanged(index) + listener.onDataChanged(index); }) } } -class MyDataSource extends BasicDataSource { - public dataArray: string[] = [] +class MyDataSource extends BasicDataSource { + public dataArray: FoodData[] = []; - constructor(ele) { + constructor(ele: FoodData[]) { super() - for (var index = 0;index < ele.length; index++) { + for (let index = 0;index < ele.length; index++) { this.dataArray.push(ele[index]) } } public totalCount(): number { - return this.dataArray.length + return this.dataArray.length; } - public getData(index: number): any { - return this.dataArray[index] + public getData(index: number): FoodData { + return this.dataArray[index]; } - public addData(index: number, data: string): void { + public addData(index: number, data: FoodData): void { this.dataArray.splice(index, 0) - this.notifyDataAdd(index) + this.notifyDataAdd(index); } } @Component struct FoodListItem { - private foodItem: FoodData + @Prop foodItem: FoodData; build() { Navigator({ target: 'pages/FoodDetail' }) { @@ -121,7 +121,7 @@ struct FoodListItem { @Component struct FoodList { - private foodItems: FoodData[] + @Prop foodItems: FoodData[]; build() { Column() { @@ -137,12 +137,12 @@ struct FoodList { .backgroundColor('#FFf1f3f5') List() { - LazyForEach(new MyDataSource(this.foodItems), (item, index) => { + LazyForEach(new MyDataSource(this.foodItems), (item: FoodData, index) => { ListItem() { FoodListItem({ foodItem: item }) } .id('foodListItem' + (index + 1)) - }, item => item.id.toString()) + }, (item: FoodData) => item.id.toString()) } .width('100%') .height('93%') @@ -153,7 +153,7 @@ struct FoodList { @Component struct FoodGridItem { - private foodItem: FoodData + @Prop foodItem: FoodData; build() { Column() { @@ -182,19 +182,19 @@ struct FoodGridItem { .height(184) .width('100%') .onClick(() => { - router.pushUrl({ url: 'pages/FoodDetail', params: { foodId: this.foodItem } }) + router.pushUrl({ url: 'pages/FoodDetail', params: { foodId: this.foodItem } }); }) } } @Component struct FoodGrid { - private foodItems: FoodData[] - private gridRowTemplate: string = '' - private heightValue: number + @Prop foodItems: FoodData[]; + @State gridRowTemplate: string = ''; + @State heightValue: number = 0; aboutToAppear() { - var rows = Math.round(this.foodItems.length / 2); + let rows = Math.round(this.foodItems.length / 2); this.gridRowTemplate = '1fr '.repeat(rows); this.heightValue = rows * 192 - 8; } @@ -224,7 +224,7 @@ struct FoodGrid { @Component struct FoodCategory { - private foodItems: FoodData[] + @Prop foodItems: FoodData[]; build() { Tabs() { @@ -262,8 +262,8 @@ struct FoodCategory { @Entry @Component struct FoodCategoryList { - private foodItems: FoodData[] = initializeOnStartup() - @State private showList: boolean = false + private foodItems: FoodData[] = initializeOnStartup(); + @State private showList: boolean = false; build() { Column() { diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/pages/FoodDetail.ets b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/pages/FoodDetail.ets similarity index 87% rename from code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/pages/FoodDetail.ets rename to code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/pages/FoodDetail.ets index 03ca74b0e4422c1c874a3528f665e781fe06806d..372f3a0ef5a4c844d24a9fe62b7d05f9c3089923 100644 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/pages/FoodDetail.ets +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/pages/FoodDetail.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,8 +13,8 @@ * limitations under the License. */ -import router from '@ohos.router' -import { FoodData } from '../model/FoodData' +import router from '@ohos.router'; +import { FoodData } from '../model/FoodData'; @Component struct PageTitle { @@ -40,7 +40,7 @@ struct PageTitle { @Component struct FoodImageDisplay { - private foodItem: FoodData + @Prop foodItem: FoodData; build() { Stack({ alignContent: Alignment.BottomStart }) { @@ -58,7 +58,7 @@ struct FoodImageDisplay { @Component struct ContentTable { - private foodItem: FoodData + @Prop foodItem: FoodData; @Builder IngredientItem(title: string, name: string, value: string) { Row() { @@ -94,13 +94,17 @@ struct ContentTable { } } +interface RouteParamsType { + foodId: FoodData +} + @Entry @Component struct FoodDetail { - private foodItem: FoodData = undefined + @State foodItem: FoodData | undefined = undefined; aboutToAppear() { - this.foodItem = router.getParams()["foodId"] + this.foodItem = (this.getUIContext().getRouter().getParams() as RouteParamsType).foodId; } build() { diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/module.json5 b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..83d92919a08799e2348ef1c77392578376a0c9a8 --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/module.json5 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "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.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:layered_image", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "name": "EntryBackupAbility", + "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", + "type": "backup", + "exported": false, + "metadata": [ + { + "name": "ohos.extension.backup", + "resource": "$profile:backup_config" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/element/color.json b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/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/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/element/float.json b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..33ea22304f9b1485b5f22d811023701b5d4e35b6 --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/element/float.json @@ -0,0 +1,8 @@ +{ + "float": [ + { + "name": "page_text_font_size", + "value": "50fp" + } + ] +} diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/element/string.json b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/element/string.json index 3440475e7cbd0420317843d6131c278bd48a8ece..15ff16ac7c961ae451edd0c860debb5c2d42fded 100644 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/element/string.json +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/element/string.json @@ -1,12 +1,16 @@ { "string": [ { - "name": "entry_MainAbility", - "value": "Healthy Diet" + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" }, { - "name": "mainability_description", - "value": "ETS_Empty Ability" + "name": "EntryAbility_label", + "value": "Healthy Diet" } ] } \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/media/background.png b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..923f2b3f27e915d6871871deea0420eb45ce102f Binary files /dev/null and b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/media/background.png differ diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/media/foreground.png b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..97014d3e10e5ff511409c378cd4255713aecd85f Binary files /dev/null and b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/media/foreground.png differ diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/media/layered_image.json b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/media/layered_image.json @@ -0,0 +1,7 @@ +{ + "layered-image": + { + "background" : "$media:background", + "foreground" : "$media:foreground" + } +} \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/media/startIcon.png b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/media/startIcon.png differ diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/profile/backup_config.json b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/profile/main_pages.json b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..33fa14e9a6c807fbcfc683dfa25554ca6bf4d2ba --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/FoodCategoryList", + "pages/FoodDetail" + ] +} diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/dark/element/color.json b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/dark/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..79b11c2747aec33e710fd3a7b2b3c94dd9965499 --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/resources/dark/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#000000" + } + ] +} \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/app.ets b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/mock/mock-config.json5 similarity index 75% rename from code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/app.ets rename to code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/mock/mock-config.json5 index bf28e58b36cf11db491d3f00768ef2c9e41d05cf..a43de6637efa43eee2125d56be134ac704da75bb 100644 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/main/ets/MainAbility/app.ets +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/mock/mock-config.json5 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,11 +13,5 @@ * limitations under the License. */ -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, +{ } \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/config.json b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/config.json deleted file mode 100644 index be3ce920e7bb248514cf42b6a67ce075ae857bec..0000000000000000000000000000000000000000 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/config.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "app": { - "bundleName": "ohos.samples.etsdefiningpagelayoutandconnection", - "vendor": "samples", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.entry_test", - "name": ".entry_test", - "mainAbility": ".TestAbility", - "srcPath": "", - "deviceType": [ - "default", - "tablet" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry_test", - "moduleType": "feature", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "TestAbility", - "name": ".TestAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_TestAbility", - "formsEnabled": false, - "label": "$string:entry_TestAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index f8f29ed8a9f7d14b531f1dbf827e328837287a6f..0000000000000000000000000000000000000000 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s itName', - '-s level', '-s testType', '-s size', '-s timeout', - '-s package' - ]) - let targetParams = '' - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - console.log('onAbilityCreateCallback') -} - -async function addAbilityMonitorCallback(err: any) { - console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - } - - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - } - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - console.info('cmd : ' + cmd) - var debug = abilityDelegatorArguments.parameters["-D"] - if (debug == 'true') { - cmd += ' -D' - } - console.info('cmd : ' + cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)) - console.info('executeShellCommand : data : ' + d.stdResult) - console.info('executeShellCommand : data : ' + d.exitCode) - }) - console.info('OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext') - var context = abilityDelegator.getAppContext() - console.info('getAppContext : ' + JSON.stringify(context)) - console.info('OpenHarmonyTestRunner onRun end') - } -} \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/test/app.test.ets b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/test/Ability.test.ets similarity index 47% rename from code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/test/app.test.ets rename to code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/test/Ability.test.ets index 7f579d5fd67842dbf7e13d26cb656fd2893fb99d..509841b662c60be1623cf5af266dc26b5f306f4a 100644 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/test/app.test.ets +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/test/Ability.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,94 +13,93 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' -import { Driver, ON } from '@ohos.UiTest' -import featureAbility from '@ohos.ability.featureAbility' -import hilog from '@ohos.hilog' +import { describe, it, expect } from '@ohos/hypium'; +import { Driver, ON } from '@ohos.UiTest'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import hilog from '@ohos.hilog'; +import Want from '@ohos.app.ability.Want'; -const TAG = '[Sample_DefiningPageLayoutAndConnection]' -const DOMAIN = 0xF811 -const BUNDLE = 'DefiningPageLayoutAndConnection_' +const TAG = '[Sample_DefiningPageLayoutAndConnection]'; +const DOMAIN = 0xF811; +const BUNDLE = 'DefiningPageLayoutAndConnection_'; export default function appTest() { - describe('appTest', function () { - it(BUNDLE + 'StartAbility_001', 0, async function (done) { - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001 begin') - let parameter = { - "want": { - bundleName: "ohos.samples.etsdefiningpagelayoutandconnection", - abilityName: "ohos.samples.etsdefiningpagelayoutandconnection.MainAbility" - } - } - await featureAbility.startAbility(parameter, (err, data) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,err.code:' + err.code) - expect(0).assertEqual(err.code) - done() - hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001 end') - }) + describe('appTest', () => { + it('StartAbility_001', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001 begin'); + let want: Want = { + bundleName: 'com.samples.etsdefiningpagelayoutandconnection', + abilityName: 'EntryAbility' + }; + let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + abilityDelegator.startAbility(want, (err) => { + hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001,err:' + JSON.stringify(err)); + done(); + hilog.info(DOMAIN, TAG, BUNDLE + 'StartAbility_001 end'); + }); }) /** * Grid布局 查看详情 */ - it(BUNDLE + 'FoodGridFunction_001', 0, async function () { + it('FoodGridFunction_001', 0, async () => { // create Driver hilog.info(DOMAIN, TAG, BUNDLE + 'FoodGridFunction_001 begin') - let driver = await Driver.create() - await driver.delayMs(1000) + let driver = Driver.create(); + await driver.delayMs(2000); // foodDetail - hilog.info(DOMAIN, TAG, BUNDLE + 'FoodGridFunction_001 foodDetail') - await driver.assertComponentExist(ON.id('foodGridItem1')) - let foodGridItem1 = await driver.findComponent(ON.id('foodGridItem1')) - await foodGridItem1.click() - await driver.delayMs(1000) + hilog.info(DOMAIN, TAG, BUNDLE + 'FoodGridFunction_001 foodDetail'); + await driver.assertComponentExist(ON.id('foodGridItem1')); + let foodGridItem1 = await driver.findComponent(ON.id('foodGridItem1')); + await foodGridItem1.click(); + await driver.delayMs(1000); // 返回上一级 - hilog.info(DOMAIN, TAG, BUNDLE + 'FoodGridFunction_001 back') - await driver.assertComponentExist(ON.id('back')) - let backBtn = await driver.findComponent(ON.id('back')) - await backBtn.click() - await driver.delayMs(1000) - hilog.info(DOMAIN, TAG, BUNDLE + 'FoodGridFunction_001 end') + hilog.info(DOMAIN, TAG, BUNDLE + 'FoodGridFunction_001 back'); + await driver.assertComponentExist(ON.id('back')); + let backBtn = await driver.findComponent(ON.id('back')); + await backBtn.click(); + await driver.delayMs(1000); + hilog.info(DOMAIN, TAG, BUNDLE + 'FoodGridFunction_001 end'); }) /** * 切换布局 */ - it(BUNDLE + 'SwitchLayoutFunction_001', 0, async function () { + it('SwitchLayoutFunction_001', 0, async () => { // create Driver - hilog.info(DOMAIN, TAG, BUNDLE + 'SwitchLayoutFunction_001 begin') - let driver = await Driver.create() - await driver.delayMs(1000) + hilog.info(DOMAIN, TAG, BUNDLE + 'SwitchLayoutFunction_001 begin'); + let driver = Driver.create(); + await driver.delayMs(1000); // switchLayout - hilog.info(DOMAIN, TAG, BUNDLE + 'SwitchLayoutFunction_001 switchLayout') - await driver.assertComponentExist(ON.id('switch')) - let switchBtn = await driver.findComponent(ON.id('switch')) - await switchBtn.click() - await driver.delayMs(1000) - hilog.info(DOMAIN, TAG, BUNDLE + 'SwitchLayoutFunction_001 end') + hilog.info(DOMAIN, TAG, BUNDLE + 'SwitchLayoutFunction_001 switchLayout'); + await driver.assertComponentExist(ON.id('switch')); + let switchBtn = await driver.findComponent(ON.id('switch')); + await switchBtn.click(); + await driver.delayMs(1000); + hilog.info(DOMAIN, TAG, BUNDLE + 'SwitchLayoutFunction_001 end'); }) /** * List布局 查看详情 */ - it(BUNDLE + 'FoodListFunction_001', 0, async function () { + it('FoodListFunction_001', 0, async () => { // create Driver - hilog.info(DOMAIN, TAG, BUNDLE + 'FoodListFunction_001 begin') - let driver = await Driver.create() - await driver.delayMs(1000) + hilog.info(DOMAIN, TAG, BUNDLE + 'FoodListFunction_001 begin'); + let driver = Driver.create(); + await driver.delayMs(1000); // foodDetail - hilog.info(DOMAIN, TAG, BUNDLE + 'FoodListFunction_001 foodDetail') - await driver.assertComponentExist(ON.id('foodListItem1')) - let foodListItem1 = await driver.findComponent(ON.id('foodListItem1')) - await foodListItem1.click() - await driver.delayMs(1000) + hilog.info(DOMAIN, TAG, BUNDLE + 'FoodListFunction_001 foodDetail'); + await driver.assertComponentExist(ON.id('foodListItem1')); + let foodListItem1 = await driver.findComponent(ON.id('foodListItem1')); + await foodListItem1.click(); + await driver.delayMs(1000); // 返回上一级 - hilog.info(DOMAIN, TAG, BUNDLE + 'FoodListFunction_001 back') - await driver.assertComponentExist(ON.id('back')) - let backBtn = await driver.findComponent(ON.id('back')) - await backBtn.click() - await driver.delayMs(1000) - hilog.info(DOMAIN, TAG, BUNDLE + 'FoodListFunction_001 end') + hilog.info(DOMAIN, TAG, BUNDLE + 'FoodListFunction_001 back'); + await driver.assertComponentExist(ON.id('back')); + let backBtn = await driver.findComponent(ON.id('back')); + await backBtn.click(); + await driver.delayMs(1000); + hilog.info(DOMAIN, TAG, BUNDLE + 'FoodListFunction_001 end'); }) }) } \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/test/List.test.ets b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/test/List.test.ets index f7a71bf395c801c8818b06f2a486660ed9f25eee..f6b6bed920d63c7dad7fbb06c69efa4373d73740 100644 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/test/List.test.ets +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/ets/test/List.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,8 +13,8 @@ * limitations under the License. */ -import appTest from './app.test' +import appTest from './Ability.test'; export default function testsuite() { - appTest() + appTest(); } diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/module.json5 b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..4970292a8d29b20cbe6e96095557b5aea35da9ce --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/module.json5 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "module": { + "name": "entry_test", + "type": "feature", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false + } +} diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/resources/base/element/string.json b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index a0901cfced5abc1cb836b55896884b769adc7175..0000000000000000000000000000000000000000 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "description_TestAbility", - "value": "eTS_Empty Ability" - }, - { - "name": "entry_TestAbility", - "value": "entry_TestAbility" - } - ] -} \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/resources/base/media/icon.png b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/test/List.test.ets b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..7ee542f3ee7740c31290d16187e1c50236295017 --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/test/List.test.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import localUnitTest from './LocalUnit.test'; + +export default function testsuite() { + localUnitTest(); +} \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/test/LocalUnit.test.ets b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/test/LocalUnit.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..007f848b412417c5d909aa64cc6f346c8f6187e4 --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/entry/src/test/LocalUnit.test.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; + +export default function localUnitTest() { + describe('localUnitTest', () => { + // 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. + 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/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/hvigor/hvigor-config.json5 b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5c89eb0c42c71dbd813b6502284e0eb88f94fc0a --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/hvigor/hvigor-config.json5 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "modelVersion": "5.0.2", + "dependencies": { + }, + "execution": { + // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */ + // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ + // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ + // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ + }, + "nodeOptions": { + // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/ + // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/ + } +} diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/hvigorfile.js b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/hvigorfile.js deleted file mode 100644 index cff9f0dfcf8cb00cca34e7f50d61380cf5496868..0000000000000000000000000000000000000000 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/hvigorfile.js +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -module.exports = require('@ohos/hvigor-ohos-plugin').legacyAppTasks \ No newline at end of file diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/hvigorfile.ts b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..e0064b842609d3ea7d8496431db2202ba2a56e8b --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/hvigorfile.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/oh-package.json5 b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c9bd6603490a3676060a3bb3e8ab83eee25e2ed6 --- /dev/null +++ b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/oh-package.json5 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "modelVersion": "5.0.2", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.21", + "@ohos/hamock": "1.0.0" + } +} diff --git a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/package.json b/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/package.json deleted file mode 100644 index b791f087aeab434d2934b87381c4f59a6862abfb..0000000000000000000000000000000000000000 --- a/code/UI/ArkTsComponentCollection/DefiningPageLayoutAndConnection/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "license": "ISC", - "devDependencies": {}, - "name": "definingpagelayoutandconnection", - "ohos": { - "org": "huawei", - "directoryLevel": "project", - "buildTool": "hvigor" - }, - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "@ohos/hypium": "1.0.3", - "@ohos/hvigor-ohos-plugin": "1.3.1", - "hypium": "^1.0.0", - "@ohos/hvigor": "1.3.1" - } -} \ No newline at end of file