diff --git a/01_EnvironmentSetup/01_Complete/AppScope/app.json5 b/01_EnvironmentSetup/01_Complete/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b63e8d74725325e18212a7b93174bfc9ec7b2e92 --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.quickstart", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/01_EnvironmentSetup/01_Complete/AppScope/resources/base/element/string.json b/01_EnvironmentSetup/01_Complete/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e1346507f210ad222a059080465e3115e7143780 --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "HMOS世界入门版" + } + ] +} diff --git a/01_EnvironmentSetup/01_Complete/AppScope/resources/base/media/app_icon.png b/01_EnvironmentSetup/01_Complete/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/01_EnvironmentSetup/01_Complete/AppScope/resources/base/media/app_icon.png differ diff --git a/01_EnvironmentSetup/01_Complete/build-profile.json5 b/01_EnvironmentSetup/01_Complete/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c033ce4278fb0641d84107c3c134047ac487368e --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/build-profile.json5 @@ -0,0 +1,35 @@ +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/01_EnvironmentSetup/01_Complete/entry/build-profile.json5 b/01_EnvironmentSetup/01_Complete/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b695582d3680556f4cce2ec518f65720a9413ca3 --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/entry/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/01_EnvironmentSetup/01_Complete/entry/hvigorfile.ts b/01_EnvironmentSetup/01_Complete/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/01_EnvironmentSetup/01_Complete/entry/obfuscation-rules.txt b/01_EnvironmentSetup/01_Complete/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/entry/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/01_EnvironmentSetup/01_Complete/entry/oh-package.json5 b/01_EnvironmentSetup/01_Complete/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..248c3b7541a589682a250f86a6d3ecf7414d2d6a --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/01_EnvironmentSetup/01_Complete/entry/src/main/ets/entryability/EntryAbility.ets b/01_EnvironmentSetup/01_Complete/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8335b7692d4cac1f8b5d78ce7bc1c45a453d563e --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,41 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/01_EnvironmentSetup/01_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/01_EnvironmentSetup/01_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc55c03d3eea7ce53d5346c732a39ce9bf5267e1 --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/01_EnvironmentSetup/01_Complete/entry/src/main/ets/pages/Index.ets b/01_EnvironmentSetup/01_Complete/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..42ebc4fcf2a5ba9766d936bde8b3bfe80404d28b --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,34 @@ +@Entry +@Component +struct Index { + @State message: string = '快速入门'; + + build() { + Column() { + Text(this.message) + .fontSize(24) + .fontWeight(700) + .width('100%') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .fontFamily('HarmonyHeiTi-Bold') + .lineHeight(33) + Banner() + } + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} + +@Preview +@Component +struct Banner { + build() { + Image($r('app.media.banner_pic1')) + .objectFit(ImageFit.Contain) + .width('100%') + .padding({ top: 11, left: 16, right: 16 }) + .borderRadius(16) + } +} \ No newline at end of file diff --git a/01_EnvironmentSetup/01_Complete/entry/src/main/module.json5 b/01_EnvironmentSetup/01_Complete/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bef6142319137babd9ef098df8037a57edfbeb05 --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "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:ic_start_icon", + "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/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/element/color.json b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/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/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/element/string.json b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/media/background.png b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4671724ec24a20eaad33c37800194a808cbfbb Binary files /dev/null and b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/media/background.png differ diff --git a/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/media/banner_pic1.png b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/media/banner_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..eaecda2444a16fb441c8d6e25d177fca167f1069 Binary files /dev/null and b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/media/banner_pic1.png differ diff --git a/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/media/foreground.png b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..c17d456e4bb7aebc3ad21b4ac87bf8ffdd8eef41 Binary files /dev/null and b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/media/foreground.png differ diff --git a/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/media/ic_start_icon.png b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/media/ic_start_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/media/ic_start_icon.png differ diff --git a/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/media/layered_image.json b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/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/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/profile/backup_config.json b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/profile/main_pages.json b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/01_EnvironmentSetup/01_Complete/entry/src/main/resources/en_US/element/string.json b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/01_EnvironmentSetup/01_Complete/entry/src/main/resources/zh_CN/element/string.json b/01_EnvironmentSetup/01_Complete/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee46bd7efbb745933e89bd42c6fb6f9d3d2635a --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/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": "HMOS世界入门版" + } + ] +} \ No newline at end of file diff --git a/01_EnvironmentSetup/01_Complete/hvigor/hvigor-config.json5 b/01_EnvironmentSetup/01_Complete/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..06b2783670a348f95533b352c1ceda909a842bbc --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "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/01_EnvironmentSetup/01_Complete/hvigorfile.ts b/01_EnvironmentSetup/01_Complete/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/hvigorfile.ts @@ -0,0 +1,6 @@ +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/01_EnvironmentSetup/01_Complete/oh-package.json5 b/01_EnvironmentSetup/01_Complete/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ebdda7e54d1c41e952f1c7f6993c6d15ea3d146d --- /dev/null +++ b/01_EnvironmentSetup/01_Complete/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.18", + "@ohos/hamock": "1.0.0" + } +} diff --git a/01_EnvironmentSetup/01_Resources/background.png b/01_EnvironmentSetup/01_Resources/background.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4671724ec24a20eaad33c37800194a808cbfbb Binary files /dev/null and b/01_EnvironmentSetup/01_Resources/background.png differ diff --git a/01_EnvironmentSetup/01_Resources/banner_pic1.png b/01_EnvironmentSetup/01_Resources/banner_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..eaecda2444a16fb441c8d6e25d177fca167f1069 Binary files /dev/null and b/01_EnvironmentSetup/01_Resources/banner_pic1.png differ diff --git a/01_EnvironmentSetup/01_Resources/foreground.png b/01_EnvironmentSetup/01_Resources/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..c17d456e4bb7aebc3ad21b4ac87bf8ffdd8eef41 Binary files /dev/null and b/01_EnvironmentSetup/01_Resources/foreground.png differ diff --git a/01_EnvironmentSetup/README.md b/01_EnvironmentSetup/README.md new file mode 100644 index 0000000000000000000000000000000000000000..dc37c1cc6fef9470ed9d0c236dbca4c716c6efaf --- /dev/null +++ b/01_EnvironmentSetup/README.md @@ -0,0 +1,5 @@ +根据【开发入门:Hello World】教程创建全新的项目。 + +根据教程中的提示使用01_Resources文件夹中的文件。 + +如果您想要自行探索,可以直接打开01_Complete文件夹中的项目并浏览代码。 \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_Complete/AppScope/app.json5 b/02_UseSwiperToBuildBanner/02_Complete/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b63e8d74725325e18212a7b93174bfc9ec7b2e92 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.quickstart", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/02_UseSwiperToBuildBanner/02_Complete/AppScope/resources/base/element/string.json b/02_UseSwiperToBuildBanner/02_Complete/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e1346507f210ad222a059080465e3115e7143780 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "HMOS世界入门版" + } + ] +} diff --git a/02_UseSwiperToBuildBanner/02_Complete/AppScope/resources/base/media/app_icon.png b/02_UseSwiperToBuildBanner/02_Complete/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Complete/AppScope/resources/base/media/app_icon.png differ diff --git a/02_UseSwiperToBuildBanner/02_Complete/build-profile.json5 b/02_UseSwiperToBuildBanner/02_Complete/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c033ce4278fb0641d84107c3c134047ac487368e --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/build-profile.json5 @@ -0,0 +1,35 @@ +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/build-profile.json5 b/02_UseSwiperToBuildBanner/02_Complete/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b695582d3680556f4cce2ec518f65720a9413ca3 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/entry/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/hvigorfile.ts b/02_UseSwiperToBuildBanner/02_Complete/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/obfuscation-rules.txt b/02_UseSwiperToBuildBanner/02_Complete/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/entry/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/oh-package.json5 b/02_UseSwiperToBuildBanner/02_Complete/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..248c3b7541a589682a250f86a6d3ecf7414d2d6a --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/ets/entryability/EntryAbility.ets b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8335b7692d4cac1f8b5d78ce7bc1c45a453d563e --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,41 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc55c03d3eea7ce53d5346c732a39ce9bf5267e1 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/ets/pages/Index.ets b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..4d19a59eb8d660b9b1dd31f9779c84c8ef9de916 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,71 @@ +class BannerClass { + id: string = ''; + imageSrc: ResourceStr = ''; + url: string = ''; + + constructor(id: string, imageSrc: ResourceStr, url: string) { + this.id = id; + this.imageSrc = imageSrc; + this.url = url; + } +} + +@Entry +@Component +struct Index { + @State message: string = '快速入门'; + + build() { + Column() { + Text(this.message) + .fontSize(24) + .fontWeight(700) + .width('100%') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .fontFamily('HarmonyHeiTi-Bold') + .lineHeight(33) + Banner() + } + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} + +@Preview +@Component +struct Banner { + @State bannerList: Array = [ + new BannerClass('pic0', $r('app.media.banner_pic0'), + 'https://developer.huawei.com/consumer/cn/training/course/video/C101718352529709527'), + new BannerClass('pic1', $r('app.media.banner_pic1'), + 'https://developer.huawei.com/consumer/cn/'), + new BannerClass('pic2', $r('app.media.banner_pic2'), + 'https://developer.huawei.com/consumer/cn/deveco-studio/'), + new BannerClass('pic3', $r('app.media.banner_pic3'), + 'https://developer.huawei.com/consumer/cn/arkts/'), + new BannerClass('pic4', $r('app.media.banner_pic4'), + 'https://developer.huawei.com/consumer/cn/arkui/'), + new BannerClass('pic5', $r('app.media.banner_pic5'), + 'https://developer.huawei.com/consumer/cn/sdk') + ]; + + build() { + Swiper() { + ForEach(this.bannerList, (item: BannerClass, index: number) => { + Image(item.imageSrc) + .objectFit(ImageFit.Contain) + .width('100%') + .padding({ top: 11, left: 16, right: 16 }) + .borderRadius(16) + }, (item: BannerClass, index: number) => item.id) + } + .autoPlay(true) + .loop(true) + .indicator( + new DotIndicator() + .color('#1a000000') + .selectedColor('#0A59F7')) + } +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/module.json5 b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bef6142319137babd9ef098df8037a57edfbeb05 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "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:ic_start_icon", + "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/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/element/color.json b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/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/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/element/string.json b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/background.png b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4671724ec24a20eaad33c37800194a808cbfbb Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/background.png differ diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic0.png b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic0.png new file mode 100644 index 0000000000000000000000000000000000000000..6a1429fef9c5f3b07dd64aa1a2f88436da35f409 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic0.png differ diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic1.png b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..eaecda2444a16fb441c8d6e25d177fca167f1069 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic1.png differ diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic2.png b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf7c12b98a618947201e4a6e4d9ac17c0313773 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic2.png differ diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic3.png b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..ad3a1446e2bd7c871fe6559a8595ebf2937d2bc3 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic3.png differ diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic4.png b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..db07d68c83941f77fd6f7318a4d7e98e4e044969 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic4.png differ diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic5.png b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..a1db950c248b32ae6df2b3959401510a0fa86392 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/banner_pic5.png differ diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/foreground.png b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..c17d456e4bb7aebc3ad21b4ac87bf8ffdd8eef41 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/foreground.png differ diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/ic_start_icon.png b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/ic_start_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/ic_start_icon.png differ diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/layered_image.json b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/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/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/profile/backup_config.json b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/profile/main_pages.json b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/en_US/element/string.json b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/zh_CN/element/string.json b/02_UseSwiperToBuildBanner/02_Complete/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee46bd7efbb745933e89bd42c6fb6f9d3d2635a --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/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": "HMOS世界入门版" + } + ] +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_Complete/hvigor/hvigor-config.json5 b/02_UseSwiperToBuildBanner/02_Complete/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..06b2783670a348f95533b352c1ceda909a842bbc --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "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/02_UseSwiperToBuildBanner/02_Complete/hvigorfile.ts b/02_UseSwiperToBuildBanner/02_Complete/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/hvigorfile.ts @@ -0,0 +1,6 @@ +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/02_UseSwiperToBuildBanner/02_Complete/oh-package.json5 b/02_UseSwiperToBuildBanner/02_Complete/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ebdda7e54d1c41e952f1c7f6993c6d15ea3d146d --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_Complete/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.18", + "@ohos/hamock": "1.0.0" + } +} diff --git a/02_UseSwiperToBuildBanner/02_Resources/banner_pic0.png b/02_UseSwiperToBuildBanner/02_Resources/banner_pic0.png new file mode 100644 index 0000000000000000000000000000000000000000..6a1429fef9c5f3b07dd64aa1a2f88436da35f409 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Resources/banner_pic0.png differ diff --git a/02_UseSwiperToBuildBanner/02_Resources/banner_pic1.png b/02_UseSwiperToBuildBanner/02_Resources/banner_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..eaecda2444a16fb441c8d6e25d177fca167f1069 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Resources/banner_pic1.png differ diff --git a/02_UseSwiperToBuildBanner/02_Resources/banner_pic2.png b/02_UseSwiperToBuildBanner/02_Resources/banner_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf7c12b98a618947201e4a6e4d9ac17c0313773 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Resources/banner_pic2.png differ diff --git a/02_UseSwiperToBuildBanner/02_Resources/banner_pic3.png b/02_UseSwiperToBuildBanner/02_Resources/banner_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..ad3a1446e2bd7c871fe6559a8595ebf2937d2bc3 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Resources/banner_pic3.png differ diff --git a/02_UseSwiperToBuildBanner/02_Resources/banner_pic4.png b/02_UseSwiperToBuildBanner/02_Resources/banner_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..db07d68c83941f77fd6f7318a4d7e98e4e044969 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Resources/banner_pic4.png differ diff --git a/02_UseSwiperToBuildBanner/02_Resources/banner_pic5.png b/02_UseSwiperToBuildBanner/02_Resources/banner_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..a1db950c248b32ae6df2b3959401510a0fa86392 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_Resources/banner_pic5.png differ diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/AppScope/app.json5 b/02_UseSwiperToBuildBanner/02_StartingPoint/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b63e8d74725325e18212a7b93174bfc9ec7b2e92 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.quickstart", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/AppScope/resources/base/element/string.json b/02_UseSwiperToBuildBanner/02_StartingPoint/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e1346507f210ad222a059080465e3115e7143780 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "HMOS世界入门版" + } + ] +} diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/AppScope/resources/base/media/app_icon.png b/02_UseSwiperToBuildBanner/02_StartingPoint/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_StartingPoint/AppScope/resources/base/media/app_icon.png differ diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/build-profile.json5 b/02_UseSwiperToBuildBanner/02_StartingPoint/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c033ce4278fb0641d84107c3c134047ac487368e --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/build-profile.json5 @@ -0,0 +1,35 @@ +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/build-profile.json5 b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b695582d3680556f4cce2ec518f65720a9413ca3 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/hvigorfile.ts b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/obfuscation-rules.txt b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/oh-package.json5 b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..248c3b7541a589682a250f86a6d3ecf7414d2d6a --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8335b7692d4cac1f8b5d78ce7bc1c45a453d563e --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,41 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc55c03d3eea7ce53d5346c732a39ce9bf5267e1 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/ets/pages/Index.ets b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..42ebc4fcf2a5ba9766d936bde8b3bfe80404d28b --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,34 @@ +@Entry +@Component +struct Index { + @State message: string = '快速入门'; + + build() { + Column() { + Text(this.message) + .fontSize(24) + .fontWeight(700) + .width('100%') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .fontFamily('HarmonyHeiTi-Bold') + .lineHeight(33) + Banner() + } + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} + +@Preview +@Component +struct Banner { + build() { + Image($r('app.media.banner_pic1')) + .objectFit(ImageFit.Contain) + .width('100%') + .padding({ top: 11, left: 16, right: 16 }) + .borderRadius(16) + } +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/module.json5 b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bef6142319137babd9ef098df8037a57edfbeb05 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "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:ic_start_icon", + "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/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/element/color.json b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/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/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/element/string.json b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/media/background.png b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4671724ec24a20eaad33c37800194a808cbfbb Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/media/background.png differ diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/media/banner_pic1.png b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/media/banner_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..eaecda2444a16fb441c8d6e25d177fca167f1069 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/media/banner_pic1.png differ diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/media/foreground.png b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..c17d456e4bb7aebc3ad21b4ac87bf8ffdd8eef41 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/media/foreground.png differ diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/media/ic_start_icon.png b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/media/ic_start_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/media/ic_start_icon.png differ diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/media/layered_image.json b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/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/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/profile/backup_config.json b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/profile/main_pages.json b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/en_US/element/string.json b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/zh_CN/element/string.json b/02_UseSwiperToBuildBanner/02_StartingPoint/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee46bd7efbb745933e89bd42c6fb6f9d3d2635a --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/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": "HMOS世界入门版" + } + ] +} \ No newline at end of file diff --git a/02_UseSwiperToBuildBanner/02_StartingPoint/hvigor/hvigor-config.json5 b/02_UseSwiperToBuildBanner/02_StartingPoint/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..06b2783670a348f95533b352c1ceda909a842bbc --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "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/02_UseSwiperToBuildBanner/02_StartingPoint/hvigorfile.ts b/02_UseSwiperToBuildBanner/02_StartingPoint/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/hvigorfile.ts @@ -0,0 +1,6 @@ +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/02_UseSwiperToBuildBanner/02_StartingPoint/oh-package.json5 b/02_UseSwiperToBuildBanner/02_StartingPoint/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ebdda7e54d1c41e952f1c7f6993c6d15ea3d146d --- /dev/null +++ b/02_UseSwiperToBuildBanner/02_StartingPoint/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.18", + "@ohos/hamock": "1.0.0" + } +} diff --git a/02_UseSwiperToBuildBanner/README.md b/02_UseSwiperToBuildBanner/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bc2ecbc1177fd079e6b14d905d4613667bc548db --- /dev/null +++ b/02_UseSwiperToBuildBanner/README.md @@ -0,0 +1,5 @@ +根据【使用Swiper构建运营运营推荐位】教程学习,您可以选择从上一教程结束时构建完成的项目开始,也可以直接运行02_StartingPoint文件夹中的项目。 + +根据教程中的提示使用02_Resources文件夹中的文件。 + +如果您想要自行探索,可以直接打开02_Complete文件夹中的项目并浏览代码。 \ No newline at end of file diff --git a/03_BuildItem/03_Complete/AppScope/app.json5 b/03_BuildItem/03_Complete/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b63e8d74725325e18212a7b93174bfc9ec7b2e92 --- /dev/null +++ b/03_BuildItem/03_Complete/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.quickstart", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/03_BuildItem/03_Complete/AppScope/resources/base/element/string.json b/03_BuildItem/03_Complete/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e1346507f210ad222a059080465e3115e7143780 --- /dev/null +++ b/03_BuildItem/03_Complete/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "HMOS世界入门版" + } + ] +} diff --git a/03_BuildItem/03_Complete/AppScope/resources/base/media/app_icon.png b/03_BuildItem/03_Complete/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/03_BuildItem/03_Complete/AppScope/resources/base/media/app_icon.png differ diff --git a/03_BuildItem/03_Complete/build-profile.json5 b/03_BuildItem/03_Complete/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c033ce4278fb0641d84107c3c134047ac487368e --- /dev/null +++ b/03_BuildItem/03_Complete/build-profile.json5 @@ -0,0 +1,35 @@ +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/03_BuildItem/03_Complete/entry/build-profile.json5 b/03_BuildItem/03_Complete/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b695582d3680556f4cce2ec518f65720a9413ca3 --- /dev/null +++ b/03_BuildItem/03_Complete/entry/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/03_BuildItem/03_Complete/entry/hvigorfile.ts b/03_BuildItem/03_Complete/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/03_BuildItem/03_Complete/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/03_BuildItem/03_Complete/entry/obfuscation-rules.txt b/03_BuildItem/03_Complete/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/03_BuildItem/03_Complete/entry/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/03_BuildItem/03_Complete/entry/oh-package.json5 b/03_BuildItem/03_Complete/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..248c3b7541a589682a250f86a6d3ecf7414d2d6a --- /dev/null +++ b/03_BuildItem/03_Complete/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/03_BuildItem/03_Complete/entry/src/main/ets/entryability/EntryAbility.ets b/03_BuildItem/03_Complete/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8335b7692d4cac1f8b5d78ce7bc1c45a453d563e --- /dev/null +++ b/03_BuildItem/03_Complete/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,41 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/03_BuildItem/03_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/03_BuildItem/03_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc55c03d3eea7ce53d5346c732a39ce9bf5267e1 --- /dev/null +++ b/03_BuildItem/03_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/03_BuildItem/03_Complete/entry/src/main/ets/pages/Index.ets b/03_BuildItem/03_Complete/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..be856c3e197e1cb8013ab9bda6874d8108a7839b --- /dev/null +++ b/03_BuildItem/03_Complete/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,165 @@ +class BannerClass { + id: string = ''; + imageSrc: ResourceStr = ''; + url: string = ''; + + constructor(id: string, imageSrc: ResourceStr, url: string) { + this.id = id; + this.imageSrc = imageSrc; + this.url = url; + } +} + +@Entry +@Component +struct Index { + @State message: string = '快速入门'; + + build() { + Column() { + Text(this.message) + .fontSize(24) + .fontWeight(700) + .width('100%') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .fontFamily('HarmonyHeiTi-Bold') + .lineHeight(33) + Banner() + } + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} + +@Preview +@Component +struct Banner { + @State bannerList: Array = [ + new BannerClass('pic0', $r('app.media.banner_pic0'), + 'https://developer.huawei.com/consumer/cn/training/course/video/C101718352529709527'), + new BannerClass('pic1', $r('app.media.banner_pic1'), + 'https://developer.huawei.com/consumer/cn/'), + new BannerClass('pic2', $r('app.media.banner_pic2'), + 'https://developer.huawei.com/consumer/cn/deveco-studio/'), + new BannerClass('pic3', $r('app.media.banner_pic3'), + 'https://developer.huawei.com/consumer/cn/arkts/'), + new BannerClass('pic4', $r('app.media.banner_pic4'), + 'https://developer.huawei.com/consumer/cn/arkui/'), + new BannerClass('pic5', $r('app.media.banner_pic5'), + 'https://developer.huawei.com/consumer/cn/sdk') + ]; + + build() { + Swiper() { + ForEach(this.bannerList, (item: BannerClass, index: number) => { + Image(item.imageSrc) + .objectFit(ImageFit.Contain) + .width('100%') + .padding({ top: 11, left: 16, right: 16 }) + .borderRadius(16) + }, (item: BannerClass, index: number) => item.id) + } + .autoPlay(true) + .loop(true) + .indicator( + new DotIndicator() + .color('#1a000000') + .selectedColor('#0A59F7')) + } +} + +@Preview +@Component +struct TutorialItem { + private title: string = 'Step1 快速入门介绍'; + private brief: string = '本篇教程实现了快速入门——一个用于了解和学习HarmonyOS的应用程序 。'; + + build() { + Row() { + Column() { + Text(this.title) + .height(19) + .width('100%') + .fontSize(14) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontWeight(400) + .margin({ top: 4 }) + Text(this.brief) + .height(32) + .width('100%') + .fontSize(12) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .fontWeight(400) + .fontColor('rgba(0, 0, 0, 0.6)') + .margin({ top: 5 }) + } + .height('100%') + .layoutWeight(1) + .alignItems(HorizontalAlign.Start) + .margin({ right: 12 }) + + Image($r('app.media.enablement_pic1')) + .height(64) + .width(108) + .objectFit(ImageFit.Cover) + .borderRadius(16) + } + .width('100%') + .height(88) + .borderRadius(16) + .backgroundColor(Color.White) + .padding(12) + .alignItems(VerticalAlign.Top) + } +} + +@Preview +@Component +struct EnablementItem { + private title: string = 'HarmonyOS第一课'; + private brief: string = '基于真实的开发场景,提供向导式学习,多维度融合课程等内容,给开发者提供全新的学习体验。'; + + build() { + Column() { + Image($r('app.media.enablement_pic1')) + .width('100%') + .objectFit(ImageFit.Cover) + .height(96) + .borderRadius({ + topLeft: 16, + topRight: 16 + }) + Text(this.title) + .height(19) + .width('100%') + .fontSize(14) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontWeight(400) + .padding({ left: 12, right: 12 }) + .margin({ top: 8 }) + Text(this.brief) + .height(32) + .width('100%') + .fontSize(12) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .fontWeight(400) + .fontColor('rgba(0, 0, 0, 0.6)') + .padding({ left: 12, right: 12 }) + .margin({ top: 2 }) + } + .width(160) + .height(169) + .borderRadius(16) + .backgroundColor(Color.White) + } +} \ No newline at end of file diff --git a/03_BuildItem/03_Complete/entry/src/main/module.json5 b/03_BuildItem/03_Complete/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bef6142319137babd9ef098df8037a57edfbeb05 --- /dev/null +++ b/03_BuildItem/03_Complete/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "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:ic_start_icon", + "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/03_BuildItem/03_Complete/entry/src/main/resources/base/element/color.json b/03_BuildItem/03_Complete/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/03_BuildItem/03_Complete/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/03_BuildItem/03_Complete/entry/src/main/resources/base/element/string.json b/03_BuildItem/03_Complete/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/03_BuildItem/03_Complete/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/03_BuildItem/03_Complete/entry/src/main/resources/base/media/background.png b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4671724ec24a20eaad33c37800194a808cbfbb Binary files /dev/null and b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/background.png differ diff --git a/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic0.png b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic0.png new file mode 100644 index 0000000000000000000000000000000000000000..6a1429fef9c5f3b07dd64aa1a2f88436da35f409 Binary files /dev/null and b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic0.png differ diff --git a/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic1.png b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..eaecda2444a16fb441c8d6e25d177fca167f1069 Binary files /dev/null and b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic1.png differ diff --git a/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic2.png b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf7c12b98a618947201e4a6e4d9ac17c0313773 Binary files /dev/null and b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic2.png differ diff --git a/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic3.png b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..ad3a1446e2bd7c871fe6559a8595ebf2937d2bc3 Binary files /dev/null and b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic3.png differ diff --git a/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic4.png b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..db07d68c83941f77fd6f7318a4d7e98e4e044969 Binary files /dev/null and b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic4.png differ diff --git a/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic5.png b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..a1db950c248b32ae6df2b3959401510a0fa86392 Binary files /dev/null and b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/banner_pic5.png differ diff --git a/03_BuildItem/03_Complete/entry/src/main/resources/base/media/enablement_pic1.png b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/enablement_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..1921034f70a6078a95b6b09e9d8b170fb7953abe Binary files /dev/null and b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/enablement_pic1.png differ diff --git a/03_BuildItem/03_Complete/entry/src/main/resources/base/media/foreground.png b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..c17d456e4bb7aebc3ad21b4ac87bf8ffdd8eef41 Binary files /dev/null and b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/foreground.png differ diff --git a/03_BuildItem/03_Complete/entry/src/main/resources/base/media/ic_start_icon.png b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/ic_start_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/ic_start_icon.png differ diff --git a/03_BuildItem/03_Complete/entry/src/main/resources/base/media/layered_image.json b/03_BuildItem/03_Complete/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/03_BuildItem/03_Complete/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/03_BuildItem/03_Complete/entry/src/main/resources/base/profile/backup_config.json b/03_BuildItem/03_Complete/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/03_BuildItem/03_Complete/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/03_BuildItem/03_Complete/entry/src/main/resources/base/profile/main_pages.json b/03_BuildItem/03_Complete/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/03_BuildItem/03_Complete/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/03_BuildItem/03_Complete/entry/src/main/resources/en_US/element/string.json b/03_BuildItem/03_Complete/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/03_BuildItem/03_Complete/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/03_BuildItem/03_Complete/entry/src/main/resources/zh_CN/element/string.json b/03_BuildItem/03_Complete/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee46bd7efbb745933e89bd42c6fb6f9d3d2635a --- /dev/null +++ b/03_BuildItem/03_Complete/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": "HMOS世界入门版" + } + ] +} \ No newline at end of file diff --git a/03_BuildItem/03_Complete/hvigor/hvigor-config.json5 b/03_BuildItem/03_Complete/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..06b2783670a348f95533b352c1ceda909a842bbc --- /dev/null +++ b/03_BuildItem/03_Complete/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "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/03_BuildItem/03_Complete/hvigorfile.ts b/03_BuildItem/03_Complete/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/03_BuildItem/03_Complete/hvigorfile.ts @@ -0,0 +1,6 @@ +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/03_BuildItem/03_Complete/oh-package.json5 b/03_BuildItem/03_Complete/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ebdda7e54d1c41e952f1c7f6993c6d15ea3d146d --- /dev/null +++ b/03_BuildItem/03_Complete/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.18", + "@ohos/hamock": "1.0.0" + } +} diff --git a/03_BuildItem/03_Resources/enablementBriefAttributes.txt b/03_BuildItem/03_Resources/enablementBriefAttributes.txt new file mode 100644 index 0000000000000000000000000000000000000000..87ca8c8844a8c89b224876b3829fac9a9b9b90ca --- /dev/null +++ b/03_BuildItem/03_Resources/enablementBriefAttributes.txt @@ -0,0 +1,10 @@ +.height(32) +.width('100%') +.fontSize(12) +.textAlign(TextAlign.Start) +.textOverflow({ overflow: TextOverflow.Ellipsis }) +.maxLines(2) +.fontWeight(400) +.fontColor('rgba(0, 0, 0, 0.6)') +.padding({ left: 12, right: 12 }) +.margin({ top: 2 }) \ No newline at end of file diff --git a/03_BuildItem/03_Resources/enablementTitleAttributes.txt b/03_BuildItem/03_Resources/enablementTitleAttributes.txt new file mode 100644 index 0000000000000000000000000000000000000000..a8ab453a8f5aba7374820a5391b760690304cde4 --- /dev/null +++ b/03_BuildItem/03_Resources/enablementTitleAttributes.txt @@ -0,0 +1,9 @@ +.height(19) +.width('100%') +.fontSize(14) +.textAlign(TextAlign.Start) +.textOverflow({ overflow: TextOverflow.Ellipsis }) +.maxLines(1) +.fontWeight(400) +.padding({ left: 12, right: 12 }) +.margin({ top: 8 }) \ No newline at end of file diff --git a/03_BuildItem/03_Resources/enablement_pic1.png b/03_BuildItem/03_Resources/enablement_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..1921034f70a6078a95b6b09e9d8b170fb7953abe Binary files /dev/null and b/03_BuildItem/03_Resources/enablement_pic1.png differ diff --git a/03_BuildItem/03_Resources/tutorialBriefAttributes.txt b/03_BuildItem/03_Resources/tutorialBriefAttributes.txt new file mode 100644 index 0000000000000000000000000000000000000000..ab3f2157014a0cb9f0a0c4abeb12e8dd48237c02 --- /dev/null +++ b/03_BuildItem/03_Resources/tutorialBriefAttributes.txt @@ -0,0 +1,9 @@ +.height(32) +.width('100%') +.fontSize(12) +.textAlign(TextAlign.Start) +.textOverflow({ overflow: TextOverflow.Ellipsis }) +.maxLines(2) +.fontWeight(400) +.fontColor('rgba(0, 0, 0, 0.6)') +.margin({ top: 5 }) \ No newline at end of file diff --git a/03_BuildItem/03_Resources/tutorialTitleAttributes.txt b/03_BuildItem/03_Resources/tutorialTitleAttributes.txt new file mode 100644 index 0000000000000000000000000000000000000000..b2e994289e35fe79a857566a641d86e64a00acef --- /dev/null +++ b/03_BuildItem/03_Resources/tutorialTitleAttributes.txt @@ -0,0 +1,8 @@ +.height(19) +.width('100%') +.fontSize(14) +.textAlign(TextAlign.Start) +.textOverflow({ overflow: TextOverflow.Ellipsis }) +.maxLines(1) +.fontWeight(400) +.margin({ top: 4 }) \ No newline at end of file diff --git a/03_BuildItem/03_StartingPoint/AppScope/app.json5 b/03_BuildItem/03_StartingPoint/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b63e8d74725325e18212a7b93174bfc9ec7b2e92 --- /dev/null +++ b/03_BuildItem/03_StartingPoint/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.quickstart", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/03_BuildItem/03_StartingPoint/AppScope/resources/base/element/string.json b/03_BuildItem/03_StartingPoint/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e1346507f210ad222a059080465e3115e7143780 --- /dev/null +++ b/03_BuildItem/03_StartingPoint/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "HMOS世界入门版" + } + ] +} diff --git a/03_BuildItem/03_StartingPoint/AppScope/resources/base/media/app_icon.png b/03_BuildItem/03_StartingPoint/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/03_BuildItem/03_StartingPoint/AppScope/resources/base/media/app_icon.png differ diff --git a/03_BuildItem/03_StartingPoint/build-profile.json5 b/03_BuildItem/03_StartingPoint/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c033ce4278fb0641d84107c3c134047ac487368e --- /dev/null +++ b/03_BuildItem/03_StartingPoint/build-profile.json5 @@ -0,0 +1,35 @@ +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/03_BuildItem/03_StartingPoint/entry/build-profile.json5 b/03_BuildItem/03_StartingPoint/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b695582d3680556f4cce2ec518f65720a9413ca3 --- /dev/null +++ b/03_BuildItem/03_StartingPoint/entry/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/03_BuildItem/03_StartingPoint/entry/hvigorfile.ts b/03_BuildItem/03_StartingPoint/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/03_BuildItem/03_StartingPoint/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/03_BuildItem/03_StartingPoint/entry/obfuscation-rules.txt b/03_BuildItem/03_StartingPoint/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/03_BuildItem/03_StartingPoint/entry/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/03_BuildItem/03_StartingPoint/entry/oh-package.json5 b/03_BuildItem/03_StartingPoint/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..248c3b7541a589682a250f86a6d3ecf7414d2d6a --- /dev/null +++ b/03_BuildItem/03_StartingPoint/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets b/03_BuildItem/03_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8335b7692d4cac1f8b5d78ce7bc1c45a453d563e --- /dev/null +++ b/03_BuildItem/03_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,41 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/03_BuildItem/03_StartingPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc55c03d3eea7ce53d5346c732a39ce9bf5267e1 --- /dev/null +++ b/03_BuildItem/03_StartingPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/ets/pages/Index.ets b/03_BuildItem/03_StartingPoint/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..4d19a59eb8d660b9b1dd31f9779c84c8ef9de916 --- /dev/null +++ b/03_BuildItem/03_StartingPoint/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,71 @@ +class BannerClass { + id: string = ''; + imageSrc: ResourceStr = ''; + url: string = ''; + + constructor(id: string, imageSrc: ResourceStr, url: string) { + this.id = id; + this.imageSrc = imageSrc; + this.url = url; + } +} + +@Entry +@Component +struct Index { + @State message: string = '快速入门'; + + build() { + Column() { + Text(this.message) + .fontSize(24) + .fontWeight(700) + .width('100%') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .fontFamily('HarmonyHeiTi-Bold') + .lineHeight(33) + Banner() + } + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} + +@Preview +@Component +struct Banner { + @State bannerList: Array = [ + new BannerClass('pic0', $r('app.media.banner_pic0'), + 'https://developer.huawei.com/consumer/cn/training/course/video/C101718352529709527'), + new BannerClass('pic1', $r('app.media.banner_pic1'), + 'https://developer.huawei.com/consumer/cn/'), + new BannerClass('pic2', $r('app.media.banner_pic2'), + 'https://developer.huawei.com/consumer/cn/deveco-studio/'), + new BannerClass('pic3', $r('app.media.banner_pic3'), + 'https://developer.huawei.com/consumer/cn/arkts/'), + new BannerClass('pic4', $r('app.media.banner_pic4'), + 'https://developer.huawei.com/consumer/cn/arkui/'), + new BannerClass('pic5', $r('app.media.banner_pic5'), + 'https://developer.huawei.com/consumer/cn/sdk') + ]; + + build() { + Swiper() { + ForEach(this.bannerList, (item: BannerClass, index: number) => { + Image(item.imageSrc) + .objectFit(ImageFit.Contain) + .width('100%') + .padding({ top: 11, left: 16, right: 16 }) + .borderRadius(16) + }, (item: BannerClass, index: number) => item.id) + } + .autoPlay(true) + .loop(true) + .indicator( + new DotIndicator() + .color('#1a000000') + .selectedColor('#0A59F7')) + } +} \ No newline at end of file diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/module.json5 b/03_BuildItem/03_StartingPoint/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bef6142319137babd9ef098df8037a57edfbeb05 --- /dev/null +++ b/03_BuildItem/03_StartingPoint/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "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:ic_start_icon", + "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/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/element/color.json b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/03_BuildItem/03_StartingPoint/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/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/element/string.json b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/03_BuildItem/03_StartingPoint/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/background.png b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4671724ec24a20eaad33c37800194a808cbfbb Binary files /dev/null and b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/background.png differ diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic0.png b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic0.png new file mode 100644 index 0000000000000000000000000000000000000000..6a1429fef9c5f3b07dd64aa1a2f88436da35f409 Binary files /dev/null and b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic0.png differ diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic1.png b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..eaecda2444a16fb441c8d6e25d177fca167f1069 Binary files /dev/null and b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic1.png differ diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic2.png b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf7c12b98a618947201e4a6e4d9ac17c0313773 Binary files /dev/null and b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic2.png differ diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic3.png b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..ad3a1446e2bd7c871fe6559a8595ebf2937d2bc3 Binary files /dev/null and b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic3.png differ diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic4.png b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..db07d68c83941f77fd6f7318a4d7e98e4e044969 Binary files /dev/null and b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic4.png differ diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic5.png b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..a1db950c248b32ae6df2b3959401510a0fa86392 Binary files /dev/null and b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/banner_pic5.png differ diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/foreground.png b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..c17d456e4bb7aebc3ad21b4ac87bf8ffdd8eef41 Binary files /dev/null and b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/foreground.png differ diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/ic_start_icon.png b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/ic_start_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/ic_start_icon.png differ diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/layered_image.json b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/03_BuildItem/03_StartingPoint/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/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/profile/backup_config.json b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/profile/main_pages.json b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/03_BuildItem/03_StartingPoint/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/resources/en_US/element/string.json b/03_BuildItem/03_StartingPoint/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/03_BuildItem/03_StartingPoint/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/03_BuildItem/03_StartingPoint/entry/src/main/resources/zh_CN/element/string.json b/03_BuildItem/03_StartingPoint/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee46bd7efbb745933e89bd42c6fb6f9d3d2635a --- /dev/null +++ b/03_BuildItem/03_StartingPoint/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": "HMOS世界入门版" + } + ] +} \ No newline at end of file diff --git a/03_BuildItem/03_StartingPoint/hvigor/hvigor-config.json5 b/03_BuildItem/03_StartingPoint/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..06b2783670a348f95533b352c1ceda909a842bbc --- /dev/null +++ b/03_BuildItem/03_StartingPoint/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "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/03_BuildItem/03_StartingPoint/hvigorfile.ts b/03_BuildItem/03_StartingPoint/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/03_BuildItem/03_StartingPoint/hvigorfile.ts @@ -0,0 +1,6 @@ +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/03_BuildItem/03_StartingPoint/oh-package.json5 b/03_BuildItem/03_StartingPoint/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ebdda7e54d1c41e952f1c7f6993c6d15ea3d146d --- /dev/null +++ b/03_BuildItem/03_StartingPoint/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.18", + "@ohos/hamock": "1.0.0" + } +} diff --git a/04_BuildGridAndList/04_Complete/AppScope/app.json5 b/04_BuildGridAndList/04_Complete/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b63e8d74725325e18212a7b93174bfc9ec7b2e92 --- /dev/null +++ b/04_BuildGridAndList/04_Complete/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.quickstart", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/04_BuildGridAndList/04_Complete/AppScope/resources/base/element/string.json b/04_BuildGridAndList/04_Complete/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e1346507f210ad222a059080465e3115e7143780 --- /dev/null +++ b/04_BuildGridAndList/04_Complete/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "HMOS世界入门版" + } + ] +} diff --git a/04_BuildGridAndList/04_Complete/AppScope/resources/base/media/app_icon.png b/04_BuildGridAndList/04_Complete/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/AppScope/resources/base/media/app_icon.png differ diff --git a/04_BuildGridAndList/04_Complete/build-profile.json5 b/04_BuildGridAndList/04_Complete/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7ae3f2a4be402c2d3bb413e572ca16ae6271b2a2 --- /dev/null +++ b/04_BuildGridAndList/04_Complete/build-profile.json5 @@ -0,0 +1,37 @@ +{ + "app": { + "signingConfigs": [ + + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_Complete/entry/build-profile.json5 b/04_BuildGridAndList/04_Complete/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b695582d3680556f4cce2ec518f65720a9413ca3 --- /dev/null +++ b/04_BuildGridAndList/04_Complete/entry/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_Complete/entry/hvigorfile.ts b/04_BuildGridAndList/04_Complete/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/04_BuildGridAndList/04_Complete/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/04_BuildGridAndList/04_Complete/entry/obfuscation-rules.txt b/04_BuildGridAndList/04_Complete/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/04_BuildGridAndList/04_Complete/entry/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/04_BuildGridAndList/04_Complete/entry/oh-package.json5 b/04_BuildGridAndList/04_Complete/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..248c3b7541a589682a250f86a6d3ecf7414d2d6a --- /dev/null +++ b/04_BuildGridAndList/04_Complete/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/ets/entryability/EntryAbility.ets b/04_BuildGridAndList/04_Complete/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8335b7692d4cac1f8b5d78ce7bc1c45a453d563e --- /dev/null +++ b/04_BuildGridAndList/04_Complete/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,41 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/04_BuildGridAndList/04_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc55c03d3eea7ce53d5346c732a39ce9bf5267e1 --- /dev/null +++ b/04_BuildGridAndList/04_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/ets/pages/Index.ets b/04_BuildGridAndList/04_Complete/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..f7a58d799586f94a9ced0dd876642863ce0129ff --- /dev/null +++ b/04_BuildGridAndList/04_Complete/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,313 @@ +class BannerClass { + id: string = ''; + imageSrc: ResourceStr = ''; + url: string = ''; + + constructor(id: string, imageSrc: ResourceStr, url: string) { + this.id = id; + this.imageSrc = imageSrc; + this.url = url; + } +} + +class ArticleClass { + id: string = ''; + imageSrc: ResourceStr = ''; + title: string = ''; + brief: string = ''; + webUrl: string = ''; + + constructor(id: string, imageSrc: ResourceStr, title: string, brief: string, webUrl: string) { + this.id = id; + this.imageSrc = imageSrc; + this.title = title; + this.brief = brief; + this.webUrl = webUrl; + } +} + +@Entry +@Component +struct Index { + @State message: string = '快速入门'; + + build() { + Column() { + Text(this.message) + .fontSize(24) + .fontWeight(700) + .width('100%') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .fontFamily('HarmonyHeiTi-Bold') + .lineHeight(33) + Scroll() { + Column() { + Banner() + EnablementView() + TutorialView() + } + } + .layoutWeight(1) + .scrollBar(BarState.Off) + .align(Alignment.TopStart) + } + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} + +@Preview +@Component +struct Banner { + @State bannerList: Array = [ + new BannerClass('pic0', $r('app.media.banner_pic0'), + 'https://developer.huawei.com/consumer/cn/training/course/video/C101718352529709527'), + new BannerClass('pic1', $r('app.media.banner_pic1'), + 'https://developer.huawei.com/consumer/cn/'), + new BannerClass('pic2', $r('app.media.banner_pic2'), + 'https://developer.huawei.com/consumer/cn/deveco-studio/'), + new BannerClass('pic3', $r('app.media.banner_pic3'), + 'https://developer.huawei.com/consumer/cn/arkts/'), + new BannerClass('pic4', $r('app.media.banner_pic4'), + 'https://developer.huawei.com/consumer/cn/arkui/'), + new BannerClass('pic5', $r('app.media.banner_pic5'), + 'https://developer.huawei.com/consumer/cn/sdk') + ]; + + build() { + Swiper() { + ForEach(this.bannerList, (item: BannerClass, index: number) => { + Image(item.imageSrc) + .objectFit(ImageFit.Contain) + .width('100%') + .padding({ top: 11, left: 16, right: 16 }) + .borderRadius(16) + }, (item: BannerClass, index: number) => item.id) + } + .autoPlay(true) + .loop(true) + .indicator( + new DotIndicator() + .color('#1a000000') + .selectedColor('#0A59F7')) + } +} + +@Preview +@Component +struct TutorialItem { + @Prop tutorialItem: ArticleClass; + + build() { + Row() { + Column() { + Text(this.tutorialItem.title) + .height(19) + .width('100%') + .fontSize(14) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontWeight(400) + .margin({ top: 4 }) + Text(this.tutorialItem.brief) + .height(32) + .width('100%') + .fontSize(12) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .fontWeight(400) + .fontColor('rgba(0, 0, 0, 0.6)') + .margin({ top: 5 }) + } + .height('100%') + .layoutWeight(1) + .alignItems(HorizontalAlign.Start) + .margin({ right: 12 }) + + Image(this.tutorialItem.imageSrc) + .height(64) + .width(108) + .objectFit(ImageFit.Cover) + .borderRadius(16) + } + .width('100%') + .height(88) + .borderRadius(16) + .backgroundColor(Color.White) + .padding(12) + .alignItems(VerticalAlign.Top) + } +} + +@Preview +@Component +struct EnablementItem { + @Prop enablementItem: ArticleClass; + + build() { + Column() { + Image(this.enablementItem.imageSrc) + .width('100%') + .objectFit(ImageFit.Cover) + .height(96) + .borderRadius({ + topLeft: 16, + topRight: 16 + }) + Text(this.enablementItem.title) + .height(19) + .width('100%') + .fontSize(14) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontWeight(400) + .padding({ left: 12, right: 12 }) + .margin({ top: 8 }) + Text(this.enablementItem.brief) + .height(32) + .width('100%') + .fontSize(12) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .fontWeight(400) + .fontColor('rgba(0, 0, 0, 0.6)') + .padding({ left: 12, right: 12 }) + .margin({ top: 2 }) + } + .width(160) + .height(169) + .borderRadius(16) + .backgroundColor(Color.White) + } +} + + +@Preview +@Component +struct EnablementView { + @State enablementList: Array = [ + new ArticleClass('1', $r('app.media.enablement_pic1'), 'HarmonyOS第一课', + '基于真实的开发场景,提供向导式学习,多维度融合课程等内容,给开发者提供全新的学习体验。', + 'https://developer.huawei.com/consumer/cn/doc/harmonyos-video-courses/video-tutorials-0000001443535745'), + new ArticleClass('2', $r('app.media.enablement_pic2'), '开发指南', + '提供系统能力概述、快速入门,用于指导开发者进行场景化的开发。指南涉及到的知识点包括必要的背景知识、符合开发者实际开发场景的操作任务流(开发流程、开发步骤、调测验证)以及常见问题等。', + 'https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/application-dev-guide-0000001630265101'), + new ArticleClass('3', $r('app.media.enablement_pic3'), '最佳实践', + '针对新发布特性及热点特性提供详细的技术解析和开发最佳实践。', + 'https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/topic-architecture-0000001678045510'), + new ArticleClass('4', $r('app.media.enablement_pic4'), 'Codelabs', + '以教学为目的的代码样例及详细的开发指导,帮助开发者一步步地完成指定场景的应用开发并掌握相关知识。Codelabs将最新的鸿蒙生态应用开发技术与典型场景结合,让开发者快速地掌握开发高质量应用的方法。同时支持互动式操作,通过文字、代码和效果联动为开发者带来更佳的学习体验。', + 'https://developer.huawei.com/consumer/cn/doc/harmonyos-codelabs/codelabs-0000001443855957'), + new ArticleClass('5', $r('app.media.enablement_pic5'), 'Sample', + '面向不同类型的开发者提供的鸿蒙生态应用开发优秀实践,每个Sample Code都是一个可运行的工程,为开发者提供实例化的代码参考。', + 'https://developer.huawei.com/consumer/cn/doc/harmonyos-samples/samples-0000001162414961'), + new ArticleClass('6', $r('app.media.enablement_pic6'), 'API参考', + '面向开发者提供鸿蒙系统开放接口的全集,供开发者了解具体接口使用方法。API参考详细地描述了每个接口的功能、使用限制、参数名、参数类型、参数含义、取值范围、权限、注意事项、错误码及返回值等。', + 'https://developer.huawei.com/consumer/cn/doc/harmonyos-references/development-intro-0000001580026066'), + new ArticleClass('7', $r('app.media.enablement_pic7'), 'FAQ', + '开发者常见问题的总结,开发者可以通过FAQ更高效地解决常见问题。FAQ会持续刷新,及时呈现最新的常见问题。', + 'https://developer.huawei.com/consumer/cn/doc/harmonyos-faqs/faqs-development-0000001753952202'), + new ArticleClass('8', $r('app.media.enablement_pic8'), '开发者论坛', '和其他应用开发者交流技术、共同进步。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + ]; + + build() { + Column() { + Text('赋能套件') + .fontColor('#182431') + .fontSize(16) + .fontWeight(500) + .fontFamily('HarmonyHeiTi-medium') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .margin({ bottom: 8.5 }) + Grid() { + ForEach(this.enablementList, (item: ArticleClass) => { + GridItem() { + EnablementItem({ enablementItem: item }) + } + }, (item: ArticleClass) => item.id) + } + .rowsTemplate('1fr') + .columnsGap(8) + .scrollBar(BarState.Off) + .height(169) + .padding({ top: 2, left: 16, right: 16 }) + + } + .margin({ top: 18 }) + .alignItems(HorizontalAlign.Start) + } +} + +@Preview +@Component +struct TutorialView { + @State tutorialList: Array = [ + new ArticleClass('1', $r('app.media.tutorial_pic1'), 'Step1 环境的搭建', + '本篇教程实现了快速入门——一个用于了解和学习HarmonyOS的应用程序。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('2', $r('app.media.tutorial_pic2'), 'Step2 使用Swiper构建运营广告位', + 'Swiper组件提供滑动轮播显示的能力。Swiper本身是一个容器组件,当设置了多个子组件后,可以对这些子组件进行轮播显示。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('3', $r('app.media.tutorial_pic3'), 'Step3 创建和组合视图', + 'Item定义子组件相关特征。相关组件支持使用条件渲染、循环渲染、懒加载等方式生成子组件。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('4', $r('app.media.tutorial_pic4'), 'Step4 网格和列表组建的使用', + '网格和列表组件中,当Item达到一定数量,内容超过屏幕大小时,可以自动提供滚动功能,适合用于呈现同类数据类型或数据类型集', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('5', $r('app.media.tutorial_pic5'), 'Step5 应用架构设计基础——MVVM模式', + 'ArkUI采取MVVM = Model + View + ViewModel模式,将数据与视图绑定在一起,更新数据的时候直接更新视图。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('6', $r('app.media.tutorial_pic6'), 'Step6 应用架构设计基础——三层架构', + '为了更好地适配复杂应用的开发,建议采用三层架构的方式对整个应用的功能进行模块化,实现高内聚、低耦合开发。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('7', $r('app.media.tutorial_pic7'), 'Step6 ArkWeb页面适配', + 'ArkWeb(方舟Web)提供了Web组件,用于在应用程序中显示Web页面内容,为开发者提供页面加载、页面交互、页面调试等能力。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('8', $r('app.media.tutorial_pic8'), 'Step7 数据驱动UI更新', '数据更新的同时会直接驱动UI的改变', + 'xxx'), + new ArticleClass('9', $r('app.media.tutorial_pic9'), 'Step8 设置组件导航', + 'Navigation组件适用于模块内页面切换,一次开发,多端部署场景。通过组件级路由能力实现更加自然流畅的转场体验,并提供多种标题栏样式来呈现更好的标题和内容联动效果。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('10', $r('app.media.tutorial_pic10'), 'Step9 原生智能:AI语音朗读', + '文本转语音服务提供将文本信息转换为语音并进行播报的能力,便于用户与设备进行互动,实现实时语音交互,文本播报。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('11', $r('app.media.tutorial_pic11'), 'Step10 原生互联:分布式流转', + '流转能力打破设备界限,多设备联动,使用户应用程序可分可合、可流转,实现如邮件跨设备编辑、多设备协同健身、多屏游戏等分布式业务。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('12', $r('app.media.tutorial_pic12'), 'Step11 一次开发,多端部署', + '一套代码工程,一次开发上架,多端按需部署。支撑开发者快速高效的开发支持多种终端设备形态的应用,实现对不同设备兼容的同时,提供跨设备的流转、迁移和协同的分布式体验。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + ]; + + build() { + Column() { + Text('入门教程') + .fontColor('#182431') + .fontSize(16) + .fontWeight(500) + .fontFamily('HarmonyHeiTi-medium') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .margin({ bottom: 8.5 }) + List({ space: 12 }) { + ForEach(this.tutorialList, (item: ArticleClass) => { + ListItem() { + TutorialItem({ tutorialItem: item }) + } + }, (item: ArticleClass) => item.id) + } + .scrollBar(BarState.Off) + .padding({ left: 16, right: 16 }) + } + .margin({ top: 18 }) + .alignItems(HorizontalAlign.Start) + } +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/module.json5 b/04_BuildGridAndList/04_Complete/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bef6142319137babd9ef098df8037a57edfbeb05 --- /dev/null +++ b/04_BuildGridAndList/04_Complete/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "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:ic_start_icon", + "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/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/element/color.json b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/04_BuildGridAndList/04_Complete/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/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/element/string.json b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/04_BuildGridAndList/04_Complete/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/background.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4671724ec24a20eaad33c37800194a808cbfbb Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/background.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic0.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic0.png new file mode 100644 index 0000000000000000000000000000000000000000..6a1429fef9c5f3b07dd64aa1a2f88436da35f409 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic0.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic1.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..eaecda2444a16fb441c8d6e25d177fca167f1069 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic1.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic2.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf7c12b98a618947201e4a6e4d9ac17c0313773 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic2.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic3.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..ad3a1446e2bd7c871fe6559a8595ebf2937d2bc3 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic3.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic4.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..db07d68c83941f77fd6f7318a4d7e98e4e044969 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic4.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic5.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..a1db950c248b32ae6df2b3959401510a0fa86392 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/banner_pic5.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic1.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..1921034f70a6078a95b6b09e9d8b170fb7953abe Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic1.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic2.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..1b8c814736d77d2cf1e9792036057d2a35274962 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic2.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic3.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..a84eeddb80a2592fa78848d9134dcf05a52b72af Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic3.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic4.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..fcbe1564d7fa21ebfb95f17924a1ae4f611030fb Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic4.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic5.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..bd72866f09003576964c55e86c501801086b3c94 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic5.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic6.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic6.png new file mode 100644 index 0000000000000000000000000000000000000000..05311e52551afd35f0e3a29030611c78f839d9a5 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic6.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic7.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic7.png new file mode 100644 index 0000000000000000000000000000000000000000..badb43c7d82ca293803625aefcafa128ee1585d4 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic7.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic8.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic8.png new file mode 100644 index 0000000000000000000000000000000000000000..ce47be8addcf4fef6cd388e655ecea9a26e741d6 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/enablement_pic8.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/foreground.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..c17d456e4bb7aebc3ad21b4ac87bf8ffdd8eef41 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/foreground.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/ic_start_icon.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/ic_start_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/ic_start_icon.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/layered_image.json b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/04_BuildGridAndList/04_Complete/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/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic1.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..0dfb98d67fe0a5517832ba0df071aa0d1c7fe113 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic1.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic10.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic10.png new file mode 100644 index 0000000000000000000000000000000000000000..411d5689e8b71aa3a34cdea5ed104fda1759e5c3 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic10.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic11.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic11.png new file mode 100644 index 0000000000000000000000000000000000000000..1a57b787949844f2bebb511b18444a04f7f1325a Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic11.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic12.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic12.png new file mode 100644 index 0000000000000000000000000000000000000000..b65cc1ff4686e07b0a0d1ddfbc8a6a0765f23d0e Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic12.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic2.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..8ce806c4cede9189bd602ac52dfda15f92539c61 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic2.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic3.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..622dab1c1d90836406c118c78f74833f9d0c2d4a Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic3.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic4.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..049aad5eb9a856d16f27b07da58593210072e3ed Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic4.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic5.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..1b2ab24d76027559b2efc890a38c2b4baf120765 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic5.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic6.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic6.png new file mode 100644 index 0000000000000000000000000000000000000000..e649e1a58707082334b5d89860a9ed10bfc6b2c3 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic6.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic7.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic7.png new file mode 100644 index 0000000000000000000000000000000000000000..b07aae9f24939f2e428e8579101f1e48d959ccc2 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic7.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic8.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic8.png new file mode 100644 index 0000000000000000000000000000000000000000..f830f8ad1c06c771b67c4f7da4b968ed3e550bf6 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic8.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic9.png b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic9.png new file mode 100644 index 0000000000000000000000000000000000000000..6f7db19eacb47f581db93b74826b9ec8bd7eb421 Binary files /dev/null and b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/media/tutorial_pic9.png differ diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/profile/backup_config.json b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/profile/main_pages.json b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/04_BuildGridAndList/04_Complete/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/en_US/element/string.json b/04_BuildGridAndList/04_Complete/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/04_BuildGridAndList/04_Complete/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_Complete/entry/src/main/resources/zh_CN/element/string.json b/04_BuildGridAndList/04_Complete/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee46bd7efbb745933e89bd42c6fb6f9d3d2635a --- /dev/null +++ b/04_BuildGridAndList/04_Complete/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": "HMOS世界入门版" + } + ] +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_Complete/hvigor/hvigor-config.json5 b/04_BuildGridAndList/04_Complete/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..06b2783670a348f95533b352c1ceda909a842bbc --- /dev/null +++ b/04_BuildGridAndList/04_Complete/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "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/04_BuildGridAndList/04_Complete/hvigorfile.ts b/04_BuildGridAndList/04_Complete/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/04_BuildGridAndList/04_Complete/hvigorfile.ts @@ -0,0 +1,6 @@ +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/04_BuildGridAndList/04_Complete/oh-package.json5 b/04_BuildGridAndList/04_Complete/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ebdda7e54d1c41e952f1c7f6993c6d15ea3d146d --- /dev/null +++ b/04_BuildGridAndList/04_Complete/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.18", + "@ohos/hamock": "1.0.0" + } +} diff --git a/04_BuildGridAndList/04_Resources/enablement_pic1.png b/04_BuildGridAndList/04_Resources/enablement_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..1921034f70a6078a95b6b09e9d8b170fb7953abe Binary files /dev/null and b/04_BuildGridAndList/04_Resources/enablement_pic1.png differ diff --git a/04_BuildGridAndList/04_Resources/enablement_pic2.png b/04_BuildGridAndList/04_Resources/enablement_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..1b8c814736d77d2cf1e9792036057d2a35274962 Binary files /dev/null and b/04_BuildGridAndList/04_Resources/enablement_pic2.png differ diff --git a/04_BuildGridAndList/04_Resources/enablement_pic3.png b/04_BuildGridAndList/04_Resources/enablement_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..a84eeddb80a2592fa78848d9134dcf05a52b72af Binary files /dev/null and b/04_BuildGridAndList/04_Resources/enablement_pic3.png differ diff --git a/04_BuildGridAndList/04_Resources/enablement_pic4.png b/04_BuildGridAndList/04_Resources/enablement_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..fcbe1564d7fa21ebfb95f17924a1ae4f611030fb Binary files /dev/null and b/04_BuildGridAndList/04_Resources/enablement_pic4.png differ diff --git a/04_BuildGridAndList/04_Resources/enablement_pic5.png b/04_BuildGridAndList/04_Resources/enablement_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..bd72866f09003576964c55e86c501801086b3c94 Binary files /dev/null and b/04_BuildGridAndList/04_Resources/enablement_pic5.png differ diff --git a/04_BuildGridAndList/04_Resources/enablement_pic6.png b/04_BuildGridAndList/04_Resources/enablement_pic6.png new file mode 100644 index 0000000000000000000000000000000000000000..05311e52551afd35f0e3a29030611c78f839d9a5 Binary files /dev/null and b/04_BuildGridAndList/04_Resources/enablement_pic6.png differ diff --git a/04_BuildGridAndList/04_Resources/enablement_pic7.png b/04_BuildGridAndList/04_Resources/enablement_pic7.png new file mode 100644 index 0000000000000000000000000000000000000000..badb43c7d82ca293803625aefcafa128ee1585d4 Binary files /dev/null and b/04_BuildGridAndList/04_Resources/enablement_pic7.png differ diff --git a/04_BuildGridAndList/04_Resources/enablement_pic8.png b/04_BuildGridAndList/04_Resources/enablement_pic8.png new file mode 100644 index 0000000000000000000000000000000000000000..ce47be8addcf4fef6cd388e655ecea9a26e741d6 Binary files /dev/null and b/04_BuildGridAndList/04_Resources/enablement_pic8.png differ diff --git a/04_BuildGridAndList/04_Resources/tutorial_pic1.png b/04_BuildGridAndList/04_Resources/tutorial_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..0dfb98d67fe0a5517832ba0df071aa0d1c7fe113 Binary files /dev/null and b/04_BuildGridAndList/04_Resources/tutorial_pic1.png differ diff --git a/04_BuildGridAndList/04_Resources/tutorial_pic10.png b/04_BuildGridAndList/04_Resources/tutorial_pic10.png new file mode 100644 index 0000000000000000000000000000000000000000..411d5689e8b71aa3a34cdea5ed104fda1759e5c3 Binary files /dev/null and b/04_BuildGridAndList/04_Resources/tutorial_pic10.png differ diff --git a/04_BuildGridAndList/04_Resources/tutorial_pic11.png b/04_BuildGridAndList/04_Resources/tutorial_pic11.png new file mode 100644 index 0000000000000000000000000000000000000000..1a57b787949844f2bebb511b18444a04f7f1325a Binary files /dev/null and b/04_BuildGridAndList/04_Resources/tutorial_pic11.png differ diff --git a/04_BuildGridAndList/04_Resources/tutorial_pic12.png b/04_BuildGridAndList/04_Resources/tutorial_pic12.png new file mode 100644 index 0000000000000000000000000000000000000000..b65cc1ff4686e07b0a0d1ddfbc8a6a0765f23d0e Binary files /dev/null and b/04_BuildGridAndList/04_Resources/tutorial_pic12.png differ diff --git a/04_BuildGridAndList/04_Resources/tutorial_pic2.png b/04_BuildGridAndList/04_Resources/tutorial_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..8ce806c4cede9189bd602ac52dfda15f92539c61 Binary files /dev/null and b/04_BuildGridAndList/04_Resources/tutorial_pic2.png differ diff --git a/04_BuildGridAndList/04_Resources/tutorial_pic3.png b/04_BuildGridAndList/04_Resources/tutorial_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..622dab1c1d90836406c118c78f74833f9d0c2d4a Binary files /dev/null and b/04_BuildGridAndList/04_Resources/tutorial_pic3.png differ diff --git a/04_BuildGridAndList/04_Resources/tutorial_pic4.png b/04_BuildGridAndList/04_Resources/tutorial_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..049aad5eb9a856d16f27b07da58593210072e3ed Binary files /dev/null and b/04_BuildGridAndList/04_Resources/tutorial_pic4.png differ diff --git a/04_BuildGridAndList/04_Resources/tutorial_pic5.png b/04_BuildGridAndList/04_Resources/tutorial_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..1b2ab24d76027559b2efc890a38c2b4baf120765 Binary files /dev/null and b/04_BuildGridAndList/04_Resources/tutorial_pic5.png differ diff --git a/04_BuildGridAndList/04_Resources/tutorial_pic6.png b/04_BuildGridAndList/04_Resources/tutorial_pic6.png new file mode 100644 index 0000000000000000000000000000000000000000..e649e1a58707082334b5d89860a9ed10bfc6b2c3 Binary files /dev/null and b/04_BuildGridAndList/04_Resources/tutorial_pic6.png differ diff --git a/04_BuildGridAndList/04_Resources/tutorial_pic7.png b/04_BuildGridAndList/04_Resources/tutorial_pic7.png new file mode 100644 index 0000000000000000000000000000000000000000..b07aae9f24939f2e428e8579101f1e48d959ccc2 Binary files /dev/null and b/04_BuildGridAndList/04_Resources/tutorial_pic7.png differ diff --git a/04_BuildGridAndList/04_Resources/tutorial_pic8.png b/04_BuildGridAndList/04_Resources/tutorial_pic8.png new file mode 100644 index 0000000000000000000000000000000000000000..f830f8ad1c06c771b67c4f7da4b968ed3e550bf6 Binary files /dev/null and b/04_BuildGridAndList/04_Resources/tutorial_pic8.png differ diff --git a/04_BuildGridAndList/04_Resources/tutorial_pic9.png b/04_BuildGridAndList/04_Resources/tutorial_pic9.png new file mode 100644 index 0000000000000000000000000000000000000000..6f7db19eacb47f581db93b74826b9ec8bd7eb421 Binary files /dev/null and b/04_BuildGridAndList/04_Resources/tutorial_pic9.png differ diff --git a/04_BuildGridAndList/04_StartingPoint/AppScope/app.json5 b/04_BuildGridAndList/04_StartingPoint/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b63e8d74725325e18212a7b93174bfc9ec7b2e92 --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.quickstart", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/04_BuildGridAndList/04_StartingPoint/AppScope/resources/base/element/string.json b/04_BuildGridAndList/04_StartingPoint/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e1346507f210ad222a059080465e3115e7143780 --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "HMOS世界入门版" + } + ] +} diff --git a/04_BuildGridAndList/04_StartingPoint/AppScope/resources/base/media/app_icon.png b/04_BuildGridAndList/04_StartingPoint/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/04_BuildGridAndList/04_StartingPoint/AppScope/resources/base/media/app_icon.png differ diff --git a/04_BuildGridAndList/04_StartingPoint/build-profile.json5 b/04_BuildGridAndList/04_StartingPoint/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c033ce4278fb0641d84107c3c134047ac487368e --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/build-profile.json5 @@ -0,0 +1,35 @@ +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_StartingPoint/entry/build-profile.json5 b/04_BuildGridAndList/04_StartingPoint/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b695582d3680556f4cce2ec518f65720a9413ca3 --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/entry/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_StartingPoint/entry/hvigorfile.ts b/04_BuildGridAndList/04_StartingPoint/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/04_BuildGridAndList/04_StartingPoint/entry/obfuscation-rules.txt b/04_BuildGridAndList/04_StartingPoint/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/entry/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/04_BuildGridAndList/04_StartingPoint/entry/oh-package.json5 b/04_BuildGridAndList/04_StartingPoint/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..248c3b7541a589682a250f86a6d3ecf7414d2d6a --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets b/04_BuildGridAndList/04_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8335b7692d4cac1f8b5d78ce7bc1c45a453d563e --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,41 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/04_BuildGridAndList/04_StartingPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc55c03d3eea7ce53d5346c732a39ce9bf5267e1 --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/ets/pages/Index.ets b/04_BuildGridAndList/04_StartingPoint/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..be856c3e197e1cb8013ab9bda6874d8108a7839b --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,165 @@ +class BannerClass { + id: string = ''; + imageSrc: ResourceStr = ''; + url: string = ''; + + constructor(id: string, imageSrc: ResourceStr, url: string) { + this.id = id; + this.imageSrc = imageSrc; + this.url = url; + } +} + +@Entry +@Component +struct Index { + @State message: string = '快速入门'; + + build() { + Column() { + Text(this.message) + .fontSize(24) + .fontWeight(700) + .width('100%') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .fontFamily('HarmonyHeiTi-Bold') + .lineHeight(33) + Banner() + } + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} + +@Preview +@Component +struct Banner { + @State bannerList: Array = [ + new BannerClass('pic0', $r('app.media.banner_pic0'), + 'https://developer.huawei.com/consumer/cn/training/course/video/C101718352529709527'), + new BannerClass('pic1', $r('app.media.banner_pic1'), + 'https://developer.huawei.com/consumer/cn/'), + new BannerClass('pic2', $r('app.media.banner_pic2'), + 'https://developer.huawei.com/consumer/cn/deveco-studio/'), + new BannerClass('pic3', $r('app.media.banner_pic3'), + 'https://developer.huawei.com/consumer/cn/arkts/'), + new BannerClass('pic4', $r('app.media.banner_pic4'), + 'https://developer.huawei.com/consumer/cn/arkui/'), + new BannerClass('pic5', $r('app.media.banner_pic5'), + 'https://developer.huawei.com/consumer/cn/sdk') + ]; + + build() { + Swiper() { + ForEach(this.bannerList, (item: BannerClass, index: number) => { + Image(item.imageSrc) + .objectFit(ImageFit.Contain) + .width('100%') + .padding({ top: 11, left: 16, right: 16 }) + .borderRadius(16) + }, (item: BannerClass, index: number) => item.id) + } + .autoPlay(true) + .loop(true) + .indicator( + new DotIndicator() + .color('#1a000000') + .selectedColor('#0A59F7')) + } +} + +@Preview +@Component +struct TutorialItem { + private title: string = 'Step1 快速入门介绍'; + private brief: string = '本篇教程实现了快速入门——一个用于了解和学习HarmonyOS的应用程序 。'; + + build() { + Row() { + Column() { + Text(this.title) + .height(19) + .width('100%') + .fontSize(14) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontWeight(400) + .margin({ top: 4 }) + Text(this.brief) + .height(32) + .width('100%') + .fontSize(12) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .fontWeight(400) + .fontColor('rgba(0, 0, 0, 0.6)') + .margin({ top: 5 }) + } + .height('100%') + .layoutWeight(1) + .alignItems(HorizontalAlign.Start) + .margin({ right: 12 }) + + Image($r('app.media.enablement_pic1')) + .height(64) + .width(108) + .objectFit(ImageFit.Cover) + .borderRadius(16) + } + .width('100%') + .height(88) + .borderRadius(16) + .backgroundColor(Color.White) + .padding(12) + .alignItems(VerticalAlign.Top) + } +} + +@Preview +@Component +struct EnablementItem { + private title: string = 'HarmonyOS第一课'; + private brief: string = '基于真实的开发场景,提供向导式学习,多维度融合课程等内容,给开发者提供全新的学习体验。'; + + build() { + Column() { + Image($r('app.media.enablement_pic1')) + .width('100%') + .objectFit(ImageFit.Cover) + .height(96) + .borderRadius({ + topLeft: 16, + topRight: 16 + }) + Text(this.title) + .height(19) + .width('100%') + .fontSize(14) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontWeight(400) + .padding({ left: 12, right: 12 }) + .margin({ top: 8 }) + Text(this.brief) + .height(32) + .width('100%') + .fontSize(12) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .fontWeight(400) + .fontColor('rgba(0, 0, 0, 0.6)') + .padding({ left: 12, right: 12 }) + .margin({ top: 2 }) + } + .width(160) + .height(169) + .borderRadius(16) + .backgroundColor(Color.White) + } +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/module.json5 b/04_BuildGridAndList/04_StartingPoint/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bef6142319137babd9ef098df8037a57edfbeb05 --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "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:ic_start_icon", + "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/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/element/color.json b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/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/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/element/string.json b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/background.png b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4671724ec24a20eaad33c37800194a808cbfbb Binary files /dev/null and b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/background.png differ diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic0.png b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic0.png new file mode 100644 index 0000000000000000000000000000000000000000..6a1429fef9c5f3b07dd64aa1a2f88436da35f409 Binary files /dev/null and b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic0.png differ diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic1.png b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..eaecda2444a16fb441c8d6e25d177fca167f1069 Binary files /dev/null and b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic1.png differ diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic2.png b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf7c12b98a618947201e4a6e4d9ac17c0313773 Binary files /dev/null and b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic2.png differ diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic3.png b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..ad3a1446e2bd7c871fe6559a8595ebf2937d2bc3 Binary files /dev/null and b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic3.png differ diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic4.png b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..db07d68c83941f77fd6f7318a4d7e98e4e044969 Binary files /dev/null and b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic4.png differ diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic5.png b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..a1db950c248b32ae6df2b3959401510a0fa86392 Binary files /dev/null and b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/banner_pic5.png differ diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/enablement_pic1.png b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/enablement_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..1921034f70a6078a95b6b09e9d8b170fb7953abe Binary files /dev/null and b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/enablement_pic1.png differ diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/foreground.png b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..c17d456e4bb7aebc3ad21b4ac87bf8ffdd8eef41 Binary files /dev/null and b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/foreground.png differ diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/ic_start_icon.png b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/ic_start_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/ic_start_icon.png differ diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/layered_image.json b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/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/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/profile/backup_config.json b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/profile/main_pages.json b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/en_US/element/string.json b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/zh_CN/element/string.json b/04_BuildGridAndList/04_StartingPoint/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee46bd7efbb745933e89bd42c6fb6f9d3d2635a --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/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": "HMOS世界入门版" + } + ] +} \ No newline at end of file diff --git a/04_BuildGridAndList/04_StartingPoint/hvigor/hvigor-config.json5 b/04_BuildGridAndList/04_StartingPoint/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..06b2783670a348f95533b352c1ceda909a842bbc --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "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/04_BuildGridAndList/04_StartingPoint/hvigorfile.ts b/04_BuildGridAndList/04_StartingPoint/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/hvigorfile.ts @@ -0,0 +1,6 @@ +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/04_BuildGridAndList/04_StartingPoint/oh-package.json5 b/04_BuildGridAndList/04_StartingPoint/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ebdda7e54d1c41e952f1c7f6993c6d15ea3d146d --- /dev/null +++ b/04_BuildGridAndList/04_StartingPoint/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.18", + "@ohos/hamock": "1.0.0" + } +} diff --git a/05_MVVMPatternDesign/05_Complete/AppScope/app.json5 b/05_MVVMPatternDesign/05_Complete/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b63e8d74725325e18212a7b93174bfc9ec7b2e92 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.quickstart", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/05_MVVMPatternDesign/05_Complete/AppScope/resources/base/element/string.json b/05_MVVMPatternDesign/05_Complete/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e1346507f210ad222a059080465e3115e7143780 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "HMOS世界入门版" + } + ] +} diff --git a/05_MVVMPatternDesign/05_Complete/AppScope/resources/base/media/app_icon.png b/05_MVVMPatternDesign/05_Complete/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/AppScope/resources/base/media/app_icon.png differ diff --git a/05_MVVMPatternDesign/05_Complete/build-profile.json5 b/05_MVVMPatternDesign/05_Complete/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7ae3f2a4be402c2d3bb413e572ca16ae6271b2a2 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/build-profile.json5 @@ -0,0 +1,37 @@ +{ + "app": { + "signingConfigs": [ + + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/build-profile.json5 b/05_MVVMPatternDesign/05_Complete/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b695582d3680556f4cce2ec518f65720a9413ca3 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/hvigorfile.ts b/05_MVVMPatternDesign/05_Complete/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/05_MVVMPatternDesign/05_Complete/entry/obfuscation-rules.txt b/05_MVVMPatternDesign/05_Complete/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/oh-package.json5 b/05_MVVMPatternDesign/05_Complete/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..803b25293388deda7b9a05a21b5aeadeb716b4d5 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/oh-package.json5 @@ -0,0 +1,9 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/entryability/EntryAbility.ets b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..0349f5ff9acce8f21f513bc97fe5907e9c5de56d --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,42 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +const TAG: string = 'EntryAbility'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // 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(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc55c03d3eea7ce53d5346c732a39ce9bf5267e1 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/model/ArticleClass.ets b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/model/ArticleClass.ets new file mode 100644 index 0000000000000000000000000000000000000000..05fd3cf00d3ec319a4195b78b46721472388b83c --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/model/ArticleClass.ets @@ -0,0 +1,15 @@ +export class ArticleClass { + id: string = ''; + imageSrc: string = ''; + title: string = ''; + brief: string = ''; + webUrl: string = ''; + + constructor(id: string, imageSrc: string, title: string, brief: string, webUrl: string) { + this.id = id; + this.imageSrc = imageSrc; + this.title = title; + this.brief = brief; + this.webUrl = webUrl; + } +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/model/BannerClass.ets b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/model/BannerClass.ets new file mode 100644 index 0000000000000000000000000000000000000000..52b7e66dc94e6986b475a105ab4a6bafe408f3d7 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/model/BannerClass.ets @@ -0,0 +1,11 @@ +export class BannerClass { + id: string = ''; + imageSrc: string = ''; + url: string = ''; + + constructor(id: string, imageSrc: string, url: string) { + this.id = id; + this.imageSrc = imageSrc; + this.url = url; + } +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/pages/Index.ets b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..9462b1afc40f76fe199adca53cf70f6fb0386349 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,35 @@ +import { Banner } from '../view/Banner'; +import { EnablementView } from '../view/EnablementView'; +import { TutorialView } from '../view/TutorialView'; + +@Entry +@Component +struct Index { + @State message: string = '快速入门'; + + build() { + Column() { + Text(this.message) + .fontSize(24) + .fontWeight(700) + .width('100%') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .fontFamily('HarmonyHeiTi-Bold') + .lineHeight(33) + Scroll() { + Column() { + Banner() + EnablementView() + TutorialView() + } + } + .layoutWeight(1) + .scrollBar(BarState.Off) + .align(Alignment.TopStart) + } + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/util/BufferUtil.ets b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/util/BufferUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..3e1137870526d0460b5ec51c48f4cf6fd2cf18eb --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/util/BufferUtil.ets @@ -0,0 +1,11 @@ +import { util } from '@kit.ArkTS'; + +export function bufferToString(buffer: ArrayBufferLike): string { + let textDecoder = util.TextDecoder.create('utf-8', { + ignoreBOM: true + }); + let resultPut = textDecoder.decodeWithStream(new Uint8Array(buffer), { + stream: true + }); + return resultPut; +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/view/Banner.ets b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/view/Banner.ets new file mode 100644 index 0000000000000000000000000000000000000000..1858232fbd0da53eec2bc3065f8bd882ee99e771 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/view/Banner.ets @@ -0,0 +1,35 @@ +import { BannerClass } from '../model/BannerClass'; +import { bufferToString } from '../util/BufferUtil'; + +@Component +export struct Banner { + @State bannerList: BannerClass[] = []; + + aboutToAppear(): void { + this.getBannerDataFromJSON(); + } + + getBannerDataFromJSON() { + getContext(this).resourceManager.getRawFileContent('BannerData.json').then(value => { + this.bannerList = JSON.parse(bufferToString(value.buffer)) as BannerClass[]; + }) + } + + build() { + Swiper() { + ForEach(this.bannerList, (item: BannerClass) => { + Image($r(item.imageSrc)) + .objectFit(ImageFit.Contain) + .width('100%') + .borderRadius(16) + .padding({ top: 11, left: 16, right: 16 }) + }, (item: BannerClass) => item.id) + } + .autoPlay(true) + .loop(true) + .indicator( + new DotIndicator() + .color('#1a000000') + .selectedColor('#0A59F7')) + } +} diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/view/EnablementView.ets b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/view/EnablementView.ets new file mode 100644 index 0000000000000000000000000000000000000000..2c5fd0efb4660e11597cff0719fe6d64b6603334 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/view/EnablementView.ets @@ -0,0 +1,89 @@ +import { ArticleClass } from '../model/ArticleClass'; +import { bufferToString } from '../util/BufferUtil'; + +@Component +export struct EnablementView { + @State enablementList: Array = []; + + aboutToAppear(): void { + this.getEnablementDataFromJSON() + } + + getEnablementDataFromJSON() { + getContext(this).resourceManager.getRawFileContent('EnablementData.json').then(value => { + this.enablementList = JSON.parse(bufferToString(value.buffer)) as ArticleClass[]; + }) + } + + build() { + Column() { + Text('赋能套件') + .fontColor('#182431') + .fontSize(16) + .fontWeight(500) + .fontFamily('HarmonyHeiTi-medium') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .margin({ bottom: 8.5 }) + Grid() { + ForEach(this.enablementList, (item: ArticleClass) => { + GridItem() { + EnablementItem({ enablementItem: item }) + } + }, (item: ArticleClass) => item.id) + } + .rowsTemplate('1fr') + .columnsGap(8) + .scrollBar(BarState.Off) + .height(169) + .padding({ top: 2, left: 16, right: 16 }) + + } + .margin({ top: 18 }) + .alignItems(HorizontalAlign.Start) + } +} + + +@Component +struct EnablementItem { + @Prop enablementItem: ArticleClass; + + build() { + Column() { + Image($r(this.enablementItem.imageSrc)) + .width('100%') + .objectFit(ImageFit.Cover) + .height(96) + .borderRadius({ + topLeft: 16, + topRight: 16 + }) + Text(this.enablementItem.title) + .height(19) + .width('100%') + .fontSize(14) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontWeight(400) + .padding({ left: 12, right: 12 }) + .margin({ top: 8 }) + Text(this.enablementItem.brief) + .height(32) + .width('100%') + .fontSize(12) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .fontWeight(400) + .fontColor('rgba(0, 0, 0, 0.6)') + .padding({ left: 12, right: 12 }) + .margin({ top: 2 }) + } + .width(160) + .height(169) + .borderRadius(16) + .backgroundColor(Color.White) + } +} diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/view/TutorialView.ets b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/view/TutorialView.ets new file mode 100644 index 0000000000000000000000000000000000000000..2222e77e0a2862e7114d8f38d48acd0728a284fd --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/ets/view/TutorialView.ets @@ -0,0 +1,89 @@ +import { ArticleClass } from '../model/ArticleClass'; +import { bufferToString } from '../util/BufferUtil'; + +@Component +export struct TutorialView { + @State tutorialList: Array = []; + + aboutToAppear(): void { + this.getTutorialDataFromJSON() + } + + getTutorialDataFromJSON() { + getContext(this).resourceManager.getRawFileContent('TutorialData.json').then(value => { + this.tutorialList = JSON.parse(bufferToString(value.buffer)) as ArticleClass[]; + }) + } + + build() { + Column() { + Text('入门教程') + .fontColor('#182431') + .fontSize(16) + .fontWeight(500) + .fontFamily('HarmonyHeiTi-medium') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .margin({ bottom: 8.5 }) + + List({ space: 12 }) { + ForEach(this.tutorialList, (item: ArticleClass) => { + ListItem() { + TutorialItem({ tutorialItem: item }) + } + }, (item: ArticleClass) => item.id) + } + .scrollBar(BarState.Off) + .padding({ left: 16, right: 16 }) + } + .margin({ top: 18 }) + .alignItems(HorizontalAlign.Start) + } +} + +@Component +struct TutorialItem { + @Prop tutorialItem: ArticleClass; + + build() { + Row() { + Column() { + Text(this.tutorialItem.title) + .height(19) + .width('100%') + .fontSize(14) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontWeight(400) + .margin({ top: 4 }) + Text(this.tutorialItem.brief) + .height(32) + .width('100%') + .fontSize(12) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .fontWeight(400) + .fontColor('rgba(0, 0, 0, 0.6)') + .margin({ top: 5 }) + } + .height('100%') + .layoutWeight(1) + .alignItems(HorizontalAlign.Start) + .margin({ right: 12 }) + + Image($r(this.tutorialItem.imageSrc)) + .height(64) + .width(108) + .objectFit(ImageFit.Cover) + .borderRadius(16) + } + .width('100%') + .height(88) + .borderRadius(16) + .backgroundColor(Color.White) + .padding(12) + .alignItems(VerticalAlign.Top) + } +} diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/module.json5 b/05_MVVMPatternDesign/05_Complete/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bef6142319137babd9ef098df8037a57edfbeb05 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "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:ic_start_icon", + "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/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/element/color.json b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/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/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/element/string.json b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/background.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4671724ec24a20eaad33c37800194a808cbfbb Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/background.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic0.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic0.png new file mode 100644 index 0000000000000000000000000000000000000000..6a1429fef9c5f3b07dd64aa1a2f88436da35f409 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic0.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic1.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..eaecda2444a16fb441c8d6e25d177fca167f1069 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic1.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic2.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf7c12b98a618947201e4a6e4d9ac17c0313773 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic2.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic3.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..ad3a1446e2bd7c871fe6559a8595ebf2937d2bc3 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic3.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic4.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..db07d68c83941f77fd6f7318a4d7e98e4e044969 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic4.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic5.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..a1db950c248b32ae6df2b3959401510a0fa86392 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/banner_pic5.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic1.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..1921034f70a6078a95b6b09e9d8b170fb7953abe Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic1.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic2.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..1b8c814736d77d2cf1e9792036057d2a35274962 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic2.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic3.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..a84eeddb80a2592fa78848d9134dcf05a52b72af Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic3.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic4.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..fcbe1564d7fa21ebfb95f17924a1ae4f611030fb Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic4.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic5.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..bd72866f09003576964c55e86c501801086b3c94 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic5.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic6.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic6.png new file mode 100644 index 0000000000000000000000000000000000000000..05311e52551afd35f0e3a29030611c78f839d9a5 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic6.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic7.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic7.png new file mode 100644 index 0000000000000000000000000000000000000000..badb43c7d82ca293803625aefcafa128ee1585d4 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic7.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic8.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic8.png new file mode 100644 index 0000000000000000000000000000000000000000..ce47be8addcf4fef6cd388e655ecea9a26e741d6 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/enablement_pic8.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/foreground.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..c17d456e4bb7aebc3ad21b4ac87bf8ffdd8eef41 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/foreground.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/ic_start_icon.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/ic_start_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/ic_start_icon.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/layered_image.json b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/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/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic1.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..0dfb98d67fe0a5517832ba0df071aa0d1c7fe113 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic1.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic10.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic10.png new file mode 100644 index 0000000000000000000000000000000000000000..411d5689e8b71aa3a34cdea5ed104fda1759e5c3 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic10.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic11.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic11.png new file mode 100644 index 0000000000000000000000000000000000000000..1a57b787949844f2bebb511b18444a04f7f1325a Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic11.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic12.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic12.png new file mode 100644 index 0000000000000000000000000000000000000000..b65cc1ff4686e07b0a0d1ddfbc8a6a0765f23d0e Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic12.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic2.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..8ce806c4cede9189bd602ac52dfda15f92539c61 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic2.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic3.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..622dab1c1d90836406c118c78f74833f9d0c2d4a Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic3.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic4.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..049aad5eb9a856d16f27b07da58593210072e3ed Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic4.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic5.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..1b2ab24d76027559b2efc890a38c2b4baf120765 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic5.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic6.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic6.png new file mode 100644 index 0000000000000000000000000000000000000000..e649e1a58707082334b5d89860a9ed10bfc6b2c3 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic6.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic7.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic7.png new file mode 100644 index 0000000000000000000000000000000000000000..b07aae9f24939f2e428e8579101f1e48d959ccc2 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic7.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic8.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic8.png new file mode 100644 index 0000000000000000000000000000000000000000..f830f8ad1c06c771b67c4f7da4b968ed3e550bf6 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic8.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic9.png b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic9.png new file mode 100644 index 0000000000000000000000000000000000000000..6f7db19eacb47f581db93b74826b9ec8bd7eb421 Binary files /dev/null and b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/media/tutorial_pic9.png differ diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/profile/backup_config.json b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/profile/main_pages.json b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/en_US/element/string.json b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/rawfile/BannerData.json b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/rawfile/BannerData.json new file mode 100644 index 0000000000000000000000000000000000000000..bb95e8aa5c389ddc74cae09059692db56aefd3af --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/rawfile/BannerData.json @@ -0,0 +1,32 @@ +[ + { + "id": 0, + "imageSrc": "app.media.banner_pic0", + "url": "https://developer.huawei.com/consumer/cn/training/course/video/C101718352529709527" + }, + { + "id": 1, + "imageSrc": "app.media.banner_pic1", + "url": "https://developer.huawei.com/consumer/cn/" + }, + { + "id": 2, + "imageSrc": "app.media.banner_pic2", + "url": "https://developer.huawei.com/consumer/cn/deveco-studio/" + }, + { + "id": 3, + "imageSrc": "app.media.banner_pic3", + "url": "https://developer.huawei.com/consumer/cn/arkts/" + }, + { + "id": 4, + "imageSrc": "app.media.banner_pic4", + "url": "https://developer.huawei.com/consumer/cn/arkui/" + }, + { + "id": 5, + "imageSrc": "app.media.banner_pic5", + "url": "https://developer.huawei.com/consumer/cn/sdk" + } +] \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/rawfile/EnablementData.json b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/rawfile/EnablementData.json new file mode 100644 index 0000000000000000000000000000000000000000..c96ea31547b84a14ebdaefa32e084291462ccf26 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/rawfile/EnablementData.json @@ -0,0 +1,58 @@ +[ + { + "id": 1, + "imageSrc": "app.media.enablement_pic1", + "title": "HarmonyOS第一课", + "brief": "基于真实的开发场景,提供向导式学习,多维度融合课程等内容,给开发者提供全新的学习体验。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-video-courses/video-tutorials-0000001443535745" + }, + { + "id": 2, + "imageSrc": "app.media.enablement_pic2", + "title": "开发指南", + "brief": "提供系统能力概述、快速入门,用于指导开发者进行场景化的开发。指南涉及到的知识点包括必要的背景知识、符合开发者实际开发场景的操作任务流(开发流程、开发步骤、调测验证)以及常见问题等。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/application-dev-guide-0000001630265101" + }, + { + "id": 3, + "imageSrc": "app.media.enablement_pic3", + "title": "最佳实践", + "brief": "针对新发布特性及热点特性提供详细的技术解析和开发最佳实践。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/topic-architecture-0000001678045510" + }, + { + "id": 4, + "imageSrc": "app.media.enablement_pic4", + "title": "Codelabs", + "brief": "以教学为目的的代码样例及详细的开发指导,帮助开发者一步步地完成指定场景的应用开发并掌握相关知识。Codelabs将最新的鸿蒙生态应用开发技术与典型场景结合,让开发者快速地掌握开发高质量应用的方法。同时支持互动式操作,通过文字、代码和效果联动为开发者带来更佳的学习体验。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-codelabs/codelabs-0000001443855957" + }, + { + "id": 5, + "imageSrc": "app.media.enablement_pic5", + "title": "Sample", + "brief": "面向不同类型的开发者提供的鸿蒙生态应用开发优秀实践,每个Sample Code都是一个可运行的工程,为开发者提供实例化的代码参考。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-samples/samples-0000001162414961" + }, + { + "id": 6, + "imageSrc": "app.media.enablement_pic6", + "title": "API参考", + "brief": "面向开发者提供鸿蒙系统开放接口的全集,供开发者了解具体接口使用方法。API参考详细地描述了每个接口的功能、使用限制、参数名、参数类型、参数含义、取值范围、权限、注意事项、错误码及返回值等。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-references/development-intro-0000001580026066" + }, + { + "id": 7, + "imageSrc": "app.media.enablement_pic7", + "title": "FAQ", + "brief": "开发者常见问题的总结,开发者可以通过FAQ更高效地解决常见问题。FAQ会持续刷新,及时呈现最新的常见问题。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-faqs/faqs-development-0000001753952202" + }, + { + "id": 8, + "imageSrc": "app.media.enablement_pic8", + "title": "开发者论坛", + "brief": "和其他应用开发者交流技术、共同进步。", + "webUrl": "https://developer.huawei.com/consumer/cn/forum/home?all=1" + } +] \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/rawfile/TutorialData.json b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/rawfile/TutorialData.json new file mode 100644 index 0000000000000000000000000000000000000000..887a78b8ccb32bedcb6832362bebfed439cfe585 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/rawfile/TutorialData.json @@ -0,0 +1,86 @@ +[ + { + "id": 1, + "imageSrc": "app.media.tutorial_pic1", + "title": "Step1 开发入门:Hello World", + "brief": "本篇教程实现了快速入门——一个用于了解和学习HarmonyOS的应用程序 。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-HelloWorld" + }, + { + "id": 2, + "imageSrc": "app.media.tutorial_pic2", + "title": "Step2 使用Swiper构建运营位", + "brief": "Swiper组件提供滑动轮播显示的能力。Swiper本身是一个容器组件,当设置了多个子组件后,可以对这些子组件进行轮播显示。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-SwiperBanner" + }, + { + "id": 3, + "imageSrc": "app.media.tutorial_pic3", + "title": "Step3 创建Item视图", + "brief": "Item定义子组件相关特征。相关组件支持使用条件渲染、循环渲染、懒加载等方式生成子组件。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BuildItem" + }, + { + "id": 4, + "imageSrc": "app.media.tutorial_pic4", + "title": "Step4 网格和列表组件的使用", + "brief": "网格和列表组件中,当Item达到一定数量,内容超过屏幕大小时,可以自动提供滚动功能,适合用于呈现同类数据类型或数据类型集", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-GridAndList" + }, + { + "id": 5, + "imageSrc": "app.media.tutorial_pic5", + "title": "Step5 应用架构设计基础——MVVM框架", + "brief": "ArkUI采取MVVM = Model + View + ViewModel模式,将数据与视图绑定在一起,数据更新时候会直接更新视图。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BasicArchitectureDesignPart1" + }, + { + "id": 6, + "imageSrc": "app.media.tutorial_pic6", + "title": "Step6 应用架构设计基础——三层架构", + "brief": "ArkWeb(方舟Web)提供了Web组件,用于在应用程序中显示Web页面内容,为开发者提供页面加载、页面交互、页面调试等能力。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BasicArchitectureDesignPart2" + }, + { + "id": 7, + "imageSrc": "app.media.tutorial_pic7", + "title": "Step7 ArkWeb页面适配", + "brief": "基于Web组件实现了快速入门案例中的课程学习界面,帮助开发者了解如何加载网络界面、本地界面以及如何进行网络权限的配置。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-ArkwebPageAdaptation" + }, + { + "id": 8, + "imageSrc": "app.media.tutorial_pic8", + "title": "Step8 通过结构数据构建页面", + "brief": "在该教程中会根据对知识地图界面进行界面实现的分析以及相应的数据结构的设计,然后逐步实现知识地图中的两个界面。通过该章节,开发者可以了解到数据如何驱动UI更新。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DataDrivenUIUpdates" + }, + { + "id": 9, + "imageSrc": "app.media.tutorial_pic9", + "title": "Step9 设置组件导航", + "brief": "该教程会在“数据驱动UI更新”教程完成了知识地图相关界面开发的基础上,对代码进行修改,实现从知识地图页到知识地图详情页的组件路由导航,同时该教程中会讲解到Tabs的开发。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-SettingUpComponentNavigation" + }, + { + "id": 10, + "imageSrc": "app.media.tutorial_pic10", + "title": "Step10 原生智能:AI语音朗读", + "brief": "为您的文章详情页添加文本转语音服务,朗读文章简介,手机在无网状态下系统应用无障碍(屏幕朗读)接入文本转语音能力,提供语音播报。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-TTS" + }, + { + "id": 11, + "imageSrc": "app.media.tutorial_pic11", + "title": "Step11 一次开发,多端部署", + "brief": "通过对快速入门整体页面的分析,得出关键的界面适配点以及需要适配的关键组件,然后通过对关键适配点的逐步适配,完成整个应用的一多开发。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DevelopOnceDeployAnywhere" + }, + { + "id": 12, + "imageSrc": "app.media.tutorial_pic12", + "title": "Step12 原生互联:分布式流转", + "brief": "基于分布式流转相关能力,使得整个应用可以在不同设备间进行无缝的流转。该章节内容会涉及到流转的相关前提,如何进行流转的权限配置以及实现应用可流转。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DistributedFlow" + } +] \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/zh_CN/element/string.json b/05_MVVMPatternDesign/05_Complete/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee46bd7efbb745933e89bd42c6fb6f9d3d2635a --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/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": "HMOS世界入门版" + } + ] +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Complete/hvigor/hvigor-config.json5 b/05_MVVMPatternDesign/05_Complete/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..06b2783670a348f95533b352c1ceda909a842bbc --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "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/05_MVVMPatternDesign/05_Complete/hvigorfile.ts b/05_MVVMPatternDesign/05_Complete/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/hvigorfile.ts @@ -0,0 +1,6 @@ +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/05_MVVMPatternDesign/05_Complete/oh-package.json5 b/05_MVVMPatternDesign/05_Complete/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ebdda7e54d1c41e952f1c7f6993c6d15ea3d146d --- /dev/null +++ b/05_MVVMPatternDesign/05_Complete/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.18", + "@ohos/hamock": "1.0.0" + } +} diff --git a/05_MVVMPatternDesign/05_Resources/BannerData.json b/05_MVVMPatternDesign/05_Resources/BannerData.json new file mode 100644 index 0000000000000000000000000000000000000000..bb95e8aa5c389ddc74cae09059692db56aefd3af --- /dev/null +++ b/05_MVVMPatternDesign/05_Resources/BannerData.json @@ -0,0 +1,32 @@ +[ + { + "id": 0, + "imageSrc": "app.media.banner_pic0", + "url": "https://developer.huawei.com/consumer/cn/training/course/video/C101718352529709527" + }, + { + "id": 1, + "imageSrc": "app.media.banner_pic1", + "url": "https://developer.huawei.com/consumer/cn/" + }, + { + "id": 2, + "imageSrc": "app.media.banner_pic2", + "url": "https://developer.huawei.com/consumer/cn/deveco-studio/" + }, + { + "id": 3, + "imageSrc": "app.media.banner_pic3", + "url": "https://developer.huawei.com/consumer/cn/arkts/" + }, + { + "id": 4, + "imageSrc": "app.media.banner_pic4", + "url": "https://developer.huawei.com/consumer/cn/arkui/" + }, + { + "id": 5, + "imageSrc": "app.media.banner_pic5", + "url": "https://developer.huawei.com/consumer/cn/sdk" + } +] \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Resources/EnablementData.json b/05_MVVMPatternDesign/05_Resources/EnablementData.json new file mode 100644 index 0000000000000000000000000000000000000000..c96ea31547b84a14ebdaefa32e084291462ccf26 --- /dev/null +++ b/05_MVVMPatternDesign/05_Resources/EnablementData.json @@ -0,0 +1,58 @@ +[ + { + "id": 1, + "imageSrc": "app.media.enablement_pic1", + "title": "HarmonyOS第一课", + "brief": "基于真实的开发场景,提供向导式学习,多维度融合课程等内容,给开发者提供全新的学习体验。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-video-courses/video-tutorials-0000001443535745" + }, + { + "id": 2, + "imageSrc": "app.media.enablement_pic2", + "title": "开发指南", + "brief": "提供系统能力概述、快速入门,用于指导开发者进行场景化的开发。指南涉及到的知识点包括必要的背景知识、符合开发者实际开发场景的操作任务流(开发流程、开发步骤、调测验证)以及常见问题等。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/application-dev-guide-0000001630265101" + }, + { + "id": 3, + "imageSrc": "app.media.enablement_pic3", + "title": "最佳实践", + "brief": "针对新发布特性及热点特性提供详细的技术解析和开发最佳实践。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/topic-architecture-0000001678045510" + }, + { + "id": 4, + "imageSrc": "app.media.enablement_pic4", + "title": "Codelabs", + "brief": "以教学为目的的代码样例及详细的开发指导,帮助开发者一步步地完成指定场景的应用开发并掌握相关知识。Codelabs将最新的鸿蒙生态应用开发技术与典型场景结合,让开发者快速地掌握开发高质量应用的方法。同时支持互动式操作,通过文字、代码和效果联动为开发者带来更佳的学习体验。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-codelabs/codelabs-0000001443855957" + }, + { + "id": 5, + "imageSrc": "app.media.enablement_pic5", + "title": "Sample", + "brief": "面向不同类型的开发者提供的鸿蒙生态应用开发优秀实践,每个Sample Code都是一个可运行的工程,为开发者提供实例化的代码参考。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-samples/samples-0000001162414961" + }, + { + "id": 6, + "imageSrc": "app.media.enablement_pic6", + "title": "API参考", + "brief": "面向开发者提供鸿蒙系统开放接口的全集,供开发者了解具体接口使用方法。API参考详细地描述了每个接口的功能、使用限制、参数名、参数类型、参数含义、取值范围、权限、注意事项、错误码及返回值等。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-references/development-intro-0000001580026066" + }, + { + "id": 7, + "imageSrc": "app.media.enablement_pic7", + "title": "FAQ", + "brief": "开发者常见问题的总结,开发者可以通过FAQ更高效地解决常见问题。FAQ会持续刷新,及时呈现最新的常见问题。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-faqs/faqs-development-0000001753952202" + }, + { + "id": 8, + "imageSrc": "app.media.enablement_pic8", + "title": "开发者论坛", + "brief": "和其他应用开发者交流技术、共同进步。", + "webUrl": "https://developer.huawei.com/consumer/cn/forum/home?all=1" + } +] \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_Resources/TutorialData.json b/05_MVVMPatternDesign/05_Resources/TutorialData.json new file mode 100644 index 0000000000000000000000000000000000000000..887a78b8ccb32bedcb6832362bebfed439cfe585 --- /dev/null +++ b/05_MVVMPatternDesign/05_Resources/TutorialData.json @@ -0,0 +1,86 @@ +[ + { + "id": 1, + "imageSrc": "app.media.tutorial_pic1", + "title": "Step1 开发入门:Hello World", + "brief": "本篇教程实现了快速入门——一个用于了解和学习HarmonyOS的应用程序 。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-HelloWorld" + }, + { + "id": 2, + "imageSrc": "app.media.tutorial_pic2", + "title": "Step2 使用Swiper构建运营位", + "brief": "Swiper组件提供滑动轮播显示的能力。Swiper本身是一个容器组件,当设置了多个子组件后,可以对这些子组件进行轮播显示。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-SwiperBanner" + }, + { + "id": 3, + "imageSrc": "app.media.tutorial_pic3", + "title": "Step3 创建Item视图", + "brief": "Item定义子组件相关特征。相关组件支持使用条件渲染、循环渲染、懒加载等方式生成子组件。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BuildItem" + }, + { + "id": 4, + "imageSrc": "app.media.tutorial_pic4", + "title": "Step4 网格和列表组件的使用", + "brief": "网格和列表组件中,当Item达到一定数量,内容超过屏幕大小时,可以自动提供滚动功能,适合用于呈现同类数据类型或数据类型集", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-GridAndList" + }, + { + "id": 5, + "imageSrc": "app.media.tutorial_pic5", + "title": "Step5 应用架构设计基础——MVVM框架", + "brief": "ArkUI采取MVVM = Model + View + ViewModel模式,将数据与视图绑定在一起,数据更新时候会直接更新视图。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BasicArchitectureDesignPart1" + }, + { + "id": 6, + "imageSrc": "app.media.tutorial_pic6", + "title": "Step6 应用架构设计基础——三层架构", + "brief": "ArkWeb(方舟Web)提供了Web组件,用于在应用程序中显示Web页面内容,为开发者提供页面加载、页面交互、页面调试等能力。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BasicArchitectureDesignPart2" + }, + { + "id": 7, + "imageSrc": "app.media.tutorial_pic7", + "title": "Step7 ArkWeb页面适配", + "brief": "基于Web组件实现了快速入门案例中的课程学习界面,帮助开发者了解如何加载网络界面、本地界面以及如何进行网络权限的配置。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-ArkwebPageAdaptation" + }, + { + "id": 8, + "imageSrc": "app.media.tutorial_pic8", + "title": "Step8 通过结构数据构建页面", + "brief": "在该教程中会根据对知识地图界面进行界面实现的分析以及相应的数据结构的设计,然后逐步实现知识地图中的两个界面。通过该章节,开发者可以了解到数据如何驱动UI更新。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DataDrivenUIUpdates" + }, + { + "id": 9, + "imageSrc": "app.media.tutorial_pic9", + "title": "Step9 设置组件导航", + "brief": "该教程会在“数据驱动UI更新”教程完成了知识地图相关界面开发的基础上,对代码进行修改,实现从知识地图页到知识地图详情页的组件路由导航,同时该教程中会讲解到Tabs的开发。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-SettingUpComponentNavigation" + }, + { + "id": 10, + "imageSrc": "app.media.tutorial_pic10", + "title": "Step10 原生智能:AI语音朗读", + "brief": "为您的文章详情页添加文本转语音服务,朗读文章简介,手机在无网状态下系统应用无障碍(屏幕朗读)接入文本转语音能力,提供语音播报。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-TTS" + }, + { + "id": 11, + "imageSrc": "app.media.tutorial_pic11", + "title": "Step11 一次开发,多端部署", + "brief": "通过对快速入门整体页面的分析,得出关键的界面适配点以及需要适配的关键组件,然后通过对关键适配点的逐步适配,完成整个应用的一多开发。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DevelopOnceDeployAnywhere" + }, + { + "id": 12, + "imageSrc": "app.media.tutorial_pic12", + "title": "Step12 原生互联:分布式流转", + "brief": "基于分布式流转相关能力,使得整个应用可以在不同设备间进行无缝的流转。该章节内容会涉及到流转的相关前提,如何进行流转的权限配置以及实现应用可流转。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DistributedFlow" + } +] \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_StartPoint/AppScope/app.json5 b/05_MVVMPatternDesign/05_StartPoint/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b63e8d74725325e18212a7b93174bfc9ec7b2e92 --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.quickstart", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/05_MVVMPatternDesign/05_StartPoint/AppScope/resources/base/element/string.json b/05_MVVMPatternDesign/05_StartPoint/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e1346507f210ad222a059080465e3115e7143780 --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "HMOS世界入门版" + } + ] +} diff --git a/05_MVVMPatternDesign/05_StartPoint/AppScope/resources/base/media/app_icon.png b/05_MVVMPatternDesign/05_StartPoint/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/AppScope/resources/base/media/app_icon.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/build-profile.json5 b/05_MVVMPatternDesign/05_StartPoint/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7ae3f2a4be402c2d3bb413e572ca16ae6271b2a2 --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/build-profile.json5 @@ -0,0 +1,37 @@ +{ + "app": { + "signingConfigs": [ + + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/build-profile.json5 b/05_MVVMPatternDesign/05_StartPoint/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b695582d3680556f4cce2ec518f65720a9413ca3 --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/entry/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/hvigorfile.ts b/05_MVVMPatternDesign/05_StartPoint/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/obfuscation-rules.txt b/05_MVVMPatternDesign/05_StartPoint/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/entry/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/oh-package.json5 b/05_MVVMPatternDesign/05_StartPoint/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..248c3b7541a589682a250f86a6d3ecf7414d2d6a --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/ets/entryability/EntryAbility.ets b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..8335b7692d4cac1f8b5d78ce7bc1c45a453d563e --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,41 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc55c03d3eea7ce53d5346c732a39ce9bf5267e1 --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/ets/pages/Index.ets b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..f7a58d799586f94a9ced0dd876642863ce0129ff --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,313 @@ +class BannerClass { + id: string = ''; + imageSrc: ResourceStr = ''; + url: string = ''; + + constructor(id: string, imageSrc: ResourceStr, url: string) { + this.id = id; + this.imageSrc = imageSrc; + this.url = url; + } +} + +class ArticleClass { + id: string = ''; + imageSrc: ResourceStr = ''; + title: string = ''; + brief: string = ''; + webUrl: string = ''; + + constructor(id: string, imageSrc: ResourceStr, title: string, brief: string, webUrl: string) { + this.id = id; + this.imageSrc = imageSrc; + this.title = title; + this.brief = brief; + this.webUrl = webUrl; + } +} + +@Entry +@Component +struct Index { + @State message: string = '快速入门'; + + build() { + Column() { + Text(this.message) + .fontSize(24) + .fontWeight(700) + .width('100%') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .fontFamily('HarmonyHeiTi-Bold') + .lineHeight(33) + Scroll() { + Column() { + Banner() + EnablementView() + TutorialView() + } + } + .layoutWeight(1) + .scrollBar(BarState.Off) + .align(Alignment.TopStart) + } + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} + +@Preview +@Component +struct Banner { + @State bannerList: Array = [ + new BannerClass('pic0', $r('app.media.banner_pic0'), + 'https://developer.huawei.com/consumer/cn/training/course/video/C101718352529709527'), + new BannerClass('pic1', $r('app.media.banner_pic1'), + 'https://developer.huawei.com/consumer/cn/'), + new BannerClass('pic2', $r('app.media.banner_pic2'), + 'https://developer.huawei.com/consumer/cn/deveco-studio/'), + new BannerClass('pic3', $r('app.media.banner_pic3'), + 'https://developer.huawei.com/consumer/cn/arkts/'), + new BannerClass('pic4', $r('app.media.banner_pic4'), + 'https://developer.huawei.com/consumer/cn/arkui/'), + new BannerClass('pic5', $r('app.media.banner_pic5'), + 'https://developer.huawei.com/consumer/cn/sdk') + ]; + + build() { + Swiper() { + ForEach(this.bannerList, (item: BannerClass, index: number) => { + Image(item.imageSrc) + .objectFit(ImageFit.Contain) + .width('100%') + .padding({ top: 11, left: 16, right: 16 }) + .borderRadius(16) + }, (item: BannerClass, index: number) => item.id) + } + .autoPlay(true) + .loop(true) + .indicator( + new DotIndicator() + .color('#1a000000') + .selectedColor('#0A59F7')) + } +} + +@Preview +@Component +struct TutorialItem { + @Prop tutorialItem: ArticleClass; + + build() { + Row() { + Column() { + Text(this.tutorialItem.title) + .height(19) + .width('100%') + .fontSize(14) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontWeight(400) + .margin({ top: 4 }) + Text(this.tutorialItem.brief) + .height(32) + .width('100%') + .fontSize(12) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .fontWeight(400) + .fontColor('rgba(0, 0, 0, 0.6)') + .margin({ top: 5 }) + } + .height('100%') + .layoutWeight(1) + .alignItems(HorizontalAlign.Start) + .margin({ right: 12 }) + + Image(this.tutorialItem.imageSrc) + .height(64) + .width(108) + .objectFit(ImageFit.Cover) + .borderRadius(16) + } + .width('100%') + .height(88) + .borderRadius(16) + .backgroundColor(Color.White) + .padding(12) + .alignItems(VerticalAlign.Top) + } +} + +@Preview +@Component +struct EnablementItem { + @Prop enablementItem: ArticleClass; + + build() { + Column() { + Image(this.enablementItem.imageSrc) + .width('100%') + .objectFit(ImageFit.Cover) + .height(96) + .borderRadius({ + topLeft: 16, + topRight: 16 + }) + Text(this.enablementItem.title) + .height(19) + .width('100%') + .fontSize(14) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontWeight(400) + .padding({ left: 12, right: 12 }) + .margin({ top: 8 }) + Text(this.enablementItem.brief) + .height(32) + .width('100%') + .fontSize(12) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .fontWeight(400) + .fontColor('rgba(0, 0, 0, 0.6)') + .padding({ left: 12, right: 12 }) + .margin({ top: 2 }) + } + .width(160) + .height(169) + .borderRadius(16) + .backgroundColor(Color.White) + } +} + + +@Preview +@Component +struct EnablementView { + @State enablementList: Array = [ + new ArticleClass('1', $r('app.media.enablement_pic1'), 'HarmonyOS第一课', + '基于真实的开发场景,提供向导式学习,多维度融合课程等内容,给开发者提供全新的学习体验。', + 'https://developer.huawei.com/consumer/cn/doc/harmonyos-video-courses/video-tutorials-0000001443535745'), + new ArticleClass('2', $r('app.media.enablement_pic2'), '开发指南', + '提供系统能力概述、快速入门,用于指导开发者进行场景化的开发。指南涉及到的知识点包括必要的背景知识、符合开发者实际开发场景的操作任务流(开发流程、开发步骤、调测验证)以及常见问题等。', + 'https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/application-dev-guide-0000001630265101'), + new ArticleClass('3', $r('app.media.enablement_pic3'), '最佳实践', + '针对新发布特性及热点特性提供详细的技术解析和开发最佳实践。', + 'https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/topic-architecture-0000001678045510'), + new ArticleClass('4', $r('app.media.enablement_pic4'), 'Codelabs', + '以教学为目的的代码样例及详细的开发指导,帮助开发者一步步地完成指定场景的应用开发并掌握相关知识。Codelabs将最新的鸿蒙生态应用开发技术与典型场景结合,让开发者快速地掌握开发高质量应用的方法。同时支持互动式操作,通过文字、代码和效果联动为开发者带来更佳的学习体验。', + 'https://developer.huawei.com/consumer/cn/doc/harmonyos-codelabs/codelabs-0000001443855957'), + new ArticleClass('5', $r('app.media.enablement_pic5'), 'Sample', + '面向不同类型的开发者提供的鸿蒙生态应用开发优秀实践,每个Sample Code都是一个可运行的工程,为开发者提供实例化的代码参考。', + 'https://developer.huawei.com/consumer/cn/doc/harmonyos-samples/samples-0000001162414961'), + new ArticleClass('6', $r('app.media.enablement_pic6'), 'API参考', + '面向开发者提供鸿蒙系统开放接口的全集,供开发者了解具体接口使用方法。API参考详细地描述了每个接口的功能、使用限制、参数名、参数类型、参数含义、取值范围、权限、注意事项、错误码及返回值等。', + 'https://developer.huawei.com/consumer/cn/doc/harmonyos-references/development-intro-0000001580026066'), + new ArticleClass('7', $r('app.media.enablement_pic7'), 'FAQ', + '开发者常见问题的总结,开发者可以通过FAQ更高效地解决常见问题。FAQ会持续刷新,及时呈现最新的常见问题。', + 'https://developer.huawei.com/consumer/cn/doc/harmonyos-faqs/faqs-development-0000001753952202'), + new ArticleClass('8', $r('app.media.enablement_pic8'), '开发者论坛', '和其他应用开发者交流技术、共同进步。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + ]; + + build() { + Column() { + Text('赋能套件') + .fontColor('#182431') + .fontSize(16) + .fontWeight(500) + .fontFamily('HarmonyHeiTi-medium') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .margin({ bottom: 8.5 }) + Grid() { + ForEach(this.enablementList, (item: ArticleClass) => { + GridItem() { + EnablementItem({ enablementItem: item }) + } + }, (item: ArticleClass) => item.id) + } + .rowsTemplate('1fr') + .columnsGap(8) + .scrollBar(BarState.Off) + .height(169) + .padding({ top: 2, left: 16, right: 16 }) + + } + .margin({ top: 18 }) + .alignItems(HorizontalAlign.Start) + } +} + +@Preview +@Component +struct TutorialView { + @State tutorialList: Array = [ + new ArticleClass('1', $r('app.media.tutorial_pic1'), 'Step1 环境的搭建', + '本篇教程实现了快速入门——一个用于了解和学习HarmonyOS的应用程序。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('2', $r('app.media.tutorial_pic2'), 'Step2 使用Swiper构建运营广告位', + 'Swiper组件提供滑动轮播显示的能力。Swiper本身是一个容器组件,当设置了多个子组件后,可以对这些子组件进行轮播显示。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('3', $r('app.media.tutorial_pic3'), 'Step3 创建和组合视图', + 'Item定义子组件相关特征。相关组件支持使用条件渲染、循环渲染、懒加载等方式生成子组件。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('4', $r('app.media.tutorial_pic4'), 'Step4 网格和列表组建的使用', + '网格和列表组件中,当Item达到一定数量,内容超过屏幕大小时,可以自动提供滚动功能,适合用于呈现同类数据类型或数据类型集', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('5', $r('app.media.tutorial_pic5'), 'Step5 应用架构设计基础——MVVM模式', + 'ArkUI采取MVVM = Model + View + ViewModel模式,将数据与视图绑定在一起,更新数据的时候直接更新视图。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('6', $r('app.media.tutorial_pic6'), 'Step6 应用架构设计基础——三层架构', + '为了更好地适配复杂应用的开发,建议采用三层架构的方式对整个应用的功能进行模块化,实现高内聚、低耦合开发。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('7', $r('app.media.tutorial_pic7'), 'Step6 ArkWeb页面适配', + 'ArkWeb(方舟Web)提供了Web组件,用于在应用程序中显示Web页面内容,为开发者提供页面加载、页面交互、页面调试等能力。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('8', $r('app.media.tutorial_pic8'), 'Step7 数据驱动UI更新', '数据更新的同时会直接驱动UI的改变', + 'xxx'), + new ArticleClass('9', $r('app.media.tutorial_pic9'), 'Step8 设置组件导航', + 'Navigation组件适用于模块内页面切换,一次开发,多端部署场景。通过组件级路由能力实现更加自然流畅的转场体验,并提供多种标题栏样式来呈现更好的标题和内容联动效果。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('10', $r('app.media.tutorial_pic10'), 'Step9 原生智能:AI语音朗读', + '文本转语音服务提供将文本信息转换为语音并进行播报的能力,便于用户与设备进行互动,实现实时语音交互,文本播报。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('11', $r('app.media.tutorial_pic11'), 'Step10 原生互联:分布式流转', + '流转能力打破设备界限,多设备联动,使用户应用程序可分可合、可流转,实现如邮件跨设备编辑、多设备协同健身、多屏游戏等分布式业务。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + new ArticleClass('12', $r('app.media.tutorial_pic12'), 'Step11 一次开发,多端部署', + '一套代码工程,一次开发上架,多端按需部署。支撑开发者快速高效的开发支持多种终端设备形态的应用,实现对不同设备兼容的同时,提供跨设备的流转、迁移和协同的分布式体验。', + 'https://developer.huawei.com/consumer/cn/forum/home?all=1'), + ]; + + build() { + Column() { + Text('入门教程') + .fontColor('#182431') + .fontSize(16) + .fontWeight(500) + .fontFamily('HarmonyHeiTi-medium') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .margin({ bottom: 8.5 }) + List({ space: 12 }) { + ForEach(this.tutorialList, (item: ArticleClass) => { + ListItem() { + TutorialItem({ tutorialItem: item }) + } + }, (item: ArticleClass) => item.id) + } + .scrollBar(BarState.Off) + .padding({ left: 16, right: 16 }) + } + .margin({ top: 18 }) + .alignItems(HorizontalAlign.Start) + } +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/module.json5 b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bef6142319137babd9ef098df8037a57edfbeb05 --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "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:ic_start_icon", + "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/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/element/color.json b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/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/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/element/string.json b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/background.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4671724ec24a20eaad33c37800194a808cbfbb Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/background.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic0.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic0.png new file mode 100644 index 0000000000000000000000000000000000000000..6a1429fef9c5f3b07dd64aa1a2f88436da35f409 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic0.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic1.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..eaecda2444a16fb441c8d6e25d177fca167f1069 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic1.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic2.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf7c12b98a618947201e4a6e4d9ac17c0313773 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic2.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic3.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..ad3a1446e2bd7c871fe6559a8595ebf2937d2bc3 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic3.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic4.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..db07d68c83941f77fd6f7318a4d7e98e4e044969 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic4.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic5.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..a1db950c248b32ae6df2b3959401510a0fa86392 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/banner_pic5.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic1.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..1921034f70a6078a95b6b09e9d8b170fb7953abe Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic1.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic2.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..1b8c814736d77d2cf1e9792036057d2a35274962 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic2.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic3.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..a84eeddb80a2592fa78848d9134dcf05a52b72af Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic3.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic4.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..fcbe1564d7fa21ebfb95f17924a1ae4f611030fb Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic4.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic5.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..bd72866f09003576964c55e86c501801086b3c94 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic5.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic6.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic6.png new file mode 100644 index 0000000000000000000000000000000000000000..05311e52551afd35f0e3a29030611c78f839d9a5 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic6.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic7.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic7.png new file mode 100644 index 0000000000000000000000000000000000000000..badb43c7d82ca293803625aefcafa128ee1585d4 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic7.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic8.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic8.png new file mode 100644 index 0000000000000000000000000000000000000000..ce47be8addcf4fef6cd388e655ecea9a26e741d6 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/enablement_pic8.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/foreground.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..c17d456e4bb7aebc3ad21b4ac87bf8ffdd8eef41 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/foreground.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/ic_start_icon.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/ic_start_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/ic_start_icon.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/layered_image.json b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/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/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic1.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..0dfb98d67fe0a5517832ba0df071aa0d1c7fe113 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic1.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic10.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic10.png new file mode 100644 index 0000000000000000000000000000000000000000..411d5689e8b71aa3a34cdea5ed104fda1759e5c3 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic10.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic11.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic11.png new file mode 100644 index 0000000000000000000000000000000000000000..1a57b787949844f2bebb511b18444a04f7f1325a Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic11.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic12.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic12.png new file mode 100644 index 0000000000000000000000000000000000000000..b65cc1ff4686e07b0a0d1ddfbc8a6a0765f23d0e Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic12.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic2.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..8ce806c4cede9189bd602ac52dfda15f92539c61 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic2.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic3.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..622dab1c1d90836406c118c78f74833f9d0c2d4a Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic3.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic4.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..049aad5eb9a856d16f27b07da58593210072e3ed Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic4.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic5.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..1b2ab24d76027559b2efc890a38c2b4baf120765 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic5.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic6.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic6.png new file mode 100644 index 0000000000000000000000000000000000000000..e649e1a58707082334b5d89860a9ed10bfc6b2c3 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic6.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic7.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic7.png new file mode 100644 index 0000000000000000000000000000000000000000..b07aae9f24939f2e428e8579101f1e48d959ccc2 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic7.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic8.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic8.png new file mode 100644 index 0000000000000000000000000000000000000000..f830f8ad1c06c771b67c4f7da4b968ed3e550bf6 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic8.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic9.png b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic9.png new file mode 100644 index 0000000000000000000000000000000000000000..6f7db19eacb47f581db93b74826b9ec8bd7eb421 Binary files /dev/null and b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/media/tutorial_pic9.png differ diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/profile/backup_config.json b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/profile/main_pages.json b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/en_US/element/string.json b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/zh_CN/element/string.json b/05_MVVMPatternDesign/05_StartPoint/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee46bd7efbb745933e89bd42c6fb6f9d3d2635a --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/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": "HMOS世界入门版" + } + ] +} \ No newline at end of file diff --git a/05_MVVMPatternDesign/05_StartPoint/hvigor/hvigor-config.json5 b/05_MVVMPatternDesign/05_StartPoint/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..06b2783670a348f95533b352c1ceda909a842bbc --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "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/05_MVVMPatternDesign/05_StartPoint/hvigorfile.ts b/05_MVVMPatternDesign/05_StartPoint/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/hvigorfile.ts @@ -0,0 +1,6 @@ +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/05_MVVMPatternDesign/05_StartPoint/oh-package.json5 b/05_MVVMPatternDesign/05_StartPoint/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ebdda7e54d1c41e952f1c7f6993c6d15ea3d146d --- /dev/null +++ b/05_MVVMPatternDesign/05_StartPoint/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.18", + "@ohos/hamock": "1.0.0" + } +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/AppScope/app.json5 b/06_LayerArchitectureDesign/QS06_Complete/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b63e8d74725325e18212a7b93174bfc9ec7b2e92 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.quickstart", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/AppScope/resources/base/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e1346507f210ad222a059080465e3115e7143780 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "HMOS世界入门版" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/AppScope/resources/base/media/app_icon.png b/06_LayerArchitectureDesign/QS06_Complete/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/AppScope/resources/base/media/app_icon.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/build-profile.json5 b/06_LayerArchitectureDesign/QS06_Complete/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..353e68e261cbbca99a493e2c585e3c6c36c4f0e5 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/build-profile.json5 @@ -0,0 +1,55 @@ +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "default", + "srcPath": "./products/default", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + }, + { + "name": "map", + "srcPath": "./features/map" + }, + { + "name": "learning", + "srcPath": "./features/learning" + }, + { + "name": "quickstart", + "srcPath": "./features/quickstart" + }, + { + "name": "utils", + "srcPath": "./commons/utils" + }, + { + "name": "uicomponents", + "srcPath": "./commons/uicomponents" + } + ] +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/BuildProfile.ets b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/BuildProfile.ets new file mode 100644 index 0000000000000000000000000000000000000000..3a501e5ddee8ea6d28961648fc7dd314a5304bd4 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/BuildProfile.ets @@ -0,0 +1,17 @@ +/** + * Use these variables when you tailor your ArkTS code. They must be of the const type. + */ +export const HAR_VERSION = '1.0.0'; +export const BUILD_MODE_NAME = 'debug'; +export const DEBUG = true; +export const TARGET_NAME = 'default'; + +/** + * BuildProfile Class is used only for compatibility purposes. + */ +export default class BuildProfile { + static readonly HAR_VERSION = HAR_VERSION; + static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; + static readonly DEBUG = DEBUG; + static readonly TARGET_NAME = TARGET_NAME; +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/Index.ets b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/build-profile.json5 b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..697dff23e224373edb713dc2b8a08ed7341d5b4c --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/build-profile.json5 @@ -0,0 +1,31 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + }, + "consumerFiles": [ + "./consumer-rules.txt" + ] + } + }, + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/consumer-rules.txt b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/consumer-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/hvigorfile.ts b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..42187071482d292588ad40babeda74f7b8d97a23 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/hvigorfile.ts @@ -0,0 +1,6 @@ +import { harTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/obfuscation-rules.txt b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/oh-package.json5 b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ba99f3b3795dbf38ebb57fca168a13131413bbda --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/oh-package.json5 @@ -0,0 +1,9 @@ +{ + "name": "uicomponents", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "Index.ets", + "author": "", + "license": "Apache-2.0", + "dependencies": {} +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/module.json5 b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7a1010d63d3c4d9a0de6f5555975e96d7bdf2754 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/module.json5 @@ -0,0 +1,11 @@ +{ + "module": { + "name": "uicomponents", + "type": "har", + "deviceTypes": [ + "default", + "tablet", + "2in1" + ] + } +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/base/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/base/media/ic_back.svg b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/base/media/ic_back.svg new file mode 100644 index 0000000000000000000000000000000000000000..0ffde80a4ef9f401a269dd0831b33112c5ffa99a --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/base/media/ic_back.svg @@ -0,0 +1,14 @@ + + + ic_back + + + + + + + + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/base/media/ic_close.svg b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/base/media/ic_close.svg new file mode 100644 index 0000000000000000000000000000000000000000..4b6eea2266c73e9023daf60e220853240b842f01 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/base/media/ic_close.svg @@ -0,0 +1,14 @@ + + + ic_close + + + + + + + + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/base/media/ic_open.svg b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/base/media/ic_open.svg new file mode 100644 index 0000000000000000000000000000000000000000..13042cd2915679f57af4d336c0a9cbe37f5c9977 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/base/media/ic_open.svg @@ -0,0 +1,14 @@ + + + ic_open + + + + + + + + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/en_US/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/en_US/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/zh_CN/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/uicomponents/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/utils/BuildProfile.ets b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/BuildProfile.ets new file mode 100644 index 0000000000000000000000000000000000000000..3a501e5ddee8ea6d28961648fc7dd314a5304bd4 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/BuildProfile.ets @@ -0,0 +1,17 @@ +/** + * Use these variables when you tailor your ArkTS code. They must be of the const type. + */ +export const HAR_VERSION = '1.0.0'; +export const BUILD_MODE_NAME = 'debug'; +export const DEBUG = true; +export const TARGET_NAME = 'default'; + +/** + * BuildProfile Class is used only for compatibility purposes. + */ +export default class BuildProfile { + static readonly HAR_VERSION = HAR_VERSION; + static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; + static readonly DEBUG = DEBUG; + static readonly TARGET_NAME = TARGET_NAME; +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/utils/Index.ets b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/utils/build-profile.json5 b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..697dff23e224373edb713dc2b8a08ed7341d5b4c --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/build-profile.json5 @@ -0,0 +1,31 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + }, + "consumerFiles": [ + "./consumer-rules.txt" + ] + } + }, + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/utils/consumer-rules.txt b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/consumer-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/utils/hvigorfile.ts b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..42187071482d292588ad40babeda74f7b8d97a23 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/hvigorfile.ts @@ -0,0 +1,6 @@ +import { harTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/utils/obfuscation-rules.txt b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/utils/oh-package.json5 b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..11c2609f7fa5cb92fead549d01cbc2509d6c332a --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/oh-package.json5 @@ -0,0 +1,9 @@ +{ + "name": "utils", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "Index.ets", + "author": "", + "license": "Apache-2.0", + "dependencies": {} +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/utils/src/main/module.json5 b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..2355b2eb8e10f153a118897f44ea0932765b15be --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/src/main/module.json5 @@ -0,0 +1,11 @@ +{ + "module": { + "name": "utils", + "type": "har", + "deviceTypes": [ + "default", + "tablet", + "2in1" + ] + } +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/utils/src/main/resources/base/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/src/main/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/utils/src/main/resources/en_US/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/src/main/resources/en_US/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/commons/utils/src/main/resources/zh_CN/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/commons/utils/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/learning/BuildProfile.ets b/06_LayerArchitectureDesign/QS06_Complete/features/learning/BuildProfile.ets new file mode 100644 index 0000000000000000000000000000000000000000..3a501e5ddee8ea6d28961648fc7dd314a5304bd4 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/learning/BuildProfile.ets @@ -0,0 +1,17 @@ +/** + * Use these variables when you tailor your ArkTS code. They must be of the const type. + */ +export const HAR_VERSION = '1.0.0'; +export const BUILD_MODE_NAME = 'debug'; +export const DEBUG = true; +export const TARGET_NAME = 'default'; + +/** + * BuildProfile Class is used only for compatibility purposes. + */ +export default class BuildProfile { + static readonly HAR_VERSION = HAR_VERSION; + static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; + static readonly DEBUG = DEBUG; + static readonly TARGET_NAME = TARGET_NAME; +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/learning/Index.ets b/06_LayerArchitectureDesign/QS06_Complete/features/learning/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/learning/build-profile.json5 b/06_LayerArchitectureDesign/QS06_Complete/features/learning/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..697dff23e224373edb713dc2b8a08ed7341d5b4c --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/learning/build-profile.json5 @@ -0,0 +1,31 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + }, + "consumerFiles": [ + "./consumer-rules.txt" + ] + } + }, + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/learning/consumer-rules.txt b/06_LayerArchitectureDesign/QS06_Complete/features/learning/consumer-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/learning/hvigorfile.ts b/06_LayerArchitectureDesign/QS06_Complete/features/learning/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..42187071482d292588ad40babeda74f7b8d97a23 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/learning/hvigorfile.ts @@ -0,0 +1,6 @@ +import { harTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/learning/obfuscation-rules.txt b/06_LayerArchitectureDesign/QS06_Complete/features/learning/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/learning/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/learning/oh-package.json5 b/06_LayerArchitectureDesign/QS06_Complete/features/learning/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d983b9a33765d22b0402dd2164362857f994accb --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/learning/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "name": "learning", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "Index.ets", + "author": "", + "license": "Apache-2.0", + "dependencies": { + "@ohos/utils": "file:../../commons/utils", + "@ohos/uicomponents": "file:../../commons/uicomponents" + } +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/learning/src/main/module.json5 b/06_LayerArchitectureDesign/QS06_Complete/features/learning/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..58b64c27fd96a4d88b4a7949bf91021aefce6fcf --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/learning/src/main/module.json5 @@ -0,0 +1,11 @@ +{ + "module": { + "name": "learning", + "type": "har", + "deviceTypes": [ + "default", + "tablet", + "2in1" + ] + } +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/learning/src/main/resources/base/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/features/learning/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/learning/src/main/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/learning/src/main/resources/en_US/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/features/learning/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/learning/src/main/resources/en_US/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/learning/src/main/resources/zh_CN/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/features/learning/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/learning/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/BuildProfile.ets b/06_LayerArchitectureDesign/QS06_Complete/features/map/BuildProfile.ets new file mode 100644 index 0000000000000000000000000000000000000000..3a501e5ddee8ea6d28961648fc7dd314a5304bd4 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/map/BuildProfile.ets @@ -0,0 +1,17 @@ +/** + * Use these variables when you tailor your ArkTS code. They must be of the const type. + */ +export const HAR_VERSION = '1.0.0'; +export const BUILD_MODE_NAME = 'debug'; +export const DEBUG = true; +export const TARGET_NAME = 'default'; + +/** + * BuildProfile Class is used only for compatibility purposes. + */ +export default class BuildProfile { + static readonly HAR_VERSION = HAR_VERSION; + static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; + static readonly DEBUG = DEBUG; + static readonly TARGET_NAME = TARGET_NAME; +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/Index.ets b/06_LayerArchitectureDesign/QS06_Complete/features/map/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/build-profile.json5 b/06_LayerArchitectureDesign/QS06_Complete/features/map/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..697dff23e224373edb713dc2b8a08ed7341d5b4c --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/map/build-profile.json5 @@ -0,0 +1,31 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + }, + "consumerFiles": [ + "./consumer-rules.txt" + ] + } + }, + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/consumer-rules.txt b/06_LayerArchitectureDesign/QS06_Complete/features/map/consumer-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/hvigorfile.ts b/06_LayerArchitectureDesign/QS06_Complete/features/map/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..42187071482d292588ad40babeda74f7b8d97a23 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/map/hvigorfile.ts @@ -0,0 +1,6 @@ +import { harTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/obfuscation-rules.txt b/06_LayerArchitectureDesign/QS06_Complete/features/map/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/map/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/oh-package.json5 b/06_LayerArchitectureDesign/QS06_Complete/features/map/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..202f67134dd8ed53296b9128282e922c9b8c95b3 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/map/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "name": "map", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "Index.ets", + "author": "", + "license": "Apache-2.0", + "dependencies": { + "@ohos/utils": "file:../../commons/utils", + "@ohos/uicomponents": "file:../../commons/uicomponents" + } +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/module.json5 b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..42b0707570101f4885903bb7c677104ae7767d29 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/module.json5 @@ -0,0 +1,11 @@ +{ + "module": { + "name": "map", + "type": "har", + "deviceTypes": [ + "default", + "tablet", + "2in1" + ] + } +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_arrow.svg b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_arrow.svg new file mode 100644 index 0000000000000000000000000000000000000000..4b60570e56da9e0264a1e4a870f55c8910f7e93c --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_arrow.svg @@ -0,0 +1,13 @@ + + + ic_arrow + + + + + + + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_guide.svg b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_guide.svg new file mode 100644 index 0000000000000000000000000000000000000000..31a40c8b62682af9f8be8cc6ecdbff3d4db7f2b8 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_guide.svg @@ -0,0 +1,7 @@ + + + ic_guide + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_medals.svg b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_medals.svg new file mode 100644 index 0000000000000000000000000000000000000000..c5f4c040ca12eff15f5ee0753c9ee757e051fe25 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_medals.svg @@ -0,0 +1,7 @@ + + + ic_medals + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_prepare.svg b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_prepare.svg new file mode 100644 index 0000000000000000000000000000000000000000..a1295c1a739e61aeb39d2bb83e0109b97a4c2ffb --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_prepare.svg @@ -0,0 +1,7 @@ + + + ic_prepare + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_video.svg b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_video.svg new file mode 100644 index 0000000000000000000000000000000000000000..2d8ed08b7baa4da16c3956d7fa400cc32eada541 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/ic_video.svg @@ -0,0 +1,7 @@ + + + ic_video + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/knowledge_map_banner.png b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/knowledge_map_banner.png new file mode 100644 index 0000000000000000000000000000000000000000..3b335ecdede6303e90e6bc421a32b277f34c3416 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/base/media/knowledge_map_banner.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/en_US/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/en_US/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/zh_CN/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/map/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/BuildProfile.ets b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/BuildProfile.ets new file mode 100644 index 0000000000000000000000000000000000000000..3a501e5ddee8ea6d28961648fc7dd314a5304bd4 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/BuildProfile.ets @@ -0,0 +1,17 @@ +/** + * Use these variables when you tailor your ArkTS code. They must be of the const type. + */ +export const HAR_VERSION = '1.0.0'; +export const BUILD_MODE_NAME = 'debug'; +export const DEBUG = true; +export const TARGET_NAME = 'default'; + +/** + * BuildProfile Class is used only for compatibility purposes. + */ +export default class BuildProfile { + static readonly HAR_VERSION = HAR_VERSION; + static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; + static readonly DEBUG = DEBUG; + static readonly TARGET_NAME = TARGET_NAME; +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/Index.ets b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..f01f36e88a9af9746ffbe669a1af8249a8df303e --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/Index.ets @@ -0,0 +1 @@ +export { QuickStartPage } from './src/main/ets/pages/QuickStartPage' diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/build-profile.json5 b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..697dff23e224373edb713dc2b8a08ed7341d5b4c --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/build-profile.json5 @@ -0,0 +1,31 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + }, + "consumerFiles": [ + "./consumer-rules.txt" + ] + } + }, + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/consumer-rules.txt b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/consumer-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/hvigorfile.ts b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..42187071482d292588ad40babeda74f7b8d97a23 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/hvigorfile.ts @@ -0,0 +1,6 @@ +import { harTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/obfuscation-rules.txt b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/oh-package.json5 b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..fcb51f0808b46171f97f00ab30ac903309bf454b --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "name": "quickstart", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "Index.ets", + "author": "", + "license": "Apache-2.0", + "dependencies": { + "@ohos/utils": "file:../../commons/utils", + "@ohos/uicomponents": "file:../../commons/uicomponents" + } +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/model/ArticleClass.ets b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/model/ArticleClass.ets new file mode 100644 index 0000000000000000000000000000000000000000..05fd3cf00d3ec319a4195b78b46721472388b83c --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/model/ArticleClass.ets @@ -0,0 +1,15 @@ +export class ArticleClass { + id: string = ''; + imageSrc: string = ''; + title: string = ''; + brief: string = ''; + webUrl: string = ''; + + constructor(id: string, imageSrc: string, title: string, brief: string, webUrl: string) { + this.id = id; + this.imageSrc = imageSrc; + this.title = title; + this.brief = brief; + this.webUrl = webUrl; + } +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/model/BannerClass.ets b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/model/BannerClass.ets new file mode 100644 index 0000000000000000000000000000000000000000..209c69afe6061209d830ff1cef4eb62aa3db3973 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/model/BannerClass.ets @@ -0,0 +1,11 @@ +export class BannerClass { + id: string = ''; + imageSrc: string = ''; + url: string = '' + + constructor(id: string, imageSrc: string, url: string) { + this.id = id + this.imageSrc = imageSrc; + this.url = url; + } +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/pages/QuickStartPage.ets b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/pages/QuickStartPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..b940d32d8d8b058b97b480b20a49b900c25d403d --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/pages/QuickStartPage.ets @@ -0,0 +1,34 @@ +import { TutorialView } from '../view/TutorialView'; +import { Banner } from '../view/Banner'; +import { EnablementView } from '../view/EnablementView'; + +@Component +export struct QuickStartPage { + @State message: string = '快速入门'; + + build() { + Column() { + Text(this.message) + .fontSize(24) + .fontWeight(700) + .width('100%') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .fontFamily('HarmonyHeiTi-Bold') + .lineHeight(33) + Scroll() { + Column() { + Banner() + EnablementView() + TutorialView() + } + } + .layoutWeight(1) + .scrollBar(BarState.Off) + .align(Alignment.TopStart) + } + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/util/BufferUtil.ets b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/util/BufferUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..3e1137870526d0460b5ec51c48f4cf6fd2cf18eb --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/util/BufferUtil.ets @@ -0,0 +1,11 @@ +import { util } from '@kit.ArkTS'; + +export function bufferToString(buffer: ArrayBufferLike): string { + let textDecoder = util.TextDecoder.create('utf-8', { + ignoreBOM: true + }); + let resultPut = textDecoder.decodeWithStream(new Uint8Array(buffer), { + stream: true + }); + return resultPut; +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/view/Banner.ets b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/view/Banner.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1f455b3abf15735b2ddb62ebb402c59e38b4ff3 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/view/Banner.ets @@ -0,0 +1,35 @@ +import { BannerClass } from '../model/BannerClass'; +import { bufferToString } from '../util/BufferUtil'; + +@Component +export struct Banner { + @State bannerList: BannerClass[] = []; + + aboutToAppear(): void { + this.getBannerDataFromJSON() + } + + getBannerDataFromJSON() { + getContext(this).resourceManager.getRawFileContent('BannerData.json').then(value => { + this.bannerList = JSON.parse(bufferToString(value.buffer)) as BannerClass[]; + }) + } + + build() { + Swiper() { + ForEach(this.bannerList, (item: BannerClass) => { + Image($r(item.imageSrc)) + .objectFit(ImageFit.Contain) + .width('100%') + .borderRadius(16) + .padding({ top: 11, left: 16, right: 16 }) + }, (item: BannerClass) => item.id) + } + .autoPlay(true) + .loop(true) + .indicator( + new DotIndicator() + .color('#1a000000') + .selectedColor('#0A59F7')) + } +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/view/EnablementView.ets b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/view/EnablementView.ets new file mode 100644 index 0000000000000000000000000000000000000000..332382cb8e32bcd0e0be300865713ef750095432 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/view/EnablementView.ets @@ -0,0 +1,86 @@ +import { ArticleClass } from '../model/ArticleClass'; +import { bufferToString } from '../util/BufferUtil'; + +@Component +export struct EnablementView { + @State enablementList: ArticleClass[] = []; + + aboutToAppear(): void { + this.getEnablementDataFromJSON() + } + + getEnablementDataFromJSON() { + getContext(this).resourceManager.getRawFileContent('EnablementData.json').then(value => { + this.enablementList = JSON.parse(bufferToString(value.buffer)) as ArticleClass[]; + }) + } + + build() { + Column() { + Text('赋能套件') + .fontColor('#182431') + .fontSize(16) + .fontWeight(500) + .fontFamily('HarmonyHeiTi-medium') + .textAlign(TextAlign.Start) + .padding({ left: 16, right: 16 }) + .width('100%') + Grid() { + ForEach(this.enablementList, (item: ArticleClass) => { + GridItem() { + EnablementItem({ enablementItem: item }) + } + }, (item: ArticleClass) => item.id) + } + .rowsTemplate('1fr') + .columnsGap(8) + .scrollBar(BarState.Off) + .height(169) + .padding({ top: 2, left: 16, right: 16 }) + } + .margin({ top: 18 }) + } +} + +@Component +export struct EnablementItem { + @Prop enablementItem: ArticleClass; + + build() { + Column() { + Image($r(this.enablementItem.imageSrc)) + .width('100%') + .objectFit(ImageFit.Cover) + .height(96) + .borderRadius({ + topLeft: 16, + topRight: 16 + }) + Text(this.enablementItem.title) + .height(19) + .width('100%') + .fontSize(14) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontWeight(400) + .padding({ left: 12, right: 12 }) + .margin({ top: 8 }) + Text(this.enablementItem.brief) + .height(32) + .width('100%') + .fontSize(12) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .fontWeight(400) + .fontColor('rgba(0, 0, 0, 0.6)') + .padding({ left: 12, right: 12 }) + .margin({ top: 2 }) + } + .width(160) + .height(169) + .borderRadius(16) + .backgroundColor(Color.White) + } +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/view/TutorialView.ets b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/view/TutorialView.ets new file mode 100644 index 0000000000000000000000000000000000000000..d0837c451bc10d735688d61a0d93d182f75073e5 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/ets/view/TutorialView.ets @@ -0,0 +1,90 @@ +import { bufferToString } from '../util/BufferUtil'; +import { ArticleClass } from '../model/ArticleClass'; + +@Component +export struct TutorialView { + @State tutorialList: ArticleClass[] = []; + + aboutToAppear(): void { + this.getTutorialDataFromJSON() + } + + getTutorialDataFromJSON() { + getContext(this).resourceManager.getRawFileContent('TutorialData.json').then(value => { + this.tutorialList = JSON.parse(bufferToString(value.buffer)) as ArticleClass[]; + }) + } + + build() { + Column() { + Text('入门教程') + .fontColor('#182431') + .fontSize(16) + .fontWeight(500) + .fontFamily('HarmonyHeiTi-medium') + .textAlign(TextAlign.Start) + .padding({ left: 16, right: 16 }) + .width('100%') + + List({ space: 12 }) { + ForEach(this.tutorialList, (item: ArticleClass) => { + ListItem() { + TutorialItem({ tutorialItem: item }) + } + }, (item: ArticleClass) => item.id) + } + .scrollBar(BarState.Off) + .padding({ left: 16, right: 16 }) + } + .margin({ top: 18 }) + .alignItems(HorizontalAlign.Start) + } +} + +@Component +export struct TutorialItem { + @Prop tutorialItem: ArticleClass; + + build() { + Row() { + Column() { + Text(this.tutorialItem.title) + .height(19) + .width('100%') + .fontSize(14) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontWeight(400) + .margin({ top: 4 }) + + Text(this.tutorialItem.brief) + .height(32) + .width('100%') + .fontSize(12) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .fontWeight(400) + .fontColor('rgba(0, 0, 0, 0.6)') + .margin({ top: 5 }) + } + .height('100%') + .layoutWeight(1) + .alignItems(HorizontalAlign.Start) + .margin({ right: 12 }) + + Image($r(this.tutorialItem.imageSrc)) + .objectFit(ImageFit.Cover) + .height(64) + .width(108) + .borderRadius(16) + } + .width('100%') + .height(88) + .borderRadius(16) + .backgroundColor(Color.White) + .padding(12) + .alignItems(VerticalAlign.Top) + } +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/module.json5 b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..9012526d2f769f1d165693cbff8eb7e8a056d2f2 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/module.json5 @@ -0,0 +1,11 @@ +{ + "module": { + "name": "quickstart", + "type": "har", + "deviceTypes": [ + "default", + "tablet", + "2in1" + ] + } +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic0.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic0.png new file mode 100644 index 0000000000000000000000000000000000000000..6a1429fef9c5f3b07dd64aa1a2f88436da35f409 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic0.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic1.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..eaecda2444a16fb441c8d6e25d177fca167f1069 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic1.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic2.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf7c12b98a618947201e4a6e4d9ac17c0313773 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic2.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic3.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..ad3a1446e2bd7c871fe6559a8595ebf2937d2bc3 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic3.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic4.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..db07d68c83941f77fd6f7318a4d7e98e4e044969 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic4.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic5.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..a1db950c248b32ae6df2b3959401510a0fa86392 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/banner_pic5.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic1.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..1921034f70a6078a95b6b09e9d8b170fb7953abe Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic1.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic2.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..1b8c814736d77d2cf1e9792036057d2a35274962 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic2.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic3.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..a84eeddb80a2592fa78848d9134dcf05a52b72af Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic3.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic4.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..fcbe1564d7fa21ebfb95f17924a1ae4f611030fb Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic4.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic5.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..bd72866f09003576964c55e86c501801086b3c94 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic5.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic6.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic6.png new file mode 100644 index 0000000000000000000000000000000000000000..05311e52551afd35f0e3a29030611c78f839d9a5 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic6.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic7.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic7.png new file mode 100644 index 0000000000000000000000000000000000000000..badb43c7d82ca293803625aefcafa128ee1585d4 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic7.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic8.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic8.png new file mode 100644 index 0000000000000000000000000000000000000000..ce47be8addcf4fef6cd388e655ecea9a26e741d6 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/enablement_pic8.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/ic_AI_read_normal.svg b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/ic_AI_read_normal.svg new file mode 100644 index 0000000000000000000000000000000000000000..5a219fdabedf25a47a2f2e68854aff952e94f53b --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/ic_AI_read_normal.svg @@ -0,0 +1,18 @@ + + + + + ic_AI_read_normal + + + + + + + + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/ic_AI_read_on.svg b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/ic_AI_read_on.svg new file mode 100644 index 0000000000000000000000000000000000000000..31f4b8b64186f4d39ffbbe890da3230f606e86a3 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/ic_AI_read_on.svg @@ -0,0 +1,18 @@ + + + + + ic_AI_read_on + + + + + + + + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/ic_back.svg b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/ic_back.svg new file mode 100644 index 0000000000000000000000000000000000000000..0ffde80a4ef9f401a269dd0831b33112c5ffa99a --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/ic_back.svg @@ -0,0 +1,14 @@ + + + ic_back + + + + + + + + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic1.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..0dfb98d67fe0a5517832ba0df071aa0d1c7fe113 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic1.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic10.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic10.png new file mode 100644 index 0000000000000000000000000000000000000000..411d5689e8b71aa3a34cdea5ed104fda1759e5c3 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic10.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic11.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic11.png new file mode 100644 index 0000000000000000000000000000000000000000..1a57b787949844f2bebb511b18444a04f7f1325a Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic11.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic12.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic12.png new file mode 100644 index 0000000000000000000000000000000000000000..b65cc1ff4686e07b0a0d1ddfbc8a6a0765f23d0e Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic12.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic2.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..8ce806c4cede9189bd602ac52dfda15f92539c61 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic2.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic3.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..622dab1c1d90836406c118c78f74833f9d0c2d4a Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic3.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic4.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..049aad5eb9a856d16f27b07da58593210072e3ed Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic4.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic5.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..1b2ab24d76027559b2efc890a38c2b4baf120765 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic5.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic6.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic6.png new file mode 100644 index 0000000000000000000000000000000000000000..e649e1a58707082334b5d89860a9ed10bfc6b2c3 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic6.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic7.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic7.png new file mode 100644 index 0000000000000000000000000000000000000000..b07aae9f24939f2e428e8579101f1e48d959ccc2 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic7.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic8.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic8.png new file mode 100644 index 0000000000000000000000000000000000000000..f830f8ad1c06c771b67c4f7da4b968ed3e550bf6 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic8.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic9.png b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic9.png new file mode 100644 index 0000000000000000000000000000000000000000..6f7db19eacb47f581db93b74826b9ec8bd7eb421 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/base/media/tutorial_pic9.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/en_US/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/en_US/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/rawfile/BannerData.json b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/rawfile/BannerData.json new file mode 100644 index 0000000000000000000000000000000000000000..bb95e8aa5c389ddc74cae09059692db56aefd3af --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/rawfile/BannerData.json @@ -0,0 +1,32 @@ +[ + { + "id": 0, + "imageSrc": "app.media.banner_pic0", + "url": "https://developer.huawei.com/consumer/cn/training/course/video/C101718352529709527" + }, + { + "id": 1, + "imageSrc": "app.media.banner_pic1", + "url": "https://developer.huawei.com/consumer/cn/" + }, + { + "id": 2, + "imageSrc": "app.media.banner_pic2", + "url": "https://developer.huawei.com/consumer/cn/deveco-studio/" + }, + { + "id": 3, + "imageSrc": "app.media.banner_pic3", + "url": "https://developer.huawei.com/consumer/cn/arkts/" + }, + { + "id": 4, + "imageSrc": "app.media.banner_pic4", + "url": "https://developer.huawei.com/consumer/cn/arkui/" + }, + { + "id": 5, + "imageSrc": "app.media.banner_pic5", + "url": "https://developer.huawei.com/consumer/cn/sdk" + } +] \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/rawfile/EnablementData.json b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/rawfile/EnablementData.json new file mode 100644 index 0000000000000000000000000000000000000000..c96ea31547b84a14ebdaefa32e084291462ccf26 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/rawfile/EnablementData.json @@ -0,0 +1,58 @@ +[ + { + "id": 1, + "imageSrc": "app.media.enablement_pic1", + "title": "HarmonyOS第一课", + "brief": "基于真实的开发场景,提供向导式学习,多维度融合课程等内容,给开发者提供全新的学习体验。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-video-courses/video-tutorials-0000001443535745" + }, + { + "id": 2, + "imageSrc": "app.media.enablement_pic2", + "title": "开发指南", + "brief": "提供系统能力概述、快速入门,用于指导开发者进行场景化的开发。指南涉及到的知识点包括必要的背景知识、符合开发者实际开发场景的操作任务流(开发流程、开发步骤、调测验证)以及常见问题等。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/application-dev-guide-0000001630265101" + }, + { + "id": 3, + "imageSrc": "app.media.enablement_pic3", + "title": "最佳实践", + "brief": "针对新发布特性及热点特性提供详细的技术解析和开发最佳实践。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/topic-architecture-0000001678045510" + }, + { + "id": 4, + "imageSrc": "app.media.enablement_pic4", + "title": "Codelabs", + "brief": "以教学为目的的代码样例及详细的开发指导,帮助开发者一步步地完成指定场景的应用开发并掌握相关知识。Codelabs将最新的鸿蒙生态应用开发技术与典型场景结合,让开发者快速地掌握开发高质量应用的方法。同时支持互动式操作,通过文字、代码和效果联动为开发者带来更佳的学习体验。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-codelabs/codelabs-0000001443855957" + }, + { + "id": 5, + "imageSrc": "app.media.enablement_pic5", + "title": "Sample", + "brief": "面向不同类型的开发者提供的鸿蒙生态应用开发优秀实践,每个Sample Code都是一个可运行的工程,为开发者提供实例化的代码参考。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-samples/samples-0000001162414961" + }, + { + "id": 6, + "imageSrc": "app.media.enablement_pic6", + "title": "API参考", + "brief": "面向开发者提供鸿蒙系统开放接口的全集,供开发者了解具体接口使用方法。API参考详细地描述了每个接口的功能、使用限制、参数名、参数类型、参数含义、取值范围、权限、注意事项、错误码及返回值等。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-references/development-intro-0000001580026066" + }, + { + "id": 7, + "imageSrc": "app.media.enablement_pic7", + "title": "FAQ", + "brief": "开发者常见问题的总结,开发者可以通过FAQ更高效地解决常见问题。FAQ会持续刷新,及时呈现最新的常见问题。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-faqs/faqs-development-0000001753952202" + }, + { + "id": 8, + "imageSrc": "app.media.enablement_pic8", + "title": "开发者论坛", + "brief": "和其他应用开发者交流技术、共同进步。", + "webUrl": "https://developer.huawei.com/consumer/cn/forum/home?all=1" + } +] \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/rawfile/TutorialData.json b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/rawfile/TutorialData.json new file mode 100644 index 0000000000000000000000000000000000000000..887a78b8ccb32bedcb6832362bebfed439cfe585 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/rawfile/TutorialData.json @@ -0,0 +1,86 @@ +[ + { + "id": 1, + "imageSrc": "app.media.tutorial_pic1", + "title": "Step1 开发入门:Hello World", + "brief": "本篇教程实现了快速入门——一个用于了解和学习HarmonyOS的应用程序 。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-HelloWorld" + }, + { + "id": 2, + "imageSrc": "app.media.tutorial_pic2", + "title": "Step2 使用Swiper构建运营位", + "brief": "Swiper组件提供滑动轮播显示的能力。Swiper本身是一个容器组件,当设置了多个子组件后,可以对这些子组件进行轮播显示。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-SwiperBanner" + }, + { + "id": 3, + "imageSrc": "app.media.tutorial_pic3", + "title": "Step3 创建Item视图", + "brief": "Item定义子组件相关特征。相关组件支持使用条件渲染、循环渲染、懒加载等方式生成子组件。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BuildItem" + }, + { + "id": 4, + "imageSrc": "app.media.tutorial_pic4", + "title": "Step4 网格和列表组件的使用", + "brief": "网格和列表组件中,当Item达到一定数量,内容超过屏幕大小时,可以自动提供滚动功能,适合用于呈现同类数据类型或数据类型集", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-GridAndList" + }, + { + "id": 5, + "imageSrc": "app.media.tutorial_pic5", + "title": "Step5 应用架构设计基础——MVVM框架", + "brief": "ArkUI采取MVVM = Model + View + ViewModel模式,将数据与视图绑定在一起,数据更新时候会直接更新视图。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BasicArchitectureDesignPart1" + }, + { + "id": 6, + "imageSrc": "app.media.tutorial_pic6", + "title": "Step6 应用架构设计基础——三层架构", + "brief": "ArkWeb(方舟Web)提供了Web组件,用于在应用程序中显示Web页面内容,为开发者提供页面加载、页面交互、页面调试等能力。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BasicArchitectureDesignPart2" + }, + { + "id": 7, + "imageSrc": "app.media.tutorial_pic7", + "title": "Step7 ArkWeb页面适配", + "brief": "基于Web组件实现了快速入门案例中的课程学习界面,帮助开发者了解如何加载网络界面、本地界面以及如何进行网络权限的配置。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-ArkwebPageAdaptation" + }, + { + "id": 8, + "imageSrc": "app.media.tutorial_pic8", + "title": "Step8 通过结构数据构建页面", + "brief": "在该教程中会根据对知识地图界面进行界面实现的分析以及相应的数据结构的设计,然后逐步实现知识地图中的两个界面。通过该章节,开发者可以了解到数据如何驱动UI更新。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DataDrivenUIUpdates" + }, + { + "id": 9, + "imageSrc": "app.media.tutorial_pic9", + "title": "Step9 设置组件导航", + "brief": "该教程会在“数据驱动UI更新”教程完成了知识地图相关界面开发的基础上,对代码进行修改,实现从知识地图页到知识地图详情页的组件路由导航,同时该教程中会讲解到Tabs的开发。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-SettingUpComponentNavigation" + }, + { + "id": 10, + "imageSrc": "app.media.tutorial_pic10", + "title": "Step10 原生智能:AI语音朗读", + "brief": "为您的文章详情页添加文本转语音服务,朗读文章简介,手机在无网状态下系统应用无障碍(屏幕朗读)接入文本转语音能力,提供语音播报。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-TTS" + }, + { + "id": 11, + "imageSrc": "app.media.tutorial_pic11", + "title": "Step11 一次开发,多端部署", + "brief": "通过对快速入门整体页面的分析,得出关键的界面适配点以及需要适配的关键组件,然后通过对关键适配点的逐步适配,完成整个应用的一多开发。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DevelopOnceDeployAnywhere" + }, + { + "id": 12, + "imageSrc": "app.media.tutorial_pic12", + "title": "Step12 原生互联:分布式流转", + "brief": "基于分布式流转相关能力,使得整个应用可以在不同设备间进行无缝的流转。该章节内容会涉及到流转的相关前提,如何进行流转的权限配置以及实现应用可流转。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DistributedFlow" + } +] \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/zh_CN/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/features/quickstart/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/hvigor/hvigor-config.json5 b/06_LayerArchitectureDesign/QS06_Complete/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f94653eefb816c14f3d0e2f67bb3b0fa7bdf459c --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/hvigor/hvigor-config.json5 @@ -0,0 +1,21 @@ +{ + "modelVersion": "5.0.0", + "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": 4096 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process */ + } +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/hvigorfile.ts b/06_LayerArchitectureDesign/QS06_Complete/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/hvigorfile.ts @@ -0,0 +1,6 @@ +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/06_LayerArchitectureDesign/QS06_Complete/oh-package.json5 b/06_LayerArchitectureDesign/QS06_Complete/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ebdda7e54d1c41e952f1c7f6993c6d15ea3d146d --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.18", + "@ohos/hamock": "1.0.0" + } +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/build-profile.json5 b/06_LayerArchitectureDesign/QS06_Complete/products/default/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b695582d3680556f4cce2ec518f65720a9413ca3 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/hvigorfile.ts b/06_LayerArchitectureDesign/QS06_Complete/products/default/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/obfuscation-rules.txt b/06_LayerArchitectureDesign/QS06_Complete/products/default/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/oh-package.json5 b/06_LayerArchitectureDesign/QS06_Complete/products/default/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..efc4a7dd43fb15389b91eda3a8ba17514ce3431c --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/oh-package.json5 @@ -0,0 +1,13 @@ +{ + "name": "default", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": { + "@ohos/learning": "file:../../features/learning", + "@ohos/map": "file:../../features/map", + "@ohos/quickstart": "file:../../features/quickstart" + } +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/ets/entryability/EntryAbility.ets b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..85624d8d8c6a2439e280de1ee36e8c1435c7a86b --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,54 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit' + +const TAG: string = 'EntryAbility'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + requestFullScreen(windowStage, this.context); + 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(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} + +function requestFullScreen(windowStage: window.WindowStage, context: Context): void { + windowStage.getMainWindow((err: BusinessError, data: window.Window) => { + if (err.code) { + return; + } + let windowClass: window.Window = data; + windowClass.setWindowLayoutFullScreen(true); + }); +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/ets/entrybackupability/EntryBackupAbility.ets b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc55c03d3eea7ce53d5346c732a39ce9bf5267e1 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/ets/pages/Index.ets b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..7996aad9fce58a4f4a18413a7af9c70aa4fe38b7 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/ets/pages/Index.ets @@ -0,0 +1,13 @@ +import { QuickStartPage } from '@ohos/quickstart'; + +@Entry +@Component +struct Index { + build() { + Column() { + QuickStartPage() + } + .backgroundColor('#F1F3F5') + .padding({ top: 36, bottom: 28 }) + } +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/module.json5 b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..6842ac514112c320d16c6731352143538ee9fff9 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/module.json5 @@ -0,0 +1,54 @@ +{ + "module": { + "name": "default", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "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:ic_start_icon", + "startWindowBackground": "$color:start_window_background", + "minWindowWidth": 520, + "minWindowHeight": 720, + "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/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/element/color.json b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/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/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..7de7783444b2d979572cc1990157d360bc06dab7 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/background.png b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4671724ec24a20eaad33c37800194a808cbfbb Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/background.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/foreground.png b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..c17d456e4bb7aebc3ad21b4ac87bf8ffdd8eef41 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/foreground.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_01_off.svg b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_01_off.svg new file mode 100644 index 0000000000000000000000000000000000000000..647fea7d33a531a278e3e1d62040f4efc7a27cc1 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_01_off.svg @@ -0,0 +1,10 @@ + + + ic_01_offmdpi + + + + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_01_on.svg b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_01_on.svg new file mode 100644 index 0000000000000000000000000000000000000000..46112ddf52274803df832b4071d95af815ea2233 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_01_on.svg @@ -0,0 +1,9 @@ + + + ic_01_onmdpi + + + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_02_off.svg b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_02_off.svg new file mode 100644 index 0000000000000000000000000000000000000000..6c99931106be3361300b8fe05286f7a41681461c --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_02_off.svg @@ -0,0 +1,11 @@ + + + ic_02_offmdpi + + + + + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_02_on.svg b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_02_on.svg new file mode 100644 index 0000000000000000000000000000000000000000..f34f6936488607b2f8381773754082903ab86217 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_02_on.svg @@ -0,0 +1,11 @@ + + + ic_02_onmdpi + + + + + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_03_off.svg b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_03_off.svg new file mode 100644 index 0000000000000000000000000000000000000000..6411eb292a3127ec52a4f710346b812241a275f1 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_03_off.svg @@ -0,0 +1,8 @@ + + + ic_03_offmdpi + + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_03_on.svg b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_03_on.svg new file mode 100644 index 0000000000000000000000000000000000000000..7fbe0814cdecf82870c0bb1d68300ce9ff5f39b2 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_03_on.svg @@ -0,0 +1,8 @@ + + + ic_03_onmdpi + + + + + \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_start_icon.png b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_start_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/ic_start_icon.png differ diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/layered_image.json b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/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/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/profile/backup_config.json b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/profile/main_pages.json b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/en_US/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..7de7783444b2d979572cc1990157d360bc06dab7 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/zh_CN/element/string.json b/06_LayerArchitectureDesign/QS06_Complete/products/default/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee46bd7efbb745933e89bd42c6fb6f9d3d2635a --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Complete/products/default/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": "HMOS世界入门版" + } + ] +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Resources/BannerData.json b/06_LayerArchitectureDesign/QS06_Resources/BannerData.json new file mode 100644 index 0000000000000000000000000000000000000000..bb95e8aa5c389ddc74cae09059692db56aefd3af --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Resources/BannerData.json @@ -0,0 +1,32 @@ +[ + { + "id": 0, + "imageSrc": "app.media.banner_pic0", + "url": "https://developer.huawei.com/consumer/cn/training/course/video/C101718352529709527" + }, + { + "id": 1, + "imageSrc": "app.media.banner_pic1", + "url": "https://developer.huawei.com/consumer/cn/" + }, + { + "id": 2, + "imageSrc": "app.media.banner_pic2", + "url": "https://developer.huawei.com/consumer/cn/deveco-studio/" + }, + { + "id": 3, + "imageSrc": "app.media.banner_pic3", + "url": "https://developer.huawei.com/consumer/cn/arkts/" + }, + { + "id": 4, + "imageSrc": "app.media.banner_pic4", + "url": "https://developer.huawei.com/consumer/cn/arkui/" + }, + { + "id": 5, + "imageSrc": "app.media.banner_pic5", + "url": "https://developer.huawei.com/consumer/cn/sdk" + } +] \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Resources/EnablementData.json b/06_LayerArchitectureDesign/QS06_Resources/EnablementData.json new file mode 100644 index 0000000000000000000000000000000000000000..c96ea31547b84a14ebdaefa32e084291462ccf26 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Resources/EnablementData.json @@ -0,0 +1,58 @@ +[ + { + "id": 1, + "imageSrc": "app.media.enablement_pic1", + "title": "HarmonyOS第一课", + "brief": "基于真实的开发场景,提供向导式学习,多维度融合课程等内容,给开发者提供全新的学习体验。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-video-courses/video-tutorials-0000001443535745" + }, + { + "id": 2, + "imageSrc": "app.media.enablement_pic2", + "title": "开发指南", + "brief": "提供系统能力概述、快速入门,用于指导开发者进行场景化的开发。指南涉及到的知识点包括必要的背景知识、符合开发者实际开发场景的操作任务流(开发流程、开发步骤、调测验证)以及常见问题等。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/application-dev-guide-0000001630265101" + }, + { + "id": 3, + "imageSrc": "app.media.enablement_pic3", + "title": "最佳实践", + "brief": "针对新发布特性及热点特性提供详细的技术解析和开发最佳实践。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/topic-architecture-0000001678045510" + }, + { + "id": 4, + "imageSrc": "app.media.enablement_pic4", + "title": "Codelabs", + "brief": "以教学为目的的代码样例及详细的开发指导,帮助开发者一步步地完成指定场景的应用开发并掌握相关知识。Codelabs将最新的鸿蒙生态应用开发技术与典型场景结合,让开发者快速地掌握开发高质量应用的方法。同时支持互动式操作,通过文字、代码和效果联动为开发者带来更佳的学习体验。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-codelabs/codelabs-0000001443855957" + }, + { + "id": 5, + "imageSrc": "app.media.enablement_pic5", + "title": "Sample", + "brief": "面向不同类型的开发者提供的鸿蒙生态应用开发优秀实践,每个Sample Code都是一个可运行的工程,为开发者提供实例化的代码参考。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-samples/samples-0000001162414961" + }, + { + "id": 6, + "imageSrc": "app.media.enablement_pic6", + "title": "API参考", + "brief": "面向开发者提供鸿蒙系统开放接口的全集,供开发者了解具体接口使用方法。API参考详细地描述了每个接口的功能、使用限制、参数名、参数类型、参数含义、取值范围、权限、注意事项、错误码及返回值等。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-references/development-intro-0000001580026066" + }, + { + "id": 7, + "imageSrc": "app.media.enablement_pic7", + "title": "FAQ", + "brief": "开发者常见问题的总结,开发者可以通过FAQ更高效地解决常见问题。FAQ会持续刷新,及时呈现最新的常见问题。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-faqs/faqs-development-0000001753952202" + }, + { + "id": 8, + "imageSrc": "app.media.enablement_pic8", + "title": "开发者论坛", + "brief": "和其他应用开发者交流技术、共同进步。", + "webUrl": "https://developer.huawei.com/consumer/cn/forum/home?all=1" + } +] \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_Resources/TutorialData.json b/06_LayerArchitectureDesign/QS06_Resources/TutorialData.json new file mode 100644 index 0000000000000000000000000000000000000000..887a78b8ccb32bedcb6832362bebfed439cfe585 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_Resources/TutorialData.json @@ -0,0 +1,86 @@ +[ + { + "id": 1, + "imageSrc": "app.media.tutorial_pic1", + "title": "Step1 开发入门:Hello World", + "brief": "本篇教程实现了快速入门——一个用于了解和学习HarmonyOS的应用程序 。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-HelloWorld" + }, + { + "id": 2, + "imageSrc": "app.media.tutorial_pic2", + "title": "Step2 使用Swiper构建运营位", + "brief": "Swiper组件提供滑动轮播显示的能力。Swiper本身是一个容器组件,当设置了多个子组件后,可以对这些子组件进行轮播显示。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-SwiperBanner" + }, + { + "id": 3, + "imageSrc": "app.media.tutorial_pic3", + "title": "Step3 创建Item视图", + "brief": "Item定义子组件相关特征。相关组件支持使用条件渲染、循环渲染、懒加载等方式生成子组件。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BuildItem" + }, + { + "id": 4, + "imageSrc": "app.media.tutorial_pic4", + "title": "Step4 网格和列表组件的使用", + "brief": "网格和列表组件中,当Item达到一定数量,内容超过屏幕大小时,可以自动提供滚动功能,适合用于呈现同类数据类型或数据类型集", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-GridAndList" + }, + { + "id": 5, + "imageSrc": "app.media.tutorial_pic5", + "title": "Step5 应用架构设计基础——MVVM框架", + "brief": "ArkUI采取MVVM = Model + View + ViewModel模式,将数据与视图绑定在一起,数据更新时候会直接更新视图。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BasicArchitectureDesignPart1" + }, + { + "id": 6, + "imageSrc": "app.media.tutorial_pic6", + "title": "Step6 应用架构设计基础——三层架构", + "brief": "ArkWeb(方舟Web)提供了Web组件,用于在应用程序中显示Web页面内容,为开发者提供页面加载、页面交互、页面调试等能力。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BasicArchitectureDesignPart2" + }, + { + "id": 7, + "imageSrc": "app.media.tutorial_pic7", + "title": "Step7 ArkWeb页面适配", + "brief": "基于Web组件实现了快速入门案例中的课程学习界面,帮助开发者了解如何加载网络界面、本地界面以及如何进行网络权限的配置。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-ArkwebPageAdaptation" + }, + { + "id": 8, + "imageSrc": "app.media.tutorial_pic8", + "title": "Step8 通过结构数据构建页面", + "brief": "在该教程中会根据对知识地图界面进行界面实现的分析以及相应的数据结构的设计,然后逐步实现知识地图中的两个界面。通过该章节,开发者可以了解到数据如何驱动UI更新。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DataDrivenUIUpdates" + }, + { + "id": 9, + "imageSrc": "app.media.tutorial_pic9", + "title": "Step9 设置组件导航", + "brief": "该教程会在“数据驱动UI更新”教程完成了知识地图相关界面开发的基础上,对代码进行修改,实现从知识地图页到知识地图详情页的组件路由导航,同时该教程中会讲解到Tabs的开发。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-SettingUpComponentNavigation" + }, + { + "id": 10, + "imageSrc": "app.media.tutorial_pic10", + "title": "Step10 原生智能:AI语音朗读", + "brief": "为您的文章详情页添加文本转语音服务,朗读文章简介,手机在无网状态下系统应用无障碍(屏幕朗读)接入文本转语音能力,提供语音播报。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-TTS" + }, + { + "id": 11, + "imageSrc": "app.media.tutorial_pic11", + "title": "Step11 一次开发,多端部署", + "brief": "通过对快速入门整体页面的分析,得出关键的界面适配点以及需要适配的关键组件,然后通过对关键适配点的逐步适配,完成整个应用的一多开发。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DevelopOnceDeployAnywhere" + }, + { + "id": 12, + "imageSrc": "app.media.tutorial_pic12", + "title": "Step12 原生互联:分布式流转", + "brief": "基于分布式流转相关能力,使得整个应用可以在不同设备间进行无缝的流转。该章节内容会涉及到流转的相关前提,如何进行流转的权限配置以及实现应用可流转。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DistributedFlow" + } +] \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/AppScope/app.json5 b/06_LayerArchitectureDesign/QS06_StartPoint/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b63e8d74725325e18212a7b93174bfc9ec7b2e92 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.quickstart", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/AppScope/resources/base/element/string.json b/06_LayerArchitectureDesign/QS06_StartPoint/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e1346507f210ad222a059080465e3115e7143780 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "HMOS世界入门版" + } + ] +} diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/AppScope/resources/base/media/app_icon.png b/06_LayerArchitectureDesign/QS06_StartPoint/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/AppScope/resources/base/media/app_icon.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/build-profile.json5 b/06_LayerArchitectureDesign/QS06_StartPoint/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7ae3f2a4be402c2d3bb413e572ca16ae6271b2a2 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/build-profile.json5 @@ -0,0 +1,37 @@ +{ + "app": { + "signingConfigs": [ + + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/build-profile.json5 b/06_LayerArchitectureDesign/QS06_StartPoint/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b695582d3680556f4cce2ec518f65720a9413ca3 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/hvigorfile.ts b/06_LayerArchitectureDesign/QS06_StartPoint/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/obfuscation-rules.txt b/06_LayerArchitectureDesign/QS06_StartPoint/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/oh-package.json5 b/06_LayerArchitectureDesign/QS06_StartPoint/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..803b25293388deda7b9a05a21b5aeadeb716b4d5 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/oh-package.json5 @@ -0,0 +1,9 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/entryability/EntryAbility.ets b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..0349f5ff9acce8f21f513bc97fe5907e9c5de56d --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,42 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +const TAG: string = 'EntryAbility'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // 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(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc55c03d3eea7ce53d5346c732a39ce9bf5267e1 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/model/ArticleClass.ets b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/model/ArticleClass.ets new file mode 100644 index 0000000000000000000000000000000000000000..05fd3cf00d3ec319a4195b78b46721472388b83c --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/model/ArticleClass.ets @@ -0,0 +1,15 @@ +export class ArticleClass { + id: string = ''; + imageSrc: string = ''; + title: string = ''; + brief: string = ''; + webUrl: string = ''; + + constructor(id: string, imageSrc: string, title: string, brief: string, webUrl: string) { + this.id = id; + this.imageSrc = imageSrc; + this.title = title; + this.brief = brief; + this.webUrl = webUrl; + } +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/model/BannerClass.ets b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/model/BannerClass.ets new file mode 100644 index 0000000000000000000000000000000000000000..52b7e66dc94e6986b475a105ab4a6bafe408f3d7 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/model/BannerClass.ets @@ -0,0 +1,11 @@ +export class BannerClass { + id: string = ''; + imageSrc: string = ''; + url: string = ''; + + constructor(id: string, imageSrc: string, url: string) { + this.id = id; + this.imageSrc = imageSrc; + this.url = url; + } +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/pages/Index.ets b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..9462b1afc40f76fe199adca53cf70f6fb0386349 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,35 @@ +import { Banner } from '../view/Banner'; +import { EnablementView } from '../view/EnablementView'; +import { TutorialView } from '../view/TutorialView'; + +@Entry +@Component +struct Index { + @State message: string = '快速入门'; + + build() { + Column() { + Text(this.message) + .fontSize(24) + .fontWeight(700) + .width('100%') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .fontFamily('HarmonyHeiTi-Bold') + .lineHeight(33) + Scroll() { + Column() { + Banner() + EnablementView() + TutorialView() + } + } + .layoutWeight(1) + .scrollBar(BarState.Off) + .align(Alignment.TopStart) + } + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/util/BufferUtil.ets b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/util/BufferUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..3e1137870526d0460b5ec51c48f4cf6fd2cf18eb --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/util/BufferUtil.ets @@ -0,0 +1,11 @@ +import { util } from '@kit.ArkTS'; + +export function bufferToString(buffer: ArrayBufferLike): string { + let textDecoder = util.TextDecoder.create('utf-8', { + ignoreBOM: true + }); + let resultPut = textDecoder.decodeWithStream(new Uint8Array(buffer), { + stream: true + }); + return resultPut; +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/view/Banner.ets b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/view/Banner.ets new file mode 100644 index 0000000000000000000000000000000000000000..1858232fbd0da53eec2bc3065f8bd882ee99e771 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/view/Banner.ets @@ -0,0 +1,35 @@ +import { BannerClass } from '../model/BannerClass'; +import { bufferToString } from '../util/BufferUtil'; + +@Component +export struct Banner { + @State bannerList: BannerClass[] = []; + + aboutToAppear(): void { + this.getBannerDataFromJSON(); + } + + getBannerDataFromJSON() { + getContext(this).resourceManager.getRawFileContent('BannerData.json').then(value => { + this.bannerList = JSON.parse(bufferToString(value.buffer)) as BannerClass[]; + }) + } + + build() { + Swiper() { + ForEach(this.bannerList, (item: BannerClass) => { + Image($r(item.imageSrc)) + .objectFit(ImageFit.Contain) + .width('100%') + .borderRadius(16) + .padding({ top: 11, left: 16, right: 16 }) + }, (item: BannerClass) => item.id) + } + .autoPlay(true) + .loop(true) + .indicator( + new DotIndicator() + .color('#1a000000') + .selectedColor('#0A59F7')) + } +} diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/view/EnablementView.ets b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/view/EnablementView.ets new file mode 100644 index 0000000000000000000000000000000000000000..2c5fd0efb4660e11597cff0719fe6d64b6603334 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/view/EnablementView.ets @@ -0,0 +1,89 @@ +import { ArticleClass } from '../model/ArticleClass'; +import { bufferToString } from '../util/BufferUtil'; + +@Component +export struct EnablementView { + @State enablementList: Array = []; + + aboutToAppear(): void { + this.getEnablementDataFromJSON() + } + + getEnablementDataFromJSON() { + getContext(this).resourceManager.getRawFileContent('EnablementData.json').then(value => { + this.enablementList = JSON.parse(bufferToString(value.buffer)) as ArticleClass[]; + }) + } + + build() { + Column() { + Text('赋能套件') + .fontColor('#182431') + .fontSize(16) + .fontWeight(500) + .fontFamily('HarmonyHeiTi-medium') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .margin({ bottom: 8.5 }) + Grid() { + ForEach(this.enablementList, (item: ArticleClass) => { + GridItem() { + EnablementItem({ enablementItem: item }) + } + }, (item: ArticleClass) => item.id) + } + .rowsTemplate('1fr') + .columnsGap(8) + .scrollBar(BarState.Off) + .height(169) + .padding({ top: 2, left: 16, right: 16 }) + + } + .margin({ top: 18 }) + .alignItems(HorizontalAlign.Start) + } +} + + +@Component +struct EnablementItem { + @Prop enablementItem: ArticleClass; + + build() { + Column() { + Image($r(this.enablementItem.imageSrc)) + .width('100%') + .objectFit(ImageFit.Cover) + .height(96) + .borderRadius({ + topLeft: 16, + topRight: 16 + }) + Text(this.enablementItem.title) + .height(19) + .width('100%') + .fontSize(14) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontWeight(400) + .padding({ left: 12, right: 12 }) + .margin({ top: 8 }) + Text(this.enablementItem.brief) + .height(32) + .width('100%') + .fontSize(12) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .fontWeight(400) + .fontColor('rgba(0, 0, 0, 0.6)') + .padding({ left: 12, right: 12 }) + .margin({ top: 2 }) + } + .width(160) + .height(169) + .borderRadius(16) + .backgroundColor(Color.White) + } +} diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/view/TutorialView.ets b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/view/TutorialView.ets new file mode 100644 index 0000000000000000000000000000000000000000..2222e77e0a2862e7114d8f38d48acd0728a284fd --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/ets/view/TutorialView.ets @@ -0,0 +1,89 @@ +import { ArticleClass } from '../model/ArticleClass'; +import { bufferToString } from '../util/BufferUtil'; + +@Component +export struct TutorialView { + @State tutorialList: Array = []; + + aboutToAppear(): void { + this.getTutorialDataFromJSON() + } + + getTutorialDataFromJSON() { + getContext(this).resourceManager.getRawFileContent('TutorialData.json').then(value => { + this.tutorialList = JSON.parse(bufferToString(value.buffer)) as ArticleClass[]; + }) + } + + build() { + Column() { + Text('入门教程') + .fontColor('#182431') + .fontSize(16) + .fontWeight(500) + .fontFamily('HarmonyHeiTi-medium') + .textAlign(TextAlign.Start) + .padding({ left: 16 }) + .margin({ bottom: 8.5 }) + + List({ space: 12 }) { + ForEach(this.tutorialList, (item: ArticleClass) => { + ListItem() { + TutorialItem({ tutorialItem: item }) + } + }, (item: ArticleClass) => item.id) + } + .scrollBar(BarState.Off) + .padding({ left: 16, right: 16 }) + } + .margin({ top: 18 }) + .alignItems(HorizontalAlign.Start) + } +} + +@Component +struct TutorialItem { + @Prop tutorialItem: ArticleClass; + + build() { + Row() { + Column() { + Text(this.tutorialItem.title) + .height(19) + .width('100%') + .fontSize(14) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontWeight(400) + .margin({ top: 4 }) + Text(this.tutorialItem.brief) + .height(32) + .width('100%') + .fontSize(12) + .textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(2) + .fontWeight(400) + .fontColor('rgba(0, 0, 0, 0.6)') + .margin({ top: 5 }) + } + .height('100%') + .layoutWeight(1) + .alignItems(HorizontalAlign.Start) + .margin({ right: 12 }) + + Image($r(this.tutorialItem.imageSrc)) + .height(64) + .width(108) + .objectFit(ImageFit.Cover) + .borderRadius(16) + } + .width('100%') + .height(88) + .borderRadius(16) + .backgroundColor(Color.White) + .padding(12) + .alignItems(VerticalAlign.Top) + } +} diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/module.json5 b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bef6142319137babd9ef098df8037a57edfbeb05 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "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:ic_start_icon", + "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/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/element/color.json b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/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/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/element/string.json b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/background.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4671724ec24a20eaad33c37800194a808cbfbb Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/background.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic0.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic0.png new file mode 100644 index 0000000000000000000000000000000000000000..6a1429fef9c5f3b07dd64aa1a2f88436da35f409 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic0.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic1.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..eaecda2444a16fb441c8d6e25d177fca167f1069 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic1.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic2.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf7c12b98a618947201e4a6e4d9ac17c0313773 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic2.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic3.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..ad3a1446e2bd7c871fe6559a8595ebf2937d2bc3 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic3.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic4.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..db07d68c83941f77fd6f7318a4d7e98e4e044969 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic4.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic5.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..a1db950c248b32ae6df2b3959401510a0fa86392 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/banner_pic5.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic1.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..1921034f70a6078a95b6b09e9d8b170fb7953abe Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic1.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic2.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..1b8c814736d77d2cf1e9792036057d2a35274962 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic2.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic3.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..a84eeddb80a2592fa78848d9134dcf05a52b72af Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic3.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic4.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..fcbe1564d7fa21ebfb95f17924a1ae4f611030fb Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic4.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic5.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..bd72866f09003576964c55e86c501801086b3c94 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic5.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic6.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic6.png new file mode 100644 index 0000000000000000000000000000000000000000..05311e52551afd35f0e3a29030611c78f839d9a5 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic6.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic7.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic7.png new file mode 100644 index 0000000000000000000000000000000000000000..badb43c7d82ca293803625aefcafa128ee1585d4 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic7.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic8.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic8.png new file mode 100644 index 0000000000000000000000000000000000000000..ce47be8addcf4fef6cd388e655ecea9a26e741d6 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/enablement_pic8.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/foreground.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..c17d456e4bb7aebc3ad21b4ac87bf8ffdd8eef41 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/foreground.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/ic_start_icon.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/ic_start_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/ic_start_icon.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/layered_image.json b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/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/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic1.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..0dfb98d67fe0a5517832ba0df071aa0d1c7fe113 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic1.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic10.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic10.png new file mode 100644 index 0000000000000000000000000000000000000000..411d5689e8b71aa3a34cdea5ed104fda1759e5c3 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic10.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic11.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic11.png new file mode 100644 index 0000000000000000000000000000000000000000..1a57b787949844f2bebb511b18444a04f7f1325a Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic11.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic12.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic12.png new file mode 100644 index 0000000000000000000000000000000000000000..b65cc1ff4686e07b0a0d1ddfbc8a6a0765f23d0e Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic12.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic2.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..8ce806c4cede9189bd602ac52dfda15f92539c61 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic2.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic3.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic3.png new file mode 100644 index 0000000000000000000000000000000000000000..622dab1c1d90836406c118c78f74833f9d0c2d4a Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic3.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic4.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic4.png new file mode 100644 index 0000000000000000000000000000000000000000..049aad5eb9a856d16f27b07da58593210072e3ed Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic4.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic5.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic5.png new file mode 100644 index 0000000000000000000000000000000000000000..1b2ab24d76027559b2efc890a38c2b4baf120765 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic5.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic6.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic6.png new file mode 100644 index 0000000000000000000000000000000000000000..e649e1a58707082334b5d89860a9ed10bfc6b2c3 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic6.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic7.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic7.png new file mode 100644 index 0000000000000000000000000000000000000000..b07aae9f24939f2e428e8579101f1e48d959ccc2 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic7.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic8.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic8.png new file mode 100644 index 0000000000000000000000000000000000000000..f830f8ad1c06c771b67c4f7da4b968ed3e550bf6 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic8.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic9.png b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic9.png new file mode 100644 index 0000000000000000000000000000000000000000..6f7db19eacb47f581db93b74826b9ec8bd7eb421 Binary files /dev/null and b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/media/tutorial_pic9.png differ diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/profile/backup_config.json b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/profile/main_pages.json b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/en_US/element/string.json b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1db26f26ed5703fd1f81fa0a370b8fc163449c83 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/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": "HMOS Basic" + } + ] +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/rawfile/BannerData.json b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/rawfile/BannerData.json new file mode 100644 index 0000000000000000000000000000000000000000..bb95e8aa5c389ddc74cae09059692db56aefd3af --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/rawfile/BannerData.json @@ -0,0 +1,32 @@ +[ + { + "id": 0, + "imageSrc": "app.media.banner_pic0", + "url": "https://developer.huawei.com/consumer/cn/training/course/video/C101718352529709527" + }, + { + "id": 1, + "imageSrc": "app.media.banner_pic1", + "url": "https://developer.huawei.com/consumer/cn/" + }, + { + "id": 2, + "imageSrc": "app.media.banner_pic2", + "url": "https://developer.huawei.com/consumer/cn/deveco-studio/" + }, + { + "id": 3, + "imageSrc": "app.media.banner_pic3", + "url": "https://developer.huawei.com/consumer/cn/arkts/" + }, + { + "id": 4, + "imageSrc": "app.media.banner_pic4", + "url": "https://developer.huawei.com/consumer/cn/arkui/" + }, + { + "id": 5, + "imageSrc": "app.media.banner_pic5", + "url": "https://developer.huawei.com/consumer/cn/sdk" + } +] \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/rawfile/EnablementData.json b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/rawfile/EnablementData.json new file mode 100644 index 0000000000000000000000000000000000000000..c96ea31547b84a14ebdaefa32e084291462ccf26 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/rawfile/EnablementData.json @@ -0,0 +1,58 @@ +[ + { + "id": 1, + "imageSrc": "app.media.enablement_pic1", + "title": "HarmonyOS第一课", + "brief": "基于真实的开发场景,提供向导式学习,多维度融合课程等内容,给开发者提供全新的学习体验。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-video-courses/video-tutorials-0000001443535745" + }, + { + "id": 2, + "imageSrc": "app.media.enablement_pic2", + "title": "开发指南", + "brief": "提供系统能力概述、快速入门,用于指导开发者进行场景化的开发。指南涉及到的知识点包括必要的背景知识、符合开发者实际开发场景的操作任务流(开发流程、开发步骤、调测验证)以及常见问题等。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/application-dev-guide-0000001630265101" + }, + { + "id": 3, + "imageSrc": "app.media.enablement_pic3", + "title": "最佳实践", + "brief": "针对新发布特性及热点特性提供详细的技术解析和开发最佳实践。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/topic-architecture-0000001678045510" + }, + { + "id": 4, + "imageSrc": "app.media.enablement_pic4", + "title": "Codelabs", + "brief": "以教学为目的的代码样例及详细的开发指导,帮助开发者一步步地完成指定场景的应用开发并掌握相关知识。Codelabs将最新的鸿蒙生态应用开发技术与典型场景结合,让开发者快速地掌握开发高质量应用的方法。同时支持互动式操作,通过文字、代码和效果联动为开发者带来更佳的学习体验。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-codelabs/codelabs-0000001443855957" + }, + { + "id": 5, + "imageSrc": "app.media.enablement_pic5", + "title": "Sample", + "brief": "面向不同类型的开发者提供的鸿蒙生态应用开发优秀实践,每个Sample Code都是一个可运行的工程,为开发者提供实例化的代码参考。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-samples/samples-0000001162414961" + }, + { + "id": 6, + "imageSrc": "app.media.enablement_pic6", + "title": "API参考", + "brief": "面向开发者提供鸿蒙系统开放接口的全集,供开发者了解具体接口使用方法。API参考详细地描述了每个接口的功能、使用限制、参数名、参数类型、参数含义、取值范围、权限、注意事项、错误码及返回值等。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-references/development-intro-0000001580026066" + }, + { + "id": 7, + "imageSrc": "app.media.enablement_pic7", + "title": "FAQ", + "brief": "开发者常见问题的总结,开发者可以通过FAQ更高效地解决常见问题。FAQ会持续刷新,及时呈现最新的常见问题。", + "webUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-faqs/faqs-development-0000001753952202" + }, + { + "id": 8, + "imageSrc": "app.media.enablement_pic8", + "title": "开发者论坛", + "brief": "和其他应用开发者交流技术、共同进步。", + "webUrl": "https://developer.huawei.com/consumer/cn/forum/home?all=1" + } +] \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/rawfile/TutorialData.json b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/rawfile/TutorialData.json new file mode 100644 index 0000000000000000000000000000000000000000..887a78b8ccb32bedcb6832362bebfed439cfe585 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/rawfile/TutorialData.json @@ -0,0 +1,86 @@ +[ + { + "id": 1, + "imageSrc": "app.media.tutorial_pic1", + "title": "Step1 开发入门:Hello World", + "brief": "本篇教程实现了快速入门——一个用于了解和学习HarmonyOS的应用程序 。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-HelloWorld" + }, + { + "id": 2, + "imageSrc": "app.media.tutorial_pic2", + "title": "Step2 使用Swiper构建运营位", + "brief": "Swiper组件提供滑动轮播显示的能力。Swiper本身是一个容器组件,当设置了多个子组件后,可以对这些子组件进行轮播显示。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-SwiperBanner" + }, + { + "id": 3, + "imageSrc": "app.media.tutorial_pic3", + "title": "Step3 创建Item视图", + "brief": "Item定义子组件相关特征。相关组件支持使用条件渲染、循环渲染、懒加载等方式生成子组件。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BuildItem" + }, + { + "id": 4, + "imageSrc": "app.media.tutorial_pic4", + "title": "Step4 网格和列表组件的使用", + "brief": "网格和列表组件中,当Item达到一定数量,内容超过屏幕大小时,可以自动提供滚动功能,适合用于呈现同类数据类型或数据类型集", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-GridAndList" + }, + { + "id": 5, + "imageSrc": "app.media.tutorial_pic5", + "title": "Step5 应用架构设计基础——MVVM框架", + "brief": "ArkUI采取MVVM = Model + View + ViewModel模式,将数据与视图绑定在一起,数据更新时候会直接更新视图。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BasicArchitectureDesignPart1" + }, + { + "id": 6, + "imageSrc": "app.media.tutorial_pic6", + "title": "Step6 应用架构设计基础——三层架构", + "brief": "ArkWeb(方舟Web)提供了Web组件,用于在应用程序中显示Web页面内容,为开发者提供页面加载、页面交互、页面调试等能力。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-BasicArchitectureDesignPart2" + }, + { + "id": 7, + "imageSrc": "app.media.tutorial_pic7", + "title": "Step7 ArkWeb页面适配", + "brief": "基于Web组件实现了快速入门案例中的课程学习界面,帮助开发者了解如何加载网络界面、本地界面以及如何进行网络权限的配置。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-ArkwebPageAdaptation" + }, + { + "id": 8, + "imageSrc": "app.media.tutorial_pic8", + "title": "Step8 通过结构数据构建页面", + "brief": "在该教程中会根据对知识地图界面进行界面实现的分析以及相应的数据结构的设计,然后逐步实现知识地图中的两个界面。通过该章节,开发者可以了解到数据如何驱动UI更新。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DataDrivenUIUpdates" + }, + { + "id": 9, + "imageSrc": "app.media.tutorial_pic9", + "title": "Step9 设置组件导航", + "brief": "该教程会在“数据驱动UI更新”教程完成了知识地图相关界面开发的基础上,对代码进行修改,实现从知识地图页到知识地图详情页的组件路由导航,同时该教程中会讲解到Tabs的开发。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-SettingUpComponentNavigation" + }, + { + "id": 10, + "imageSrc": "app.media.tutorial_pic10", + "title": "Step10 原生智能:AI语音朗读", + "brief": "为您的文章详情页添加文本转语音服务,朗读文章简介,手机在无网状态下系统应用无障碍(屏幕朗读)接入文本转语音能力,提供语音播报。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-TTS" + }, + { + "id": 11, + "imageSrc": "app.media.tutorial_pic11", + "title": "Step11 一次开发,多端部署", + "brief": "通过对快速入门整体页面的分析,得出关键的界面适配点以及需要适配的关键组件,然后通过对关键适配点的逐步适配,完成整个应用的一多开发。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DevelopOnceDeployAnywhere" + }, + { + "id": 12, + "imageSrc": "app.media.tutorial_pic12", + "title": "Step12 原生互联:分布式流转", + "brief": "基于分布式流转相关能力,使得整个应用可以在不同设备间进行无缝的流转。该章节内容会涉及到流转的相关前提,如何进行流转的权限配置以及实现应用可流转。", + "webUrl": "https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_Next-DistributedFlow" + } +] \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/zh_CN/element/string.json b/06_LayerArchitectureDesign/QS06_StartPoint/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee46bd7efbb745933e89bd42c6fb6f9d3d2635a --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/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": "HMOS世界入门版" + } + ] +} \ No newline at end of file diff --git a/06_LayerArchitectureDesign/QS06_StartPoint/hvigor/hvigor-config.json5 b/06_LayerArchitectureDesign/QS06_StartPoint/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..06b2783670a348f95533b352c1ceda909a842bbc --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "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/06_LayerArchitectureDesign/QS06_StartPoint/hvigorfile.ts b/06_LayerArchitectureDesign/QS06_StartPoint/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/hvigorfile.ts @@ -0,0 +1,6 @@ +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/06_LayerArchitectureDesign/QS06_StartPoint/oh-package.json5 b/06_LayerArchitectureDesign/QS06_StartPoint/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ebdda7e54d1c41e952f1c7f6993c6d15ea3d146d --- /dev/null +++ b/06_LayerArchitectureDesign/QS06_StartPoint/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.18", + "@ohos/hamock": "1.0.0" + } +} diff --git a/07_ArkWebPageAdaptation/07_Complete/AppScope/app.json5 b/07_ArkWebPageAdaptation/07_Complete/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b63e8d74725325e18212a7b93174bfc9ec7b2e92 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.quickstart", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/07_ArkWebPageAdaptation/07_Complete/AppScope/resources/base/element/string.json b/07_ArkWebPageAdaptation/07_Complete/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e1346507f210ad222a059080465e3115e7143780 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "HMOS世界入门版" + } + ] +} diff --git a/07_ArkWebPageAdaptation/07_Complete/AppScope/resources/base/media/app_icon.png b/07_ArkWebPageAdaptation/07_Complete/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..70d199582d58f8a5d6fb3ecacf7f8c55b93f14b1 Binary files /dev/null and b/07_ArkWebPageAdaptation/07_Complete/AppScope/resources/base/media/app_icon.png differ diff --git a/07_ArkWebPageAdaptation/07_Complete/build-profile.json5 b/07_ArkWebPageAdaptation/07_Complete/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..353e68e261cbbca99a493e2c585e3c6c36c4f0e5 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/build-profile.json5 @@ -0,0 +1,55 @@ +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "default", + "srcPath": "./products/default", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + }, + { + "name": "map", + "srcPath": "./features/map" + }, + { + "name": "learning", + "srcPath": "./features/learning" + }, + { + "name": "quickstart", + "srcPath": "./features/quickstart" + }, + { + "name": "utils", + "srcPath": "./commons/utils" + }, + { + "name": "uicomponents", + "srcPath": "./commons/uicomponents" + } + ] +} \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/BuildProfile.ets b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/BuildProfile.ets new file mode 100644 index 0000000000000000000000000000000000000000..3a501e5ddee8ea6d28961648fc7dd314a5304bd4 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/BuildProfile.ets @@ -0,0 +1,17 @@ +/** + * Use these variables when you tailor your ArkTS code. They must be of the const type. + */ +export const HAR_VERSION = '1.0.0'; +export const BUILD_MODE_NAME = 'debug'; +export const DEBUG = true; +export const TARGET_NAME = 'default'; + +/** + * BuildProfile Class is used only for compatibility purposes. + */ +export default class BuildProfile { + static readonly HAR_VERSION = HAR_VERSION; + static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; + static readonly DEBUG = DEBUG; + static readonly TARGET_NAME = TARGET_NAME; +} \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/Index.ets b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/build-profile.json5 b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..697dff23e224373edb713dc2b8a08ed7341d5b4c --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/build-profile.json5 @@ -0,0 +1,31 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + }, + "consumerFiles": [ + "./consumer-rules.txt" + ] + } + }, + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest" + } + ] +} diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/consumer-rules.txt b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/consumer-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/hvigorfile.ts b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..42187071482d292588ad40babeda74f7b8d97a23 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/hvigorfile.ts @@ -0,0 +1,6 @@ +import { harTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/obfuscation-rules.txt b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/oh-package.json5 b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ba99f3b3795dbf38ebb57fca168a13131413bbda --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/oh-package.json5 @@ -0,0 +1,9 @@ +{ + "name": "uicomponents", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "Index.ets", + "author": "", + "license": "Apache-2.0", + "dependencies": {} +} diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/module.json5 b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7a1010d63d3c4d9a0de6f5555975e96d7bdf2754 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/module.json5 @@ -0,0 +1,11 @@ +{ + "module": { + "name": "uicomponents", + "type": "har", + "deviceTypes": [ + "default", + "tablet", + "2in1" + ] + } +} diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/base/element/string.json b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/base/media/ic_back.svg b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/base/media/ic_back.svg new file mode 100644 index 0000000000000000000000000000000000000000..0ffde80a4ef9f401a269dd0831b33112c5ffa99a --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/base/media/ic_back.svg @@ -0,0 +1,14 @@ + + + ic_back + + + + + + + + + + + \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/base/media/ic_close.svg b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/base/media/ic_close.svg new file mode 100644 index 0000000000000000000000000000000000000000..4b6eea2266c73e9023daf60e220853240b842f01 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/base/media/ic_close.svg @@ -0,0 +1,14 @@ + + + ic_close + + + + + + + + + + + \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/base/media/ic_open.svg b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/base/media/ic_open.svg new file mode 100644 index 0000000000000000000000000000000000000000..13042cd2915679f57af4d336c0a9cbe37f5c9977 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/base/media/ic_open.svg @@ -0,0 +1,14 @@ + + + ic_open + + + + + + + + + + + \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/en_US/element/string.json b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/en_US/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/zh_CN/element/string.json b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/uicomponents/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/utils/BuildProfile.ets b/07_ArkWebPageAdaptation/07_Complete/commons/utils/BuildProfile.ets new file mode 100644 index 0000000000000000000000000000000000000000..3a501e5ddee8ea6d28961648fc7dd314a5304bd4 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/utils/BuildProfile.ets @@ -0,0 +1,17 @@ +/** + * Use these variables when you tailor your ArkTS code. They must be of the const type. + */ +export const HAR_VERSION = '1.0.0'; +export const BUILD_MODE_NAME = 'debug'; +export const DEBUG = true; +export const TARGET_NAME = 'default'; + +/** + * BuildProfile Class is used only for compatibility purposes. + */ +export default class BuildProfile { + static readonly HAR_VERSION = HAR_VERSION; + static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; + static readonly DEBUG = DEBUG; + static readonly TARGET_NAME = TARGET_NAME; +} \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/utils/Index.ets b/07_ArkWebPageAdaptation/07_Complete/commons/utils/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/utils/build-profile.json5 b/07_ArkWebPageAdaptation/07_Complete/commons/utils/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..697dff23e224373edb713dc2b8a08ed7341d5b4c --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/utils/build-profile.json5 @@ -0,0 +1,31 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + }, + "consumerFiles": [ + "./consumer-rules.txt" + ] + } + }, + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest" + } + ] +} diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/utils/consumer-rules.txt b/07_ArkWebPageAdaptation/07_Complete/commons/utils/consumer-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/utils/hvigorfile.ts b/07_ArkWebPageAdaptation/07_Complete/commons/utils/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..42187071482d292588ad40babeda74f7b8d97a23 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/utils/hvigorfile.ts @@ -0,0 +1,6 @@ +import { harTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/utils/obfuscation-rules.txt b/07_ArkWebPageAdaptation/07_Complete/commons/utils/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/utils/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/utils/oh-package.json5 b/07_ArkWebPageAdaptation/07_Complete/commons/utils/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..11c2609f7fa5cb92fead549d01cbc2509d6c332a --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/utils/oh-package.json5 @@ -0,0 +1,9 @@ +{ + "name": "utils", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "Index.ets", + "author": "", + "license": "Apache-2.0", + "dependencies": {} +} diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/utils/src/main/module.json5 b/07_ArkWebPageAdaptation/07_Complete/commons/utils/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..2355b2eb8e10f153a118897f44ea0932765b15be --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/utils/src/main/module.json5 @@ -0,0 +1,11 @@ +{ + "module": { + "name": "utils", + "type": "har", + "deviceTypes": [ + "default", + "tablet", + "2in1" + ] + } +} diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/utils/src/main/resources/base/element/string.json b/07_ArkWebPageAdaptation/07_Complete/commons/utils/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/utils/src/main/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/utils/src/main/resources/en_US/element/string.json b/07_ArkWebPageAdaptation/07_Complete/commons/utils/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/utils/src/main/resources/en_US/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/07_ArkWebPageAdaptation/07_Complete/commons/utils/src/main/resources/zh_CN/element/string.json b/07_ArkWebPageAdaptation/07_Complete/commons/utils/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/commons/utils/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/BuildProfile.ets b/07_ArkWebPageAdaptation/07_Complete/features/learning/BuildProfile.ets new file mode 100644 index 0000000000000000000000000000000000000000..3a501e5ddee8ea6d28961648fc7dd314a5304bd4 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/BuildProfile.ets @@ -0,0 +1,17 @@ +/** + * Use these variables when you tailor your ArkTS code. They must be of the const type. + */ +export const HAR_VERSION = '1.0.0'; +export const BUILD_MODE_NAME = 'debug'; +export const DEBUG = true; +export const TARGET_NAME = 'default'; + +/** + * BuildProfile Class is used only for compatibility purposes. + */ +export default class BuildProfile { + static readonly HAR_VERSION = HAR_VERSION; + static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; + static readonly DEBUG = DEBUG; + static readonly TARGET_NAME = TARGET_NAME; +} \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/Index.ets b/07_ArkWebPageAdaptation/07_Complete/features/learning/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..5504328fe9fce93bf316e07d722144c23c5948ad --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/Index.ets @@ -0,0 +1 @@ +export { CourseLearning } from './src/main/ets/pages/CourseLearning'; diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/build-profile.json5 b/07_ArkWebPageAdaptation/07_Complete/features/learning/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..697dff23e224373edb713dc2b8a08ed7341d5b4c --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/build-profile.json5 @@ -0,0 +1,31 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + }, + "consumerFiles": [ + "./consumer-rules.txt" + ] + } + }, + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest" + } + ] +} diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/consumer-rules.txt b/07_ArkWebPageAdaptation/07_Complete/features/learning/consumer-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/hvigorfile.ts b/07_ArkWebPageAdaptation/07_Complete/features/learning/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..42187071482d292588ad40babeda74f7b8d97a23 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/hvigorfile.ts @@ -0,0 +1,6 @@ +import { harTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/obfuscation-rules.txt b/07_ArkWebPageAdaptation/07_Complete/features/learning/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..985b2aeb7658286b17bd26eab8f217c3fe75ea8b --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/oh-package.json5 b/07_ArkWebPageAdaptation/07_Complete/features/learning/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d983b9a33765d22b0402dd2164362857f994accb --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "name": "learning", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "Index.ets", + "author": "", + "license": "Apache-2.0", + "dependencies": { + "@ohos/utils": "file:../../commons/utils", + "@ohos/uicomponents": "file:../../commons/uicomponents" + } +} diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/ets/pages/CourseLearning.ets b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/ets/pages/CourseLearning.ets new file mode 100644 index 0000000000000000000000000000000000000000..c5a4b209be50c0f29a355ba7e973da5ee5156e56 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/ets/pages/CourseLearning.ets @@ -0,0 +1,13 @@ +import { webview } from '@kit.ArkWeb'; + +@Component +export struct CourseLearning { + private webviewController: webview.WebviewController = new webview.WebviewController(); + + build() { + Column() { + Web({ src: $rawfile('course_learning/index.html'), controller: this.webviewController }) + .domStorageAccess(true) + } + } +} \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/module.json5 b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..58b64c27fd96a4d88b4a7949bf91021aefce6fcf --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/module.json5 @@ -0,0 +1,11 @@ +{ + "module": { + "name": "learning", + "type": "har", + "deviceTypes": [ + "default", + "tablet", + "2in1" + ] + } +} diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/base/element/string.json b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/en_US/element/string.json b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/en_US/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/asset-manifest.json b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/asset-manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..e0a95528e1995861a76ff38968384e751ae81645 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/asset-manifest.json @@ -0,0 +1,13 @@ +{ + "files": { + "main.css": "./static/css/main.9a55d7a9.css", + "main.js": "./static/js/main.b1cba247.js", + "index.html": "./index.html", + "main.9a55d7a9.css.map": "./static/css/main.9a55d7a9.css.map", + "main.b1cba247.js.map": "./static/js/main.b1cba247.js.map" + }, + "entrypoints": [ + "static/css/main.9a55d7a9.css", + "static/js/main.b1cba247.js" + ] +} \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/banner.png b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/banner.png new file mode 100644 index 0000000000000000000000000000000000000000..30795e1ac5eef098af60d3992331da83deb9693d Binary files /dev/null and b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/banner.png differ diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_1.png b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_1.png new file mode 100644 index 0000000000000000000000000000000000000000..95bb3c0b7448fc72fa12d0ebe033781596c3fdf0 Binary files /dev/null and b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_1.png differ diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_2.png b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_2.png new file mode 100644 index 0000000000000000000000000000000000000000..5c47b7fd296c547b0e776a18227fe030bd2d8db6 Binary files /dev/null and b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_2.png differ diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_3.png b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_3.png new file mode 100644 index 0000000000000000000000000000000000000000..efa449bb01256e1ec96d936679311b72fa55f991 Binary files /dev/null and b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_3.png differ diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_4.png b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_4.png new file mode 100644 index 0000000000000000000000000000000000000000..9a9700b5af5eb6f9715cc8ece25192a14cf4c9ee Binary files /dev/null and b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_4.png differ diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_5.png b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_5.png new file mode 100644 index 0000000000000000000000000000000000000000..fc5b7e91b41072f43a2fc3ae8cbfffc7c9236aa9 Binary files /dev/null and b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_5.png differ diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_6.png b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_6.png new file mode 100644 index 0000000000000000000000000000000000000000..af444c69139f798360359b3d08ec3f9e8ea65015 Binary files /dev/null and b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_6.png differ diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_7.png b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_7.png new file mode 100644 index 0000000000000000000000000000000000000000..93db46e9c99527e5279e7f59920708fedc1ec417 Binary files /dev/null and b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_7.png differ diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_8.png b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_8.png new file mode 100644 index 0000000000000000000000000000000000000000..e354e4a69c585000653f77a2b446a5b4526c2f96 Binary files /dev/null and b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/course_cover_8.png differ diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/ic_book.svg b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/ic_book.svg new file mode 100644 index 0000000000000000000000000000000000000000..83133f71132232534d65f3d9237ea1e484cb7658 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/ic_book.svg @@ -0,0 +1,19 @@ + + + ic_DLP_college_kechengmdpi + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/ic_time.svg b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/ic_time.svg new file mode 100644 index 0000000000000000000000000000000000000000..53e6fa4d0ebc5d9e0394b6a0c02337edf173d274 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/assets/ic_time.svg @@ -0,0 +1,17 @@ + + + ic_DLP_college_timemdpi + + + + + + + + + + + + + + \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/css/reset.css b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/css/reset.css new file mode 100644 index 0000000000000000000000000000000000000000..7d40e6ce8725bb607e13174e53d8c0163eff21ea --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/css/reset.css @@ -0,0 +1,43 @@ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/index.html b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/index.html new file mode 100644 index 0000000000000000000000000000000000000000..f69d467766d27acb8d391ae4b6efac60bbef0205 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/index.html @@ -0,0 +1 @@ +React App
\ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/static/css/main.9a55d7a9.css b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/static/css/main.9a55d7a9.css new file mode 100644 index 0000000000000000000000000000000000000000..ec8a1d80fa739d4ccbb86f6c2ae92380e6e8c811 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/static/css/main.9a55d7a9.css @@ -0,0 +1,2 @@ +body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-color:#f1f3f5;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.App{text-align:center}.App-logo{height:40vmin;pointer-events:none}@media (prefers-reduced-motion:no-preference){.App-logo{animation:App-logo-spin 20s linear infinite}}.App-header{align-items:center;background-color:#282c34;color:#fff;display:flex;flex-direction:column;font-size:calc(10px + 2vmin);justify-content:center;min-height:100vh}.App-link{color:#61dafb}@keyframes App-logo-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}:root{--containerPadding:0;--bannerHeight:168px;--innerBoxTop:0px;--innerBoxLeft:0px}@media screen and (min-width:320px)and (max-width:600px){:root{--containerPadding:16px}}@media screen and (min-width:600px)and (max-width:1000px){:root{--bannerHeight:168px;--containerPadding:24px}}@media screen and (min-width:1000px)and (max-width:1500px){:root{--bannerHeight:230px;--innerBoxTop:54px;--innerBoxLeft:94px;--containerPadding:32px}}@media screen and (min-width:1500px){:root{--bannerHeight:372px;--innerBoxTop:109px;--innerBoxLeft:117px;--containerPadding:40px}}.course_learing_box{padding:0;padding:0 var(--containerPadding)}.course_learing_box .complexBanner{background-color:#e7e9ec;border-radius:16px;height:168px;height:var(--bannerHeight);overflow:hidden;position:relative;transition:all .3s ease-in-out;width:100%}.course_learing_box .complexBanner .inner_banner{height:100%;text-align:right}.course_learing_box .complexBanner .inner_banner img{height:100%}.course_learing_box .complexBanner .inner_description{left:0;left:var(--innerBoxLeft);position:absolute;top:0;top:var(--innerBoxTop)}.course_learing_box .complexBanner .inner_description .innner_page_title{color:#000;font-family:HarmonyHeiTi-Bold;font-size:36px;font-weight:700;line-height:33px;margin-bottom:18px;text-align:left}.course_learing_box .complexBanner .inner_description .inner_brief{color:#0009;font-family:HarmonyHeiTi;font-size:18px;font-weight:400;height:72px;text-align:left;width:522px}.course_learing_box .page_title{color:#000;font-family:HarmonyHeiTi-Bold;font-size:24px;font-weight:700;line-height:33px;text-align:left}.course_learing_box .banner{background-color:#e7e9ec;border-radius:16px;height:168px;margin-top:19px;overflow:hidden;width:100%}.course_learing_box .banner img{height:100%}.course_learing_box .description{color:#0009;font-family:HarmonyHeiTi;font-size:14px;font-weight:400;margin-top:8px;text-align:left;width:100%}.course_learing_box .basic_course{color:#182431;font-family:HarmonyHeiTi-Medium;font-size:16px;font-weight:500;line-height:22px;margin-bottom:8.5px;margin-top:18px;text-align:left}.course_learing_box .course_box_container{align-items:center;display:flex;flex-wrap:wrap;justify-content:flex-start}.course_box{background-color:#f1f2f3;border-radius:16px;height:213px;overflow:hidden;width:100%}.course_box .cover{height:88px}.course_box .cover img{height:100%;object-fit:fill;width:100%}.course_box .down{background-color:#fff;height:calc(100% - 108px);padding:8px 12px 12px}.course_box .down .title{color:#000000e6;font-size:14px;height:19px;line-height:19px;margin-bottom:2px;text-overflow:ellipsis;-o-text-overflow:ellipsis;white-space:nowrap}.course_box .down .brief,.course_box .down .title{font-family:HarmonyHeiTi;font-weight:400;overflow:hidden;text-align:left}.course_box .down .brief{-webkit-line-clamp:2;-webkit-box-orient:vertical;color:#0009;display:-webkit-box;font-size:12px;height:32px;line-height:16px;margin-bottom:12px;text-overflow:ellipsis}.course_box .down .other_info .info_line{align-items:center;display:flex;height:16px;justify-content:flex-start;line-height:16px;text-align:left}.course_box .down .other_info .info_line .tips{color:#000;font-family:HarmonyHeiTi-Light;font-size:12px;font-weight:200;text-align:left}.course_box .down .other_info .info_line:first-child{margin-bottom:8px}.course_box .down .other_info .info_line img{height:16px;margin-right:4px;object-fit:contain;width:16px}.ant-row>.ant-col:last-child{padding-right:0} +/*# sourceMappingURL=main.9a55d7a9.css.map*/ \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/static/css/main.9a55d7a9.css.map b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/static/css/main.9a55d7a9.css.map new file mode 100644 index 0000000000000000000000000000000000000000..7e61983588c115704bbd3f43c82ba4b73a10dc76 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/static/css/main.9a55d7a9.css.map @@ -0,0 +1 @@ +{"version":3,"file":"static/css/main.9a55d7a9.css","mappings":"AAAA,KAKI,kCAAmC,CACnC,iCAAkC,CAClC,wBAAyB,CALzB,mIAEU,CAHV,QAOJ,CAEA,KACI,uEAEJ,CCbA,KACE,iBACF,CAEA,UACE,aAAc,CACd,mBACF,CAEA,8CACE,UACE,2CACF,CACF,CAEA,YAKE,kBAAmB,CAJnB,wBAAyB,CAOzB,UAAY,CALZ,YAAa,CACb,qBAAsB,CAGtB,4BAA6B,CAD7B,sBAAuB,CAJvB,gBAOF,CAEA,UACE,aACF,CAEA,yBACE,GACE,sBACF,CACA,GACE,uBACF,CACF,CChCA,MACE,oBAAqB,CACrB,oBAAqB,CACrB,iBAAkB,CAClB,kBAAmB,CAGrB,yDAEE,MACE,uBAAwB,CAAxB,CAIJ,0DAEE,MACE,oBAAqB,CACrB,uBAAwB,CAAxB,CAIJ,2DAEE,MACE,oBAAqB,CACrB,kBAAmB,CACnB,mBAAoB,CACpB,uBAAwB,CAAxB,CAIJ,qCAEE,MACE,oBAAqB,CACrB,mBAAoB,CACpB,oBAAqB,CACrB,uBAAwB,CAAxB,CAKJ,oBACE,4CAEA,mCAGE,yBACA,mBAFA,wCAGA,gBACA,kBACA,+BANA,UAMA,CAEA,iDACE,YACA,iBAEA,qDACE,YAIJ,sDAGE,gCAFA,kBACA,4BACA,CAEA,yEAGE,WAFA,8BACA,eAIA,gBADA,iBAEA,mBAHA,eAGA,CAGF,mEAKE,YAFA,yBACA,eAGA,gBALA,YAIA,gBALA,WAMA,CAMN,gCAGE,WAFA,8BACA,eAIA,gBADA,iBADA,eAEA,CAGF,4BAGE,yBACA,mBAFA,aAGA,gBACA,gBALA,UAKA,CAEA,gCAEE,YAKJ,iCAOE,YAFA,yBACA,eAGA,gBANA,eADA,gBADA,UAQA,CAGF,kCAGE,cAFA,gCACA,eAIA,gBADA,iBAGA,oBADA,gBAHA,eAIA,CAGF,0CAGE,mBAFA,aAGA,eAFA,0BAEA,CCpJJ,YAGE,yBACA,mBAFA,aAGA,gBAJA,UAIA,CAEA,mBACE,YAGA,uBAEE,YACA,gBAFA,UAEA,CAIJ,kBAGE,sBAFA,0BACA,qBACA,CAEA,yBAIE,gBADA,eAFA,YAOA,iBADA,kBAIA,uBACA,0BAFA,kBAEA,CAGF,kDAbE,yBAIA,gBAGA,gBAJA,eAuBA,CAbF,yBAWE,qBACA,4BAPA,YAKA,oBANA,eAHA,YACA,iBAWA,mBAJA,sBAIA,CAIA,yCAME,mBAFA,aAHA,YAIA,2BAFA,iBADA,eAIA,CAEA,+CAGE,WAFA,+BACA,eAGA,gBADA,eACA,CAGF,qDACE,kBAGF,6CAEE,YAEA,iBADA,mBAFA,UAGA,CAOV,6BACE","sources":["index.css","App.css","pages/CourseLearning/index.scss","components/CourseBox/index.scss"],"sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n background-color: #F1F3F5;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n",".App {\n text-align: center;\n}\n\n.App-logo {\n height: 40vmin;\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .App-logo {\n animation: App-logo-spin infinite 20s linear;\n }\n}\n\n.App-header {\n background-color: #282c34;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-size: calc(10px + 2vmin);\n color: white;\n}\n\n.App-link {\n color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n","//$padding: 16px;\r\n$SM_SIZE: 320px;\r\n$MD_SIZE: 600px;\r\n$LG_SIZE: 1000px;\r\n$XL_SIZE: 1500px;\r\n:root {\r\n --containerPadding: 0;\r\n --bannerHeight: 168px;\r\n --innerBoxTop: 0px;\r\n --innerBoxLeft: 0px;\r\n}\r\n\r\n@media screen and (min-width: $SM_SIZE) and (max-width: $MD_SIZE) {\r\n // sm时\r\n :root {\r\n --containerPadding: 16px;\r\n }\r\n}\r\n\r\n@media screen and (min-width: $MD_SIZE) and (max-width: $LG_SIZE) {\r\n // md时\r\n :root {\r\n --bannerHeight: 168px;\r\n --containerPadding: 24px;\r\n }\r\n}\r\n\r\n@media screen and (min-width: $LG_SIZE) and (max-width: $XL_SIZE) {\r\n // lg时\r\n :root {\r\n --bannerHeight: 230px;\r\n --innerBoxTop: 54px;\r\n --innerBoxLeft: 94px;\r\n --containerPadding: 32px;\r\n }\r\n}\r\n\r\n@media screen and (min-width: $XL_SIZE) {\r\n //xl时\r\n :root {\r\n --bannerHeight: 372px;\r\n --innerBoxTop: 109px;\r\n --innerBoxLeft: 117px;\r\n --containerPadding: 40px;\r\n }\r\n}\r\n\r\n\r\n.course_learing_box {\r\n padding: 0 var(--containerPadding);\r\n\r\n .complexBanner {\r\n width: 100%;\r\n height: var(--bannerHeight);\r\n background-color: #E7E9EC;\r\n border-radius: 16px;\r\n overflow: hidden;\r\n position: relative;\r\n transition: all ease-in-out .3s;\r\n\r\n .inner_banner {\r\n height: 100%;\r\n text-align: right;\r\n\r\n img {\r\n height: 100%;\r\n }\r\n }\r\n\r\n .inner_description {\r\n position: absolute;\r\n top: var(--innerBoxTop);\r\n left: var(--innerBoxLeft);\r\n\r\n .innner_page_title {\r\n font-family: HarmonyHeiTi-Bold;\r\n font-size: 36px;\r\n color: #000000;\r\n text-align: left;\r\n line-height: 33px;\r\n font-weight: 700;\r\n margin-bottom: 18px;\r\n }\r\n\r\n .inner_brief {\r\n width: 522px;\r\n height: 72px;\r\n font-family: HarmonyHeiTi;\r\n font-size: 18px;\r\n color: rgba(0, 0, 0, 0.60);\r\n text-align: left;\r\n font-weight: 400;\r\n }\r\n }\r\n }\r\n\r\n\r\n .page_title {\r\n font-family: HarmonyHeiTi-Bold;\r\n font-size: 24px;\r\n color: #000000;\r\n text-align: left;\r\n line-height: 33px;\r\n font-weight: 700;\r\n }\r\n\r\n .banner {\r\n width: 100%;\r\n height: 168px;\r\n background-color: #e7e9ec;\r\n border-radius: 16px;\r\n margin-top: 19px;\r\n overflow: hidden;\r\n\r\n img {\r\n //width: 100%;\r\n height: 100%;\r\n //object-fit: cover;\r\n }\r\n }\r\n\r\n .description {\r\n width: 100%;\r\n text-align: left;\r\n margin-top: 8px;\r\n //margin-bottom: 18px;\r\n font-family: HarmonyHeiTi;\r\n font-size: 14px;\r\n color: rgba(0, 0, 0, 0.60);\r\n //text-align: left;\r\n font-weight: 400;\r\n }\r\n\r\n .basic_course {\r\n font-family: HarmonyHeiTi-Medium;\r\n font-size: 16px;\r\n color: #182431;\r\n text-align: left;\r\n line-height: 22px;\r\n font-weight: 500;\r\n margin-top: 18px;\r\n margin-bottom: 8.5px;\r\n }\r\n\r\n .course_box_container {\r\n display: flex;\r\n justify-content: flex-start;\r\n align-items: center;\r\n flex-wrap: wrap;\r\n }\r\n}",".course_box {\r\n width: 100%;\r\n height: 213px;\r\n background-color: #f1f2f3;\r\n border-radius: 16px;\r\n overflow: hidden;\r\n\r\n .cover {\r\n height: 88px;\r\n //overflow: hidden;\r\n\r\n img {\r\n width: 100%;\r\n height: 100%;\r\n object-fit: fill;\r\n }\r\n }\r\n\r\n .down {\r\n height: calc(100% - 108px);\r\n padding: 8px 12px 12px 12px;\r\n background-color: #fff;\r\n\r\n .title {\r\n height: 19px;\r\n font-family: HarmonyHeiTi;\r\n font-size: 14px;\r\n color: rgba(0, 0, 0, 0.90);\r\n text-align: left;\r\n font-weight: 400;\r\n margin-bottom: 2px;\r\n line-height: 19px;\r\n overflow: hidden;\r\n white-space: nowrap;\r\n text-overflow: ellipsis; // clip设置属性为clip不显示点点点;\r\n -o-text-overflow: ellipsis; // clip设置属性为clip不显示点点点;\r\n }\r\n\r\n .brief {\r\n height: 32px;\r\n line-height: 16px;\r\n font-family: HarmonyHeiTi;\r\n font-size: 12px;\r\n color: rgba(0, 0, 0, 0.60);\r\n text-align: left;\r\n font-weight: 400;\r\n overflow: hidden;\r\n text-overflow: ellipsis; // clip设置属性为clip不显示点点点;\r\n display: -webkit-box;\r\n -webkit-line-clamp: 2;\r\n -webkit-box-orient: vertical;\r\n margin-bottom: 12px;\r\n }\r\n\r\n .other_info {\r\n .info_line {\r\n height: 16px;\r\n text-align: left;\r\n line-height: 16px;\r\n display: flex;\r\n justify-content: flex-start;\r\n align-items: center;\r\n\r\n .tips {\r\n font-family: HarmonyHeiTi-Light;\r\n font-size: 12px;\r\n color: #000000;\r\n text-align: left;\r\n font-weight: 200;\r\n }\r\n\r\n &:nth-child(1) {\r\n margin-bottom: 8px;\r\n }\r\n\r\n img {\r\n width: 16px;\r\n height: 16px;\r\n object-fit: contain;\r\n margin-right: 4px;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n.ant-row > .ant-col:last-child {\r\n padding-right: 0;\r\n\r\n}"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/static/js/main.b1cba247.js b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/static/js/main.b1cba247.js new file mode 100644 index 0000000000000000000000000000000000000000..7338b4fafd1a0ec81fb0c5183b0fab0acc0a7265 --- /dev/null +++ b/07_ArkWebPageAdaptation/07_Complete/features/learning/src/main/resources/rawfile/course_learning/static/js/main.b1cba247.js @@ -0,0 +1,3 @@ +/*! For license information please see main.b1cba247.js.LICENSE.txt */ +(()=>{var e={132:(e,t)=>{"use strict";var n,r=Symbol.for("react.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen");function g(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case a:case l:case i:case d:case p:return e;default:switch(e=e&&e.$$typeof){case s:case c:case f:case m:case h:case u:return e;default:return t}}case o:return t}}}n=Symbol.for("react.module.reference"),t.ForwardRef=f,t.isMemo=function(e){return g(e)===h}},816:(e,t,n)=>{"use strict";e.exports=n(132)},730:(e,t,n)=>{"use strict";var r=n(43),o=n(853);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n