diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..e69de29b diff --git a/LICENSE b/LICENSE new file mode 100755 index 00000000..d0381d6d --- /dev/null +++ b/LICENSE @@ -0,0 +1,176 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + 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: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) 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 + + (d) 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 diff --git a/README.en.md b/README.en.md deleted file mode 100644 index fda4e3cf..00000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# applications_systemui - -#### Description -SystemUI system app | 系统界面应用 - -#### 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 old mode 100644 new mode 100755 index 65fd6c6a..a9e5294c --- a/README.md +++ b/README.md @@ -1,37 +1,43 @@ -# applications_systemui +# SystemUI -#### 介绍 -SystemUI system app | 系统界面应用 +- [Introduction](#section11660541593) + - [Architecture](#section125101832114213) -#### 软件架构 -软件架构说明 +- [Directory Structure](#section161941989596) +- [Repositories Involved](#section1371113476307) +## Introduction -#### 安装教程 +SystemUI is a system app preinstalled in OpenHarmony. It provides users with interactive UIs that display system-related information, including the system status, prompts, and notifications \(such as the system time and battery level\). -1. xxxx -2. xxxx -3. xxxx +### Architecture -#### 使用说明 +![](figures/en-us_image_0000001103686480.png) -1. xxxx -2. xxxx -3. xxxx +## Directory Structure -#### 参与贡献 +``` +/applications/standard/systemui +├── figures # Architecture figures +├── entry # Main entry module code +│ └── src +│ ├── main +│ ├── js # JavaScript code +│ ├── resources # Resource configuration files +│ └── config.json # Global configuration files +├── navigationBar # System navigation module code +│ └── src +│ ├── main +│ ├── js # JavaScript code +│ ├── resources # Resource configuration files +│ └── config.json # Global configuration files +├── signature # Certificate files +├── LICENSE # License files +``` -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +## Repositories Involved +System apps -#### 特技 +**applications\_standard\_systemui** -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/) diff --git a/README_zh.md b/README_zh.md new file mode 100755 index 00000000..47bbef8c --- /dev/null +++ b/README_zh.md @@ -0,0 +1,43 @@ +# SystemUI + +- [简介](#section11660541593) + - [架构图](#section125101832114213) + +- [目录](#section161941989596) +- [相关仓](#section1371113476307) + +## 简介 + +SystemUI应用是OpenHarmony中预置的系统应用,为用户提供系统相关信息展示及交互界面,包括系统状态、系统提示、系统提醒等,例如系统时间、电量信息。 + +### 架构图 + +![](figures/zh-cn_image_0000001103686480.png) + +## 目录 + +``` +/applications/standard/systemui +├── figures # 架构图目录 +├── entry # 主entry模块目录 +│ └── src +│ ├── main +│ ├── js # js代码目录 +│ ├── resources # 资源配置文件存放目录 +│ └── config.json # 全局配置文件 +├── navigationBar # 系统导航模块目录 +│ └── src +│ ├── main +│ ├── js # js代码目录 +│ ├── resources # 资源配置文件存放目录 +│ └── config.json # 全局配置文件 +├── signature # 证书文件目录 +├── LICENSE # 许可文件 +``` + +## 相关仓 + +系统应用 + +**applications\_standard\_systemui** + diff --git a/build.gradle b/build.gradle new file mode 100755 index 00000000..45ddcb88 --- /dev/null +++ b/build.gradle @@ -0,0 +1,42 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.huawei.ohos.app' + +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 6 + } +} + +buildscript { + repositories { + maven { + url 'http://repo.ark.tools.huawei.com/artifactory/maven-public/' + } + maven { + url 'https://mirrors.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } + dependencies { + classpath 'com.huawei.ohos:hap:2.4.4.3-RC' + } +} + +allprojects { + repositories { + maven { + url 'http://repo.ark.tools.huawei.com/artifactory/maven-public/' + } + maven { + url 'https://mirrors.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} diff --git a/entry/.gitignore b/entry/.gitignore new file mode 100755 index 00000000..3543521e --- /dev/null +++ b/entry/.gitignore @@ -0,0 +1 @@ +/build diff --git a/entry/build.gradle b/entry/build.gradle new file mode 100755 index 00000000..c847e028 --- /dev/null +++ b/entry/build.gradle @@ -0,0 +1,11 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 6 + } + supportSystem "standard" +} + +dependencies { +} diff --git a/entry/package.json b/entry/package.json new file mode 100755 index 00000000..69a88e3b --- /dev/null +++ b/entry/package.json @@ -0,0 +1 @@ +{} diff --git a/entry/src/main/config.json b/entry/src/main/config.json new file mode 100755 index 00000000..e622202a --- /dev/null +++ b/entry/src/main/config.json @@ -0,0 +1,60 @@ +{ + "app": { + "bundleName": "com.ohos.systemui", + "vendor": "ohos", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.systemui.statusbar", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.ohos.systemui.statusbar.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "singleton" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/entry/src/main/js/default/app.js b/entry/src/main/js/default/app.js new file mode 100644 index 00000000..c2306778 --- /dev/null +++ b/entry/src/main/js/default/app.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2021 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 default { + onCreate() { + console.info('AceApplication onCreate'); + }, + + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/entry/src/main/js/default/center/battery/batteryStatus.js b/entry/src/main/js/default/center/battery/batteryStatus.js new file mode 100755 index 00000000..10d931e6 --- /dev/null +++ b/entry/src/main/js/default/center/battery/batteryStatus.js @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2021 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 batteryInfo from '@ohos.batteryInfo'; +import statusImage from '../statuscenter/manager/StatusImage.js'; + +const NONE = 0; +const ENABLE = 1; +const DISABLE = 2; +const FULL = 3; +const loopTime = 1000; +const percentNum = 100; + +var mBackgroundColor = '#00ff21'; +var mBatteryChargingColor = '#00ff21'; +var mBatteryHighColor = '#ffffff'; +var mBatteryMediumColor = '#ffd800'; +var mBatteryLowColor = '#ff0000'; +var mHighBatteryLevel = 50; +var mLowBatteryLevel = 10; +var mProgressWidth = 51; +var mProgress = 100; + +export default class batteryStatus extends statusImage { + constructor() { + super(); + } + + getStatusImage() { + let BatteryValue = {}; + BatteryValue.mBackgroundColor = mBackgroundColor; + BatteryValue.mProgressWidth = mProgressWidth; + console.info('color = ' + BatteryValue.mBackgroundColor + ' width = ' + BatteryValue.mProgressWidth); + return JSON.stringify(BatteryValue); + } + + startGettingStatus() { + this.setOnBatteryListener(); + } + + // Method of getting the battery status + setOnBatteryListener() { + let that = this; + let batterySOC; + let batteryCharging; + setInterval(function () { + batterySOC = batteryInfo.batterySOC; + console.info('batterySOC = ' + batterySOC); + batteryCharging = batteryInfo.chargingStatus; + console.info('batteryCharging = ' + batteryCharging); + if (null == batterySOC) { + // Set the battery SOC as full when there is no battery hardware + batterySOC = 1; + } + if (batterySOC <= 0) { + // If the result is a negative number, set it as positive number. + batterySOC = Math.abs(batterySOC); + } + // Set the battery status as charging when there is no battery hardware + let batteryStatus = that.checkBatteryStatus(batteryCharging); + that.updateBattery(batterySOC * percentNum, batteryStatus); + }, loopTime); + } + + updateBattery(val, charging) { + console.info('Battery updateBattery:' + val + ' charging:' + charging); + mProgress = val; + if (charging) { + mBackgroundColor = mBatteryChargingColor; + } else if (val <= mLowBatteryLevel) { + mBackgroundColor = mBatteryLowColor; + } else if (val > mLowBatteryLevel && val <= mHighBatteryLevel) { + mBackgroundColor = mBatteryMediumColor; + } else if (val > mHighBatteryLevel) { + mBackgroundColor = mBatteryHighColor; + } + mProgressWidth = mProgressWidth * mProgress / percentNum; + console.info('Battery updateBattery mBackgroundColor:' + mBackgroundColor); + } + + checkBatteryStatus(charging) { + console.info('Battery updateBattery checkBatteryStatus:' + charging); + let batteryStatus; + switch (charging) { + case DISABLE: + batteryStatus = false; + break; + case NONE: + case ENABLE: + case FULL: + default: + batteryStatus = true; + break; + } + return batteryStatus; + } +} diff --git a/entry/src/main/js/default/center/statuscenter/StatusCenter.js b/entry/src/main/js/default/center/statuscenter/StatusCenter.js new file mode 100755 index 00000000..439f8873 --- /dev/null +++ b/entry/src/main/js/default/center/statuscenter/StatusCenter.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021 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 StatusManager from '../statuscenter/manager/IconManager.js'; +import BatteryStatus from '../../center/battery/batteryStatus.js'; + +var mStatusManager = new StatusManager; +var mBatteryStatus = new BatteryStatus; + +var time; +var mStatusList = []; +var mResultStatusList = []; + +const LOOP_TIME = 1000; + +export default class StatusCenter { + constructor() { + } + + // Method of getting the battery status + setOnBatteryListener() { + let batteryStatus = mBatteryStatus.getStatusImage(); + console.info('battery status = ' + batteryStatus); + return batteryStatus; + } + + // Method of setting the time to current + setOnTimeListener(callback) { + time = setInterval(function () { + let date = new Date(); + // Get the hours and minutes by substring. + callback(date.toTimeString().substring(0,5)); + }, LOOP_TIME); + } + + stopUpdateTime() { + clearInterval(time); + } + + // Status Icon + setOnStatusListener(callback) { + mStatusManager.setStatusList(mStatusList); + mResultStatusList = mStatusManager.getStatusList(); + callback(mResultStatusList); + } +} \ No newline at end of file diff --git a/entry/src/main/js/default/center/statuscenter/manager/IconManager.js b/entry/src/main/js/default/center/statuscenter/manager/IconManager.js new file mode 100755 index 00000000..ad965eb0 --- /dev/null +++ b/entry/src/main/js/default/center/statuscenter/manager/IconManager.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021 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. + */ + +var mStatusList = []; + +export default class IconManager { + setStatusList(list) { + mStatusList = list; + } + + getStatusList() { + return mStatusList; + } +} \ No newline at end of file diff --git a/entry/src/main/js/default/center/statuscenter/manager/StatusImage.js b/entry/src/main/js/default/center/statuscenter/manager/StatusImage.js new file mode 100755 index 00000000..b275c298 --- /dev/null +++ b/entry/src/main/js/default/center/statuscenter/manager/StatusImage.js @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021 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 default class StatusImage { + constructor() { + } + + getStatusImage() { + } + + init() { + } +} \ No newline at end of file diff --git a/entry/src/main/js/default/common/image_hdpi/ic_status_battery.png b/entry/src/main/js/default/common/image_hdpi/ic_status_battery.png new file mode 100644 index 00000000..94b1137d Binary files /dev/null and b/entry/src/main/js/default/common/image_hdpi/ic_status_battery.png differ diff --git a/entry/src/main/js/default/common/image_hdpi/ic_status_bluetooth.png b/entry/src/main/js/default/common/image_hdpi/ic_status_bluetooth.png new file mode 100644 index 00000000..6a9e81f6 Binary files /dev/null and b/entry/src/main/js/default/common/image_hdpi/ic_status_bluetooth.png differ diff --git a/entry/src/main/js/default/common/image_hdpi/ic_status_signal.png b/entry/src/main/js/default/common/image_hdpi/ic_status_signal.png new file mode 100644 index 00000000..2d97e04d Binary files /dev/null and b/entry/src/main/js/default/common/image_hdpi/ic_status_signal.png differ diff --git a/entry/src/main/js/default/common/image_hdpi/ic_status_wifi.png b/entry/src/main/js/default/common/image_hdpi/ic_status_wifi.png new file mode 100644 index 00000000..486c8b02 Binary files /dev/null and b/entry/src/main/js/default/common/image_hdpi/ic_status_wifi.png differ diff --git a/entry/src/main/js/default/common/image_mdpi/ic_status_battery.png b/entry/src/main/js/default/common/image_mdpi/ic_status_battery.png new file mode 100644 index 00000000..6a6ab3b0 Binary files /dev/null and b/entry/src/main/js/default/common/image_mdpi/ic_status_battery.png differ diff --git a/entry/src/main/js/default/common/image_mdpi/ic_status_bluetooth.png b/entry/src/main/js/default/common/image_mdpi/ic_status_bluetooth.png new file mode 100644 index 00000000..214f063c Binary files /dev/null and b/entry/src/main/js/default/common/image_mdpi/ic_status_bluetooth.png differ diff --git a/entry/src/main/js/default/common/image_mdpi/ic_status_signal.png b/entry/src/main/js/default/common/image_mdpi/ic_status_signal.png new file mode 100644 index 00000000..16769df0 Binary files /dev/null and b/entry/src/main/js/default/common/image_mdpi/ic_status_signal.png differ diff --git a/entry/src/main/js/default/common/image_mdpi/ic_status_wifi.png b/entry/src/main/js/default/common/image_mdpi/ic_status_wifi.png new file mode 100644 index 00000000..63d9d6d1 Binary files /dev/null and b/entry/src/main/js/default/common/image_mdpi/ic_status_wifi.png differ diff --git a/entry/src/main/js/default/common/image_xhdpi/ic_status_battery.png b/entry/src/main/js/default/common/image_xhdpi/ic_status_battery.png new file mode 100644 index 00000000..9efbc47a Binary files /dev/null and b/entry/src/main/js/default/common/image_xhdpi/ic_status_battery.png differ diff --git a/entry/src/main/js/default/common/image_xhdpi/ic_status_bluetooth.png b/entry/src/main/js/default/common/image_xhdpi/ic_status_bluetooth.png new file mode 100644 index 00000000..2dd0dec7 Binary files /dev/null and b/entry/src/main/js/default/common/image_xhdpi/ic_status_bluetooth.png differ diff --git a/entry/src/main/js/default/common/image_xhdpi/ic_status_signal.png b/entry/src/main/js/default/common/image_xhdpi/ic_status_signal.png new file mode 100644 index 00000000..f256c609 Binary files /dev/null and b/entry/src/main/js/default/common/image_xhdpi/ic_status_signal.png differ diff --git a/entry/src/main/js/default/common/image_xhdpi/ic_status_wifi.png b/entry/src/main/js/default/common/image_xhdpi/ic_status_wifi.png new file mode 100644 index 00000000..3f49ec5b Binary files /dev/null and b/entry/src/main/js/default/common/image_xhdpi/ic_status_wifi.png differ diff --git a/entry/src/main/js/default/common/image_xxhdpi/ic_status_battery.png b/entry/src/main/js/default/common/image_xxhdpi/ic_status_battery.png new file mode 100644 index 00000000..b209209a Binary files /dev/null and b/entry/src/main/js/default/common/image_xxhdpi/ic_status_battery.png differ diff --git a/entry/src/main/js/default/common/image_xxhdpi/ic_status_bluetooth.png b/entry/src/main/js/default/common/image_xxhdpi/ic_status_bluetooth.png new file mode 100644 index 00000000..53c6d464 Binary files /dev/null and b/entry/src/main/js/default/common/image_xxhdpi/ic_status_bluetooth.png differ diff --git a/entry/src/main/js/default/common/image_xxhdpi/ic_status_signal.png b/entry/src/main/js/default/common/image_xxhdpi/ic_status_signal.png new file mode 100644 index 00000000..65c057e1 Binary files /dev/null and b/entry/src/main/js/default/common/image_xxhdpi/ic_status_signal.png differ diff --git a/entry/src/main/js/default/common/image_xxhdpi/ic_status_wifi.png b/entry/src/main/js/default/common/image_xxhdpi/ic_status_wifi.png new file mode 100644 index 00000000..c8d92cf4 Binary files /dev/null and b/entry/src/main/js/default/common/image_xxhdpi/ic_status_wifi.png differ diff --git a/entry/src/main/js/default/common/image_xxxhdpi/ic_status_battery.png b/entry/src/main/js/default/common/image_xxxhdpi/ic_status_battery.png new file mode 100644 index 00000000..4f95a350 Binary files /dev/null and b/entry/src/main/js/default/common/image_xxxhdpi/ic_status_battery.png differ diff --git a/entry/src/main/js/default/common/image_xxxhdpi/ic_status_bluetooth.png b/entry/src/main/js/default/common/image_xxxhdpi/ic_status_bluetooth.png new file mode 100644 index 00000000..c96d94e1 Binary files /dev/null and b/entry/src/main/js/default/common/image_xxxhdpi/ic_status_bluetooth.png differ diff --git a/entry/src/main/js/default/common/image_xxxhdpi/ic_status_signal.png b/entry/src/main/js/default/common/image_xxxhdpi/ic_status_signal.png new file mode 100644 index 00000000..fb596c14 Binary files /dev/null and b/entry/src/main/js/default/common/image_xxxhdpi/ic_status_signal.png differ diff --git a/entry/src/main/js/default/common/image_xxxhdpi/ic_status_wifi.png b/entry/src/main/js/default/common/image_xxxhdpi/ic_status_wifi.png new file mode 100644 index 00000000..c5375bae Binary files /dev/null and b/entry/src/main/js/default/common/image_xxxhdpi/ic_status_wifi.png differ diff --git a/entry/src/main/js/default/i18n/en-US.json b/entry/src/main/js/default/i18n/en-US.json new file mode 100755 index 00000000..9e520910 --- /dev/null +++ b/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,4 @@ +{ + "strings": { + } +} \ No newline at end of file diff --git a/entry/src/main/js/default/i18n/zh-CN.json b/entry/src/main/js/default/i18n/zh-CN.json new file mode 100755 index 00000000..9e520910 --- /dev/null +++ b/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,4 @@ +{ + "strings": { + } +} \ No newline at end of file diff --git a/entry/src/main/js/default/pages/index/index.css b/entry/src/main/js/default/pages/index/index.css new file mode 100755 index 00000000..b54aef4f --- /dev/null +++ b/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2021 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. + */ + +.bk { + flex-direction: column; + background-color: #66000000; + position: relative; +} \ No newline at end of file diff --git a/entry/src/main/js/default/pages/index/index.hml b/entry/src/main/js/default/pages/index/index.hml new file mode 100755 index 00000000..e059bba0 --- /dev/null +++ b/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,23 @@ + + + + +
+ + +
\ No newline at end of file diff --git a/entry/src/main/js/default/pages/index/index.js b/entry/src/main/js/default/pages/index/index.js new file mode 100755 index 00000000..063f92da --- /dev/null +++ b/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 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 batteryStatus from '../../center/battery/batteryStatus.js'; + +var mBatteryStatus = new batteryStatus; + +export default { + data: { + isShow: false, + showMask: '', + }, + + onInit() { + mBatteryStatus.startGettingStatus(); + }, + + clickFunc() { + console.info('statusBarClicked'); + } +} \ No newline at end of file diff --git a/entry/src/main/js/default/pages/statusbar/clock/clock.css b/entry/src/main/js/default/pages/statusbar/clock/clock.css new file mode 100644 index 00000000..ac1cdbf1 --- /dev/null +++ b/entry/src/main/js/default/pages/statusbar/clock/clock.css @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2021 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. + */ + +.clock_text { + margin-left: -10px; + width: 14%; + height: 30px; +} + +text { + color: white; +} \ No newline at end of file diff --git a/entry/src/main/js/default/pages/statusbar/clock/clock.hml b/entry/src/main/js/default/pages/statusbar/clock/clock.hml new file mode 100755 index 00000000..93e8490b --- /dev/null +++ b/entry/src/main/js/default/pages/statusbar/clock/clock.hml @@ -0,0 +1,20 @@ + + +
+ {{ mTime }} +
\ No newline at end of file diff --git a/entry/src/main/js/default/pages/statusbar/clock/clock.js b/entry/src/main/js/default/pages/statusbar/clock/clock.js new file mode 100755 index 00000000..99f5dd87 --- /dev/null +++ b/entry/src/main/js/default/pages/statusbar/clock/clock.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021 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 StatusCenter from '../../../center/statuscenter/StatusCenter.js'; + +var mStatusCenter = new StatusCenter(); + +export default { + data: { + mTime: '' + }, + + onInit() { + mStatusCenter.setOnTimeListener((time) => { + console.info('ClockModel mStatusManager time:' + time); + this.mTime = time; + }); + }, + + onDestroy() { + mStatusCenter.stopUpdateTime(); + } +} diff --git a/entry/src/main/js/default/pages/statusbar/statusBar.css b/entry/src/main/js/default/pages/statusbar/statusBar.css new file mode 100755 index 00000000..03cdb5aa --- /dev/null +++ b/entry/src/main/js/default/pages/statusbar/statusBar.css @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021 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. + */ + +.status_bar_page { + background-color: #66000000; + flex-direction: row; + display: flex; + flex-wrap: nowrap; + justify-content: flex-end; + align-items: center; + height: 100%; +} + +text { + color: white; +} + +.main_body { + display: flex; + width: 100%; +} + +.icon_list { + margin-left: 6px; + width: 100%; + height: 30px; + display: flex; + flex-direction: row; +} + +.battery { + flex-direction: row; + align-items: center; +} + +.battery_body { + position: relative; + margin-top: 16px; + align-items: center; + width: 80px; + height: 40px; + background-image: url("common/image_xxhdpi/ic_status_battery.png"); + background-repeat: no-repeat; + padding: 1px; + display: flex; +} + +.battery_progress { + margin-top: -7px; + margin-left: 6px; + height: 32px; + stroke-width: 32px; + stroke-linecap: "round"; +} + diff --git a/entry/src/main/js/default/pages/statusbar/statusBar.hml b/entry/src/main/js/default/pages/statusbar/statusBar.hml new file mode 100755 index 00000000..dc57d75b --- /dev/null +++ b/entry/src/main/js/default/pages/statusbar/statusBar.hml @@ -0,0 +1,32 @@ + + + +
+
+
+
+
+
+
+
+
+
+ +
+
diff --git a/entry/src/main/js/default/pages/statusbar/statusBar.js b/entry/src/main/js/default/pages/statusbar/statusBar.js new file mode 100755 index 00000000..3e6af816 --- /dev/null +++ b/entry/src/main/js/default/pages/statusbar/statusBar.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 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 StatusCenter from '../../center/statuscenter/StatusCenter.js'; + +var mStatusCenter = new StatusCenter(); +const LOOP_TIME = 1500; + +export default { + data: { + mBackgroundColor: '', + mProgressWidth: '', + }, + + onInit() { + console.info('onInit'); + let that = this; + setInterval(function () { + that.getBatteryValue(); + }, LOOP_TIME); + + console.info('mOneSignalImg====>>' + this.mSignalOneImg); + }, + + getBatteryValue() { + let batteryValue = mStatusCenter.setOnBatteryListener(); + console.info('batteryValue = ' + batteryValue); + this.mBackgroundColor = JSON.parse(batteryValue).mBackgroundColor; + this.mProgressWidth = JSON.parse(batteryValue).mProgressWidth; + } +} diff --git a/entry/src/main/js/default/pages/statusbar/statusIcon/statusIconList.css b/entry/src/main/js/default/pages/statusbar/statusIcon/statusIconList.css new file mode 100644 index 00000000..911e33d4 --- /dev/null +++ b/entry/src/main/js/default/pages/statusbar/statusIcon/statusIconList.css @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 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. + */ + +.status_list { + display: flex; + flex-shrink: 0; + flex-direction: row; +} +.status_icon { + margin-right: 8px; +} \ No newline at end of file diff --git a/entry/src/main/js/default/pages/statusbar/statusIcon/statusIconList.hml b/entry/src/main/js/default/pages/statusbar/statusIcon/statusIconList.hml new file mode 100644 index 00000000..f0a374ab --- /dev/null +++ b/entry/src/main/js/default/pages/statusbar/statusIcon/statusIconList.hml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/entry/src/main/js/default/pages/statusbar/statusIcon/statusIconList.js b/entry/src/main/js/default/pages/statusbar/statusIcon/statusIconList.js new file mode 100755 index 00000000..f39081a0 --- /dev/null +++ b/entry/src/main/js/default/pages/statusbar/statusIcon/statusIconList.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 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 StatusCenter from '../../../center/statuscenter/StatusCenter.js'; + +var mStatusCenter = new StatusCenter(); + +export default { + data: { + statusListData:[] + }, + + onInit(){ + console.info('Status onInit'); + mStatusCenter.setOnStatusListener((data)=>{ + this.statusListData = data; + }) + } +} \ 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 00000000..24fea82b --- /dev/null +++ b/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "SystemUI" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/media/icon.png b/entry/src/main/resources/base/media/icon.png new file mode 100644 index 00000000..ce307a88 Binary files /dev/null and b/entry/src/main/resources/base/media/icon.png differ diff --git a/figures/en-us_image_0000001103686480.png b/figures/en-us_image_0000001103686480.png new file mode 100755 index 00000000..772a9709 Binary files /dev/null and b/figures/en-us_image_0000001103686480.png differ diff --git a/figures/zh-cn_image_0000001103686480.png b/figures/zh-cn_image_0000001103686480.png new file mode 100755 index 00000000..751bd05d Binary files /dev/null and b/figures/zh-cn_image_0000001103686480.png differ diff --git a/gradle.properties b/gradle.properties new file mode 100755 index 00000000..c555b4e6 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,10 @@ +# Project-wide Gradle settings. +# IDE (e.g. DevEco Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# If the Chinese output is garbled, please configure the following parameter. +# org.gradle.jvmargs=-Dfile.encoding=GBK diff --git a/gradlew b/gradlew new file mode 100755 index 00000000..2fe81a7d --- /dev/null +++ b/gradlew @@ -0,0 +1,183 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# 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 +# +# https://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. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100755 index 00000000..62bd9b9c --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,103 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/navigationBar/.gitignore b/navigationBar/.gitignore new file mode 100755 index 00000000..3543521e --- /dev/null +++ b/navigationBar/.gitignore @@ -0,0 +1 @@ +/build diff --git a/navigationBar/build.gradle b/navigationBar/build.gradle new file mode 100755 index 00000000..c2ac0f33 --- /dev/null +++ b/navigationBar/build.gradle @@ -0,0 +1,13 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 6 + } + entryModules "entry" + supportSystem "standard" +} + +dependencies { + entryImplementation project(':entry') +} diff --git a/navigationBar/package.json b/navigationBar/package.json new file mode 100755 index 00000000..69a88e3b --- /dev/null +++ b/navigationBar/package.json @@ -0,0 +1 @@ +{} diff --git a/navigationBar/src/main/config.json b/navigationBar/src/main/config.json new file mode 100755 index 00000000..768821a9 --- /dev/null +++ b/navigationBar/src/main/config.json @@ -0,0 +1,51 @@ +{ + "app": { + "bundleName": "com.ohos.systemui", + "vendor": "ohos", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.systemui.navigationbar", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "navigationBar", + "moduleType": "feature" + }, + "abilities": [ + { + "visible": true, + "name": "com.ohos.systemui.navigationbar.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "singleton" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/navigationBar/src/main/js/default/app.js b/navigationBar/src/main/js/default/app.js new file mode 100644 index 00000000..8e47afff --- /dev/null +++ b/navigationBar/src/main/js/default/app.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 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 default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/navigationBar/src/main/js/default/common/image_hdpi/ic_navigation_back.png b/navigationBar/src/main/js/default/common/image_hdpi/ic_navigation_back.png new file mode 100644 index 00000000..b9bd0b2d Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_hdpi/ic_navigation_back.png differ diff --git a/navigationBar/src/main/js/default/common/image_hdpi/ic_navigation_home.png b/navigationBar/src/main/js/default/common/image_hdpi/ic_navigation_home.png new file mode 100644 index 00000000..9ff159b4 Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_hdpi/ic_navigation_home.png differ diff --git a/navigationBar/src/main/js/default/common/image_hdpi/ic_navigation_recent.png b/navigationBar/src/main/js/default/common/image_hdpi/ic_navigation_recent.png new file mode 100644 index 00000000..0eca6bc2 Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_hdpi/ic_navigation_recent.png differ diff --git a/navigationBar/src/main/js/default/common/image_mdpi/ic_navigation_back.png b/navigationBar/src/main/js/default/common/image_mdpi/ic_navigation_back.png new file mode 100644 index 00000000..4da0066c Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_mdpi/ic_navigation_back.png differ diff --git a/navigationBar/src/main/js/default/common/image_mdpi/ic_navigation_home.png b/navigationBar/src/main/js/default/common/image_mdpi/ic_navigation_home.png new file mode 100644 index 00000000..7749ca1e Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_mdpi/ic_navigation_home.png differ diff --git a/navigationBar/src/main/js/default/common/image_mdpi/ic_navigation_recent.png b/navigationBar/src/main/js/default/common/image_mdpi/ic_navigation_recent.png new file mode 100644 index 00000000..8ecfc720 Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_mdpi/ic_navigation_recent.png differ diff --git a/navigationBar/src/main/js/default/common/image_xhdpi/ic_navigation_back.png b/navigationBar/src/main/js/default/common/image_xhdpi/ic_navigation_back.png new file mode 100644 index 00000000..0f14cd39 Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_xhdpi/ic_navigation_back.png differ diff --git a/navigationBar/src/main/js/default/common/image_xhdpi/ic_navigation_home.png b/navigationBar/src/main/js/default/common/image_xhdpi/ic_navigation_home.png new file mode 100644 index 00000000..7b6fde4f Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_xhdpi/ic_navigation_home.png differ diff --git a/navigationBar/src/main/js/default/common/image_xhdpi/ic_navigation_recent.png b/navigationBar/src/main/js/default/common/image_xhdpi/ic_navigation_recent.png new file mode 100644 index 00000000..70544ed5 Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_xhdpi/ic_navigation_recent.png differ diff --git a/navigationBar/src/main/js/default/common/image_xxhdpi/ic_navigation_back.png b/navigationBar/src/main/js/default/common/image_xxhdpi/ic_navigation_back.png new file mode 100644 index 00000000..423faea5 Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_xxhdpi/ic_navigation_back.png differ diff --git a/navigationBar/src/main/js/default/common/image_xxhdpi/ic_navigation_home.png b/navigationBar/src/main/js/default/common/image_xxhdpi/ic_navigation_home.png new file mode 100644 index 00000000..f08b4e6d Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_xxhdpi/ic_navigation_home.png differ diff --git a/navigationBar/src/main/js/default/common/image_xxhdpi/ic_navigation_recent.png b/navigationBar/src/main/js/default/common/image_xxhdpi/ic_navigation_recent.png new file mode 100644 index 00000000..591e6ee7 Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_xxhdpi/ic_navigation_recent.png differ diff --git a/navigationBar/src/main/js/default/common/image_xxxhdpi/ic_navigation_back.png b/navigationBar/src/main/js/default/common/image_xxxhdpi/ic_navigation_back.png new file mode 100644 index 00000000..c25181ee Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_xxxhdpi/ic_navigation_back.png differ diff --git a/navigationBar/src/main/js/default/common/image_xxxhdpi/ic_navigation_home.png b/navigationBar/src/main/js/default/common/image_xxxhdpi/ic_navigation_home.png new file mode 100644 index 00000000..774a3e1c Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_xxxhdpi/ic_navigation_home.png differ diff --git a/navigationBar/src/main/js/default/common/image_xxxhdpi/ic_navigation_recent.png b/navigationBar/src/main/js/default/common/image_xxxhdpi/ic_navigation_recent.png new file mode 100644 index 00000000..a2f0f100 Binary files /dev/null and b/navigationBar/src/main/js/default/common/image_xxxhdpi/ic_navigation_recent.png differ diff --git a/navigationBar/src/main/js/default/i18n/en-US.json b/navigationBar/src/main/js/default/i18n/en-US.json new file mode 100755 index 00000000..9e520910 --- /dev/null +++ b/navigationBar/src/main/js/default/i18n/en-US.json @@ -0,0 +1,4 @@ +{ + "strings": { + } +} \ No newline at end of file diff --git a/navigationBar/src/main/js/default/i18n/zh-CN.json b/navigationBar/src/main/js/default/i18n/zh-CN.json new file mode 100755 index 00000000..9e520910 --- /dev/null +++ b/navigationBar/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,4 @@ +{ + "strings": { + } +} \ No newline at end of file diff --git a/navigationBar/src/main/js/default/pages/backKey/backKey.css b/navigationBar/src/main/js/default/pages/backKey/backKey.css new file mode 100755 index 00000000..5144f837 --- /dev/null +++ b/navigationBar/src/main/js/default/pages/backKey/backKey.css @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021 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. + */ + +.back { + icon-width: 42px; + icon-height: 42px; + width: 100%; + height: 100%; + background-color: transparent; +} + +.back:active { + background-color: #DCDCDC; +} \ No newline at end of file diff --git a/navigationBar/src/main/js/default/pages/backKey/backKey.hml b/navigationBar/src/main/js/default/pages/backKey/backKey.hml new file mode 100644 index 00000000..f7324ac8 --- /dev/null +++ b/navigationBar/src/main/js/default/pages/backKey/backKey.hml @@ -0,0 +1,18 @@ + + + \ No newline at end of file diff --git a/navigationBar/src/main/js/default/pages/backKey/backKey.js b/navigationBar/src/main/js/default/pages/backKey/backKey.js new file mode 100755 index 00000000..7ea80acf --- /dev/null +++ b/navigationBar/src/main/js/default/pages/backKey/backKey.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 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 input from '@ohos.injectEventHandler'; + +var mDelayTime = 100; + +const KEYCODE = 2; +const KEY_DOWN_DURATION = 1; + +export default { + backClick() { + console.info('=====================test_inject_event back'); + var res; + res = input.injectEventSync({ + isPressed: true, + keyCode: KEYCODE, + keyDownDuration: KEY_DOWN_DURATION + }); + console.info('=====================test_inject_event down res = ' + res); + setTimeout(function () { + res = input.injectEventSync({ + isPressed: false, + keyCode: KEYCODE, + keyDownDuration: KEY_DOWN_DURATION + }); + console.info('=====================test_inject_event up res = ' + res); + }, mDelayTime); + }, +} \ No newline at end of file diff --git a/navigationBar/src/main/js/default/pages/homeKey/homeKey.css b/navigationBar/src/main/js/default/pages/homeKey/homeKey.css new file mode 100755 index 00000000..49304723 --- /dev/null +++ b/navigationBar/src/main/js/default/pages/homeKey/homeKey.css @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021 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. + */ + +.home { + icon-width: 42px; + icon-height: 42px; + width: 100%; + height: 100%; + background-color: transparent; +} + +.home:active { + background-color: #DCDCDC; +} \ No newline at end of file diff --git a/navigationBar/src/main/js/default/pages/homeKey/homeKey.hml b/navigationBar/src/main/js/default/pages/homeKey/homeKey.hml new file mode 100644 index 00000000..b12133b2 --- /dev/null +++ b/navigationBar/src/main/js/default/pages/homeKey/homeKey.hml @@ -0,0 +1,18 @@ + + + \ No newline at end of file diff --git a/navigationBar/src/main/js/default/pages/homeKey/homeKey.js b/navigationBar/src/main/js/default/pages/homeKey/homeKey.js new file mode 100755 index 00000000..fd72000d --- /dev/null +++ b/navigationBar/src/main/js/default/pages/homeKey/homeKey.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 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 feature_ability from '@ohos.feature_ability'; + +const BUNDLE_NAME = "com.ohos.launcher"; +const ABILITY_NAME = "com.ohos.launcher.MainAbility"; +const REQUEST_CODE = 1; +const ABILITY_TYPE = "PageAbility"; +const ACTION = "action1"; +const ENTITIES = ["entity1"]; +const FLAGS = 2; +const DEVICE_ID = "deviceId"; +const SYNC_OPTION = 1; + +export default { + homeClick() { + console.info('homeChange'); + var result = feature_ability.startAbility({ + bundleName: BUNDLE_NAME, + abilityName: ABILITY_NAME, + requestCode: REQUEST_CODE, + abilityType: ABILITY_TYPE, + want: { + action: ACTION, + entities: ENTITIES, + type: ABILITY_TYPE, + flags: FLAGS, + elementName: { + deviceId: DEVICE_ID, + bundleName: BUNDLE_NAME, + abilityName: ABILITY_NAME, + }, + }, + syncOption: SYNC_OPTION, + }).then(data => + console.log('promise::then : ' + data)).catch(error => + console.log('promise::catch : ' + error)); + }, +} \ No newline at end of file diff --git a/navigationBar/src/main/js/default/pages/index/index.css b/navigationBar/src/main/js/default/pages/index/index.css new file mode 100644 index 00000000..c0057f71 --- /dev/null +++ b/navigationBar/src/main/js/default/pages/index/index.css @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021 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. + */ + +.navigation { + justify-content: center; + align-items: center; + justify-content: space-around; + height: 100px; + background-color: #66000000; + padding-left: 130px; + padding-right: 130px; + width: 100%; + position: absolute; + bottom: 0px; +} \ No newline at end of file diff --git a/navigationBar/src/main/js/default/pages/index/index.hml b/navigationBar/src/main/js/default/pages/index/index.hml new file mode 100755 index 00000000..92647163 --- /dev/null +++ b/navigationBar/src/main/js/default/pages/index/index.hml @@ -0,0 +1,26 @@ + + + + + + + \ No newline at end of file diff --git a/navigationBar/src/main/js/default/pages/index/index.js b/navigationBar/src/main/js/default/pages/index/index.js new file mode 100755 index 00000000..1cc169c0 --- /dev/null +++ b/navigationBar/src/main/js/default/pages/index/index.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021 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 device from '@system.device'; + +export default { + onInit() { + device.getInfo({ + success: (data) => { + console.log(`Resolution: ${this.width}*${this.height}`); + } + }); + }, +} diff --git a/navigationBar/src/main/js/default/pages/recentKey/recentKey.css b/navigationBar/src/main/js/default/pages/recentKey/recentKey.css new file mode 100755 index 00000000..a159e2e1 --- /dev/null +++ b/navigationBar/src/main/js/default/pages/recentKey/recentKey.css @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021 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. + */ + +.recent { + icon-width: 42px; + icon-height: 42px; + width: 100%; + height: 100%; + background-color: transparent; +} + +.recent:active { + background-color: #DCDCDC; +} \ No newline at end of file diff --git a/navigationBar/src/main/js/default/pages/recentKey/recentKey.hml b/navigationBar/src/main/js/default/pages/recentKey/recentKey.hml new file mode 100644 index 00000000..2856c9a4 --- /dev/null +++ b/navigationBar/src/main/js/default/pages/recentKey/recentKey.hml @@ -0,0 +1,18 @@ + + + \ No newline at end of file diff --git a/navigationBar/src/main/js/default/pages/recentKey/recentKey.js b/navigationBar/src/main/js/default/pages/recentKey/recentKey.js new file mode 100755 index 00000000..70944b1c --- /dev/null +++ b/navigationBar/src/main/js/default/pages/recentKey/recentKey.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2021 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 feature_ability from '@ohos.feature_ability'; + +const BUNDLE_NAME = "com.ohos.launcher"; +const ABILITY_NAME = "com.ohos.launcher.recents.MainAbility"; +const REQUEST_CODE = 1; +const ABILITY_TYPE = "PageAbility"; +const ACTION = "action1"; +const ENTITIES = ["entity1"]; +const FLAGS = 2; +const DEVICE_ID = "deviceId"; +const SYNC_OPTION =1; + +export default { + recentClick() { + // launcher support + console.log('onRecentClick:'); + var result = feature_ability.startAbility({ + bundleName: BUNDLE_NAME, + abilityName: ABILITY_NAME, + requestCode: REQUEST_CODE, + abilityType: ABILITY_TYPE, + want: { + action: ACTION, + entities: ENTITIES, + type: ABILITY_TYPE, + flags: FLAGS, + elementName: { + deviceId: DEVICE_ID, + bundleName: BUNDLE_NAME, + abilityName: ABILITY_NAME, + }, + }, + syncOption: SYNC_OPTION, + }).then(data => + console.log('promise::then : ' + data)).catch(error => + console.log('promise::catch : ' + error)); + }, +} \ No newline at end of file diff --git a/navigationBar/src/main/resources/base/element/string.json b/navigationBar/src/main/resources/base/element/string.json new file mode 100644 index 00000000..d405647b --- /dev/null +++ b/navigationBar/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MyApplication" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/navigationBar/src/main/resources/base/media/icon.png b/navigationBar/src/main/resources/base/media/icon.png new file mode 100644 index 00000000..ce307a88 Binary files /dev/null and b/navigationBar/src/main/resources/base/media/icon.png differ diff --git a/settings.gradle b/settings.gradle new file mode 100755 index 00000000..a58b4aca --- /dev/null +++ b/settings.gradle @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2021 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. + */ +include ':entry', ':navigationBar' \ No newline at end of file diff --git a/signature/systemui.p7b b/signature/systemui.p7b new file mode 100644 index 00000000..cf9fe423 Binary files /dev/null and b/signature/systemui.p7b differ