diff --git a/AppScope/app.json5 b/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..6f3a784fa33b817e35d051e808e662d0f5646b5b --- /dev/null +++ b/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.cardinforefresh", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "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..6d74312b35a0e98da9a2121d7760cea2c47e7ae9 --- /dev/null +++ b/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "CardInfoRefresh" + } + ] +} diff --git a/AppScope/resources/base/media/app_icon.png b/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a39445dc87828b76fed6d2ec470dd455c45319e3 Binary files /dev/null and b/AppScope/resources/base/media/app_icon.png differ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..338e5b0bc22082e0ffcc7121c2ed3897a3ddccb0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2024 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 ee54abc639d0590b03883df4597080a8ddd8b8a1..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# CardInfoRefresh - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### 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 0a5d701dc3fbf324b9b3af08ddf9e142a60b413c..a0d84f27d4e801838a2cd0a8e95820948bd7addd 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,62 @@ -# CardInfoRefresh - -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -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/) +# 卡片更新 + +### 介绍 + +本示例实现使用router、call和message三种事件,以及定点刷新的方式实现卡片信息的刷新。 + +### 效果预览 +![](screenshots/form.png) + +### 工程目录 + +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ ├──CommonConstants.ets // 卡片数据 +│ │ └──CommonData.ets // 卡片数据工具类 +│ ├──entryability +│ │ └──EntryAbility.ets // 程序入口类 +│ ├──entrybackupability +│ │ └──EntryBackupAbility.ets +│ ├──entryformability +│ │ └──EntryFormAbility.ets // 卡片生命周期类 +│ ├──pages +│ │ └──Index.ets // 首页 +│ └──widget +│ ├──pages +│ │ └──WidgetCard.ets // 卡片页面 +│ ├──view +│ │ └──CardListComponent.ets +│ └──viewmodel +│ └──CardListParameter.ets +└──entry/src/main/resources // 应用静态资源目录 +``` + +### 使用说明 + +1. 安装应用后,长按应用图标,添加服务卡片。 +2. 点击“router事件”按钮进入应用页面,返回桌面时可见卡片信息刷新。 +3. 点击“call事件”,可见卡片信息刷新。 +4. 点击“message事件”可见卡片信息刷新。 +5. 配置“src/main/resources/base/profile/form_config.json”文件中的“scheduledUpdateTime”字段为某个时间,卡片信息即可在相应时间刷新。 + +### 实现说明 + +1. router事件通过应用EntryAbility的生命周期回调触发更新方法,使用formProvider的updateForm方法,将内容更新到指定卡片。 +2. call事件在EntryFormAbility的onAddForm中更新卡片信息,触发卡片UI的onFormTimeChange方法,通过其中postCardAction方法携带的updateCardInfo信息,触发EntryAbility中的callee监听,在监听方法中进行刷新处理。 +3. message事件在EntryFormAbility的onFormEvent回调中进行刷新处理。 + +#### 注: +1. 卡片刷新也可以通过定时刷新实现,在“form_config.json”文件中配置“updateDuration”字段即可。由于定时刷新和定点刷新同时配置时,定点刷新也会被忽略,本示例项目仅使用定点刷新。若想要实现定时刷新,可参考指南指导。 +2. 本项目的卡片中信息为代码中配置的数据,在真实场景中,可以自行封装获取信息的方法。 + +### 相关权限 + +ohos.permission.KEEP_BACKGROUND_RUNNING:允许Service Ability在后台持续运行。call事件需要提供方应用具备后台运行权限。 + +### 约束与限制 + +1. 本示例仅支持标准系统上运行,支持设备:华为手机。 +2. HarmonyOS系统:HarmonyOS NEXT Developer Beta5及以上。 +3. DevEco Studio版本:DevEco Studio NEXT Developer Beta5及以上。 +4. HarmonyOS SDK版本:HarmonyOS NEXT Developer Beta5 SDK及以上。 \ No newline at end of file diff --git a/build-profile.json5 b/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c033ce4278fb0641d84107c3c134047ac487368e --- /dev/null +++ b/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/entry/build-profile.json5 b/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b695582d3680556f4cce2ec518f65720a9413ca3 --- /dev/null +++ b/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/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..69c4d6a8a5531548e4886fa766090c5c157a87d9 --- /dev/null +++ b/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://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 \ 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/common/CommonConstants.ets b/entry/src/main/ets/common/CommonConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..e9601a05ee366338cd94a9b78e5905dd0d0caf06 --- /dev/null +++ b/entry/src/main/ets/common/CommonConstants.ets @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 { CardListItemData } from '../widget/pages/WidgetCard'; + +export class CommonConstants { + static readonly CARD_LIST_DATA_FIRST: Array = [ + { + id: 1, + title: $r('app.string.title1'), + content: $r('app.string.content1'), + icon: $r('app.media.item1') + }, + { + id: 2, + title: $r('app.string.title2'), + content: $r('app.string.content2'), + icon: $r('app.media.item2') + }, + { + id: 3, + title: $r('app.string.title3'), + content: $r('app.string.content3'), + icon: $r('app.media.item3') + }, + { + id: 4, + title: $r('app.string.title4'), + content: $r('app.string.content4'), + icon: $r('app.media.item4') + } + ]; + + static readonly CARD_LIST_DATA_SECOND: Array = [ + { + id: 1, + title: $r('app.string.title5'), + content: $r('app.string.content5'), + icon: $r('app.media.item5') + }, + { + id: 2, + title: $r('app.string.title6'), + content: $r('app.string.content6'), + icon: $r('app.media.item6') + }, + { + id: 3, + title: $r('app.string.title7'), + content: $r('app.string.content7'), + icon: $r('app.media.item7') + }, + { + id: 4, + title: $r('app.string.title8'), + content: $r('app.string.content8'), + icon: $r('app.media.item8') + } + ]; + + static readonly CARD_LIST_DATA_THIRD: Array = [ + { + id: 1, + title: $r('app.string.title9'), + content: $r('app.string.content9'), + icon: $r('app.media.item9') + }, + { + id: 2, + title: $r('app.string.title10'), + content: $r('app.string.content10'), + icon: $r('app.media.item10') + }, + { + id: 3, + title: $r('app.string.title11'), + content: $r('app.string.content11'), + icon: $r('app.media.item11') + }, + { + id: 4, + title: $r('app.string.title12'), + content: $r('app.string.content12'), + icon: $r('app.media.item12') + } + ]; +} \ No newline at end of file diff --git a/entry/src/main/ets/common/CommonData.ets b/entry/src/main/ets/common/CommonData.ets new file mode 100644 index 0000000000000000000000000000000000000000..e91cd9112f4df8987e0622d0bf6c21f43e154219 --- /dev/null +++ b/entry/src/main/ets/common/CommonData.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CardListItemData } from '../widget/pages/WidgetCard'; +import { CommonConstants } from './CommonConstants'; + +export class CommonData { + static flag: number = 0; + + static getData(): Array { + if (CommonData.flag % 3 === 0) { + return CommonConstants.CARD_LIST_DATA_FIRST; + } else if (CommonData.flag % 3 === 1) { + return CommonConstants.CARD_LIST_DATA_SECOND; + } else { + return CommonConstants.CARD_LIST_DATA_THIRD; + } + } + + static changeFlag(): void { + CommonData.flag++; + } +} \ No newline at end of file diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..e59cd06549fb805f0e3964fa57c4ace6ab83d542 --- /dev/null +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; +import { formBindingData, formInfo, formProvider } from '@kit.FormKit'; +import { rpc } from '@kit.IPCKit'; +import { FormData } from '../widget/pages/WidgetCard'; +import { CommonData } from '../common/CommonData'; + +export default class EntryAbility extends UIAbility { + private callFunc = (data: rpc.MessageSequence): MyParcelable => { + let params: Record = JSON.parse(data.readString()); + if (params.formId !== undefined) { + let formId: string = params.formId; + let formData = new FormData(formId); + formData.cardList = CommonData.getData(); + CommonData.changeFlag(); + let formMsg: formBindingData.FormBindingData = formBindingData.createFormBindingData(formData); + formProvider.updateForm(formId, formMsg).then((data) => { + hilog.info(0x0000, 'testTag', `updateForm success. ${JSON.stringify(data)}`); + }).catch((error: Error) => { + hilog.error(0x0000, 'testTag', `updateForm failed: ${JSON.stringify(error)}`); + }); + } + return new MyParcelable(1); + }; + + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + this.updateInfo(want); + this.callee.on('updateCardInfo', this.callFunc); + } + + onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void { + this.updateInfo(want); + } + + private updateInfo(want: Want) { + if (!want.parameters || want.parameters[formInfo.FormParam.IDENTITY_KEY] === undefined) { + return; + } + let message: string = (JSON.parse(want.parameters?.params as string))?.message; + if (message === 'Router refresh card.') { + this.routerUpdate(want.parameters); + } + } + + private routerUpdate(parameters: Record) { + let formId = parameters[formInfo.FormParam.IDENTITY_KEY].toString(); + let formData = new FormData(formId); + formData.cardList = CommonData.getData(); + CommonData.changeFlag(); + let formMsg = formBindingData.createFormBindingData(formData); + formProvider.updateForm(formId, formMsg).then((data) => { + hilog.info(0x0000, 'testTag', 'updateForm success.', JSON.stringify(data)); + }).catch((error: Error) => { + hilog.info(0x0000, 'testTag', 'updateForm failed.', JSON.stringify(error)); + }); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + try { + this.callee.off('updateCardInfo'); + } catch (err) { + hilog.error(0x0000, 'testTag', 'Failed to disconnect callee. Cause: %{public}s', JSON.stringify(err) ?? ''); + } + } + + 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'); + } +} + +class MyParcelable implements rpc.Parcelable { + num: number; + + constructor(num: number) { + this.num = num; + } + + marshalling(dataOut: rpc.MessageSequence): boolean { + dataOut.writeInt(this.num); + return true; + } + + unmarshalling(dataIn: rpc.MessageSequence): boolean { + this.num = dataIn.readInt(); + return true; + } +} \ 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..6b744d7eaa66e51e79fc4e0896e251292ee767c5 --- /dev/null +++ b/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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'; + +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/entry/src/main/ets/entryformability/EntryFormAbility.ets b/entry/src/main/ets/entryformability/EntryFormAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..3a456ad358a4207cd35273cbbdaad7843fad53a2 --- /dev/null +++ b/entry/src/main/ets/entryformability/EntryFormAbility.ets @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Want } from '@kit.AbilityKit'; +import { systemDateTime } from '@kit.BasicServicesKit'; +import { formBindingData, FormExtensionAbility, formInfo, formProvider } from '@kit.FormKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { FormData } from '../widget/pages/WidgetCard'; +import { CommonData } from '../common/CommonData'; + +export default class EntryFormAbility extends FormExtensionAbility { + onAddForm(want: Want) { + // Called to return a FormBindingData object. + let formData = ''; + if (want && want.parameters) { + let formName: string = want.parameters['ohos.extra.param.key.form_name'] as string; + let formId: string = want.parameters['ohos.extra.param.key.form_identity'] as string; + if (formName === 'card_info_refresh') { + let formData = new FormData(formId); + formData.formTime = systemDateTime.getTime().toString(); + let formInfo: formBindingData.FormBindingData = formBindingData.createFormBindingData(formData); + formProvider.updateForm(formId, formInfo); + } + } + return formBindingData.createFormBindingData(formData); + } + + onUpdateForm(formId: string) { + // Called to notify the form provider to update a specified form. + let formData = new FormData(formId); + formData.formTime = systemDateTime.getTime().toString(); + let formMsg: formBindingData.FormBindingData = formBindingData.createFormBindingData(formData); + formProvider.updateForm(formId, formMsg); + } + + onFormEvent(formId: string, message: string) { + // Called when a specified message event defined by the form provider is triggered. + hilog.info(0x0000, 'testTag', `FormAbility onFormEvent, formId = ${formId}, message: ${JSON.stringify(message)}`); + let formData = new FormData(formId); + formData.cardList = CommonData.getData(); + CommonData.changeFlag(); + let formMsg: formBindingData.FormBindingData = formBindingData.createFormBindingData(formData); + formProvider.updateForm(formId, formMsg).then((data) => { + hilog.info(0x0000, 'testTag', 'updateForm success.', JSON.stringify(data)); + }).catch((error: Error) => { + hilog.info(0x0000, 'testTag', 'updateForm failed.', JSON.stringify(error)); + }); + } + + onAcquireFormState(want: Want) { + // Called to return a {@link FormState} object. + return formInfo.FormState.READY; + } +} \ 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..cda7864a53eba71837766f62d5f2dc40d321a841 --- /dev/null +++ b/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct Index { + @State message: string = 'Hello World'; + + build() { + RelativeContainer() { + Text(this.message) + .id('HelloWorld') + .fontSize(50) + .fontWeight(FontWeight.Bold) + .alignRules({ + center: { anchor: '__container__', align: VerticalAlign.Center }, + middle: { anchor: '__container__', align: HorizontalAlign.Center } + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/entry/src/main/ets/widget/pages/WidgetCard.ets b/entry/src/main/ets/widget/pages/WidgetCard.ets new file mode 100644 index 0000000000000000000000000000000000000000..8accfcae083c6eb281afe27355a948916a54d8d0 --- /dev/null +++ b/entry/src/main/ets/widget/pages/WidgetCard.ets @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 { CardListComponent } from '../view/CardListComponent'; +import { CardListParameter } from '../viewmodel/CardListParameter'; + +let storageUpdate = new LocalStorage(); + +@Entry(storageUpdate) +@Component +struct WidgetCard { + /* + * The action type. + */ + readonly ACTION_TYPE: string = 'router'; + /* + * The ability name. + */ + readonly ABILITY_NAME: string = 'EntryAbility'; + /* + * The message. + */ + readonly MESSAGE: string = 'add detail'; + /* + * The width percentage setting. + */ + readonly FULL_WIDTH_PERCENT: string = '100%'; + /* + * The height percentage setting. + */ + readonly FULL_HEIGHT_PERCENT: string = '100%'; + @LocalStorageProp('formTime') @Watch('onFormTimeChange') formTime: string = ''; + @LocalStorageProp('cardList') cardList: Array = []; + @LocalStorageProp('formId') formId: string = ''; + @State cardListParameter: CardListParameter = new CardListParameter($r('sys.color.ohos_id_color_background'), + $r('app.string.card_list_title'), '', ImageSize.Cover, $r('app.media.logo'), false, + $r('sys.color.ohos_id_color_background'), true, this.cardList.length, $r('sys.color.ohos_id_color_emphasize'), + $r('app.color.list_item_count_background'), '', false); + + onFormTimeChange() { + postCardAction(this, { + action: 'call', + abilityName: 'EntryAbility', + params: { + formId: this.formId, + method: 'updateCardInfo', + message: 'Call refresh card.' + } + }); + } + + @Builder + buttonBuilder(text: ResourceStr, action: string, message: string, method?: string) { + Column() { + Image($r('app.media.refresh')) + .width($r('app.float.refresh_image_size')) + .height($r('app.float.refresh_image_size')) + + Text(text) + .fontColor($r('app.color.refresh_color')) + .fontSize($r('app.float.item_content_font_size')) + .margin({ top: $r('app.float.text_image_space') }) + } + .justifyContent(FlexAlign.Center) + .height($r('app.float.refresh_area_height')) + .width($r('app.float.refresh_area_width')) + .borderRadius($r('app.float.border_radius')) + .backgroundColor($r('sys.color.comp_background_focus')) + .onClick(() => { + postCardAction(this, { + action: action, + abilityName: 'EntryAbility', + params: { + formId: this.formId, + method: method, + message: message + } + }); + }) + } + + @Builder + cardListBuilder() { + if (this.cardList.length > 0) { + Column() { + Column() { + ForEach(this.cardList, (item: CardListItemData) => { + ListItem() { + Row() { + Column() { + Text(item.title) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .fontSize($r('app.float.item_content_font_size')) + .fontWeight(FontWeight.Medium) + .fontColor(Color.Black) + .height($r('app.float.item_text_height')) + .margin({ top: $r('app.float.item_text_margin') }) + Text(item.content) + .maxLines(1) + .fontSize($r('app.float.item_content_font_size')) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .fontWeight(FontWeight.Regular) + .height($r('app.float.item_text_height')) + + Divider() + .strokeWidth(0.38) + .lineCap(LineCapStyle.Square) + .margin({ top: $r('app.float.list_divider_margin') }) + .visibility(item.id === 4 ? Visibility.None : Visibility.Visible) + } + .margin({ right: $r('app.float.list_row_margin') }) + .alignItems(HorizontalAlign.Start) + .layoutWeight(1) + + Image(item.icon) + .width($r('app.float.item_image_size')) + .height($r('app.float.item_image_size')) + .borderRadius($r('app.float.border_radius')) + } + .alignItems(VerticalAlign.Center) + .width(this.FULL_WIDTH_PERCENT) + } + .width(this.FULL_WIDTH_PERCENT) + .height($r('app.float.item_height')) + }, (item: number, index) => index + JSON.stringify(item)) + } + + Row() { + this.buttonBuilder($r('app.string.router'), 'router', 'Router refresh card.') + + this.buttonBuilder($r('app.string.call'), 'call', 'Call refresh card.', 'updateCardInfo') + + this.buttonBuilder($r('app.string.message'), 'message', 'Message refresh card.') + } + .width(this.FULL_WIDTH_PERCENT) + .justifyContent(FlexAlign.SpaceBetween) + } + .height(this.FULL_HEIGHT_PERCENT) + .justifyContent(FlexAlign.SpaceBetween) + } + } + + build() { + Row() { + CardListComponent({ cardListParameter: this.cardListParameter }) { + this.cardListBuilder() + } + } + .height(this.FULL_HEIGHT_PERCENT) + .onClick(() => { + postCardAction(this, { + action: this.ACTION_TYPE, + abilityName: this.ABILITY_NAME, + params: { + message: this.MESSAGE + } + }); + }) + } +} + +export interface CardListItemData { + id: number; + title: ResourceStr; + content: ResourceStr; + icon?: Resource; +} + +export class FormData { + formId: string = ''; + formTime: string = ''; + cardList: Array = []; + + constructor(formId: string) { + this.formId = formId; + } +} \ No newline at end of file diff --git a/entry/src/main/ets/widget/view/CardListComponent.ets b/entry/src/main/ets/widget/view/CardListComponent.ets new file mode 100644 index 0000000000000000000000000000000000000000..064405a0da95f06c8a1cb2a8c42a41e88f4e1e42 --- /dev/null +++ b/entry/src/main/ets/widget/view/CardListComponent.ets @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CardListParameter } from '../viewmodel/CardListParameter'; + +@Component +export struct CardListComponent { + /** + * The max quantity of list items. + */ + readonly MAX_QUANTITY: number = 99; + /* + * The width percentage setting. + */ + readonly FULL_WIDTH_PERCENT: string = '100%'; + /* + * The height percentage setting. + */ + readonly FULL_HEIGHT_PERCENT: string = '100%'; + @BuilderParam customBuilderParam: () => void = this.customBuilder; + @Link cardListParameter: CardListParameter; + + @Builder + customBuilder() { + } + + build() { + if (this.cardListParameter !== undefined) { + Stack({ alignContent: Alignment.Bottom }) { + Column({ space: FlexAlign.Start }) { + Row() { + Row() { + Text(this.cardListParameter.title) + .fontSize($r('app.float.list_title_font_size')) + .fontWeight(FontWeight.Bold) + .height($r('app.float.list_title_height')) + .fontColor(this.cardListParameter.titleColor) + .padding({ right: $r('app.float.list_title_padding_right') }) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + + if (this.cardListParameter.isItemCount && this.cardListParameter.itemCount) { + Text(this.cardListParameter.itemCount > this.MAX_QUANTITY ? '99+' : + this.cardListParameter.itemCount + '') + .textAlign(TextAlign.Center) + .fontSize($r('app.float.item_count_font_size')) + .fontWeight(FontWeight.Medium) + .fontColor(this.cardListParameter.itemCountColor) + .backgroundColor(this.cardListParameter.itemCountBackgroundColor) + .width($r('app.float.item_count_width')) + .height($r('app.float.item_count_height')) + .borderRadius($r('app.float.item_count_radius')) + } + }.layoutWeight(1) + + Image(this.cardListParameter.logo) + .width($r('app.float.list_logo_size')) + .height($r('app.float.list_logo_size')) + .margin({ left: $r('app.float.icon_margin') }) + } + .width(this.FULL_WIDTH_PERCENT) + .alignItems(VerticalAlign.Top) + .justifyContent(FlexAlign.SpaceBetween) + .padding({ bottom: $r('app.float.list_row_padding_bottom') }) + + List() { + this.customBuilderParam() + } + .width(this.FULL_WIDTH_PERCENT) + .height(this.FULL_HEIGHT_PERCENT) + .layoutWeight(1) + .scrollBar(BarState.Off) + } + .pixelRound({ bottom: PixelRoundCalcPolicy.FORCE_CEIL }) + + Stack({ alignContent: Alignment.BottomEnd }) { + if (this.cardListParameter.isMask) { + Row() + .width(this.FULL_WIDTH_PERCENT) + .height($r('app.float.list_mask_height')) + .linearGradient({ + direction: GradientDirection.Top, + repeating: false, + colors: [[this.cardListParameter.maskColor, 0.0], ['#00ffffff', 1]] + }) + .pixelRound({ bottom: PixelRoundCalcPolicy.FORCE_CEIL }) + .hitTestBehavior(HitTestMode.None) + } + + if (this.cardListParameter.isBottomIcon) { + Image(this.cardListParameter.bottomIcon) + .width($r('app.float.bottom_icon_size')) + .height($r('app.float.bottom_icon_size')) + } + } + .width(this.FULL_WIDTH_PERCENT) + } + .backgroundImage(this.cardListParameter.backgroundImage) + .backgroundImageSize(this.cardListParameter.backgroundImageSize) + .backgroundColor(this.cardListParameter.backgroundColor) + .padding({ + top: $r('app.float.list_side_padding'), + bottom: $r('app.float.list_side_padding'), + left: $r('app.float.list_side_padding'), + right: $r('app.float.list_side_padding') + }) + } + } +} \ No newline at end of file diff --git a/entry/src/main/ets/widget/viewmodel/CardListParameter.ets b/entry/src/main/ets/widget/viewmodel/CardListParameter.ets new file mode 100644 index 0000000000000000000000000000000000000000..896fdcf2a79758954d108a03da5aa20276fddf06 --- /dev/null +++ b/entry/src/main/ets/widget/viewmodel/CardListParameter.ets @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class CardListParameter { + /** + * Card background color. + */ + backgroundColor: ResourceColor = ''; + /** + * Background image. + */ + backgroundImage?: ResourceStr; + /** + * ImageSize of background image. + */ + backgroundImageSize?: ImageSize; + /** + * Whether to set mask. + */ + isMask?: boolean; + /** + * Mask color. + */ + maskColor?: ResourceColor; + /** + * Whether to set item count. + */ + isItemCount?: boolean; + /** + * Item count. + */ + itemCount?: number; + /** + * Item count color. + */ + itemCountColor?: ResourceColor; + /** + * Item count background color. + */ + itemCountBackgroundColor?: ResourceColor; + /** + * Card list title. + */ + title: ResourceStr = ''; + /** + * Card list title color. + */ + titleColor?: ResourceColor; + /** + * Logo icon. + */ + logo?: ResourceStr; + /** + * Whether to display the bottom icon. + */ + isBottomIcon?: boolean; + /** + * Bottom icon. + */ + bottomIcon?: ResourceStr; + + constructor(backgroundColor: ResourceColor, title: ResourceStr, backgroundImage?: ResourceStr, + backgroundImageSize?: ImageSize, logo?: ResourceStr, isMask?: boolean, maskColor?: ResourceColor, + isItemCount?: boolean, itemCount?: number, itemCountColor?: ResourceColor, + itemCountBackgroundColor?: ResourceColor, titleColor?: ResourceColor, isBottomIcon?: boolean, + bottomIcon?: ResourceStr) { + this.backgroundColor = backgroundColor; + this.title = title; + this.backgroundImage = backgroundImage; + this.backgroundImageSize = backgroundImageSize; + this.logo = logo; + this.isMask = isMask; + this.maskColor = maskColor; + this.isItemCount = isItemCount; + this.itemCount = itemCount; + this.itemCountColor = itemCountColor; + this.itemCountBackgroundColor = itemCountBackgroundColor; + this.titleColor = titleColor; + this.isBottomIcon = isBottomIcon; + this.bottomIcon = bottomIcon; + } +} \ 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..00660b717133c227c7d83f90fa8e3ca405bcebd0 --- /dev/null +++ b/entry/src/main/module.json5 @@ -0,0 +1,74 @@ +{ + "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" + } + ] + }, + { + "name": "EntryFormAbility", + "srcEntry": "./ets/entryformability/EntryFormAbility.ets", + "label": "$string:EntryFormAbility_label", + "description": "$string:EntryFormAbility_desc", + "type": "form", + "metadata": [ + { + "name": "ohos.extension.form", + "resource": "$profile:form_config" + } + ] + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "always" + } + } + ] + } +} \ 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..2171512a7ae5aeeb8eaaeaf87994af626e51e824 --- /dev/null +++ b/entry/src/main/resources/base/element/color.json @@ -0,0 +1,20 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "card_list_background", + "value": "#FFFFFF" + }, + { + "name": "list_item_count_background", + "value": "#290a59f7" + }, + { + "name": "refresh_color", + "value": "#0A59F7" + } + ] +} \ 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..9f090b9f5538448988a196ca8da938b48d463a55 --- /dev/null +++ b/entry/src/main/resources/base/element/float.json @@ -0,0 +1,104 @@ +{ + "float": [ + { + "name": "list_title_font_size", + "value": "18fp" + }, + { + "name": "list_title_height", + "value": "24vp" + }, + { + "name": "list_title_padding_right", + "value": "4vp" + }, + { + "name": "item_count_font_size", + "value": "10fp" + }, + { + "name": "item_count_width", + "value": "24vp" + }, + { + "name": "item_count_height", + "value": "16vp" + }, + { + "name": "item_count_radius", + "value": "8vp" + }, + { + "name": "list_logo_size", + "value": "20vp" + }, + { + "name": "list_row_padding_bottom", + "value": "4vp" + }, + { + "name": "list_mask_height", + "value": "24vp" + }, + { + "name": "list_side_padding", + "value": "12vp" + }, + { + "name": "item_content_font_size", + "value": "12fp" + }, + { + "name": "item_text_height", + "value": "16vp" + }, + { + "name": "item_text_margin", + "value": "5vp" + }, + { + "name": "list_divider_margin", + "value": "6vp" + }, + { + "name": "list_row_margin", + "value": "4vp" + }, + { + "name": "item_image_size", + "value": "40vp" + }, + { + "name": "item_height", + "value": "50vp" + }, + { + "name": "bottom_icon_size", + "value": "32vp" + }, + { + "name": "icon_margin", + "value": "28vp" + }, + { + "name": "refresh_image_size", + "value": "24vp" + }, + { + "name": "text_image_space", + "value": "5vp" + }, + { + "name": "refresh_area_height", + "value": "52vp" + }, + { + "name": "refresh_area_width", + "value": "90vp" + }, + { + "name": "border_radius", + "value": "12vp" + } + ] +} \ 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..03a2021435aec76e709e31e691013582746f3d54 --- /dev/null +++ b/entry/src/main/resources/base/element/string.json @@ -0,0 +1,148 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "CardInfoRefresh" + }, + { + "name": "EntryFormAbility_desc", + "value": "form_description" + }, + { + "name": "EntryFormAbility_label", + "value": "form_label" + }, + { + "name": "widget_desc", + "value": "This is a service widget." + }, + { + "name": "widget_display_name", + "value": "widget" + }, + { + "name": "card_list_title", + "value": "Card info refresh" + }, + { + "name": "card_list_content", + "value": "Introduction" + }, + { + "name": "router", + "value": "router events" + }, + { + "name": "call", + "value": "call events" + }, + { + "name": "message", + "value": "message events" + }, + { + "name": "title1", + "value": "The advantages of ArkTS cards." + }, + { + "name": "content1", + "value": "Unified development paradigm to enhance development experience and efficiency. Enhanced the card's abilities, such as animation and custom drawing, making it more versatile." + }, + { + "name": "title2", + "value": "Constraints on ArkTS cards." + }, + { + "name": "content2", + "value": "When importing modules, only modules with the identifier 'supported for use in ArkTS cards' are supported. Importing shared packages is not supported. Not supported for development using native languages." + }, + { + "name": "title3", + "value": "Card expansion module." + }, + { + "name": "content3", + "value": "FormExtendAbility: A card extension module that provides lifecycle callbacks for card creation, destruction, and refresh." + }, + { + "name": "title4", + "value": "Card configuration." + }, + { + "name": "content4", + "value": "In the module. json 5 configuration file, configure the FormExtendeAbilities related information under the ExtendenAbility tag." + }, + { + "name": "title5", + "value": "Create an ArkTS card." + }, + { + "name": "content5", + "value": "There are currently two ways to create a card: when creating a project, select Application, which does not include a card by default. You can right-click to create a new card after creating the project. Alternatively, you can choose Atomic Service or right-click to create a new card after creating the project." + }, + { + "name": "title6", + "value": "Configure the configuration file of the card." + }, + { + "name": "content6", + "value": "The configuration files related to cards mainly include two parts: the configuration of FormExtendeAbility and the configuration of cards." + }, + { + "name": "title7", + "value": "Card lifecycle management." + }, + { + "name": "content7", + "value": "To create an ArkTS card, the FormExtendeAbility lifecycle interface needs to be implemented." + }, + { + "name": "title8", + "value": "Develop card page." + }, + { + "name": "content8", + "value": "Developers can use declarative paradigms to develop ArkTS card pages. The card page can also be automatically generated by DevEco Studio templates, and developers can adjust it according to their own business scenarios." + }, + { + "name": "title9", + "value": "Card usage dynamic effect capability." + }, + { + "name": "content9", + "value": "ArkTS cards have opened up the ability to use animation effects, supporting explicit animation, attribute animation, and component transition capabilities." + }, + { + "name": "title10", + "value": "Custom drawing ability for card usage." + }, + { + "name": "content10", + "value": "ArkTS cards have opened up the ability for custom drawing. On the card, a canvas can be created using the Canvas component, and then custom graphics can be drawn on the canvas using the CanvasRendering Context2D object." + }, + { + "name": "title11", + "value": "Card event capability." + }, + { + "name": "content11", + "value": "For dynamic cards, ArkTS cards provide a postCardAction interface for interaction between card internal and provider applications. Currently, it supports three types of events: router, message, and call, which can only be called within the card." + }, + { + "name": "title12", + "value": "Card Data Interaction Instructions." + }, + { + "name": "content12", + "value": "The ArkTS card framework provides the updateForm and requestForm interfaces to actively trigger the page refresh of the card, and confirms the card data that needs to be refreshed through LocalStoreProp." + } + ] +} \ No newline at end of file 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..f939c9fa8cc8914832e602198745f592a0dfa34d Binary files /dev/null and b/entry/src/main/resources/base/media/background.png differ diff --git a/entry/src/main/resources/base/media/bottom_icon.png b/entry/src/main/resources/base/media/bottom_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1274a51196f622372e01eaaa259a14d9d951e315 Binary files /dev/null and b/entry/src/main/resources/base/media/bottom_icon.png differ 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..4483ddad1f079e1089d685bd204ee1cfe1d01902 Binary files /dev/null and b/entry/src/main/resources/base/media/foreground.png differ diff --git a/entry/src/main/resources/base/media/item1.png b/entry/src/main/resources/base/media/item1.png new file mode 100644 index 0000000000000000000000000000000000000000..2f4883e78925e9e2a5153cc79f1cd892bf278db9 Binary files /dev/null and b/entry/src/main/resources/base/media/item1.png differ diff --git a/entry/src/main/resources/base/media/item10.png b/entry/src/main/resources/base/media/item10.png new file mode 100644 index 0000000000000000000000000000000000000000..9e1227fb9c1c8302ad2c2d252100706239756aed Binary files /dev/null and b/entry/src/main/resources/base/media/item10.png differ diff --git a/entry/src/main/resources/base/media/item11.png b/entry/src/main/resources/base/media/item11.png new file mode 100644 index 0000000000000000000000000000000000000000..14b9debabd215c09358e0620d66557b8f53ee43b Binary files /dev/null and b/entry/src/main/resources/base/media/item11.png differ diff --git a/entry/src/main/resources/base/media/item12.png b/entry/src/main/resources/base/media/item12.png new file mode 100644 index 0000000000000000000000000000000000000000..c26a604ee5b54ef042b26e748b08ce6b78f94ef5 Binary files /dev/null and b/entry/src/main/resources/base/media/item12.png differ diff --git a/entry/src/main/resources/base/media/item2.png b/entry/src/main/resources/base/media/item2.png new file mode 100644 index 0000000000000000000000000000000000000000..4761594f43d692ec317c3630ce735e5c794d0ad7 Binary files /dev/null and b/entry/src/main/resources/base/media/item2.png differ diff --git a/entry/src/main/resources/base/media/item3.png b/entry/src/main/resources/base/media/item3.png new file mode 100644 index 0000000000000000000000000000000000000000..0a81724c3e683e42fbb67a208d44dd63d29f370d Binary files /dev/null and b/entry/src/main/resources/base/media/item3.png differ diff --git a/entry/src/main/resources/base/media/item4.png b/entry/src/main/resources/base/media/item4.png new file mode 100644 index 0000000000000000000000000000000000000000..6d78a7c92871404ea268a17117f87e5b49a8c055 Binary files /dev/null and b/entry/src/main/resources/base/media/item4.png differ diff --git a/entry/src/main/resources/base/media/item5.png b/entry/src/main/resources/base/media/item5.png new file mode 100644 index 0000000000000000000000000000000000000000..99b1f3dca2004fb0d6f058dfc0187dd3be16fdea Binary files /dev/null and b/entry/src/main/resources/base/media/item5.png differ diff --git a/entry/src/main/resources/base/media/item6.png b/entry/src/main/resources/base/media/item6.png new file mode 100644 index 0000000000000000000000000000000000000000..b9f0fa88e5384157dbbb829383bb924a794cc85f Binary files /dev/null and b/entry/src/main/resources/base/media/item6.png differ diff --git a/entry/src/main/resources/base/media/item7.png b/entry/src/main/resources/base/media/item7.png new file mode 100644 index 0000000000000000000000000000000000000000..2aa9fd587c4059e87c95012894958c693d598f5c Binary files /dev/null and b/entry/src/main/resources/base/media/item7.png differ diff --git a/entry/src/main/resources/base/media/item8.png b/entry/src/main/resources/base/media/item8.png new file mode 100644 index 0000000000000000000000000000000000000000..ce599873872f39a2c686ee2928ddb77688d42205 Binary files /dev/null and b/entry/src/main/resources/base/media/item8.png differ diff --git a/entry/src/main/resources/base/media/item9.png b/entry/src/main/resources/base/media/item9.png new file mode 100644 index 0000000000000000000000000000000000000000..8461bc2fd42f0856adb99e876e01cd19597661e1 Binary files /dev/null and b/entry/src/main/resources/base/media/item9.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/list_background.png b/entry/src/main/resources/base/media/list_background.png new file mode 100644 index 0000000000000000000000000000000000000000..2f4883e78925e9e2a5153cc79f1cd892bf278db9 Binary files /dev/null and b/entry/src/main/resources/base/media/list_background.png differ diff --git a/entry/src/main/resources/base/media/list_item.png b/entry/src/main/resources/base/media/list_item.png new file mode 100644 index 0000000000000000000000000000000000000000..a9157a50d764962099df0be9417681bdade82c03 Binary files /dev/null and b/entry/src/main/resources/base/media/list_item.png differ diff --git a/entry/src/main/resources/base/media/logo.png b/entry/src/main/resources/base/media/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..4a8453a43dad82a620928d9051eb467600d19b31 Binary files /dev/null and b/entry/src/main/resources/base/media/logo.png differ diff --git a/entry/src/main/resources/base/media/refresh.png b/entry/src/main/resources/base/media/refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..fa3fc28487e7a1fbdc45fcc3680d12740d4a44bf Binary files /dev/null and b/entry/src/main/resources/base/media/refresh.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/form_config.json b/entry/src/main/resources/base/profile/form_config.json new file mode 100644 index 0000000000000000000000000000000000000000..bdc0a6bd4c5a6cc7c67d421b62d404e3bb912408 --- /dev/null +++ b/entry/src/main/resources/base/profile/form_config.json @@ -0,0 +1,25 @@ +{ + "forms": [ + { + "name": "card_info_refresh", + "displayName": "$string:widget_display_name", + "description": "$string:widget_desc", + "src": "./ets/widget/pages/WidgetCard.ets", + "uiSyntax": "arkts", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "colorMode": "auto", + "isDynamic": true, + "isDefault": true, + "updateEnabled": true, + "scheduledUpdateTime": "14:00", + "updateDuration": 0, + "defaultDimension": "4*4", + "supportDimensions": [ + "4*4" + ] + } + ] +} \ 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/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..b42f30989642ca77aa95a82c1fcf5816e1e8c3b5 --- /dev/null +++ b/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,148 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "CardInfoRefresh" + }, + { + "name": "EntryFormAbility_desc", + "value": "form_description" + }, + { + "name": "EntryFormAbility_label", + "value": "form_label" + }, + { + "name": "widget_desc", + "value": "This is a service widget." + }, + { + "name": "widget_display_name", + "value": "widget" + }, + { + "name": "card_list_title", + "value": "Card info refresh" + }, + { + "name": "card_list_content", + "value": "Introduction" + }, + { + "name": "router", + "value": "router events" + }, + { + "name": "call", + "value": "call events" + }, + { + "name": "message", + "value": "message events" + }, + { + "name": "title1", + "value": "The advantages of ArkTS cards." + }, + { + "name": "content1", + "value": "Unified development paradigm to enhance development experience and efficiency. Enhanced the card's abilities, such as animation and custom drawing, making it more versatile." + }, + { + "name": "title2", + "value": "Constraints on ArkTS cards." + }, + { + "name": "content2", + "value": "When importing modules, only modules with the identifier 'supported for use in ArkTS cards' are supported. Importing shared packages is not supported. Not supported for development using native languages." + }, + { + "name": "title3", + "value": "Card expansion module." + }, + { + "name": "content3", + "value": "FormExtendeAbility: A card extension module that provides lifecycle callbacks for card creation, destruction, and refresh." + }, + { + "name": "title4", + "value": "Card configuration." + }, + { + "name": "content4", + "value": "In the module. json 5 configuration file, configure the FormExtendeAbilities related information under the ExtendenAbility tag." + }, + { + "name": "title5", + "value": "Create an ArkTS card." + }, + { + "name": "content5", + "value": "There are currently two ways to create a card: when creating a project, select Application, which does not include a card by default. You can right-click to create a new card after creating the project. Alternatively, you can choose Atomic Service or right-click to create a new card after creating the project." + }, + { + "name": "title6", + "value": "Configure the configuration file of the card." + }, + { + "name": "content6", + "value": "The configuration files related to cards mainly include two parts: the configuration of FormExtendeAbility and the configuration of cards." + }, + { + "name": "title7", + "value": "Card lifecycle management." + }, + { + "name": "content7", + "value": "To create an ArkTS card, the FormExtendeAbility lifecycle interface needs to be implemented." + }, + { + "name": "title8", + "value": "Develop card page." + }, + { + "name": "content8", + "value": "Developers can use declarative paradigms to develop ArkTS card pages. The card page can also be automatically generated by DevEco Studio templates, and developers can adjust it according to their own business scenarios." + }, + { + "name": "title9", + "value": "Card usage dynamic effect capability." + }, + { + "name": "content9", + "value": "ArkTS cards have opened up the ability to use animation effects, supporting explicit animation, attribute animation, and component transition capabilities." + }, + { + "name": "title10", + "value": "Custom drawing ability for card usage." + }, + { + "name": "content10", + "value": "ArkTS cards have opened up the ability for custom drawing. On the card, a canvas can be created using the Canvas component, and then custom graphics can be drawn on the canvas using the CanvasRendering Context2D object." + }, + { + "name": "title11", + "value": "Card event capability." + }, + { + "name": "content11", + "value": "For dynamic cards, ArkTS cards provide a postCardAction interface for interaction between card internal and provider applications. Currently, it supports three types of events: router, message, and call, which can only be called within the card." + }, + { + "name": "title12", + "value": "Card Data Interaction Instructions." + }, + { + "name": "content12", + "value": "The ArkTS card framework provides the updateForm and requestForm interfaces to actively trigger the page refresh of the card, and confirms the card data that needs to be refreshed through LocalStoreProp." + } + ] +} \ 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..39829c88fabb826737c016843c4ec239808292d7 --- /dev/null +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,148 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "卡片更新" + }, + { + "name": "EntryFormAbility_desc", + "value": "form_description" + }, + { + "name": "EntryFormAbility_label", + "value": "form_label" + }, + { + "name": "widget_desc", + "value": "This is a service widget." + }, + { + "name": "widget_display_name", + "value": "widget" + }, + { + "name": "card_list_title", + "value": "卡片更新" + }, + { + "name": "card_list_content", + "value": "Introduction" + }, + { + "name": "router", + "value": "router事件" + }, + { + "name": "call", + "value": "call事件" + }, + { + "name": "message", + "value": "message事件" + }, + { + "name": "title1", + "value": "ArkTS卡片的优势" + }, + { + "name": "content1", + "value": "统一开发范式,提升开发体验和开发效率。增强了卡片的能力,如动效的能力、自定义绘制的能力等,使卡片更加万能。" + }, + { + "name": "title2", + "value": "ArkTS卡片的约束" + }, + { + "name": "content2", + "value": "当导入模块时,仅支持导入标识“支持在ArkTS卡片中使用”的模块。不支持导入共享包。不支持使用native语言开发。" + }, + { + "name": "title3", + "value": "卡片扩展模块" + }, + { + "name": "content3", + "value": "FormExtensionAbility:卡片扩展模块,提供卡片创建、销毁、刷新等生命周期回调。" + }, + { + "name": "title4", + "value": "卡片配置" + }, + { + "name": "content4", + "value": "在module.json5配置文件中的extensionAbilities标签下,配置FormExtensionAbility相关信息。" + }, + { + "name": "title5", + "value": "创建一个ArkTS卡片" + }, + { + "name": "content5", + "value": "创建卡片当前有两种入口:创建工程时,选择Application,默认不带卡片,可以在创建工程后右键新建卡片。或选择Atomic Service,也可以在创建工程后右键新建卡片。" + }, + { + "name": "title6", + "value": "配置卡片的配置文件" + }, + { + "name": "content6", + "value": "卡片相关的配置文件主要包含FormExtensionAbility的配置和卡片的配置两部分。" + }, + { + "name": "title7", + "value": "卡片生命周期管理" + }, + { + "name": "content7", + "value": "创建ArkTS卡片,需实现FormExtensionAbility生命周期接口。" + }, + { + "name": "title8", + "value": "开发卡片页面" + }, + { + "name": "content8", + "value": "开发者可以使用声明式范式开发ArkTS卡片页面。卡片页面也可以由DevEco Studio模板自动生成,开发者可以根据自身的业务场景进行调整。" + }, + { + "name": "title9", + "value": "卡片使用动效能力" + }, + { + "name": "content9", + "value": "ArkTS卡片开放了使用动画效果的能力,支持显式动画、属性动画、组件内转场能力。" + }, + { + "name": "title10", + "value": "卡片使用自定义绘制能力" + }, + { + "name": "content10", + "value": "ArkTS卡片开放了自定义绘制的能力,在卡片上可以通过Canvas组件创建一块画布,然后通过CanvasRenderingContext2D对象在画布上进行自定义图形的绘制。" + }, + { + "name": "title11", + "value": "卡片事件能力" + }, + { + "name": "content11", + "value": "针对动态卡片,ArkTS卡片中提供了postCardAction接口用于卡片内部和提供方应用间的交互,当前支持router、message和call三种类型的事件,仅在卡片中可以调用。" + }, + { + "name": "title12", + "value": "卡片数据交互说明" + }, + { + "name": "content12", + "value": "ArkTS卡片框架提供了updateForm接口和requestForm接口主动触发卡片的页面刷新,通过LocalStorageProp确认需要刷新的卡片数据。" + } + ] +} \ No newline at end of file diff --git a/hvigor/hvigor-config.json5 b/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..06b2783670a348f95533b352c1ceda909a842bbc --- /dev/null +++ b/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/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..ebdda7e54d1c41e952f1c7f6993c6d15ea3d146d --- /dev/null +++ b/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/screenshots/form.png b/screenshots/form.png new file mode 100644 index 0000000000000000000000000000000000000000..457a55783817e80c2bde80d27c8d22b53767a36f Binary files /dev/null and b/screenshots/form.png differ