diff --git a/AppScope/app.json5 b/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bec8b5df3484943b87d93e2dec174fa5a7115fbd --- /dev/null +++ b/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.desktopshortcuts", + "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..be974f8d32bcb68f7b74e142c2bb0f5dd1bea33d --- /dev/null +++ b/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "DesktopShortcuts" + } + ] +} diff --git a/AppScope/resources/base/media/app_icon.png b/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..6d85d5bef39a733abdc72ccbf80158567cc12ccf 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 7256832a84abfa17e47862058f99ff2ac2ae80ef..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# DesktopShortcut - -#### 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 74a8ab73cef24e78c245cf828c64e4efbafa6ad3..6aada342939dc1139f9459f2542032923c07e220 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,37 @@ -# DesktopShortcut - -#### 介绍 -{**以下是 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/) +# 桌面快捷方式开发实践 +## 介绍 +桌面快捷方式能让用户快速访问应用的核心功能,有效提高操作效率,同时增加用户对应用的依赖性。 + +以导航场景为例,为常去的地点(例如家、公司等)创建导航方式,点击即可启动地图应用并开始导航。 +## 预览效果 +![](/screenshots/image.gif) +## 工程目录 +```` +├──entry/src/main/ets // 代码区 +│ ├──entryability +│ │ └──EntryAbility.ets // 程序入口类 +│ ├──entrybackupability +│ │ └──EntryBackupAbility.ets +│ └──pages +│ ├──GoCompany.ets // 我的公司页 +│ ├──Login.ets // 我的家页 +│ └──Logout.ets // 首页 +└──entry/src/main/resources // 应用资源目录 +```` +## 使用说明 +长安应用图标,即可出现快捷方式列表。点击对应图标,即可快速打开应用中对应的页面。 +## 实现说明 +* 在/resources/base/profile/目录下配置shortcuts_config.json配置文件 + +* 在module.json5配置文件的abilities标签中,针对需要添加快捷方式的UIAbility进行配置metadata标签,使shortcut配置文件对该UIAbility生效。 + +## 相关权限 +无 +## 约束与限制 +* 本示例仅支持标准系统上运行,支持设备:华为手机。 + +* HarmonyOS系统:HarmonyOS 5.0.0 Release及以上。 + +* DevEco Studio版本:DevEco Studio 5.0.0 Release及以上。 + +* HarmonyOS SDK版本:HarmonyOS 5.0.0 Release 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/code-linter.json5 b/code-linter.json5 new file mode 100644 index 0000000000000000000000000000000000000000..77b31b517a3e5c2f34c3ae1bf44083c0c06cbd6d --- /dev/null +++ b/code-linter.json5 @@ -0,0 +1,20 @@ +{ + "files": [ + "**/*.ets" + ], + "ignore": [ + "**/src/ohosTest/**/*", + "**/src/test/**/*", + "**/src/mock/**/*", + "**/node_modules/**/*", + "**/oh_modules/**/*", + "**/build/**/*", + "**/.preview/**/*" + ], + "ruleSet": [ + "plugin:@performance/recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + } +} \ No newline at end of file diff --git a/entry/.gitignore b/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/entry/build-profile.json5 b/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..0311b505dbf43f0d22662c8d783c5f4464d15b15 --- /dev/null +++ b/entry/build-profile.json5 @@ -0,0 +1,25 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + } + ] +} \ No newline at end of file diff --git a/entry/hvigorfile.ts b/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/entry/obfuscation-rules.txt b/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..272efb6ca3f240859091bbbfc7c5802d52793b0b --- /dev/null +++ b/entry/obfuscation-rules.txt @@ -0,0 +1,23 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/entry/oh-package.json5 b/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..248c3b7541a589682a250f86a6d3ecf7414d2d6a --- /dev/null +++ b/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..846d460ce2065804e3631de9066171148a33efce --- /dev/null +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,110 @@ +/* + * 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 { Router, window } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit'; + +export default class EntryAbility extends UIAbility { + funcAbilityWant: Want | undefined = undefined; + uiContext: UIContext | undefined = undefined; + + // DocsCode 1 + goToSpecifyPage(want: Want) { + let shortCutKey = want.parameters?.shortCutKey; + + if (this.uiContext && shortCutKey && shortCutKey === 'CompanyPage') { + let router: Router = this.uiContext.getRouter(); + router.pushUrl({ + url: 'pages/GoCompany' + }).catch((err: BusinessError) => { + hilog.error(0x0000, 'testTag', `Failed to push url. Code is ${err.code},message is ${err.message}`); + }); + } + if (this.uiContext && shortCutKey && shortCutKey === 'HousePage') { + let router: Router = this.uiContext.getRouter(); + router.pushUrl({ + url: 'pages/GoHouse' + }).catch((err: BusinessError) => { + hilog.error(0x0000, 'testTag', `Failed to push url. Code is ${err.code},message is ${err.message}`); + }); + } + } + // DocsCode 1 + + // DocsCode 2 + onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void { + // Receive the parameters passed by UIAbility from the caller + this.goToSpecifyPage(want); + + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onNewWant'); + } + // DocsCode 2 + + 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'); + + let path: string | undefined = 'page/Index'; + if (this.funcAbilityWant?.parameters?.shortCutKey === 'CompanyPage') { + path = 'pages/GoCompany'; + } + if (this.funcAbilityWant?.parameters?.shortCutKey === 'HousePage') { + path = 'pages/GoHouse'; + } + + 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; + windowStage.getMainWindow((err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', + `Failed to obtain the main window. Code is ${err.code},message is ${err.message}`); + } + windowClass = data; + this.uiContext = windowClass.getUIContext(); + }) + }); + } + + 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..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/pages/GoCompany.ets b/entry/src/main/ets/pages/GoCompany.ets new file mode 100644 index 0000000000000000000000000000000000000000..f723ca47ae852fe54ebe41b479bbe27ab4c6a54f --- /dev/null +++ b/entry/src/main/ets/pages/GoCompany.ets @@ -0,0 +1,352 @@ +/* + * 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 { display, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +export struct GoCompany { + @State isFoldAble: boolean = false; + @State foldStatus: number = 2; + @State routes: number[] = [1, 2, 3, 4, 5]; + @State currentIndex: number = 0; + private tabList: ResourceStr[] = [$r('app.string.driving'), $r('app.string.taxi'), $r('app.string.bus_and_subway'), $r('app.string.ride'), $r('app.string.walking'), $r('app.string.substitute_driver'), $r('app.string.train'), $r('app.string.coach')]; + private tabsController: TabsController = new TabsController(); + controller: TextInputController = new TextInputController(); + controller1: TextInputController = new TextInputController(); + + 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); + } + } + + showTips() { + promptAction.showToast({ + message: $r('app.string.ui_displayed'), + duration: 2000 + }) + } + + @Builder + myBuilder() { + Column() { + Column() { + Image('') + .width(90) + .height(24) + .draggable(false) + } + .alignItems(HorizontalAlign.Center) + .width('100%') + .height(24) + + Row() { + Row() { + Image($r('app.media.directions')) + .height(46) + .width(8) + .margin({ left: 16 }) + .draggable(false) + + Column() { + TextInput({ text: $r('app.string.my_position'), controller: this.controller }) + .backgroundColor($r('app.color.textInput_background')) + .fontSize(17) + .height(40) + .fontWeight(FontWeight.Medium) + .enableKeyboardOnFocus(false) + .onClick(() => { + this.controller.stopEditing(); + }) + Divider() + .strokeWidth(1) + .lineCap(LineCapStyle.Round) + .margin({ left: 15 }) + + TextInput({ text: $r('app.string.my_company'), controller: this.controller1 }) + .backgroundColor($r('app.color.textInput_background')) + .fontSize(17) + .height(40) + .fontWeight(FontWeight.Medium) + .enableKeyboardOnFocus(false) + .onClick(() => { + this.controller1.stopEditing(); + }) + } + .width(this.isFoldAble && this.foldStatus === 2 ? '56%' : + this.isFoldAble && this.foldStatus === 1 ? '78%' : '60%') + + Image($r('app.media.plus')) + .width(17) + .margin({ left: 30, right: 12 }) + .onClick(() => { + this.showTips(); + }) + .draggable(false) + Image($r('app.media.swap')) + .width(17) + .margin({ right: 12 }) + .onClick(() => { + this.showTips(); + }) + .draggable(false) + Image($r('app.media.mic')) + .width(17) + .onClick(() => { + this.showTips(); + }) + .draggable(false) + } + .width('100%') + .height(91) + .backgroundColor($r('app.color.textInput_background')) + .borderRadius(20) + .layoutWeight(1) + } + .alignItems(VerticalAlign.Top) + .width('100%') + .height(91) + + Row() { + this.TabList(); + } + .height(126) + .margin({ top: 4 }) + + Row() { + Button() { + Text($r('app.string.take_a_taxi_now')) + .fontSize(17) + .fontColor($r('app.color.button_fontColor')) + .margin({ left: 8 }) + .fontWeight(FontWeight.Medium) + } + .width('100%') + .height(42) + .linearGradient({ + direction: GradientDirection.Right, + repeating: false, + colors: [[$r('app.color.linearGradient_color1'), 0], [$r('app.color.linearGradient_color2'), 1]] + }) + .onClick(() => { + this.showTips(); + }) + + } + .height(40) + .justifyContent(FlexAlign.SpaceBetween) + .alignItems(VerticalAlign.Bottom) + .width('100%') + .backgroundColor(Color.White) + .margin({ top: 8 }) + .onClick(() => { + this.showTips(); + }) + } + .backgroundColor(Color.White) + .padding({ left: 16, right: 16 }) + .height(301) + .width('100%') + .borderRadius({ topLeft: 32, topRight: 32 }) + } + + @Builder + PlanList() { + Row() { + Column() { + Text($r('app.string.intelligent_recommendation')) + .fontSize(13) + .fontWeight(FontWeight.Bold) + .fontColor($r('app.color.text_fontColor')) + .opacity(0.9) + .margin({ bottom: 4 }) + Row() { + Text($r('app.string.estimate')) + .fontSize(11) + .fontColor($r('app.color.text_fontColor2')) + .opacity(0.9) + Text($r('app.string.money')) + .fontSize(20) + .fontWeight(FontWeight.Bold) + .fontColor($r('app.color.text_fontColor')) + .opacity(0.9) + Text($r('app.string.yuan')) + .fontSize(11) + .fontColor($r('app.color.text_fontColor3')) + .opacity(0.9) + } + + Text($r('app.string.21_models_selected')) + .fontSize(11) + .fontColor($r('app.color.text_fontColor4')) + .opacity(0.9) + } + .width(this.isFoldAble && this.foldStatus === 1 ? 280 : 158) + .height(70) + .alignItems(HorizontalAlign.Start) + .padding({ left: 10, top: 6 }) + .borderRadius(12) + .shadow({ + radius: 10, + color: $r('app.color.shadow_color') + }) + .onClick(() => { + this.showTips(); + }) + + Column() { + Text($r('app.string.last_memory')) + .fontSize(13) + .fontWeight(FontWeight.Bold) + .fontColor($r('app.color.text_fontColor5')) + .opacity(0.9) + .margin({ bottom: 4 }) + Row() { + Text($r('app.string.estimate')) + .fontSize(11) + .fontColor($r('app.color.text_fontColor6')) + .opacity(0.9) + Text($r('app.string.money')) + .fontSize(20) + .fontWeight(FontWeight.Bold) + .fontColor(Color.Black) + .opacity(0.9) + Text($r('app.string.yuan')) + .fontSize(11) + .fontColor($r('app.color.text_fontColor6')) + .opacity(0.9) + } + + Text($r('app.string.5_models_in_total')) + .fontSize(11) + .fontColor($r('app.color.text_fontColor4')) + .opacity(0.9) + } + .width(this.isFoldAble && this.foldStatus === 1 ? 280 : 158) + .height(70) + .alignItems(HorizontalAlign.Start) + .padding({ left: 8, top: 6 }) + .onClick(() => { + this.showTips(); + }) + } + .width('100%') + .padding({ left: 2 }) + .justifyContent(FlexAlign.SpaceBetween) + .height(82) + } + + @Builder + TabBuilder(type: ResourceStr, targetIndex: number) { + Row() { + Image($r('app.media.path_2')) + .height(16) + .width(20) + .margin({ right: 4 }) + .draggable(false) + .visibility(this.currentIndex === 0 ? Visibility.Visible : Visibility.None) + Text(type) + .fontSize(14) + .fontColor((this.currentIndex === targetIndex) ? $r('app.color.button_fontColor') : + $r('app.color.text_fontColor7')) + } + .onClick(() => { + this.currentIndex = targetIndex; + this.tabsController.changeIndex(this.currentIndex) + }) + .justifyContent(FlexAlign.Center) + .backgroundColor((this.currentIndex === targetIndex) ? $r('app.color.backgroundColor') : + $r('app.color.start_window_background')) + .borderRadius(14) + .height(28) + .width(this.isFoldAble && this.foldStatus === 1 ? 100 : 80) + } + + @Builder + TabList() { + Tabs({ barPosition: BarPosition.Start, controller: this.tabsController }) { + ForEach(this.tabList,(_:ResourceStr,index: number)=>{ + TabContent() { + if(index === 0){ + this.PlanList(); + } + } + .tabBar(this.TabBuilder(this.tabList[index], index)) + },(item:ResourceStr)=> item.toString()) + } + .barHeight(45) + .width('100%') + .scrollable(true) + .barMode(BarMode.Scrollable) + } + + build() { + NavDestination() { + Column() { + Image($r('app.media.roadSign')) + .width(240) + .position({ + x: this.isFoldAble && this.foldStatus === 2 ? 86 : this.isFoldAble && this.foldStatus === 1 ? 286 : 106, + y: 220 + }) + .draggable(false) + .onClick(() => { + this.showTips(); + }) + Image($r('app.media.routes2')) + .width(148) + .height(260) + .draggable(false) + .position({ + x: this.isFoldAble && this.foldStatus === 2 ? 100 : this.isFoldAble && this.foldStatus === 1 ? 300 : 120, + y: 100 + }) + .onClick(() => { + this.showTips(); + }) + .draggable(false) + Image($r('app.media.detection')) + .width(84) + .height(84) + .draggable(false) + .position({ + x: this.isFoldAble && this.foldStatus === 2 ? 270 : this.isFoldAble && this.foldStatus === 1 ? 624 : 306, + y: this.isFoldAble ? 296 : 328 + }) + .onClick(() => { + this.showTips(); + }) + .draggable(false) + this.myBuilder(); + } + .justifyContent(FlexAlign.End) + .width('100%') + .height('100%') + } + .backgroundImage($r('app.media.backgroundMap')) + .backgroundImageSize({ width: '100%', height: '100%' }) + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/GoHouse.ets b/entry/src/main/ets/pages/GoHouse.ets new file mode 100644 index 0000000000000000000000000000000000000000..8453b0fe5c96dc41e9180e3a2ce513c5f270020e --- /dev/null +++ b/entry/src/main/ets/pages/GoHouse.ets @@ -0,0 +1,375 @@ +/* + * 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 { display, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +export struct GoHouse { + @State isFoldAble: boolean = false; + @State foldStatus: number = 2; + @State routes: number[] = [1, 2, 3, 4, 5]; + @State currentIndex: number = 0; + private tabList: ResourceStr[] = [$r('app.string.driving'), $r('app.string.taxi'), $r('app.string.bus_and_subway'), $r('app.string.ride'), $r('app.string.walking'), $r('app.string.substitute_driver'), $r('app.string.train'), $r('app.string.coach')]; + private tabsController: TabsController = new TabsController(); + controller: TextInputController = new TextInputController(); + controller1: TextInputController = new TextInputController(); + + 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); + } + } + + showTips() { + promptAction.showToast({ + message: $r('app.string.ui_displayed'), + duration: 2000 + }) + } + + @Builder + myBuilder() { + Column() { + Column() { + Image('') + .width(90) + .height(24) + .draggable(false) + } + .alignItems(HorizontalAlign.Center) + .width('100%') + .height(24) + + Row() { + Row() { + Image($r('app.media.directions')) + .height(46) + .width(8) + .margin({ left: 16 }) + .draggable(false) + + Column() { + TextInput({ text: $r('app.string.my_position'), controller: this.controller }) + .backgroundColor($r('app.color.textInput_background')) + .fontSize(17) + .height(40) + .fontWeight(FontWeight.Medium) + .enableKeyboardOnFocus(false) + .onClick(() => { + this.controller.stopEditing(); + }) + Divider() + .strokeWidth(1) + .lineCap(LineCapStyle.Round) + .margin({ left: 15 }) + + TextInput({ text: $r('app.string.my_home'), controller: this.controller1 }) + .backgroundColor($r('app.color.textInput_background')) + .fontSize(17) + .height(40) + .fontWeight(FontWeight.Medium) + .enableKeyboardOnFocus(false) + .onClick(() => { + this.controller1.stopEditing(); + }) + } + .width(this.isFoldAble && this.foldStatus === 2 ? '56%' : + this.isFoldAble && this.foldStatus === 1 ? '78%' : '60%') + + Image($r('app.media.plus')) + .width(17) + .margin({ left: 30, right: 12 }) + .onClick(() => { + this.showTips(); + }) + .draggable(false) + Image($r('app.media.swap')) + .width(17) + .margin({ right: 12 }) + .onClick(() => { + this.showTips(); + }) + .draggable(false) + Image($r('app.media.mic')) + .width(17) + .onClick(() => { + this.showTips(); + }) + .draggable(false) + } + .width('100%') + .height(91) + .backgroundColor($r('app.color.textInput_background')) + .borderRadius(20) + .layoutWeight(1) + } + .alignItems(VerticalAlign.Top) + .width('100%') + .height(91) + + Row() { + this.TabList(); + } + .height(112) + .margin({ top: 4 }) + + Row() { + Row() { + Column() { + Image($r('app.media.public_right')) + .draggable(false) + .height(33) + } + .onClick(() => { + this.showTips(); + }) + + Column() { + Image($r('app.media.share')) + .draggable(false) + .height(33) + } + .onClick(() => { + this.showTips(); + }) + } + .width(120) + .justifyContent(FlexAlign.SpaceAround) + + Button() { + Row() { + Image($r('app.media.path_2')) + .draggable(false) + .width(25) + Text($r('app.string.start_navigating')) + .fontSize(17) + .fontColor($r('app.color.button_fontColor')) + .fontWeight(FontWeight.Medium) + .margin({ left: 8 }) + } + } + .width(190) + .height(42) + .linearGradient({ + direction: GradientDirection.Right, + repeating: false, + colors: [[$r('app.color.linearGradient_color1'), 0], [$r('app.color.linearGradient_color2'), 1]] + }) + .onClick(() => { + this.showTips(); + }) + + } + .height(40) + .justifyContent(FlexAlign.SpaceBetween) + .alignItems(VerticalAlign.Bottom) + .width('100%') + .backgroundColor(Color.White) + .margin({ top: 24 }) + } + .backgroundColor(Color.White) + .padding({ left: 16, right: 16 }) + .height(301) + .width('100%') + .borderRadius({ topLeft: 32, topRight: 32 }) + } + + @Builder + PlanList() { + Row() { + Column() { + Text($r('app.string.good_road')) + .fontSize(13) + .fontWeight(FontWeight.Bold) + .fontColor($r('app.color.text_fontColor')) + .opacity(0.9) + .margin({ bottom: 2 }) + Text($r('app.string.10_minutes')) + .fontSize(20) + .fontWeight(FontWeight.Bold) + .fontColor($r('app.color.text_fontColor')) + .opacity(0.9) + .margin({ bottom: 2 }) + Text($r('app.string.23_km')) + .fontSize(13) + .fontWeight(FontWeight.Medium) + .fontColor($r('app.color.text_fontColor2')) + .opacity(0.6) + } + .padding({ left: 10, top: 6 }) + .width('30%') + .height(64) + .alignItems(HorizontalAlign.Start) + .borderRadius(12) + .shadow({ + radius: 10, + color: $r('app.color.shadow_color') + }) + .onClick(() => { + this.showTips(); + }) + + Column() { + Text($r('app.string.option_2')) + .fontSize(13) + .fontWeight(FontWeight.Bold) + .fontColor(Color.Black) + .opacity(0.9) + .margin({ bottom: 2 }) + Text($r('app.string.12_minutes')) + .fontSize(20) + .fontWeight(FontWeight.Bold) + .fontColor(Color.Black) + .opacity(0.9) + .margin({ bottom: 2 }) + Text($r('app.string.26_km')) + .fontSize(13) + .fontWeight(FontWeight.Medium) + .fontColor(Color.Black) + .opacity(0.6) + } + .padding({ left: 10, top: 6 }) + .width('30%') + .height(64) + .alignItems(HorizontalAlign.Start) + .onClick(() => { + this.showTips(); + }) + + Column() { + Text($r('app.string.short_distance')) + .fontSize(13) + .fontWeight(FontWeight.Bold) + .fontColor(Color.Black) + .opacity(0.9) + .margin({ bottom: 2 }) + Text($r('app.string.8_minutes')) + .fontSize(20) + .fontWeight(FontWeight.Bold) + .fontColor(Color.Black) + .opacity(0.9) + .margin({ bottom: 2 }) + Text($r('app.string.21_km')) + .fontSize(13) + .fontWeight(FontWeight.Medium) + .fontColor(Color.Black) + .opacity(0.6) + } + .padding({ left: 8, top: 6 }) + .width('30%') + .height(64) + .alignItems(HorizontalAlign.Start) + .onClick(() => { + this.showTips(); + }) + } + .clip(false) + .width('100%') + .padding({ left: 2 }) + .justifyContent(FlexAlign.SpaceBetween) + .height(74) + .borderRadius(12) + } + + @Builder + TabBuilder(type: ResourceStr, targetIndex: number) { + Row() { + Image($r('app.media.path_2')) + .height(16) + .width(20) + .margin({ right: 4 }) + .draggable(false) + .visibility(this.currentIndex === 0 ? Visibility.Visible : Visibility.None) + Text(type) + .fontSize(14) + .fontColor((this.currentIndex === targetIndex) ? $r('app.color.button_fontColor') : + $r('app.color.text_fontColor7')) + } + .onClick(() => { + this.currentIndex = targetIndex; + this.tabsController.changeIndex(this.currentIndex) + }) + .justifyContent(FlexAlign.Center) + .backgroundColor((this.currentIndex === targetIndex) ? $r('app.color.backgroundColor') : + $r('app.color.start_window_background')) + .borderRadius(14) + .height(28) + .width(this.isFoldAble && this.foldStatus === 1 ? 100 : 80) + } + + @Builder + TabList() { + Tabs({ barPosition: BarPosition.Start, controller: this.tabsController }) { + ForEach(this.tabList,(_:ResourceStr,index: number)=>{ + TabContent() { + if(index === 0){ + this.PlanList(); + } + } + .tabBar(this.TabBuilder(this.tabList[index], index)) + },(item:ResourceStr)=> item.toString()) + } + .barHeight(45) + .width('100%') + .scrollable(true) + .barMode(BarMode.Scrollable) + } + + build() { + NavDestination() { + Column() { + Image($r('app.media.routes')) + .width(140) + .height(350) + .position({ + x: this.isFoldAble && this.foldStatus === 2 ? 100 : this.isFoldAble && this.foldStatus === 1 ? 300 : 120, + y: 30 + }) + .draggable(false) + .onClick(() => { + this.showTips(); + }) + Image($r('app.media.detection')) + .width(90) + .height(90) + .position({ + x: this.isFoldAble && this.foldStatus === 2 ? 270 : this.isFoldAble && this.foldStatus === 1 ? 624 : 306, + y: this.isFoldAble ? 296 : 328 + }) + .onClick(()=>{ + this.showTips(); + }) + .draggable(false) + this.myBuilder(); + } + .justifyContent(FlexAlign.End) + .width('100%') + .height('100%') + } + .backgroundImage($r('app.media.backgroundMap')) + .backgroundImageSize({ width: '100%', height: '100%' }) + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) + .height('100%') + .width('100%') + } +} \ 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..8158eab4095c39685d752cc527dbb66b5ca08371 --- /dev/null +++ b/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,351 @@ +/* + * 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 { display, promptAction } from '@kit.ArkUI'; +import { GoHouse } from './GoHouse'; +import { GoCompany } from './GoCompany'; + +@Entry +@Component +struct Index { + @State isFoldAble: boolean = false; + @State foldStatus: number = 2; + @State voiceIcon: number = 326; + @State text: string = ''; + pageInfos: NavPathStack = new NavPathStack(); + + aboutToAppear(): void { + this.isFoldAble = display.isFoldable(); + let foldStatus: display.FoldStatus = display.getFoldStatus(); + if (this.isFoldAble) { + this.foldStatus = foldStatus; + if (this.foldStatus === 1) { + this.voiceIcon = 650; + } else if (this.foldStatus === 2) { + this.voiceIcon = 286; + } + let callback: Callback = () => { + let data: display.FoldStatus = display.getFoldStatus(); + this.foldStatus = data; + if (this.foldStatus === 1) { + this.voiceIcon = 650; + } else if (this.foldStatus === 2) { + this.voiceIcon = 286; + } + } + display.on('change', callback); + } else { + let deviceWidth = px2vp(display.getDefaultDisplaySync().width); + if (deviceWidth < 380) { + this.voiceIcon = 312; + } + } + } + + showTips() { + promptAction.showToast({ + message: $r('app.string.ui_displayed'), + duration: 2000 + }) + } + + @Builder + PagesMap(name: string) { + if (name === 'GoHouse') { + GoHouse(); + } else if (name === 'GoCompany') { + GoCompany(); + } + } + + @Builder + myBuilder() { + Column() { + Column() { + Image('') + .width(90) + .height(24) + .draggable(false) + } + .alignItems(HorizontalAlign.Center) + .width('100%') + .height(24) + + Scroll() { + Column() { + TextInput({ placeholder: $r('app.string.placeholder'), text: this.text }) + .padding({ left: 36 }) + .fontSize(18) + .height(46) + .onSubmit(() => { + this.showTips(); + this.text = ''; + }) + .onChange((value: string) => { + this.text = value; + }) + Image($r('app.media.Public_ic_public_input_search')) + .width(18) + .height(18) + .position({ + x: 12, + y: 15 + }) + .draggable(false) + Image($r('app.media.mic')) + .width(18) + .height(18) + .position({ + x: this.voiceIcon, + y: 15 + }) + .draggable(false) + Row() { + Column() { + Image($r('app.media.avatar1')) + .width(48) + .draggable(false) + } + .width(56) + .height(64) + .onClick(() => { + this.showTips(); + }) + + Column({ space: 6 }) { + Image($r('app.media.avatar2')) + .width(48) + .draggable(false) + } + .width(56) + .height(64) + .onClick(() => { + this.showTips(); + }) + + Column({ space: 6 }) { + Image($r('app.media.avatar3')) + .width(40) + .draggable(false) + } + .width(56) + .height(64) + .onClick(() => { + this.showTips(); + }) + + Column({ space: 6 }) { + Image($r('app.media.avatar4')) + .width(48) + .draggable(false) + } + .width(56) + .height(64) + .onClick(() => { + this.showTips(); + }) + + Column({ space: 6 }) { + Image($r('app.media.avatar5')) + .width(40) + .draggable(false) + } + .width(56) + .height(64) + .onClick(() => { + this.showTips(); + }) + } + .margin({ top: 24 }) + .width('100%') + .padding({ left: 16, right: 16 }) + .height(64) + .justifyContent(FlexAlign.SpaceBetween) + + Column() { + Row() { + Row() { + Image($r('app.media.home')) + .width(16) + .draggable(false) + Text($r('app.string.add_home')) + .fontSize(15) + .margin({ left: 8 }) + .fontColor($r('app.color.text_fontColor8')) + .opacity(0.9) + } + .width('50%') + .onClick(() => { + this.showTips(); + }) + + Row() { + Image($r('app.media.company')) + .width(16) + .draggable(false) + Text($r('app.string.add_company_school')) + .fontSize(15) + .margin({ left: 8 }) + .fontColor($r('app.color.text_fontColor8')) + .opacity(0.9) + } + .width('50%') + .onClick(() => { + this.showTips(); + }) + } + .padding(16) + .width('100%') + .height(60) + .justifyContent(FlexAlign.SpaceBetween) + + Row() { + Image($r('app.media.company')) + .width(16) + .draggable(false) + Text($r('app.string.add_frequent_address')) + .fontSize(15) + .margin({ left: 8 }) + .fontColor($r('app.color.text_fontColor8')) + } + .padding({ left: 16 }) + .width(130) + .onClick(() => { + this.showTips(); + }) + } + .alignItems(HorizontalAlign.Start) + .margin({ top: 24, bottom: 16 }) + .width('100%') + .height(100) + .borderRadius(16) + .shadow({ + radius: 20, + color: $r('app.color.shadow_color') + }) + } + } + .height(265) + .scrollBar(BarState.Off) + + Row() { + Column() { + Image($r('app.media.homePage')) + .height(41) + .draggable(false) + } + .width(82) + .height(54) + .onClick(() => { + this.showTips(); + }) + + Column({ space: 4 }) { + Image($r('app.media.near')) + .height(41) + .draggable(false) + } + .width(82) + .height(54) + .onClick(() => { + this.showTips(); + }) + + Column({ space: 4 }) { + Image($r('app.media.taxi')) + .height(41) + .draggable(false) + } + .width(82) + .height(54) + .onClick(() => { + this.showTips(); + }) + + Column({ space: 4 }) { + Image($r('app.media.mine')) + .height(41) + .draggable(false) + } + .width(82) + .height(54) + .onClick(() => { + this.showTips(); + }) + } + .width('100%') + .height(54) + .padding({ top: 12 }) + .justifyContent(FlexAlign.SpaceBetween) + } + .backgroundColor(Color.White) + .padding({ + left: 16, + right: 16, + bottom: 88 + }) + .width('100%') + .height(301) + .borderRadius({ topLeft: 32, topRight: 32 }) + } + + build() { + Navigation(this.pageInfos) { + Column() { + Image($r('app.media.positioning')) + .width(32) + .position({ + x: this.isFoldAble && this.foldStatus === 2 ? 160 : this.isFoldAble && this.foldStatus === 1 ? 360 : 200, + y: 200 + }) + .draggable(false) + Image($r('app.media.detection')) + .width(90) + .height(90) + .position({ + x: this.isFoldAble && this.foldStatus === 2 ? 270 : this.isFoldAble && this.foldStatus === 1 ? 624 : 306, + y: this.isFoldAble ? 288 : 324 + }) + .draggable(false) + .onClick(() => { + this.showTips(); + }) + Image($r('app.media.routes3')) + .width(90) + .height(90) + .position({ + x: this.isFoldAble && this.foldStatus === 2 ? 270 : this.isFoldAble && this.foldStatus === 1 ? 624 : 306, + y: this.isFoldAble ? 348 : 384 + }) + .draggable(false) + .onClick(() => { + this.showTips(); + }) + this.myBuilder(); + } + .justifyContent(FlexAlign.End) + .width('100%') + .height('100%') + } + .backgroundImage($r('app.media.backgroundMap')) + .backgroundImageSize({ width: '100%', height: '100%' }) + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) + .mode(NavigationMode.Stack) + .height('100%') + .width('100%') + .hideToolBar(true) + .navDestination(this.PagesMap) + } +} \ 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..946cdea7f3a907e80a2018ab6a433e650716d4be --- /dev/null +++ b/entry/src/main/module.json5 @@ -0,0 +1,56 @@ +{ + "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:app_icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:app_icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "metadata": [ + { + "name": "ohos.ability.shortcuts", + "resource": "$profile:shortcuts_config" + } + ] + } + ], + "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..d545e7d8cd544d8f6fd8c957ede6db8924b1080a --- /dev/null +++ b/entry/src/main/resources/base/element/color.json @@ -0,0 +1,64 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "textInput_background", + "value": "#F2F2F2" + }, + { + "name": "button_fontColor", + "value": "#E6FFFFFF" + }, + { + "name": "linearGradient_color1", + "value": "#0A59F7" + }, + { + "name": "linearGradient_color2", + "value": "#1880FC" + }, + { + "name": "text_fontColor", + "value": "#2864DD" + }, + { + "name": "text_fontColor2", + "value": "#6694F1" + }, + { + "name": "text_fontColor3", + "value": "#E62864DD" + }, + { + "name": "text_fontColor4", + "value": "#39393A" + }, + { + "name": "shadow_color", + "value": "#1400001E" + }, + { + "name": "text_fontColor5", + "value": "#A6A6A6" + }, + { + "name": "text_fontColor6", + "value": "#515151" + }, + { + "name": "text_fontColor7", + "value": "#99000000" + }, + { + "name": "backgroundColor", + "value": "#45598E" + }, + { + "name": "text_fontColor8", + "value": "#666666" + } + ] +} \ 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..fdd5718ff337ca6052d9a1098f65c90edd0cf346 --- /dev/null +++ b/entry/src/main/resources/base/element/string.json @@ -0,0 +1,192 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Desktop shortcuts" + }, + { + "name": "Go_to_company", + "value": "Go to company" + }, + { + "name": "Go_to_house", + "value": "Go to house" + }, + { + "name": "ui_displayed", + "value": "Displayed only as a UI" + }, + { + "name": "placeholder", + "value": "Search place, address, bus" + }, + { + "name": "driving", + "value": "Driving" + }, + { + "name": "bus_and_subway", + "value": "Bus and subway" + }, + { + "name": "take_a_taxi", + "value": "Take a taxi" + }, + { + "name": "real_time_bus", + "value": "Real-time bus" + }, + { + "name": "book_a_hotel", + "value": "Book a hotel" + }, + { + "name": "add_home", + "value": "Add home" + }, + { + "name": "add_company_school", + "value": "Add company/school" + }, + { + "name": "add_frequent_address", + "value": "Add frequent address" + }, + { + "name": "home_page", + "value": "Home page" + }, + { + "name": "near", + "value": "Near" + }, + { + "name": "mine", + "value": "Mine" + }, + { + "name": "my_position", + "value": "My position" + }, + { + "name": "my_home", + "value": "My home" + }, + { + "name": "collection", + "value": "Collection" + }, + { + "name": "share", + "value": "Share" + }, + { + "name": "start_navigating", + "value": "Start navigating" + }, + { + "name": "good_road", + "value": "Good road" + }, + { + "name": "10_minutes", + "value": "10 minutes" + }, + { + "name": "23_km", + "value": "2.3 km" + }, + { + "name": "option_2", + "value": "Option 2" + }, + { + "name": "26_km", + "value": "2.6 km" + }, + { + "name": "12_minutes", + "value": "12 minutes" + }, + { + "name": "short_distance", + "value": "Short distance" + }, + { + "name": "8_minutes", + "value": "8 minutes" + }, + { + "name": "21_km", + "value": "2.1 km" + }, + { + "name": "my_company", + "value": "My company" + }, + { + "name": "take_a_taxi_now", + "value": "Take a taxi now" + }, + { + "name": "intelligent_recommendation", + "value": "intelligent recommendation" + }, + { + "name": "estimate", + "value": "Estimate" + }, + { + "name": "money", + "value": "10-11" + }, + { + "name": "yuan", + "value": "Yuan" + }, + { + "name": "21_models_selected", + "value": "21 models selected" + }, + { + "name": "last_memory", + "value": "Last memory" + }, + { + "name": "5_models_in_total", + "value": "5 models in total" + }, + { + "name": "ride", + "value": "Ride" + }, + { + "name": "taxi", + "value": "Taxi" + }, + { + "name": "walking", + "value": "Walking" + }, + { + "name": "substitute_driver", + "value": "Sub driver" + }, + { + "name": "train", + "value": "Train" + }, + { + "name": "coach", + "value": "Coach" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/media/Public_ic_public_input_search.png b/entry/src/main/resources/base/media/Public_ic_public_input_search.png new file mode 100644 index 0000000000000000000000000000000000000000..f97300c81e0c19c26ff08091c625bb427dd8d1b9 Binary files /dev/null and b/entry/src/main/resources/base/media/Public_ic_public_input_search.png differ diff --git a/entry/src/main/resources/base/media/avatar1.png b/entry/src/main/resources/base/media/avatar1.png new file mode 100644 index 0000000000000000000000000000000000000000..61ba41df3bab9a90a73128c82d496b23e3a3a506 Binary files /dev/null and b/entry/src/main/resources/base/media/avatar1.png differ diff --git a/entry/src/main/resources/base/media/avatar2.png b/entry/src/main/resources/base/media/avatar2.png new file mode 100644 index 0000000000000000000000000000000000000000..c26f0fb4e0b0be02658ae246134a21b1daf1ddb7 Binary files /dev/null and b/entry/src/main/resources/base/media/avatar2.png differ diff --git a/entry/src/main/resources/base/media/avatar3.png b/entry/src/main/resources/base/media/avatar3.png new file mode 100644 index 0000000000000000000000000000000000000000..3f9bf62c2373736f08a3371815bbce18f76bfe9c Binary files /dev/null and b/entry/src/main/resources/base/media/avatar3.png differ diff --git a/entry/src/main/resources/base/media/avatar4.png b/entry/src/main/resources/base/media/avatar4.png new file mode 100644 index 0000000000000000000000000000000000000000..74ea621cfdd92b87761d36d115e08cad6d980ccf Binary files /dev/null and b/entry/src/main/resources/base/media/avatar4.png differ diff --git a/entry/src/main/resources/base/media/avatar5.png b/entry/src/main/resources/base/media/avatar5.png new file mode 100644 index 0000000000000000000000000000000000000000..3ec750199a2346c3b1892a51ec90df49416bfc07 Binary files /dev/null and b/entry/src/main/resources/base/media/avatar5.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/backgroundMap.png b/entry/src/main/resources/base/media/backgroundMap.png new file mode 100644 index 0000000000000000000000000000000000000000..4f72f42ca7bb78b8beae4f61d0ba4f390f5b4ee3 Binary files /dev/null and b/entry/src/main/resources/base/media/backgroundMap.png differ diff --git a/entry/src/main/resources/base/media/company.png b/entry/src/main/resources/base/media/company.png new file mode 100644 index 0000000000000000000000000000000000000000..30733a0c1160cdd0ce8e9702758cd5f26f504658 Binary files /dev/null and b/entry/src/main/resources/base/media/company.png differ diff --git a/entry/src/main/resources/base/media/companyCuts.png b/entry/src/main/resources/base/media/companyCuts.png new file mode 100644 index 0000000000000000000000000000000000000000..bff3612690b3f1b5e12bbef1352f0f858dc3f1e4 Binary files /dev/null and b/entry/src/main/resources/base/media/companyCuts.png differ diff --git a/entry/src/main/resources/base/media/detection.png b/entry/src/main/resources/base/media/detection.png new file mode 100644 index 0000000000000000000000000000000000000000..f1dfd813bc5310bfa5d712564d6f1e894692c482 Binary files /dev/null and b/entry/src/main/resources/base/media/detection.png differ diff --git a/entry/src/main/resources/base/media/directions.png b/entry/src/main/resources/base/media/directions.png new file mode 100644 index 0000000000000000000000000000000000000000..1bc657456432f59a9a75b47f57adaf5fac73e8c7 Binary files /dev/null and b/entry/src/main/resources/base/media/directions.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/home.png b/entry/src/main/resources/base/media/home.png new file mode 100644 index 0000000000000000000000000000000000000000..80b2f0c817981e63dad15bc685aff150b25d3770 Binary files /dev/null and b/entry/src/main/resources/base/media/home.png differ diff --git a/entry/src/main/resources/base/media/homePage.png b/entry/src/main/resources/base/media/homePage.png new file mode 100644 index 0000000000000000000000000000000000000000..06e45b2211d63ebbea1a173e652ce25119aa31fe Binary files /dev/null and b/entry/src/main/resources/base/media/homePage.png differ diff --git a/entry/src/main/resources/base/media/house.png b/entry/src/main/resources/base/media/house.png new file mode 100644 index 0000000000000000000000000000000000000000..06534db3444d6661f445c9b69b0735f9fc7885ab Binary files /dev/null and b/entry/src/main/resources/base/media/house.png differ diff --git a/entry/src/main/resources/base/media/houseCuts.png b/entry/src/main/resources/base/media/houseCuts.png new file mode 100644 index 0000000000000000000000000000000000000000..06534db3444d6661f445c9b69b0735f9fc7885ab Binary files /dev/null and b/entry/src/main/resources/base/media/houseCuts.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/mic.png b/entry/src/main/resources/base/media/mic.png new file mode 100644 index 0000000000000000000000000000000000000000..9997e7d199879e8ee1d507bda4156d1314cee675 Binary files /dev/null and b/entry/src/main/resources/base/media/mic.png differ diff --git a/entry/src/main/resources/base/media/mine.png b/entry/src/main/resources/base/media/mine.png new file mode 100644 index 0000000000000000000000000000000000000000..a8aaf43f3f8ae65710bc75d895b6e7df1f57d44f Binary files /dev/null and b/entry/src/main/resources/base/media/mine.png differ diff --git a/entry/src/main/resources/base/media/near.png b/entry/src/main/resources/base/media/near.png new file mode 100644 index 0000000000000000000000000000000000000000..35292cfc3201959a4e8029932db9d86dd74688bd Binary files /dev/null and b/entry/src/main/resources/base/media/near.png differ diff --git a/entry/src/main/resources/base/media/path_2.png b/entry/src/main/resources/base/media/path_2.png new file mode 100644 index 0000000000000000000000000000000000000000..5d842d96e5cc69ee80553602349948ccccdca9f6 Binary files /dev/null and b/entry/src/main/resources/base/media/path_2.png differ diff --git a/entry/src/main/resources/base/media/path_2_path.png b/entry/src/main/resources/base/media/path_2_path.png new file mode 100644 index 0000000000000000000000000000000000000000..74672d0f2bffdf1f01ee500f7495fdd6a43b640f Binary files /dev/null and b/entry/src/main/resources/base/media/path_2_path.png differ diff --git a/entry/src/main/resources/base/media/plus.png b/entry/src/main/resources/base/media/plus.png new file mode 100644 index 0000000000000000000000000000000000000000..b15d27c54ce26ba1d072dc8587dfaf7f20505ff1 Binary files /dev/null and b/entry/src/main/resources/base/media/plus.png differ diff --git a/entry/src/main/resources/base/media/positioning.png b/entry/src/main/resources/base/media/positioning.png new file mode 100644 index 0000000000000000000000000000000000000000..b6433e04e2f43c8e925fd74216c89ce2b6ee824b Binary files /dev/null and b/entry/src/main/resources/base/media/positioning.png differ diff --git a/entry/src/main/resources/base/media/public_right.png b/entry/src/main/resources/base/media/public_right.png new file mode 100644 index 0000000000000000000000000000000000000000..18d0e79db128402c6aa6b495176303f076e60b8c Binary files /dev/null and b/entry/src/main/resources/base/media/public_right.png differ diff --git a/entry/src/main/resources/base/media/roadSign.png b/entry/src/main/resources/base/media/roadSign.png new file mode 100644 index 0000000000000000000000000000000000000000..a8e4b34168b189716aa0697f6bd3e0161dd974af Binary files /dev/null and b/entry/src/main/resources/base/media/roadSign.png differ diff --git a/entry/src/main/resources/base/media/routes.png b/entry/src/main/resources/base/media/routes.png new file mode 100644 index 0000000000000000000000000000000000000000..ea9e484f2609fe6bf3423db2c1ec91813dc3a292 Binary files /dev/null and b/entry/src/main/resources/base/media/routes.png differ diff --git a/entry/src/main/resources/base/media/routes2.png b/entry/src/main/resources/base/media/routes2.png new file mode 100644 index 0000000000000000000000000000000000000000..ab0566cd1b543a0a0f7ed522b22d6d6c778b37f6 Binary files /dev/null and b/entry/src/main/resources/base/media/routes2.png differ diff --git a/entry/src/main/resources/base/media/routes3.png b/entry/src/main/resources/base/media/routes3.png new file mode 100644 index 0000000000000000000000000000000000000000..b8a0e46f81da38561570a7ee317867d3748fcdc1 Binary files /dev/null and b/entry/src/main/resources/base/media/routes3.png differ diff --git a/entry/src/main/resources/base/media/share.png b/entry/src/main/resources/base/media/share.png new file mode 100644 index 0000000000000000000000000000000000000000..e289534c297ff782407db3cdfee658cc5af6fb6e Binary files /dev/null and b/entry/src/main/resources/base/media/share.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/media/swap.png b/entry/src/main/resources/base/media/swap.png new file mode 100644 index 0000000000000000000000000000000000000000..cdc79a3d8f2852c3cf563ac22396b26c45156585 Binary files /dev/null and b/entry/src/main/resources/base/media/swap.png differ diff --git a/entry/src/main/resources/base/media/taxi.png b/entry/src/main/resources/base/media/taxi.png new file mode 100644 index 0000000000000000000000000000000000000000..d5202ed8d00534377bc72759d564f6c85e4dc88b Binary files /dev/null and b/entry/src/main/resources/base/media/taxi.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..d090cb1e661120973e9fbb22eb9f02671bcb7cf1 --- /dev/null +++ b/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,7 @@ +{ + "src": [ + "pages/Index", + "pages/GoHouse", + "pages/GoCompany" + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/profile/shortcuts_config.json b/entry/src/main/resources/base/profile/shortcuts_config.json new file mode 100644 index 0000000000000000000000000000000000000000..21b64bb73c48ba74c52fefa87001aa9433b66c3b --- /dev/null +++ b/entry/src/main/resources/base/profile/shortcuts_config.json @@ -0,0 +1,34 @@ +{ + "shortcuts": [ + { + "shortcutId": "id_house", + "label": "$string:Go_to_house", + "icon": "$media:houseCuts", + "wants": [ + { + "bundleName": "com.example.desktopshortcuts", + "moduleName": "entry", + "abilityName": "EntryAbility", + "parameters": { + "shortCutKey": "HousePage" + } + } + ] + }, + { + "shortcutId": "id_company", + "label": "$string:Go_to_company", + "icon": "$media:companyCuts", + "wants": [ + { + "bundleName": "com.example.desktopshortcuts", + "moduleName": "entry", + "abilityName": "EntryAbility", + "parameters": { + "shortCutKey": "CompanyPage" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..fdd5718ff337ca6052d9a1098f65c90edd0cf346 --- /dev/null +++ b/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,192 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Desktop shortcuts" + }, + { + "name": "Go_to_company", + "value": "Go to company" + }, + { + "name": "Go_to_house", + "value": "Go to house" + }, + { + "name": "ui_displayed", + "value": "Displayed only as a UI" + }, + { + "name": "placeholder", + "value": "Search place, address, bus" + }, + { + "name": "driving", + "value": "Driving" + }, + { + "name": "bus_and_subway", + "value": "Bus and subway" + }, + { + "name": "take_a_taxi", + "value": "Take a taxi" + }, + { + "name": "real_time_bus", + "value": "Real-time bus" + }, + { + "name": "book_a_hotel", + "value": "Book a hotel" + }, + { + "name": "add_home", + "value": "Add home" + }, + { + "name": "add_company_school", + "value": "Add company/school" + }, + { + "name": "add_frequent_address", + "value": "Add frequent address" + }, + { + "name": "home_page", + "value": "Home page" + }, + { + "name": "near", + "value": "Near" + }, + { + "name": "mine", + "value": "Mine" + }, + { + "name": "my_position", + "value": "My position" + }, + { + "name": "my_home", + "value": "My home" + }, + { + "name": "collection", + "value": "Collection" + }, + { + "name": "share", + "value": "Share" + }, + { + "name": "start_navigating", + "value": "Start navigating" + }, + { + "name": "good_road", + "value": "Good road" + }, + { + "name": "10_minutes", + "value": "10 minutes" + }, + { + "name": "23_km", + "value": "2.3 km" + }, + { + "name": "option_2", + "value": "Option 2" + }, + { + "name": "26_km", + "value": "2.6 km" + }, + { + "name": "12_minutes", + "value": "12 minutes" + }, + { + "name": "short_distance", + "value": "Short distance" + }, + { + "name": "8_minutes", + "value": "8 minutes" + }, + { + "name": "21_km", + "value": "2.1 km" + }, + { + "name": "my_company", + "value": "My company" + }, + { + "name": "take_a_taxi_now", + "value": "Take a taxi now" + }, + { + "name": "intelligent_recommendation", + "value": "intelligent recommendation" + }, + { + "name": "estimate", + "value": "Estimate" + }, + { + "name": "money", + "value": "10-11" + }, + { + "name": "yuan", + "value": "Yuan" + }, + { + "name": "21_models_selected", + "value": "21 models selected" + }, + { + "name": "last_memory", + "value": "Last memory" + }, + { + "name": "5_models_in_total", + "value": "5 models in total" + }, + { + "name": "ride", + "value": "Ride" + }, + { + "name": "taxi", + "value": "Taxi" + }, + { + "name": "walking", + "value": "Walking" + }, + { + "name": "substitute_driver", + "value": "Sub driver" + }, + { + "name": "train", + "value": "Train" + }, + { + "name": "coach", + "value": "Coach" + } + ] +} \ 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..cccb89fa7fca55f679eee482b0583eb7ccf1a52d --- /dev/null +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,192 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "桌面快捷方式" + }, + { + "name": "Go_to_company", + "value": "去公司" + }, + { + "name": "Go_to_house", + "value": "回家" + }, + { + "name": "ui_displayed", + "value": "仅作为UI展示" + }, + { + "name": "placeholder", + "value": "搜索地点、地址、公交" + }, + { + "name": "driving", + "value": "驾车" + }, + { + "name": "bus_and_subway", + "value": "公交地铁" + }, + { + "name": "take_a_taxi", + "value": "打车" + }, + { + "name": "real_time_bus", + "value": "实时公交" + }, + { + "name": "book_a_hotel", + "value": "订酒店" + }, + { + "name": "add_home", + "value": "添加家" + }, + { + "name": "add_company_school", + "value": "添加公司/学校" + }, + { + "name": "add_frequent_address", + "value": "添加常去地址" + }, + { + "name": "home_page", + "value": "首页" + }, + { + "name": "near", + "value": "附件" + }, + { + "name": "mine", + "value": "我的" + }, + { + "name": "my_position", + "value": "我的位置" + }, + { + "name": "my_home", + "value": "我的家" + }, + { + "name": "collection", + "value": "收藏" + }, + { + "name": "share", + "value": "分享" + }, + { + "name": "start_navigating", + "value": "开始导航" + }, + { + "name": "good_road", + "value": "大路多" + }, + { + "name": "10_minutes", + "value": "10分钟" + }, + { + "name": "23_km", + "value": "2.3公里" + }, + { + "name": "option_2", + "value": "备选二" + }, + { + "name": "26_km", + "value": "2.6公里" + }, + { + "name": "12_minutes", + "value": "12分钟" + }, + { + "name": "short_distance", + "value": "距离短" + }, + { + "name": "8_minutes", + "value": "8分钟" + }, + { + "name": "21_km", + "value": "2.1公里" + }, + { + "name": "my_company", + "value": "我的公司" + }, + { + "name": "take_a_taxi_now", + "value": "立即打车" + }, + { + "name": "intelligent_recommendation", + "value": "智能推荐" + }, + { + "name": "estimate", + "value": "预估" + }, + { + "name": "money", + "value": "10-11" + }, + { + "name": "yuan", + "value": "元" + }, + { + "name": "21_models_selected", + "value": "已选21个车型" + }, + { + "name": "last_memory", + "value": "上次记忆" + }, + { + "name": "5_models_in_total", + "value": "共5个车型" + }, + { + "name": "ride", + "value": "骑行" + }, + { + "name": "taxi", + "value": "打车" + }, + { + "name": "walking", + "value": "步行" + }, + { + "name": "substitute_driver", + "value": "代驾" + }, + { + "name": "train", + "value": "火车" + }, + { + "name": "coach", + "value": "客车" + } + ] +} \ No newline at end of file diff --git a/hvigor/hvigor-config.json5 b/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..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/local.properties b/local.properties new file mode 100644 index 0000000000000000000000000000000000000000..20f608699522ce5b5f170457336fbfbf96165c62 --- /dev/null +++ b/local.properties @@ -0,0 +1,9 @@ +# This file is automatically generated by DevEco Studio. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file should *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# For customization when using a Version Control System, please read the header note. + + diff --git a/oh-package.json5 b/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..0cec98259052cc175d04dbcf61780de4bc9785f4 --- /dev/null +++ b/oh-package.json5 @@ -0,0 +1,7 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": {} +} diff --git a/screenshots/image.gif b/screenshots/image.gif new file mode 100644 index 0000000000000000000000000000000000000000..a97057e047d2a60b2de48c5e9ddc4d58ca3e3802 Binary files /dev/null and b/screenshots/image.gif differ