diff --git a/AppScope/app.json5 b/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..6b5c29fecde866570ed361c12a01c70deadd0599 --- /dev/null +++ b/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.dialogHubSample", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:layered_image", + "label": "$string:app_name" + } +} diff --git a/AppScope/resources/base/element/string.json b/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1080233f01384411ec684b58955cb8808746fdd3 --- /dev/null +++ b/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MyApplication" + } + ] +} diff --git a/AppScope/resources/base/media/background.png b/AppScope/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..923f2b3f27e915d6871871deea0420eb45ce102f Binary files /dev/null and b/AppScope/resources/base/media/background.png differ diff --git a/AppScope/resources/base/media/foreground.png b/AppScope/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..97014d3e10e5ff511409c378cd4255713aecd85f Binary files /dev/null and b/AppScope/resources/base/media/foreground.png differ diff --git a/AppScope/resources/base/media/layered_image.json b/AppScope/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/AppScope/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/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..381eb507bc1eef9b5158e496dedab769e810b657 --- /dev/null +++ b/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 09efb7dcbf77033d8eb20d9ed1a325dda0b72c9b..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# CustomDialogSelectionAndDevelopment - -#### Description -本示例主要介绍如何给应用添加自定义样式的弹窗,包括非模态弹窗:文本提示、图文提示、操作提示等;以及模态弹窗:确认弹窗、隐私弹窗、进度条、操作列表、评论回复弹窗等。 - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md index 4007db1a9518eb7ebc22a0d030af513ca517c36c..b6540d9db94e0a4bac93a6eeb847c693f9ab7814 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,53 @@ -# CustomDialogSelectionAndDevelopment - -#### 介绍 -本示例主要介绍如何给应用添加自定义样式的弹窗,包括非模态弹窗:文本提示、图文提示、操作提示等;以及模态弹窗:确认弹窗、隐私弹窗、进度条、操作列表、评论回复弹窗等。 - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +# **实现自定义样式弹窗** +## 介绍 +本示例主要介绍如何给应用添加自定义样式的弹窗,包括非模态弹窗:文本提示、图文提示、操作提示等;以及模态弹窗:确认弹窗、隐私弹窗、进度条、操作列表、评论回复弹窗等。旨在帮助开发者了解 +如何实现这些弹窗,给应用添加这些交互弹窗,也能提升用户体验。 +## 预览效果 +![](screenshots/device/image.png) +## 工程目录 +``` +├──entry/src/main/ets // 代码区 +│ ├──entryability +│ | └──EntryAbility.ets // 程序入口类 +│ ├──entrybackupability +│ | └──EntryBackupAbility.ets +│ ├──pages +│ | ├──AgreementPage.ets // 隐私协议页面 +│ | ├──CommentList.ets // 评论回复弹窗 +│ | ├──Index.ets // 首页 +│ | ├──NavigationDialog.ets // 导航弹窗 +│ | └──PrivacyDialog.ets // 隐私弹窗 +| ├──uiComponent.ets +│ | ├──ItemHead.ets // 首页标题 +│ | └──SubItemHead.ets // 首页副标题 +| └──utils.ets +│ └──PromptActionClass.ets // 自定义弹窗 +└──entry/src/main/resources // 应用资源目录 +``` + +## 相关概念 + +* 非模态弹窗:用户可忽略弹窗,继续操作其他内容。弹窗出现时,背景界面仍可点击或滚动。通常自动消失或手动轻触关闭。 +* 模态弹窗:用户必须处理弹窗内容(点击按钮或关闭),否则无法操作其他界面。弹窗出现时,背景内容通常变暗或模糊(防止误触)。 + +## 使用说明 +1. 打开应用首页,点击文本提示,展示文本提示弹框。 +2. 打开应用首页,点击图文提示,展示图文提示弹框。 +3. 打开应用首页,点击操作提示,展示操作提示弹框。 +4. 打开应用首页,点击确认弹窗,展示确认弹窗,需点击确认按钮关闭。 +5. 打开应用首页,点击隐私弹窗,跳转至二级页面,点击按钮打开隐私弹窗,点击隐私协议跳转到二级页面,返回后隐私弹窗不消失。 +6. 打开应用首页,点击进度条,展示进度条弹框,点击暂停后,进度停止增长;点击开始后,进度继续增长。 +7. 打开应用首页,点击操作列表,展示操作列表弹框。 +8. 打开应用首页,点击评论回复弹窗,展示评论回复弹窗。 + +## 相关权限 +不涉及。 + +## 约束与限制 +* 本示例仅支持标准系统上运行,支持设备:华为手机。 + +* HarmonyOS系统:HarmonyOS 5.0.5 Release及以上。 + +* DevEco Studio版本:DevEco Studio 5.0.5 Release及以上。 + +* HarmonyOS SDK版本:HarmonyOS 5.0.5 Release SDK及以上。 \ No newline at end of file diff --git a/build-profile.json5 b/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ac6267b0851a7098a8b72e2f519b4112c177d655 --- /dev/null +++ b/build-profile.json5 @@ -0,0 +1,41 @@ +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.5(17)", + "runtimeOS": "HarmonyOS", + "buildOption": { + "strictMode": { + "caseSensitiveCheck": true, + "useNormalizedOHMUrl": true + } + } + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/code-linter.json5 b/code-linter.json5 new file mode 100644 index 0000000000000000000000000000000000000000..073990fa45394e1f8e85d85418ee60a8953f9b99 --- /dev/null +++ b/code-linter.json5 @@ -0,0 +1,32 @@ +{ + "files": [ + "**/*.ets" + ], + "ignore": [ + "**/src/ohosTest/**/*", + "**/src/test/**/*", + "**/src/mock/**/*", + "**/node_modules/**/*", + "**/oh_modules/**/*", + "**/build/**/*", + "**/.preview/**/*" + ], + "ruleSet": [ + "plugin:@performance/recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "@security/no-unsafe-aes": "error", + "@security/no-unsafe-hash": "error", + "@security/no-unsafe-mac": "warn", + "@security/no-unsafe-dh": "error", + "@security/no-unsafe-dsa": "error", + "@security/no-unsafe-ecdsa": "error", + "@security/no-unsafe-rsa-encrypt": "error", + "@security/no-unsafe-rsa-sign": "error", + "@security/no-unsafe-rsa-key": "error", + "@security/no-unsafe-dsa-key": "error", + "@security/no-unsafe-dh-key": "error", + "@security/no-unsafe-3des": "error" + } +} \ No newline at end of file diff --git a/entry/build-profile.json5 b/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..4d611879c7913fb0610c686e2399258ab3a6dad1 --- /dev/null +++ b/entry/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/entry/hvigorfile.ts b/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/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/entry/obfuscation-rules.txt b/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..272efb6ca3f240859091bbbfc7c5802d52793b0b --- /dev/null +++ b/entry/obfuscation-rules.txt @@ -0,0 +1,23 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/entry/oh-package.json5 b/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..248c3b7541a589682a250f86a6d3ecf7414d2d6a --- /dev/null +++ b/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/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..656c020b013a8319f58535f64787d32406022bd7 --- /dev/null +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +const DOMAIN = 0x0000; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); + return; + } + hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.'); + }); + let windowClass: window.Window = windowStage.getMainWindowSync(); + let isLayoutFullScreen = true; + windowClass.setWindowLayoutFullScreen(isLayoutFullScreen); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); + } +} \ No newline at end of file diff --git a/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..0a97e21bd7a15599af76a806695860ff1eb0ebfe --- /dev/null +++ b/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +const DOMAIN = 0x0000; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(DOMAIN, 'testTag', 'onBackup ok'); + await Promise.resolve(); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + await Promise.resolve(); + } +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/AgreementPage.ets b/entry/src/main/ets/pages/AgreementPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..c7b0610d0d9cd31fc34fef84425a7a15e46ea33f --- /dev/null +++ b/entry/src/main/ets/pages/AgreementPage.ets @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// [Start AgreementPage] +@Component +export struct AgreementPage { + build() { + NavDestination() { + Scroll() { + Column() { + Image($r('app.media.privacy')) + .width(30) + .height(30) + Text($r('app.string.privacy_title')) + .fontSize(20) + .margin({ top: 12 }) + .fontWeight(700) + .height(28) + + Text($r('app.string.update_date')) + .fontSize(16) + .margin({ top: 2 }) + .fontColor(Color.Gray) + .fontWeight(700) + .height(28) + + Column() { + Text($r('app.string.introductory_1')) + .lineHeight(24) + } + .width('100%') + .margin({ top: 24 }) + + Column() { + Text() { + Span($r('app.string.introductory_2')) + .margin({ bottom: 8 }) + Span($r('app.string.introductory_3')) + .lineHeight(24) + } + } + .width('100%') + .margin({ top: 24 }) + .alignItems(HorizontalAlign.Start) + + Column() { + Text() { + Span($r('app.string.introductory_4')) + .lineHeight(24) + Span($r('app.string.introductory_5')) + .lineHeight(24) + } + } + .width('100%') + .margin({ top: 24 }) + .alignItems(HorizontalAlign.Start) + } + .width('100%') + .height('100%') + .margin({ bottom: 16 }) + .padding({ + left: 12, + right: 12 + }) + } + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + .padding({ + left: 16, + right: 16 + }) + } + .height('100%') + .backgroundColor('#F1F3F5') + } +} + +// [End AgreementPage] \ No newline at end of file diff --git a/entry/src/main/ets/pages/CommentList.ets b/entry/src/main/ets/pages/CommentList.ets new file mode 100644 index 0000000000000000000000000000000000000000..b09eb3ef04a6bf4b90c88411f1347f711c10f4ff --- /dev/null +++ b/entry/src/main/ets/pages/CommentList.ets @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NavigationDialog } from './NavigationDialog'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +class Person { + image: ResourceStr = ''; + nickName: ResourceStr = ''; + comment: ResourceStr = ''; + place: ResourceStr = ''; + number: string = ''; +} + +let personList: Array = [ + { + image: $r('app.media.friend_1'), + nickName: $r('app.string.nick_name_1'), + comment: $r('app.string.comment_1'), + place: $r('app.string.place_1'), + number: '876' + }, + { + image: $r('app.media.friend_2'), + nickName: $r('app.string.nick_name_2'), + comment: $r('app.string.comment_2'), + place: $r('app.string.place_2'), + number: '323' + }, + { + image: $r('app.media.friend_1'), + nickName: $r('app.string.nick_name_3'), + comment: $r('app.string.comment_3'), + place: $r('app.string.place_3'), + number: '666' + }, + { + image: $r('app.media.friend_2'), + nickName: $r('app.string.nick_name_4'), + comment: $r('app.string.comment_4'), + place: $r('app.string.place_4'), + number: '999' + }, + { + image: $r('app.media.friend_1'), + nickName: $r('app.string.nick_name_5'), + comment: $r('app.string.comment_5'), + place: $r('app.string.place_5'), + number: '111' + }, + { + image: $r('app.media.friend_1'), + nickName: $r('app.string.nick_name_1'), + comment: $r('app.string.comment_1'), + place: $r('app.string.place_1'), + number: '876' + }, + { + image: $r('app.media.friend_2'), + nickName: $r('app.string.nick_name_2'), + comment: $r('app.string.comment_2'), + place: $r('app.string.place_2'), + number: '323' + } +]; + +@Component +export struct CommentList { + private operateButtonIcons: Resource[] = [ + $r('app.media.paper_plane') + ] + @Consume('NavPathStack') pageStack: NavPathStack; + + aboutToDisappear(): void { + AppStorage.setOrCreate('commentListHeight', 0); + } + + closeCommentList = () => { + this.pageStack.pop(); + } + onCommentListAreaChange = (oldArea: Area, newArea: Area) => { + AppStorage.setOrCreate('commentListHeight', newArea.height); + hilog.info(0x0001, "dialog", JSON.stringify(oldArea)); + } + + @Builder + TitleBar() { + Row() { + Text($r('app.string.comment_list_title')) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Blank() + Button() { + Image($r('app.media.cancel')) + .width(18) + } + .padding(10) + .backgroundColor('rgba(0, 0, 0, 0.05)') + .onClick(this.closeCommentList) + } + .padding(15) + .width('100%') + } + + @Builder + ToolBar() { + Row({ space: 10 }) { + Button($r('app.string.comment_button_text')) + .layoutWeight(1) + .align(Alignment.Start) + .backgroundColor('rgba(0, 0, 0, 0.05)') + .fontColor('rgba(0, 0, 0, 0.6)') + ForEach(this.operateButtonIcons, (icon: Resource) => { + Image(icon) + .width(24) + }) + } + .padding(10) + } + + build() { + NavigationDialog() { + Column() { + this.TitleBar() + List() { + ForEach(personList, (item: Person) => { + ListItem() { + Column() { + Row() { + Row() { + Image(item.image) + .width(36) + .height(36) + Text(item.nickName) + .fontSize(14) + .margin({ left: 12 }) + } + + Row() { + Text(item.number) + .fontSize(12) + .fontColor(Color.Gray) + Image($r('app.media.heart')) + .width(16) + .height(16) + .margin({ left: 8 }) + } + } + .width('100%') + .justifyContent(FlexAlign.SpaceBetween) + + Column() { + Text(item.comment) + .margin({ left: 48 }) + Text() { + Span(item.place) + .fontColor(Color.Gray) + .margin({ right: 8 }) + Span($r('app.string.reply')) + } + .margin({ left: 48, top: 12 }) + .fontSize(12) + } + .alignItems(HorizontalAlign.Start) + .width('100%') + } + .height(100) + } + }, (item: Person) => JSON.stringify(item)) + } + .padding({ left: 16, right: 16 }) + .width('100%') + .height('auto') + + this.ToolBar() + } + .borderRadius({ topLeft: 16, topRight: 16 }) + .backgroundColor('#F1F3F5') + .onAreaChange(this.onCommentListAreaChange) + } + } +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..ab801a4b5dd0e5bdf0de54ce6dda71a3f4a59880 --- /dev/null +++ b/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,595 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BusinessError } from '@kit.BasicServicesKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { ComponentContent, PromptAction, promptAction } from '@kit.ArkUI'; +import { ItemHead } from '../uiComponent/ItemHead'; +import { SubItemHead } from '../uiComponent/SubItemHead'; +import { PromptActionClass } from '../utils/PromptActionClass'; +import { AgreementPage } from './AgreementPage'; +import { CommentList } from './CommentList'; +import { PrivacyDialog } from './PrivacyDialog'; + +let timer: number = 0; +let getUIContext: UIContext; +let contentNode: ComponentContent; +let progressContentNode: ComponentContent; +let actionTipsContentNode: ComponentContent; +let imageTipsContentNode: ComponentContent; +let isOn: boolean = false; +let value: number = 0; + +class Params { + text: ResourceStr = ''; + + constructor(text: ResourceStr) { + this.text = text; + } +} + +class ProgressParams { + text: ResourceStr = ''; + value: number = 0; + isOn: boolean = false; + + constructor(text: ResourceStr, value: number, isOn: boolean) { + this.text = text; + this.value = value; + this.isOn = isOn; + } +} + +class ActionParams { + text: ResourceStr = ''; + text2: ResourceStr = ''; + + constructor(text: ResourceStr, text2: ResourceStr) { + this.text = text; + this.text2 = text2; + } +} + +class ActionListParams { + text: ResourceStr = ''; + text2?: ResourceStr = ''; + + constructor(text: ResourceStr, text2?: ResourceStr) { + this.text = text; + this.text2 = text2; + } +} + +// [Start image_text] +// Graphic and text prompt. +@Builder +function buildText(params: Params) { + // [Start image_text_style] + Row() { + Image($r('app.media.checkmark_circle')) + .width(24) + .height(24) + .margin({ right: 16 }) + Text(params.text) + .fontSize(16) + } + .focusable(false) + // [End image_text_style] + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.White) + .padding({ left: 24, right: 24 }) + .height(50) + .borderRadius(24) +} + +// [End image_text] + +// Operation prompt. +@Builder +function buildActionTips(params: ActionParams) { + Row() { + Row() { + Image($r('app.media.checkmark_circle_fill')) + .width(24) + .height(24) + .margin({ right: 8 }) + Text(params.text) + .fontSize(16) + } + + Row() { + Text(params.text2) + .fontSize(16) + .margin({ right: 8 }) + Image($r('app.media.chevron_right')) + .width(12) + .height(12) + } + .onClick(() => { + promptAction.showToast({ + message: $r('app.string.after'), + duration: 2000, + showMode: promptAction.ToastShowMode.DEFAULT, + bottom: 48 + }); + }) + } + .justifyContent(FlexAlign.SpaceBetween) + .backgroundColor(Color.White) + .padding({ left: 16, right: 16 }) + .width(350) + .height(50) + .borderRadius(24) +} + +// Progress bar +@Builder +function buildProgress(params: ProgressParams) { + Column() { + Row() { + Column() { + Row() { + Text(params.text) + .fontSize(16) + Text(`${params.value}%`) + .fontColor(Color.Gray) + } + .width('100%') + .justifyContent(FlexAlign.SpaceBetween) + + Progress({ value: 0, total: 100, type: ProgressType.Linear }) + .width('100%') + .height(20) + .value(params.value) + .margin({ top: 12 }) + } + .width('80%') + + Row() { + Image($r('app.media.mark_circle_fill')) + .width(30) + .height(30) + .onClick(() => { + PromptActionClass.closeDialog(progressContentNode); + }) + } + .margin({ left: 12, top: 30 }) + } + + // [Start Progress] + Text(isOn ? $r('app.string.pause') : $r('app.string.start')) + .fontSize(16) + .fontColor('#0A59F7') + .margin({ top: 8 }) + .onClick(() => { + isOn = !isOn; + if (isOn) { + timer = setInterval(() => { + if (value === 100) { + value = 0; + } + value += 10; + progressContentNode.update(new ProgressParams($r('app.string.progress'), value, isOn)); + }, 1000) + } else { + clearInterval(timer); + } + progressContentNode.update(new ProgressParams($r('app.string.progress'), value, isOn)); + }) + // [End Progress] + } + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.SpaceEvenly) + .backgroundColor('#FFF0F0F0') + .padding({ + left: 24, + right: 24, + top: 16, + bottom: 16 + }) + .width(320) + .height(140) + .borderRadius(24) +} + +let actionList: Array = [ + new ActionListParams($r('app.string.not_interested'), $r('app.string.reduce')), + new ActionListParams($r('app.string.shield'), $r('app.string.share')) +] + +// Operation list +@Builder +function buildActionList() { + Column() { + List() { + ListItemGroup() { + ForEach(actionList, (item: ActionListParams) => { + ListItem() { + Row() { + Text(item.text).fontSize(16) + Text(item.text2).fontSize(14) + .fontColor(Color.Gray) + } + .width('100%') + .height(50) + .justifyContent(FlexAlign.SpaceBetween) + } + + }, (item: ActionListParams) => JSON.stringify(item)) + } + .divider({ strokeWidth: 1, color: '#F8F8FF' }) + } + .backgroundColor(Color.White) + .width('100%') + .height('auto') + .padding({ + left: 16, + right: 16, + top: 8, + bottom: 8 + }) + .borderRadius(16) + } + .padding(16) + .width('100%') +} + +// Confirm the pop-up window +@Builder +function customDialogComponent() { + Column() { + Column() { + Text($r('app.string.cancel')).fontSize(20) + .fontWeight(FontWeight.Bold) + Text($r('app.string.cancel_user')) + .fontSize(16) + .fontColor(Color.Gray) + } + .justifyContent(FlexAlign.SpaceEvenly) + .height(120) + + Row() { + Text($r('app.string.think_again')) + .fontColor('#0A59F7') + .onClick(() => { + PromptActionClass.closeDialog(contentNode); + }) + .width('50%') + .height('100%') + .textAlign(TextAlign.Center) + + Text($r('app.string.confirm')) + .fontColor('#0A59F7') + .onClick(() => { + PromptActionClass.closeDialog(contentNode); + }) + .width('50%') + .height('100%') + .textAlign(TextAlign.Center) + } + .height(50) + } + .width(350) + .padding({ bottom: 8 }) + .borderRadius(32) + .backgroundColor(Color.White) +} + +class objectParams { + img: ResourceStr = '' + text: ResourceStr = '' +} + +@Entry +@Component +struct Index { + @State message: ResourceStr = $r('app.string.tips'); + promptAction: PromptAction = this.getUIContext().getPromptAction(); + @Provide('NavPathStack') pathStack: NavPathStack = new NavPathStack(); + @State customPopup: boolean = false; + @State listCustomPopup: boolean = false; + @State simpleList: objectParams[] = [ + { + img: $r('app.media.line_viewfinder'), + text: $r('app.string.scan') + }, + { + img: $r('app.media.star'), + text: $r('app.string.collect') + }, + { + img: $r('app.media.setting'), + text: $r('app.string.setting') + } + ]; + + aboutToAppear(): void { + AppStorage.setOrCreate('NavPathStack', this.pathStack); + getUIContext = this.getUIContext(); + contentNode = new ComponentContent(getUIContext, wrapBuilder(customDialogComponent)); + imageTipsContentNode = new ComponentContent(getUIContext, wrapBuilder(buildText), new Params(this.message)); + actionTipsContentNode = new ComponentContent(getUIContext, wrapBuilder(buildActionTips), + new ActionParams($r('app.string.collection_successful'), $r('app.string.join_the_album'))) + progressContentNode = new ComponentContent(getUIContext, wrapBuilder(buildProgress), + new ProgressParams($r('app.string.progress'), value, false)); + } + + @Builder + PagesMap(name: string) { + if (name === 'AgreementPage') { + AgreementPage(); + } else if (name === 'PrivacyDialog') { + PrivacyDialog(); + } else if (name === 'CommentList') { + CommentList(); + } + } + + build() { + Navigation(this.pathStack) { + Column() { + // Not modal dialog. + ItemHead($r('app.string.non_modal_dialog')) + SubItemHead($r('app.string.tips_title')) + List() { + ListItemGroup() { + ListItem() { + Text($r('app.string.text_tips')) + .onClick(() => { + // Show toast + this.getUIContext().getPromptAction().showToast({ + message: $r('app.string.message'), + duration: 2000, + showMode: promptAction.ToastShowMode.DEFAULT, + bottom: 48 + }); + }) + .width('100%') + } + .height(40) + + ListItem() { + Text($r('app.string.img_tips')) + .onClick(() => { + // [Start image_text_tips] + // Open the graphic and text prompts + let uiContext = this.getUIContext(); + PromptActionClass.setContext(uiContext); + PromptActionClass.setContentNode(imageTipsContentNode); + PromptActionClass.setOptions({ + isModal: false, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -80 } + }); + PromptActionClass.openDialog(); + setTimeout(() => { + PromptActionClass.closeDialog(imageTipsContentNode); + }, 3000) + // [End image_text_tips] + }) + .width('100%') + } + .height(40) + + ListItem() { + Text($r('app.string.operate_tips')) + .onClick(() => { + // Open the operation prompt + let uiContext = this.getUIContext(); + PromptActionClass.setContext(uiContext); + PromptActionClass.setContentNode(actionTipsContentNode); + PromptActionClass.setOptions({ + isModal: false, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -80 } + }); + PromptActionClass.openDialog(); + setTimeout(() => { + PromptActionClass.closeDialog(actionTipsContentNode); + }, 3000) + }) + .width('100%') + } + .height(40) + } + .divider({ strokeWidth: 1, color: '#F3F3F3' }) + } + .backgroundColor(Color.White) + .width('100%') + .height('auto') + .padding({ + left: 16, + right: 16, + top: 4, + bottom: 4 + }) + .borderRadius(16) + + // Modal dialog. + ItemHead($r('app.string.modal_dialog')) + SubItemHead($r('app.string.dialog')) + List() { + ListItemGroup() { + ListItem() { + Text($r('app.string.confirm_dialog')) + .onClick(() => { + // Open the confirmation pop-up window + let uiContext = this.getUIContext(); + PromptActionClass.setContext(uiContext); + PromptActionClass.setContentNode(contentNode); + PromptActionClass.setOptions({ autoCancel: false }); + PromptActionClass.openDialog(); + }) + .width('100%') + } + .height(40) + + ListItem() { + Row() { + Text($r('app.string.privacy_dialog')) + Image($r('app.media.chevron_right_gray')) + .width(14) + .height(14) + } + .onClick(() => { + this.pathStack.pushPathByName('PrivacyDialog', ''); + }) + .width('100%') + .justifyContent(FlexAlign.SpaceBetween) + } + .height(40) + + ListItem() { + Text($r('app.string.progress_dialog')) + .onClick(() => { + // [Start progress_bar] + // Open the progress bar pop-up window + let uiContext = this.getUIContext(); + PromptActionClass.setContext(uiContext); + PromptActionClass.setContentNode(progressContentNode); + PromptActionClass.setOptions({ + autoCancel: true, + // [Start animation] + transition: TransitionEffect.asymmetric( + TransitionEffect.OPACITY + .animation({ duration: 1000 }) + , + TransitionEffect.OPACITY + .animation({ delay: 500, duration: 1000 }) + ) + // [End animation] + }) + PromptActionClass.openDialog(); + // [End progress_bar] + }) + .width('100%') + } + .height(40) + } + .divider({ strokeWidth: 1, color: '#F3F3F3' }) + } + .backgroundColor(Color.White) + .width('100%') + .height('auto') + .padding({ + left: 16, + right: 16, + top: 4, + bottom: 4 + }) + .borderRadius(16) + .margin({ bottom: 4 }) + + SubItemHead($r('app.string.operation')) + List() { + ListItemGroup() { + ListItem() { + // [Start operation_list] + Text($r('app.string.operation_list')) + .onClick(() => { + // Open the operation list pop-up window + let contentNode = + new ComponentContent(this.getUIContext(), wrapBuilder(buildActionList)); + let uiContext = this.getUIContext(); + let uniqueId = this.getUniqueId(); + let frameNode: FrameNode | null = uiContext.getFrameNodeByUniqueId(uniqueId); + let targetId = frameNode?.getFirstChild()?.getUniqueId(); + uiContext.openBindSheet(contentNode, { + title: { title: $r('app.string.more') }, + height: SheetSize.MEDIUM, + backgroundColor: '#F1F3F5', + preferType: SheetType.BOTTOM + }, targetId) + .then(() => { + hilog.info(0xFF00, 'TAG', 'openBindSheet success'); + }) + .catch((err: BusinessError) => { + hilog.info(0xFF00, 'TAG', 'openBindSheet error: ' + err.code + ' ' + err.message); + }) + }) + .width('100%') + // [End operation_list] + } + .height(40) + + ListItem() { + Text($r('app.string.list')) + .onClick(() => { + // Open the pop-up window of the variable height operation list + let contentNode = + new ComponentContent(this.getUIContext(), wrapBuilder(buildActionList)); + let uiContext = this.getUIContext(); + let uniqueId = this.getUniqueId(); + let frameNode: FrameNode | null = uiContext.getFrameNodeByUniqueId(uniqueId); + let targetId = frameNode?.getFirstChild()?.getUniqueId(); + // [Start operation_list_variable] + uiContext.openBindSheet(contentNode, { + title: { title: $r('app.string.more') }, + height: SheetSize.MEDIUM, + backgroundColor: '#F1F3F5', + preferType: SheetType.BOTTOM, + detents: [SheetSize.MEDIUM, SheetSize.LARGE, 200] + }, targetId) + .then(() => { + hilog.info(0xFF00, 'TAG', 'openBindSheet success'); + }) + .catch((err: BusinessError) => { + hilog.info(0xFF00, 'TAG', 'openBindSheet error: ' + err.code + ' ' + err.message); + }) + // [End operation_list_variable] + }) + .width('100%') + } + .height(40) + + ListItem() { + Text($r('app.string.comment_reply_dialog')) + .onClick(() => { + this.pathStack.pushPathByName('CommentList', ''); + }) + .width('100%') + } + .height(40) + } + .divider({ strokeWidth: 1, color: '#F3F3F3' }) + } + .backgroundColor(Color.White) + .width('100%') + .height('auto') + .borderRadius(16) + .padding({ + left: 16, + right: 16, + top: 4, + bottom: 4 + }) + } + .padding({ + left: 16, + right: 16 + }) + .height('100%') + } + .padding({ + top: 32, + bottom: 36 + }) + .backgroundColor('#F1F3F5') + .navDestination(this.PagesMap) + .width('100%') + .height('100%') + .hideToolBar(true) + } +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/NavigationDialog.ets b/entry/src/main/ets/pages/NavigationDialog.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f0a520a417cac2ae2869cb1629873dcb1b07b35 --- /dev/null +++ b/entry/src/main/ets/pages/NavigationDialog.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// [Start navigation_dialog] +@Component +export struct NavigationDialog { + @Consume('NavPathStack') pageStack: NavPathStack; + @Prop alignContent: Alignment = Alignment.Bottom; + @Prop maskBackgroundColor: ResourceColor + + @Builder + DefaultContentBuilder() {} + + @BuilderParam + contentBuilderParam: () => void = this.DefaultContentBuilder + + onClose = () => { + this.pageStack.pop(); + } + + build() { + NavDestination() { + Stack() { + Column() + .height('100%') + .width('100%') + .backgroundColor(this.maskBackgroundColor) + .onClick(this.onClose) + this.contentBuilderParam() + } + .height('100%') + .alignContent(this.alignContent) + } + .mode(NavDestinationMode.DIALOG) + .hideTitleBar(true) + .expandSafeArea([SafeAreaType.KEYBOARD]) + .hideToolBar(true) + } +} +// [End navigation_dialog] \ No newline at end of file diff --git a/entry/src/main/ets/pages/PrivacyDialog.ets b/entry/src/main/ets/pages/PrivacyDialog.ets new file mode 100644 index 0000000000000000000000000000000000000000..798fa495252b35c5046155a446bb4bf8d71f027f --- /dev/null +++ b/entry/src/main/ets/pages/PrivacyDialog.ets @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ComponentContent, LevelMode } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { PromptActionClass } from '../utils/PromptActionClass'; + +let getUIContext: UIContext; +let privacyContentNode: ComponentContent; + +@Builder +function buildActionTips() { + Stack({ alignContent: Alignment.Center }) { + Column() { + Text($r('app.string.agreement_tips')) + .fontSize(20) + .fontWeight(700) + Row({ space: 4 }) { + Text() { + Span($r('app.string.sign_in_and_agree')) + Span($r('app.string.user_authentication_protocol')) + .fontColor('#0A59F7') + .onClick(() => { + let pathStack = AppStorage.get('NavPathStack') as NavPathStack; + pathStack.pushPathByName('AgreementPage', ''); + }) + } + + } + .width('100%') + .margin({ + top: 24, + bottom: 16 + }) + .justifyContent(FlexAlign.Start) + .padding({ left: 12 }) + + Row() { + Text($r('app.string.rejected')) + .fontSize(16) + .fontColor('#0A59F7') + .layoutWeight(1) + .textAlign(TextAlign.Center) + .width(140) + .height(40) + .lineHeight(24) + .onClick(() => { + PromptActionClass.closeDialog(privacyContentNode); + }) + + Text($r('app.string.confirm_login')) + .fontSize(16) + .fontColor('#0A59F7') + .layoutWeight(1) + .textAlign(TextAlign.Center) + .width(140) + .height(40) + .lineHeight(24) + .onClick(() => { + PromptActionClass.closeDialog(privacyContentNode); + }) + } + .width('100%') + } + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + .backgroundColor(Color.White) + .borderRadius(32) + .padding(16) + } + .padding(16) + .height('100%') + .width('100%') +} + +@Component +export struct PrivacyDialog { + @State isShowSheet: boolean = false; + @Consume('NavPathStack') pageStack: NavPathStack; + + aboutToAppear(): void { + getUIContext = this.getUIContext(); + privacyContentNode = new ComponentContent(getUIContext, wrapBuilder(buildActionTips)); + } + + build() { + NavDestination() { + // [Start privacy_dialog] + Column() { + Row() { + Button('OPEN') + .id('privacyDialog') + .fontSize(16) + .width('100%') + .borderRadius(20) + .margin({ bottom: 16 }) + .backgroundColor('#0A59F7') + .onClick(() => { + const node: FrameNode | null = this.getUIContext().getFrameNodeById('privacyDialog'); + let uiContext = this.getUIContext(); + PromptActionClass.setContext(uiContext); + PromptActionClass.setContentNode(privacyContentNode); + // [Start privacy_dialog_setOptions] + PromptActionClass.setOptions({ + levelMode: LevelMode.EMBEDDED, + levelUniqueId: node?.getUniqueId(), + onWillDismiss: (dismissDialogAction: DismissDialogAction) => { + hilog.info(0xFF00, 'TAG', JSON.stringify(dismissDialogAction.reason)); + } + }) + // [End privacy_dialog_setOptions] + PromptActionClass.openDialog(); + }) + } + .width('100%') + .alignItems(VerticalAlign.Center) + } + .width('100%') + .height('100%') + .padding({ + left: 16, + right: 16 + }) + .justifyContent(FlexAlign.End) + // [End privacy_dialog] + } + .hideToolBar(true) + .width('100%') + .height('100%') + .backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/entry/src/main/ets/uiComponent/ItemHead.ets b/entry/src/main/ets/uiComponent/ItemHead.ets new file mode 100644 index 0000000000000000000000000000000000000000..1216737e3daeb8906320f231458ece9069f0d283 --- /dev/null +++ b/entry/src/main/ets/uiComponent/ItemHead.ets @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Builder +export function ItemHead($$: ResourceStr) { + Column(){ + Text($$) + .fontSize($r('app.float.font_size_middle')) + .fontWeight(FontWeight.Bold) + .fontColor($r('app.color.item_text_color')) + .layoutWeight(1) + .margin({ top: $r('app.float.item_head_top_margin'), bottom: $r('app.float.item_head_bottom_margin') }) + .width('100%') + } + .height(40) +} diff --git a/entry/src/main/ets/uiComponent/SubItemHead.ets b/entry/src/main/ets/uiComponent/SubItemHead.ets new file mode 100644 index 0000000000000000000000000000000000000000..336ed9b2acbd099664a1d290c8be99ffad6d7e22 --- /dev/null +++ b/entry/src/main/ets/uiComponent/SubItemHead.ets @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Builder +export function SubItemHead($$: ResourceStr) { + Column(){ + Text($$) + .fontSize($r('app.float.font_size_medium')) + .fontWeight(FontWeight.Normal) + .fontColor(Color.Gray) + .layoutWeight(1) + .margin({ top: $r('app.float.item_head_bottom_margin'), bottom: $r('app.float.item_head_bottom_margin') }) + .width('100%') + } + .height(40) +} diff --git a/entry/src/main/ets/utils/PromptActionClass.ets b/entry/src/main/ets/utils/PromptActionClass.ets new file mode 100644 index 0000000000000000000000000000000000000000..0ff95690f78082465ec200ba7e35c9437cc442cd --- /dev/null +++ b/entry/src/main/ets/utils/PromptActionClass.ets @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BusinessError } from '@kit.BasicServicesKit'; +import { ComponentContent, promptAction, UIContext } from '@kit.ArkUI'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +export class PromptActionClass { + static ctx: UIContext; + static contentNode: ComponentContent; + static options: promptAction.BaseDialogOptions; + + + static setContext(context: UIContext) { + PromptActionClass.ctx = context; + } + + + static setContentNode(node: ComponentContent) { + PromptActionClass.contentNode = node; + } + + + static setOptions(options: promptAction.BaseDialogOptions) { + PromptActionClass.options = options; + } + + + static openDialog() { + if (PromptActionClass.contentNode !== null) { + PromptActionClass.ctx.getPromptAction().openCustomDialog(PromptActionClass.contentNode, PromptActionClass.options) + .then(() => { + hilog.info(0xFF00, 'TAG', 'OpenCustomDialog complete'); + }) + .catch((error: BusinessError) => { + let message = (error as BusinessError).message; + let code = (error as BusinessError).code; + hilog.info(0xFF00, 'TAG', `OpenCustomDialog args error code is ${code}, message is ${message}`); + }) + } + } + + + static closeDialog(contentNode: ComponentContent) { + if (PromptActionClass.contentNode !== null) { + PromptActionClass.ctx.getPromptAction().closeCustomDialog(contentNode) + .then(() => { + hilog.info(0xFF00, 'TAG', 'CloseCustomDialog complete'); + }) + .catch((error: BusinessError) => { + let message = (error as BusinessError).message; + let code = (error as BusinessError).code; + hilog.info(0xFF00, 'TAG', `CloseCustomDialog args error code is ${code}, message is ${message}`); + }) + } + } + + + static updateDialog(options: promptAction.BaseDialogOptions) { + if (PromptActionClass.contentNode !== null) { + PromptActionClass.ctx.getPromptAction().updateCustomDialog(PromptActionClass.contentNode, options) + .then(() => { + hilog.info(0xFF00, 'TAG', 'UpdateCustomDialog complete'); + }) + .catch((error: BusinessError) => { + let message = (error as BusinessError).message; + let code = (error as BusinessError).code; + hilog.info(0xFF00, 'TAG', `UpdateCustomDialog args error code is ${code}, message is ${message}`); + }) + } + } +} \ No newline at end of file diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ad219d733f6afa5ea07f85f580208b08cc3b9041 --- /dev/null +++ b/entry/src/main/module.json5 @@ -0,0 +1,50 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:layered_image", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "name": "EntryBackupAbility", + "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", + "type": "backup", + "exported": false, + "metadata": [ + { + "name": "ohos.extension.backup", + "resource": "$profile:backup_config" + } + ], + } + ] + } +} \ No newline at end of file diff --git a/entry/src/main/resources/base/element/color.json b/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..5daa972036eec43e9e0325efbd31870cc09ac537 --- /dev/null +++ b/entry/src/main/resources/base/element/color.json @@ -0,0 +1,109 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "base_blue", + "value": "#0A59F7" + }, + { + "name": "reuse_example_backgroundColor", + "value": "#FFF1F3F5" + }, + { + "name": "base_red", + "value": "#f24b49" + }, + { + "name": "item_text_color", + "value": "#e6000000" + }, + { + "name": "item_button_background", + "value": "#0d000000" + }, + { + "name": "item_group_divider_color", + "value": "#FFCCCCCC" + }, + { + "name": "custom_sample_shadow_color", + "value": "#29000000" + }, + { + "name": "mask_automatically_close_dialog_maskColor", + "value": "#b8484848" + }, + { + "name": "snackbar_builder_background", + "value": "#ccffffff" + }, + { + "name": "snackbar_builder_input_placeholderColor", + "value": "#99000000" + }, + { + "name": "image_popup_shadow_color", + "value": "#26000000" + }, + { + "name": "auto_dismiss_content_color", + "value": "#99000000" + }, + { + "name": "active_close_content_color", + "value": "#99000000" + }, + { + "name": "page_bg_color", + "value": "#FFF1F3F5" + }, + { + "name": "index_page_bg_color", + "value": "#FFF1F3F5" + }, + { + "name": "now_dialogs_font_color", + "value": "#99000000" + }, + { + "name": "toast_template_shadow_color", + "value": "#29000000" + }, + { + "name": "InputCallbackBuilderFontColor", + "value": "#E6000000" + }, + { + "name": "InputCallbackBuilderBgColor", + "value": "#FFFFFFFF" + }, + { + "name": "ProgressBuilderFontColor", + "value": "#E6000000" + }, + { + "name": "ProgressBuilderBgColor", + "value": "#FFFFFFFF" + } + , + { + "name": "SkipBuilderFontColor", + "value": "#E6000000" + }, + { + "name": "SkipBuilderSpanColor", + "value": "#99000000" + }, + { + "name": "RouterSkipBgColor", + "value": "#FFF1F3F5" + }, + { + "name": "SkipActionBgColor", + "value": "#FFF1F3F5" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/element/float.json b/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..32e97f7091aee225cadb5229c37d07e446676eb5 --- /dev/null +++ b/entry/src/main/resources/base/element/float.json @@ -0,0 +1,96 @@ +{ + "float": [ + { + "name": "vp_16", + "value": "24vp" + }, + { + "name": "item_list_margin", + "value": "12" + }, + { + "name": "item_list_height", + "value": "48" + }, + { + "name": "item_button_height", + "value": "40" + }, + { + "name": "item_button_horizon_margin", + "value": "8" + }, + { + "name": "item_button_vertical_margin", + "value": "4" + }, + { + "name": "item_group_divider_margin", + "value": "12" + }, + { + "name": "item_group_divider_width", + "value": "1" + }, + { + "name": "font_size_normal", + "value": "12" + }, + { + "name": "font_size_regular", + "value": "14" + }, + { + "name": "font_size_medium", + "value": "16" + }, + { + "name": "font_size_middle", + "value": "18" + }, + { + "name": "font_size_large", + "value": "20" + }, + { + "name": "font_size_larger", + "value": "22" + }, + { + "name": "font_size_largest", + "value": "24" + }, + { + "name": "item_head_top_margin", + "value": "16" + }, + { + "name": "item_head_bottom_margin", + "value": "8" + }, + { + "name": "custom_template_sample_radius", + "value": "18" + }, + { + "name": "custom_sample_shadow_radius", + "value": "20" + }, + { + "name": "custom_sample_shadow_offset", + "value": "8" + }, + { + "name": "custom_sample_offset", + "value": "-80" + }, + { + "name": "page_padding", + "value": "16" + }, + { + "name": "page_padding_bottom", + "value": "32" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..d9b880b0e14bed7bba6e676d161595f79b1ad464 --- /dev/null +++ b/entry/src/main/resources/base/element/string.json @@ -0,0 +1,296 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "DialogHubSample" + }, + { + "name": "privacy_title", + "value": "Statement privacy" + }, + { + "name": "update_date", + "value": "Updated date: 20XX XX" + }, + { + "name": "introductory_1", + "value": "\"XX\" is owned by Huawei Software Technologies Co., LTD. (hereinafter referred to as \"We\" or \"Huawei\").\nProvide you with XXXX. Huawei attaches great importance to the protection of your personal information and privacy, and we will provide appropriate security protection measures for your personal information in accordance with legal requirements and industry mature security standards." + }, + { + "name": "introductory_2", + "value": "1. How do we collect and use your Personal information" + }, + { + "name": "introductory_3", + "value": "You can access the Personal information collection list to quickly understand the basic information about the collection and use of personal information by \"XX\" in the full functional service mode. Details of how each function collects and uses personal information can be found below." + }, + { + "name": "introductory_4", + "value": "1.1 We will provide you with the following business capabilities through \"XX\". In the process of your use of the relevant business functions, we will process the information necessary for the following functions to perform our contractual obligations and ensure that you can normally use the relevant functions of the application." + }, + { + "name": "introductory_5", + "value": "In order to achieve the basic functions of providing you with XX products and services, including positioning services, search services, map services, travel services (navigation services, route planning services, car appearance services)" + }, + { + "name": "friend_nickname_1", + "value": "Friend1" + }, + { + "name": "friend_nickname_2", + "value": "Friend2" + }, + { + "name": "comment_button_text", + "value": "Write a Comment" + }, + { + "name": "comment_list_title", + "value": "23 Comments" + }, + { + "name": "after", + "value": "Click post-processing logic" + }, + { + "name": "pause", + "value": "Pause" + }, + { + "name": "not_interested", + "value": "Not interested" + }, + { + "name": "reduce", + "value": "Reduce this kind of content" + }, + { + "name": "shield", + "value": "Shield" + }, + { + "name": "share", + "value": "Share" + }, + { + "name": "more", + "value": "More functions" + }, + { + "name": "cancel", + "value": "Unfollow" + }, + { + "name": "cancel_user", + "value": "Are you sure you no longer follow this user" + }, + { + "name": "tips", + "value": "Success prompt" + }, + { + "name": "think_again", + "value": "Think again." + }, + { + "name": "confirm", + "value": "Confirm" + }, + { + "name": "scan", + "value": "Scan" + }, + { + "name": "collect", + "value": "Collect" + }, + { + "name": "setting", + "value": "Setting" + }, + { + "name": "text_tips", + "value": "Text tips" + }, + { + "name": "message", + "value": "Ok, I'm DEFAULT toast" + }, + { + "name": "img_tips", + "value": "Graphic and text tips" + }, + { + "name": "operate_tips", + "value": "Operation prompt" + }, + { + "name": "collection_successful", + "value": "Collection successful" + }, + { + "name": "join_the_album", + "value": "Join the album" + }, + { + "name": "turn_off_the_sound", + "value": "Turn off the sound" + }, + { + "name": "dialog", + "value": "Dialog" + }, + { + "name": "confirm_dialog", + "value": "Confirm dialog" + }, + { + "name": "privacy_dialog", + "value": "Privacy dialog" + }, + { + "name": "progress_dialog", + "value": "Progress dialog" + }, + { + "name": "progress", + "value": "In progress" + }, + { + "name": "menu", + "value": "Menu/Bubble" + }, + { + "name": "menu_dialog", + "value": "Menu dialog" + }, + { + "name": "bubble_dialog", + "value": "Bubble dialog" + }, + { + "name": "operation", + "value": "Operation bar" + }, + { + "name": "operation_list", + "value": "Operation list" + }, + { + "name": "comment_reply_dialog", + "value": "Comment reply dialog" + }, + { + "name": "agreement_tips", + "value": "Agreement tips" + }, + { + "name": "sign_in_and_agree", + "value": "Sign in and agree" + }, + { + "name": "user_authentication_protocol", + "value": "User authentication protocol" + }, + { + "name": "rejected", + "value": "Rejected" + }, + { + "name": "confirm_login", + "value": "Confirm login" + }, + { + "name": "modal_dialog", + "value": "Modal dialog" + }, + { + "name": "non_modal_dialog", + "value": "Non modal dialog" + }, + { + "name": "start", + "value": "Start" + }, + { + "name": "list", + "value": "List of variable height operations" + }, + { + "name": "nick_name_1", + "value": "Yellow River" + }, + { + "name": "nick_name_2", + "value": "Forest" + }, + { + "name": "nick_name_3", + "value": "Geographical scenery" + }, + { + "name": "nick_name_4", + "value": "Mountain" + }, + { + "name": "nick_name_5", + "value": "Stream" + }, + { + "name": "comment_1", + "value": "Have you not seen the water of the Yellow River coming from the sky" + }, + { + "name": "comment_2", + "value": "The geographical environment of this mountain is very important" + }, + { + "name": "comment_3", + "value": "One will reach the summit" + }, + { + "name": "comment_4", + "value": "Beautiful mountains" + }, + { + "name": "comment_5", + "value": "The meandering river water" + }, + { + "name": "place_1", + "value": "10-23·From Beijing" + }, + { + "name": "place_2", + "value": "10-23·From Yunnan" + }, + { + "name": "place_3", + "value": "10-23·From Wuhan" + }, + { + "name": "place_4", + "value": "10-23·From Hunan" + }, + { + "name": "place_5", + "value": "10-23·From Henan" + }, + { + "name": "tips_title", + "value": "Tips" + }, + { + "name": "reply", + "value": "Reply" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/media/arrow_clockwise.png b/entry/src/main/resources/base/media/arrow_clockwise.png new file mode 100644 index 0000000000000000000000000000000000000000..f75b9ac923b753f188354aee9c7bb8400df058bc Binary files /dev/null and b/entry/src/main/resources/base/media/arrow_clockwise.png differ diff --git a/entry/src/main/resources/base/media/at.svg b/entry/src/main/resources/base/media/at.svg new file mode 100644 index 0000000000000000000000000000000000000000..e6e9454320431794e15f35fe5a7c6e01bd5fd579 --- /dev/null +++ b/entry/src/main/resources/base/media/at.svg @@ -0,0 +1,16 @@ + + + Created with Pixso. + + + + + + + + + + + + + diff --git a/entry/src/main/resources/base/media/background.png b/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..923f2b3f27e915d6871871deea0420eb45ce102f Binary files /dev/null and b/entry/src/main/resources/base/media/background.png differ diff --git a/entry/src/main/resources/base/media/cancel.png b/entry/src/main/resources/base/media/cancel.png new file mode 100644 index 0000000000000000000000000000000000000000..056c1ca4346a7546e1bc4f6e7c6a62be3a91bbfe Binary files /dev/null and b/entry/src/main/resources/base/media/cancel.png differ diff --git a/entry/src/main/resources/base/media/checkmark_circle.png b/entry/src/main/resources/base/media/checkmark_circle.png new file mode 100644 index 0000000000000000000000000000000000000000..e5360de442ea04de7b1a99515da54e01cebfd15e Binary files /dev/null and b/entry/src/main/resources/base/media/checkmark_circle.png differ diff --git a/entry/src/main/resources/base/media/checkmark_circle_fill.png b/entry/src/main/resources/base/media/checkmark_circle_fill.png new file mode 100644 index 0000000000000000000000000000000000000000..3174bd670e86174925092b31078920185bd0f812 Binary files /dev/null and b/entry/src/main/resources/base/media/checkmark_circle_fill.png differ diff --git a/entry/src/main/resources/base/media/chevron_right.png b/entry/src/main/resources/base/media/chevron_right.png new file mode 100644 index 0000000000000000000000000000000000000000..f4505b79046aad18f33998dd0f7a3b47277e98e2 Binary files /dev/null and b/entry/src/main/resources/base/media/chevron_right.png differ diff --git a/entry/src/main/resources/base/media/chevron_right_gray.png b/entry/src/main/resources/base/media/chevron_right_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..984a60dc276246a4586f47eef7559d2d74f463a0 Binary files /dev/null and b/entry/src/main/resources/base/media/chevron_right_gray.png differ diff --git a/entry/src/main/resources/base/media/comment_list.png b/entry/src/main/resources/base/media/comment_list.png new file mode 100644 index 0000000000000000000000000000000000000000..9f95106870bed5cb990d571d0f26076a9f115a95 Binary files /dev/null and b/entry/src/main/resources/base/media/comment_list.png differ diff --git a/entry/src/main/resources/base/media/face.svg b/entry/src/main/resources/base/media/face.svg new file mode 100644 index 0000000000000000000000000000000000000000..333f98cadd051de6728297b04c118da4f23f1359 --- /dev/null +++ b/entry/src/main/resources/base/media/face.svg @@ -0,0 +1,16 @@ + + + Created with Pixso. + + + + + + + + + + + + + diff --git a/entry/src/main/resources/base/media/foreground.png b/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..97014d3e10e5ff511409c378cd4255713aecd85f Binary files /dev/null and b/entry/src/main/resources/base/media/foreground.png differ diff --git a/entry/src/main/resources/base/media/friend_1.png b/entry/src/main/resources/base/media/friend_1.png new file mode 100644 index 0000000000000000000000000000000000000000..4774ef15d304098c78d36e827d01b0f8e188d954 Binary files /dev/null and b/entry/src/main/resources/base/media/friend_1.png differ diff --git a/entry/src/main/resources/base/media/friend_2.png b/entry/src/main/resources/base/media/friend_2.png new file mode 100644 index 0000000000000000000000000000000000000000..e026b5d838debc53b4afeb41cbc7a146c83b4441 Binary files /dev/null and b/entry/src/main/resources/base/media/friend_2.png differ diff --git a/entry/src/main/resources/base/media/heart.png b/entry/src/main/resources/base/media/heart.png new file mode 100644 index 0000000000000000000000000000000000000000..211ece3997008ecd7f5fa932bd70cec9ddb29cc6 Binary files /dev/null and b/entry/src/main/resources/base/media/heart.png differ diff --git a/entry/src/main/resources/base/media/keyboard_circle.png b/entry/src/main/resources/base/media/keyboard_circle.png new file mode 100644 index 0000000000000000000000000000000000000000..b6013a3abac0a00d17a4a0e5d64d969227deae3b Binary files /dev/null and b/entry/src/main/resources/base/media/keyboard_circle.png differ diff --git a/entry/src/main/resources/base/media/layered_image.json b/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/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/entry/src/main/resources/base/media/line_viewfinder.png b/entry/src/main/resources/base/media/line_viewfinder.png new file mode 100644 index 0000000000000000000000000000000000000000..e5337138421e54d552502654fbae51bd5dfeb509 Binary files /dev/null and b/entry/src/main/resources/base/media/line_viewfinder.png differ diff --git a/entry/src/main/resources/base/media/mark_circle_fill.png b/entry/src/main/resources/base/media/mark_circle_fill.png new file mode 100644 index 0000000000000000000000000000000000000000..f5a8322077e4c51c0560166b458376515abe29ee Binary files /dev/null and b/entry/src/main/resources/base/media/mark_circle_fill.png differ diff --git a/entry/src/main/resources/base/media/paper_plane.svg b/entry/src/main/resources/base/media/paper_plane.svg new file mode 100644 index 0000000000000000000000000000000000000000..bcd28f0545b06296bff05c974adf1070473e6c9a --- /dev/null +++ b/entry/src/main/resources/base/media/paper_plane.svg @@ -0,0 +1,16 @@ + + + Created with Pixso. + + + + + + + + + + + + + diff --git a/entry/src/main/resources/base/media/picture.svg b/entry/src/main/resources/base/media/picture.svg new file mode 100644 index 0000000000000000000000000000000000000000..8f22719adae1bc43a5ef6c1cb240e37e44738373 --- /dev/null +++ b/entry/src/main/resources/base/media/picture.svg @@ -0,0 +1,16 @@ + + + Created with Pixso. + + + + + + + + + + + + + diff --git a/entry/src/main/resources/base/media/privacy.png b/entry/src/main/resources/base/media/privacy.png new file mode 100644 index 0000000000000000000000000000000000000000..5f8c77d60c60a7609ee4e1045c98866ca6da9136 Binary files /dev/null and b/entry/src/main/resources/base/media/privacy.png differ diff --git a/entry/src/main/resources/base/media/setting.png b/entry/src/main/resources/base/media/setting.png new file mode 100644 index 0000000000000000000000000000000000000000..2826603b44b8e6053e9e8d1b87d11fe20975e15e Binary files /dev/null and b/entry/src/main/resources/base/media/setting.png differ diff --git a/entry/src/main/resources/base/media/speaker_slash.png b/entry/src/main/resources/base/media/speaker_slash.png new file mode 100644 index 0000000000000000000000000000000000000000..6bca300edef436fdc764f970217ddcea013f527e Binary files /dev/null and b/entry/src/main/resources/base/media/speaker_slash.png differ diff --git a/entry/src/main/resources/base/media/star.png b/entry/src/main/resources/base/media/star.png new file mode 100644 index 0000000000000000000000000000000000000000..e295720022bb3c775961658ec53047e8ef57c840 Binary files /dev/null and b/entry/src/main/resources/base/media/star.png differ diff --git a/entry/src/main/resources/base/media/startIcon.png b/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/entry/src/main/resources/base/media/startIcon.png differ diff --git a/entry/src/main/resources/base/profile/backup_config.json b/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/entry/src/main/resources/base/profile/main_pages.json b/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/entry/src/main/resources/dark/element/color.json b/entry/src/main/resources/dark/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..79b11c2747aec33e710fd3a7b2b3c94dd9965499 --- /dev/null +++ b/entry/src/main/resources/dark/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#000000" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..579b3b46b60f653bfed3e51c1051b8b603b9f177 --- /dev/null +++ b/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,296 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "DialogHubSample" + }, + { + "name": "privacy_title", + "value": "Statement privacy" + }, + { + "name": "update_date", + "value": "Updated date: 20XX XX" + }, + { + "name": "introductory_1", + "value": "\"XX\" is owned by Huawei Software Technologies Co., LTD. (hereinafter referred to as \"We\" or \"Huawei\").\nProvide you with XXXX. Huawei attaches great importance to the protection of your personal information and privacy, and we will provide appropriate security protection measures for your personal information in accordance with legal requirements and industry mature security standards." + }, + { + "name": "introductory_2", + "value": "1. How do we collect and use your Personal information" + }, + { + "name": "introductory_3", + "value": "You can access the Personal information collection list to quickly understand the basic information about the collection and use of personal information by \"XX\" in the full functional service mode. Details of how each function collects and uses personal information can be found below." + }, + { + "name": "introductory_4", + "value": "1.1 We will provide you with the following business capabilities through \"XX\". In the process of your use of the relevant business functions, we will process the information necessary for the following functions to perform our contractual obligations and ensure that you can normally use the relevant functions of the application." + }, + { + "name": "introductory_5", + "value": "In order to achieve the basic functions of providing you with XX products and services, including positioning services, search services, map services, travel services (navigation services, route planning services, car appearance services)" + }, + { + "name": "friend_nickname_1", + "value": "Friend1" + }, + { + "name": "friend_nickname_2", + "value": "Friend2" + }, + { + "name": "comment_button_text", + "value": "Write a Comment" + }, + { + "name": "comment_list_title", + "value": "23 Comments" + }, + { + "name": "after", + "value": "Click post-processing logic" + }, + { + "name": "pause", + "value": "Pause" + }, + { + "name": "not_interested", + "value": "Not interested" + }, + { + "name": "reduce", + "value": "Reduce this kind of content" + }, + { + "name": "shield", + "value": "Shield" + }, + { + "name": "share", + "value": "Share" + }, + { + "name": "more", + "value": "More functions" + }, + { + "name": "cancel", + "value": "Unfollow" + }, + { + "name": "cancel_user", + "value": "Are you sure you no longer follow this user" + }, + { + "name": "tips", + "value": "Success prompt" + }, + { + "name": "think_again", + "value": "Think again" + }, + { + "name": "confirm", + "value": "Confirm" + }, + { + "name": "scan", + "value": "Scan" + }, + { + "name": "collect", + "value": "Collect" + }, + { + "name": "setting", + "value": "Setting" + }, + { + "name": "text_tips", + "value": "Text tips" + }, + { + "name": "message", + "value": "Ok, I'm DEFAULT toast" + }, + { + "name": "img_tips", + "value": "Graphic and text tips" + }, + { + "name": "operate_tips", + "value": "Operation prompt" + }, + { + "name": "collection_successful", + "value": "Collection successful" + }, + { + "name": "join_the_album", + "value": "Join the album" + }, + { + "name": "turn_off_the_sound", + "value": "Turn off the sound" + }, + { + "name": "dialog", + "value": "Dialog" + }, + { + "name": "confirm_dialog", + "value": "Confirm dialog" + }, + { + "name": "privacy_dialog", + "value": "Privacy dialog" + }, + { + "name": "progress_dialog", + "value": "Progress dialog" + }, + { + "name": "progress", + "value": "In progress" + }, + { + "name": "menu", + "value": "Menu/Bubble" + }, + { + "name": "menu_dialog", + "value": "Menu dialog" + }, + { + "name": "bubble_dialog", + "value": "Bubble dialog" + }, + { + "name": "operation", + "value": "Operation bar" + }, + { + "name": "operation_list", + "value": "Operation list" + }, + { + "name": "comment_reply_dialog", + "value": "Comment reply dialog" + }, + { + "name": "agreement_tips", + "value": "Agreement tips" + }, + { + "name": "sign_in_and_agree", + "value": "Sign in and agree" + }, + { + "name": "user_authentication_protocol", + "value": "《User authentication protocol》" + }, + { + "name": "rejected", + "value": "Rejected" + }, + { + "name": "confirm_login", + "value": "Confirm login" + }, + { + "name": "modal_dialog", + "value": "Modal dialog" + }, + { + "name": "non_modal_dialog", + "value": "Non modal dialog" + }, + { + "name": "start", + "value": "Start" + }, + { + "name": "list", + "value": "List of variable height operations" + }, + { + "name": "nick_name_1", + "value": "Yellow River" + }, + { + "name": "nick_name_2", + "value": "Forest" + }, + { + "name": "nick_name_3", + "value": "Geographical scenery" + }, + { + "name": "nick_name_4", + "value": "Mountain" + }, + { + "name": "nick_name_5", + "value": "Stream" + }, + { + "name": "comment_1", + "value": "Have you not seen the water of the Yellow River coming from the sky" + }, + { + "name": "comment_2", + "value": "The geographical environment of this mountain is very important" + }, + { + "name": "comment_3", + "value": "One will reach the summit" + }, + { + "name": "comment_4", + "value": "Beautiful mountains" + }, + { + "name": "comment_5", + "value": "The meandering river water" + }, + { + "name": "place_1", + "value": "10-23·From Beijing" + }, + { + "name": "place_2", + "value": "10-23·From Yunnan" + }, + { + "name": "place_3", + "value": "10-23·From Wuhan" + }, + { + "name": "place_4", + "value": "10-23·From Hunan" + }, + { + "name": "place_5", + "value": "10-23·From Henan" + }, + { + "name": "tips_title", + "value": "Tips" + }, + { + "name": "reply", + "value": "Reply" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..8a8c5b1c4b411c8d07f6d2834b6ce7751d1e6472 --- /dev/null +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,296 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "DialogHubSample" + }, + { + "name": "privacy_title", + "value": "关于XX与隐私的声明" + }, + { + "name": "update_date", + "value": "更新日期:20XX年X月X日" + }, + { + "name": "introductory_1", + "value": "\"XX\"是由华为软件技术有限公司(以下简称“我们”或“华为”)\n为您提供XXXX。华为非常重视您的个人信息和隐私保护,我们将会按照法律要求和业界成熟的安全标准,为您的个人信息提供相应的安全保护措施。" + }, + { + "name": "introductory_2", + "value": "1.我们如何收集和使用您的个人信息" + }, + { + "name": "introductory_3", + "value": "您可以通过访问个人信息收集清单快速了解完整功能服务模式下“XX”收集、使用个人信息的基本情况。各功能收集、使用个人信息的详细情况可查看下方说明" + }, + { + "name": "introductory_4", + "value": "1.1 我们将通过“XX”为您提供下述业务能力,在您使用相关业务功能的过程中,我们会处理下列提供功能所必需的信息,以便展行我们的合同义务,确保您能正常使用本应用的相关功能。" + }, + { + "name": "introductory_5", + "value": "为实现向您提供XX产品和服务的基本功能,包括定位服务、搜索服务、地图服务、出行服务(导航服务、路线规划服务、用车出现服务)" + }, + { + "name": "friend_nickname_1", + "value": "朋友1" + }, + { + "name": "friend_nickname_2", + "value": "朋友2" + }, + { + "name": "comment_button_text", + "value": "写评论" + }, + { + "name": "comment_list_title", + "value": "23条评论" + }, + { + "name": "after", + "value": "点击后处理逻辑" + }, + { + "name": "pause", + "value": "暂停" + }, + { + "name": "not_interested", + "value": "不感兴趣" + }, + { + "name": "reduce", + "value": "减少这类内容" + }, + { + "name": "shield", + "value": "屏蔽" + }, + { + "name": "share", + "value": "生活分享" + }, + { + "name": "more", + "value": "更多功能" + }, + { + "name": "cancel", + "value": "取消关注" + }, + { + "name": "cancel_user", + "value": "确认不再关注此用户吗" + }, + { + "name": "tips", + "value": "成功提示" + }, + { + "name": "think_again", + "value": "再想想" + }, + { + "name": "confirm", + "value": "确定" + }, + { + "name": "scan", + "value": "扫一扫" + }, + { + "name": "collect", + "value": "收藏" + }, + { + "name": "setting", + "value": "设置" + }, + { + "name": "text_tips", + "value": "文本提示" + }, + { + "name": "message", + "value": "ok,我是DEFAULT toast" + }, + { + "name": "img_tips", + "value": "图文提示" + }, + { + "name": "operate_tips", + "value": "操作提示" + }, + { + "name": "collection_successful", + "value": "收藏成功" + }, + { + "name": "join_the_album", + "value": "加入专辑" + }, + { + "name": "turn_off_the_sound", + "value": "关闭声音" + }, + { + "name": "dialog", + "value": "对话框" + }, + { + "name": "confirm_dialog", + "value": "确认弹窗" + }, + { + "name": "privacy_dialog", + "value": "隐私弹窗" + }, + { + "name": "progress_dialog", + "value": "进度条弹窗" + }, + { + "name": "progress", + "value": "保存中" + }, + { + "name": "menu", + "value": "菜单/气泡" + }, + { + "name": "menu_dialog", + "value": "菜单弹窗" + }, + { + "name": "bubble_dialog", + "value": "气泡弹窗" + }, + { + "name": "operation", + "value": "操作栏" + }, + { + "name": "operation_list", + "value": "操作列表" + }, + { + "name": "comment_reply_dialog", + "value": "评论回复弹窗" + }, + { + "name": "agreement_tips", + "value": "用户协议提示" + }, + { + "name": "sign_in_and_agree", + "value": "登录即同意" + }, + { + "name": "user_authentication_protocol", + "value": "《华为账号用户认证协议》" + }, + { + "name": "rejected", + "value": "拒绝" + }, + { + "name": "confirm_login", + "value": "确认登录" + }, + { + "name": "modal_dialog", + "value": "模态弹窗" + }, + { + "name": "non_modal_dialog", + "value": "非模态弹窗" + }, + { + "name": "start", + "value": "开始" + }, + { + "name": "list", + "value": "可变高度操作列表" + }, + { + "name": "nick_name_1", + "value": "黄河" + }, + { + "name": "nick_name_2", + "value": "森林" + }, + { + "name": "nick_name_3", + "value": "地理风光" + }, + { + "name": "nick_name_4", + "value": "大山" + }, + { + "name": "nick_name_5", + "value": "小溪" + }, + { + "name": "comment_1", + "value": "君不见黄河之水天上来" + }, + { + "name": "comment_2", + "value": "这座山的地理环境很重要" + }, + { + "name": "comment_3", + "value": "会当凌绝顶" + }, + { + "name": "comment_4", + "value": "美丽的山峦" + }, + { + "name": "comment_5", + "value": "蜿蜒的河流之水" + }, + { + "name": "place_1", + "value": "10-23·来自北京" + }, + { + "name": "place_2", + "value": "10-23·来自云南" + }, + { + "name": "place_3", + "value": "10-23·来自武汉" + }, + { + "name": "place_4", + "value": "10-23·来自湖南" + }, + { + "name": "place_5", + "value": "10-23·来自河南" + }, + { + "name": "tips_title", + "value": "提示" + }, + { + "name": "reply", + "value": "回复" + } + ] +} \ No newline at end of file diff --git a/hvigor/hvigor-config.json5 b/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5bebc9755447385d82ce4138f54d991b1f85f348 --- /dev/null +++ b/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.5", + "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/hvigorfile.ts b/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/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/oh-package.json5 b/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f440d114b8a9d9aeadd0e891bba0d0d076e70936 --- /dev/null +++ b/oh-package.json5 @@ -0,0 +1,7 @@ +{ + "modelVersion": "5.0.5", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": {} +} diff --git a/screenshots/device/image.png b/screenshots/device/image.png new file mode 100644 index 0000000000000000000000000000000000000000..17626d720354e5728ac330a5dada0c66fa41c031 Binary files /dev/null and b/screenshots/device/image.png differ