diff --git a/AppScope/app.json5 b/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f44d8a0caa2a224e7655efa91e67251de411c9bb --- /dev/null +++ b/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.multipleimages", + "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..f627990995eebc9df9600a893501631c3ceab64c --- /dev/null +++ b/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MultipleImages" + } + ] +} 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.md b/README.md index bf6fde627a8fac170a1accfd35ff8fed19004529..f027cf629445dfef01cb42dacdb07e458f365d52 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,39 @@ -# MultipleImage - -#### 介绍 -{**以下是 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/) +# **多图片合集** +## 介绍 +基于Swiper组件和自定义指示器实现多图片合计功能。 + +在短视频平台上,经常可以见到多图片合集。它的特点是:由多张图片组成一个合集,图片可以自动进行轮播,也可以手动去进行图片切换。图片下方的进度条 +会跟随图片的切换而切换。 + +多图片合集展示效果是一个常见的UI效果: +* 当作品自动播放时,图片可自动切换,下方进度条缓慢增长,且进度与该图片停留时间匹配。 +* 当作品手动播放时,下方进度条会根据图片切换改变为未完成进度状态或已完成进度状态。 + +## 预览效果 +![](\screenshots\device\image.gif) +## 工程目录 +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ └──CommonConstants.ets // 常量 +│ ├──entryability +│ │ └──EntryAbility.ets // 程序入口类 +│ ├──entrybackupability +│ │ └──EntryBackupAbility.ets +│ ├──pages +│ │ └──Index.ets // 多图片合集页 +│ └──utils.ets +│ └──DataSource.ets // 图片数据资源类 +└──entry/src/main/resources // 应用资源目录 +``` +## 相关权限 +无 + +## 约束与限制 +* 本示例仅支持标准系统上运行,支持设备:华为手机。 + +* HarmonyOS系统:HarmonyOS NEXT Developer Beta5及以上。 + +* DevEco Studio版本:DevEco Studio NEXT Developer Beta5及以上。 + +* 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..b2cc02977d74631a63703f33a1ae6c1f94d81219 --- /dev/null +++ b/build-profile.json5 @@ -0,0 +1,36 @@ +{ + "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..022da48cdeeb580b0259d8145daa90ecd7e3c09e --- /dev/null +++ b/entry/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "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..beb7c240e71fe440efac5279a43666f2941e6ed6 --- /dev/null +++ b/entry/src/main/ets/common/CommonConstants.ets @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 CommonConstants { + /** + * Full percent. + */ + static readonly FULL_PERCENT: string = '100%'; + + /** + * Foldable percent. + */ + static readonly Foldable_PERCENT: string = '70%'; + + /** + * None percent. + */ + static readonly NONE_PERCENT: string = '0'; + + /** + * Swiper initially currentIndex. + */ + static readonly INITIALLY_CURRENT_INDEX: number = -1; + + /** + * Swiper slide index. + */ + static readonly SLIDE_INDEX: number = -1; + + /** + * Swiper image duration. + */ + static readonly IMAGE_DURATION: number = 300; + + /** + * Swiper duration. + */ + static readonly DURATION: number = 3000; + + /** + * Swiper interval. + */ + static readonly INTERVAL: number = 3000; + + /** + * Swiper item space. + */ + static readonly ITEM_SPACE: number = 0; + + /** + * Swiper interval duration. + */ + static readonly INITIALLY_DURATION: number = 300; + + /** + * Swiper duration. + */ + static readonly NO_DURATION: number = 0; + + /** + * Swiper max height. + */ + static readonly SWIPER_MAX_HEIGHT: number = 333; + + /** + * Swiper cached count. + */ + static readonly SWIPER_CACHED_COUNT: number = 2; + + /** + * Progress wrap height. + */ + static readonly PROGRESS_WRAP_HEIGHT: number = 50; + + /** + * zIndex. + */ + static readonly Z_INDEX_0: number = 0; + + /** + * zIndex. + */ + static readonly Z_INDEX_1: number = 1; + + /** + * zIndex. + */ + static readonly Z_INDEX_2: number = 2; + + /** + * zIndex. + */ + static readonly Z_INDEX_3: number = 3; + + /** + * Swiper initially Index. + */ + static readonly INITIALLY_INDEX: number = 0; + + /** + * Layout weight. + */ + static readonly LAYOUT_WEIGHT: number = 1; + + /** + * Column height. + */ + static readonly COLUMN_HEIGHT: number = 100; + + /** + * Multipart form text weight. + */ + static readonly FORM_TEXT_FONT_WEIGHT: number = 500; + + /** + * Row space. + */ + static readonly ROW_SPACE: number = 5; + + /** + * Column space. + */ + static readonly COLUMN_SPACE: number = 16; + + /** + * Column space inside. + */ + static readonly COLUMN_SPACE_INSIDE: number = 8; +} \ 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..7592f47e01b4717265b8cd910855e6ee0779ec2a --- /dev/null +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + + let windowClass: window.Window | null = null; + windowStage.getMainWindow((err: BusinessError, data) => { + let errCode: number = err.code; + if (errCode) { + hilog.error(0x0000, 'testTag', 'Failed to obtain the main window. Cause: %{public}s', + JSON.stringify(err) ?? ''); + return; + } + windowClass = data; + hilog.info(0x0000, 'testTag', 'Succeeded in obtaining the main window.'); + + windowClass.setWindowLayoutFullScreen(true); + let sysBarProps: window.SystemBarProperties = { + statusBarColor: '#000000', + navigationBarColor: '#000000', + statusBarContentColor: '#ffffff', + navigationBarContentColor: '#ffffff' + }; + windowClass.setWindowSystemBarProperties(sysBarProps); + }) + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..f761896856d183e1085b804cfde0d84aeab41ee8 --- /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/pages/Index.ets b/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..e7350757d18873e11c2df8bf9cfecf8059b9cc51 --- /dev/null +++ b/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,275 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 { DataSource, PhotoData } from '../util/DataSource'; +import { CommonConstants } from '../common//CommonConstants'; +import { common } from '@kit.AbilityKit'; +import { display } from '@kit.ArkUI'; + +@Entry +@Component +struct Index { + private swiperController: SwiperController = new SwiperController(); + @State progressData: PhotoData[] = []; + @State data: DataSource = new DataSource([]); + @State currentIndex: number = CommonConstants.INITIALLY_CURRENT_INDEX; + @State slideIndex: number = CommonConstants.SLIDE_INDEX; + @State duration: number = CommonConstants.DURATION; + @State swiperMaxHeight: number = CommonConstants.SWIPER_MAX_HEIGHT; + @State progressHeight: number = CommonConstants.PROGRESS_WRAP_HEIGHT; + @State slide: boolean = false; + @State foldStatus: number = 2; + @State isFoldable: boolean = false; + scroller: Scroller = new Scroller(); + + aboutToAppear(): void { + this.isFoldable = display.isFoldable(); + let foldStatus: display.FoldStatus = display.getFoldStatus(); + if (this.isFoldable) { + this.foldStatus = foldStatus; + let callback: Callback = () => { + let data: display.FoldStatus = display.getFoldStatus(); + this.foldStatus = data; + } + display.on('change', callback); + } + let list: PhotoData[] = []; + for (let i = 1; i <= 7; i++) { + let newPhotoData = new PhotoData(); + newPhotoData.id = i; + list.push(newPhotoData); + } + this.progressData = list; + this.data = new DataSource(list); + } + + @Builder + progressComponent() { + Row({ space: CommonConstants.ROW_SPACE }) { + ForEach(this.progressData, (item: PhotoData, index: number) => { + Stack({ alignContent: Alignment.Start }) { + Row() + .zIndex(CommonConstants.Z_INDEX_0) + .width(CommonConstants.FULL_PERCENT) + .height($r('app.float.row_height')) + .borderRadius($r('app.float.row_borderRadius')) + .backgroundColor(Color.Grey) + Row() + .zIndex(CommonConstants.Z_INDEX_1) + .width(this.currentIndex >= index && !this.slide ? CommonConstants.FULL_PERCENT : + CommonConstants.NONE_PERCENT) + .height($r('app.float.row_height')) + .borderRadius($r('app.float.row_borderRadius')) + .backgroundColor(Color.White) + .animation(!this.slide ? { + duration: this.duration - 400, + curve: Curve.Linear, + iterations: 1, + playMode: PlayMode.Normal, + onFinish: () => { + if (this.currentIndex === this.progressData.length - 1) { + this.duration = 400; + this.currentIndex = -1; + } + } + } : { + duration: 0 + }) + Row() + .zIndex(CommonConstants.Z_INDEX_2) + .width(this.currentIndex >= index && this.slide ? CommonConstants.FULL_PERCENT : + CommonConstants.NONE_PERCENT) + .height($r('app.float.row_height')) + .borderRadius($r('app.float.row_borderRadius')) + .backgroundColor(Color.White) + } + .layoutWeight(CommonConstants.LAYOUT_WEIGHT) + }, (item: PhotoData) => JSON.stringify(item)) + } + .width(CommonConstants.FULL_PERCENT) + .height(CommonConstants.PROGRESS_WRAP_HEIGHT) + } + + build() { + Column() { + Row() { + Image($r('app.media.back')) + .width($r('app.float.image_width')) + .height($r('app.float.image_height')) + .margin({ top: $r('app.float.image_margin_top') }) + } + .width(CommonConstants.FULL_PERCENT) + .height($r('app.float.row_image_height')) + .padding({ left: $r('app.float.padding_left'), right: $r('app.float.padding_right') }) + + Stack({ alignContent: Alignment.BottomStart }) { + Scroll() { + List() { + ListItem() { + Swiper(this.swiperController) { + LazyForEach(this.data, (item: PhotoData, index: number) => { + Image($r(`app.media.` + item.id)) + .width(this.foldStatus === 2 ? CommonConstants.FULL_PERCENT: CommonConstants.Foldable_PERCENT) + .height(CommonConstants.FULL_PERCENT) + }, (item: PhotoData) => JSON.stringify(item)) + } + .cachedCount(CommonConstants.SWIPER_CACHED_COUNT) + .index($$this.slideIndex) + .autoPlay(!this.slide ? true : false) + .interval(CommonConstants.INTERVAL) + .loop(!this.slide ? true : false) + .indicatorInteractive(false) + .duration(CommonConstants.IMAGE_DURATION) + .itemSpace(CommonConstants.ITEM_SPACE) + .indicator(false) + .displayArrow(false) + .curve(Curve.Linear) + .onChange((index: number) => { + this.duration = 3000; + this.currentIndex = index; + }) + .onAppear(() => { + this.currentIndex = 0; + }) + .onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => { + if (extraInfo.currentOffset > 0 && index === 0 && !this.slide) { + let context = getContext(this) as common.UIAbilityContext; + context.terminateSelf(); + } + this.slide = true; + if (extraInfo.currentOffset > 0 && this.currentIndex > 0) { + this.currentIndex = index - 1; + } + }) + } + .width(CommonConstants.FULL_PERCENT) + .height(this.swiperMaxHeight) + } + .width(CommonConstants.FULL_PERCENT) + .height(CommonConstants.FULL_PERCENT) + .sticky(StickyStyle.Footer) + } + .layoutWeight(CommonConstants.LAYOUT_WEIGHT) + + Column() { + Column({ space: CommonConstants.COLUMN_SPACE }) { + Image($r('app.media.avatar')) + .width($r('app.float.image_width')) + .height($r('app.float.image_height')) + .borderRadius($r('app.float.image_borderRadius')) + Column({ space: CommonConstants.COLUMN_SPACE_INSIDE }) { + Image($r("app.media.favor")) + .width($r('app.float.image_width_inside')) + .height($r('app.float.image_height_inside')) + Text($r('app.string.collection')) + .fontSize($r('app.float.text_font_size')) + .fontColor(Color.White) + } + .width($r('app.float.column_width')) + .height($r('app.float.column_height')) + + Column({ space: CommonConstants.COLUMN_SPACE_INSIDE }) { + Image($r('app.media.comments')) + .width($r('app.float.image_width_inside')) + .height($r('app.float.image_height_inside')) + Text($r('app.string.Comments')) + .fontSize($r('app.float.text_font_size')) + .fontColor(Color.White) + } + .width($r('app.float.column_width')) + .height($r('app.float.column_height')) + + Column({ space: CommonConstants.COLUMN_SPACE_INSIDE }) { + Image($r('app.media.share')) + .width($r('app.float.image_width_inside')) + .height($r('app.float.image_height_inside')) + Text($r('app.string.share')) + .fontSize($r('app.float.text_font_size')) + .fontColor(Color.White) + } + .width($r('app.float.column_width')) + .height($r('app.float.column_height')) + + Image($r('app.media.recording')) + .width($r('app.float.image_width')) + .height($r('app.float.image_height')) + .borderRadius($r('app.float.image_borderRadius')) + } + .margin({ top: $r('app.float.column_image_margin_top') }) + } + .width(CommonConstants.FULL_PERCENT) + .height(CommonConstants.FULL_PERCENT) + .alignItems(HorizontalAlign.End) + .justifyContent(FlexAlign.Center) + .padding({ left: $r('app.float.column_padding_left'), right: $r('app.float.column_padding_right') }) + .hitTestBehavior(HitTestMode.Transparent) + + Column() { + Column({ space: CommonConstants.COLUMN_SPACE_INSIDE }) { + Row() { + Text($r('app.string.cute_pet')) + .fontWeight(FontWeight.Bold) + .fontColor(Color.White) + Text($r('app.string.dots')) + .fontColor(Color.White) + .margin({ left: 6, right: 6 }) + Text($r('app.string.date')) + .fontColor(Color.White) + } + .width(CommonConstants.FULL_PERCENT) + .justifyContent(FlexAlign.Start) + .margin({ top: $r('app.float.row_margin_top') }) + + Row() { + Text($r('app.string.pets')) + .fontWeight(FontWeight.Bold) + .fontColor(Color.White) + Text($r('app.string.dog')) + .fontColor(Color.White) + .margin({ left: $r('app.float.text_margin_left'), right: $r('app.float.text_margin_right') }) + Text($r('app.string.spoiled')) + .fontColor(Color.White) + } + .width(CommonConstants.FULL_PERCENT) + .justifyContent(FlexAlign.Start) + + this.progressComponent(); + } + + TextInput({ placeholder: $r('app.string.placeholder') }) + .width(CommonConstants.FULL_PERCENT) + .backgroundColor($r('app.color.textInput_backgroundColor')) + .fontColor(Color.White) + .placeholderColor(Color.White) + .focusable(false) + } + .width(CommonConstants.FULL_PERCENT) + .height($r('app.float.description_column_height')) + .padding({ + left: $r('app.float.padding_left'), + right: $r('app.float.padding_right'), + bottom: $r('app.float.padding_bottom') + }) + .hitTestBehavior(HitTestMode.Transparent) + .justifyContent(FlexAlign.SpaceBetween) + } + .margin({ top: $r('app.float.stack_margin_top'), }) + .height($r('app.float.stack_height')) + } + .backgroundColor(Color.Black) + .height(CommonConstants.FULL_PERCENT) + .width(CommonConstants.FULL_PERCENT) + } +} \ No newline at end of file diff --git a/entry/src/main/ets/util/DataSource.ets b/entry/src/main/ets/util/DataSource.ets new file mode 100644 index 0000000000000000000000000000000000000000..18b7523141a672f67c344e799086512bb48f0be3 --- /dev/null +++ b/entry/src/main/ets/util/DataSource.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class DataSource implements IDataSource { + private list: Array = []; + + constructor(list: Array) { + this.list = list; + } + + totalCount(): number { + return this.list.length; + } + + getData(index: number): PhotoData { + return this.list[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + } +} + +class PhotoData { + total: number = 7; + value: number = 0; + id: number = -1; +} + +export { DataSource, PhotoData } \ 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..6db519bef8d786bf5bea73d37a8fa2027fbfea64 --- /dev/null +++ b/entry/src/main/resources/base/element/color.json @@ -0,0 +1,12 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "textInput_backgroundColor", + "value": "#33FFFFFF" + } + ] +} \ 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..9e5865214ae9241ba0e824df650227509e216279 --- /dev/null +++ b/entry/src/main/resources/base/element/float.json @@ -0,0 +1,100 @@ +{ + "float": [ + { + "name": "row_height", + "value": "2vp" + }, + { + "name": "row_borderRadius", + "value": "2vp" + }, + { + "name": "image_width", + "value": "40vp" + }, + { + "name": "image_margin_top", + "value": "72vp" + }, + { + "name": "image_height", + "value": "40vp" + }, + { + "name": "image_borderRadius", + "value": "40vp" + }, + { + "name": "image_width_inside", + "value": "29vp" + }, + { + "name": "image_height_inside", + "value": "25vp" + }, + { + "name": "column_image_margin_top", + "value": "80vp" + }, + { + "name": "row_image_height", + "value": "56vp" + }, + { + "name": "padding_left", + "value": "16vp" + }, + { + "name": "column_padding_left", + "value": "12vp" + }, + { + "name": "column_padding_right", + "value": "12vp" + }, + { + "name": "padding_right", + "value": "16vp" + }, + { + "name": "padding_bottom", + "value": "32vp" + }, + { + "name": "text_font_size", + "value": "12vp" + }, + { + "name": "column_width", + "value": "60vp" + }, + { + "name": "column_height", + "value": "52vp" + }, + { + "name": "text_margin_left", + "value": "6vp" + }, + { + "name": "text_margin_right", + "value": "6vp" + }, + { + "name": "row_margin_top", + "value": "24vp" + }, + { + "name": "description_column_height", + "value": "200vp" + }, + { + "name": "stack_height", + "value": "640vp" + }, + { + "name": "stack_margin_top", + "value": "120vp" + } + ] +} \ 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..0d958bd80f746369c3ba51bc092b7e5cb24c188d --- /dev/null +++ b/entry/src/main/resources/base/element/string.json @@ -0,0 +1,56 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Multiple Images" + }, + { + "name": "cute_pet", + "value": "@Cute Pet" + }, + { + "name": "dots", + "value": "·" + }, + { + "name": "date", + "value": "08-14" + }, + { + "name": "pets", + "value": "#Pets" + }, + { + "name": "dog", + "value": "#Dog" + }, + { + "name": "spoiled", + "value": "#Spoiled" + }, + { + "name": "placeholder", + "value": "Commentary" + }, + { + "name": "collection", + "value": "12" + }, + { + "name": "Comments", + "value": "Comments" + }, + { + "name": "share", + "value": "5" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/media/1.jpg b/entry/src/main/resources/base/media/1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..288336ad1a3047d23a1efb8a1f4197a0eb158f0f Binary files /dev/null and b/entry/src/main/resources/base/media/1.jpg differ diff --git a/entry/src/main/resources/base/media/2.jpg b/entry/src/main/resources/base/media/2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..dee92d99ec2b8094d62c505f044a2cae8acf08d7 Binary files /dev/null and b/entry/src/main/resources/base/media/2.jpg differ diff --git a/entry/src/main/resources/base/media/3.jpg b/entry/src/main/resources/base/media/3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d57f20d03d74e980878e44292e7d89132020e097 Binary files /dev/null and b/entry/src/main/resources/base/media/3.jpg differ diff --git a/entry/src/main/resources/base/media/4.jpg b/entry/src/main/resources/base/media/4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..679228c56459fb4701894c558aaa567b822cdfe8 Binary files /dev/null and b/entry/src/main/resources/base/media/4.jpg differ diff --git a/entry/src/main/resources/base/media/5.jpg b/entry/src/main/resources/base/media/5.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f6e47f8c6b51bafd7165394e263fc12026dda082 Binary files /dev/null and b/entry/src/main/resources/base/media/5.jpg differ diff --git a/entry/src/main/resources/base/media/6.jpg b/entry/src/main/resources/base/media/6.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6497585c09712892c5b638937f6866f63932ca2b Binary files /dev/null and b/entry/src/main/resources/base/media/6.jpg differ diff --git a/entry/src/main/resources/base/media/7.jpg b/entry/src/main/resources/base/media/7.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6bd3b541382433a660ecf3c60120ff11ae824a88 Binary files /dev/null and b/entry/src/main/resources/base/media/7.jpg differ diff --git a/entry/src/main/resources/base/media/avatar.svg b/entry/src/main/resources/base/media/avatar.svg new file mode 100644 index 0000000000000000000000000000000000000000..8d8aee10e5dcdf791ec3039a0da016e3f74390ab --- /dev/null +++ b/entry/src/main/resources/base/media/avatar.svg @@ -0,0 +1,13 @@ + + + Created with Pixso. + + + + + + + + + + diff --git a/entry/src/main/resources/base/media/back.png b/entry/src/main/resources/base/media/back.png new file mode 100644 index 0000000000000000000000000000000000000000..d781ec00721fe355c96204bedf517ff3062c5ef2 Binary files /dev/null and b/entry/src/main/resources/base/media/back.png differ 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/comments.svg b/entry/src/main/resources/base/media/comments.svg new file mode 100644 index 0000000000000000000000000000000000000000..8541166dce4f5ea8f9b5f3ccf24fa5b2649ead71 --- /dev/null +++ b/entry/src/main/resources/base/media/comments.svg @@ -0,0 +1,14 @@ + + + Created with Pixso. + + + + + + + + + + + diff --git a/entry/src/main/resources/base/media/favor.svg b/entry/src/main/resources/base/media/favor.svg new file mode 100644 index 0000000000000000000000000000000000000000..d79b33902c6a45a8603b39c7dc5c486592e8d214 --- /dev/null +++ b/entry/src/main/resources/base/media/favor.svg @@ -0,0 +1,14 @@ + + + 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..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/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/recording.svg b/entry/src/main/resources/base/media/recording.svg new file mode 100644 index 0000000000000000000000000000000000000000..1395e9529be0fe0b39f83a29b7338a92e10b8279 --- /dev/null +++ b/entry/src/main/resources/base/media/recording.svg @@ -0,0 +1,15 @@ + + + Created with Pixso. + + + + + + + + + + + + diff --git a/entry/src/main/resources/base/media/share.svg b/entry/src/main/resources/base/media/share.svg new file mode 100644 index 0000000000000000000000000000000000000000..2cad06df681ccf667bf2a18ee979bcd87084a881 --- /dev/null +++ b/entry/src/main/resources/base/media/share.svg @@ -0,0 +1,14 @@ + + + Created with Pixso. + + + + + + + + + + + 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/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..267fd153648a7e0d2c9e64380835afcde8f28778 --- /dev/null +++ b/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,56 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Multiple Images" + }, + { + "name": "cute_pet", + "value": "@Cute Pet" + }, + { + "name": "dots", + "value": "·" + }, + { + "name": "date", + "value": "08-14" + }, + { + "name": "pets", + "value": "#Pets" + }, + { + "name": "dog", + "value": "#Dog" + }, + { + "name": "spoiled", + "value": "#Spoiled" + }, + { + "name": "placeholder", + "value": "Commentary" + }, + { + "name": "collection", + "value": "12" + }, + { + "name": "commentary", + "value": "Commentary" + }, + { + "name": "share", + "value": "5" + } + ] +} \ 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..1bfc5d8e8bd8766c3b72a21a68c2534be60dd982 --- /dev/null +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,56 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "多图片合集" + }, + { + "name": "cute_pet", + "value": "@欢乐萌宠" + }, + { + "name": "dots", + "value": "·" + }, + { + "name": "date", + "value": "08-14" + }, + { + "name": "pets", + "value": "#宠物" + }, + { + "name": "dog", + "value": "#小狗" + }, + { + "name": "spoiled", + "value": "#萌坏了" + }, + { + "name": "placeholder", + "value": "评论" + }, + { + "name": "collection", + "value": "12" + }, + { + "name": "commentary", + "value": "评论" + }, + { + "name": "share", + "value": "5" + } + ] +} \ 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..62b1c6e70b72320b7005315f5efd9cc089d62ba2 --- /dev/null +++ b/oh-package.json5 @@ -0,0 +1,11 @@ +{ + "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/device/image.gif b/screenshots/device/image.gif new file mode 100644 index 0000000000000000000000000000000000000000..cbd9208f979ec9602a701acc17977e8a6699b41c Binary files /dev/null and b/screenshots/device/image.gif differ