Signed-off-by: r00498791 <renjie32@huawei.com>
This commit is contained in:
r00498791 2022-04-25 20:39:39 +08:00
parent a146bc5e92
commit bb40246da1
427 changed files with 7651 additions and 2419 deletions

11
.gitignore vendored
View File

@ -1,5 +1,14 @@
.gradle
.idea
build
node_modules/
local.properties
signature/systemui_provision_verified.json
signature/systemui_provision_verified.json
product/default/volumepanel/node_modules
product/default/notificationmanagement/node_modules
product/default/navigationBar/node_modules
product/pc/controlpanel/node_modules
product/pc/notificationpanel/node_modules
product/pc/statusbar/node_modules
product/phone/dropdownpanel/node_modules
product/phone/statusbar/node_modules

15
AppScope/app.json5 Normal file
View File

@ -0,0 +1,15 @@
{
"app": {
"bundleName": "com.ohos.systemui",
"vendor": "ohos",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name",
"distributedNotificationEnabled": true,
"singleton": true,
"keepAlive": true,
"minAPIVersion": 8,
"targetAPIVersion": 9
}
}

View File

@ -0,0 +1,8 @@
{
"string": [
{
"name": "app_name",
"value": "SystemUI"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

113
build-profile.json5 Normal file
View File

@ -0,0 +1,113 @@
{
"app": {
"compileSdkVersion": 9,
"compatibleSdkVersion": 9,
"products": [
{
"name": "default",
"signingConfig": "release"
}
]
},
"modules": [
{
"name": "phone_entry",
"srcPath": "./entry/phone",
"targets": [
{
"name": "default",
},
],
},
{
"name": "pc_entry",
"srcPath": "./entry/pc",
"targets": [
{
"name": "default"
},
],
},
{
"name": "default_navigationBar",
"srcPath": "./product/default/navigationBar",
"targets": [
{
"name": "default"
},
],
},
{
"name": "default_notificationmanagement",
"srcPath": "./product/default/notificationmanagement",
"targets": [
{
"name": "default"
},
],
},
{
"name": "default_volumepanel",
"srcPath": "./product/default/volumepanel",
"targets": [
{
"name": "default"
},
],
},
{
"name": "pc_controlpanel",
"srcPath": "./product/pc/controlpanel",
"targets": [
{
"name": "default"
},
],
},
{
"name": "pc_notificationpanel",
"srcPath": "./product/pc/notificationpanel",
"targets": [
{
"name": "default"
},
],
},
{
"name": "pc_statusbar",
"srcPath": "./product/pc/statusbar",
"targets": [
{
"name": "default"
},
],
},
{
"name": "phone_dropdownpanel",
"srcPath": "./product/phone/dropdownpanel",
"targets": [
{
"name": "default"
},
],
},
{
"name": "phone_statusbar",
"srcPath": "./product/phone/statusbar",
"targets": [
{
"name": "default"
},
],
},
{
"name": "common",
"srcPath": "./common",
"targets": [
{
"name": "default"
},
],
}
],
}

View File

@ -1,48 +0,0 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'com.huawei.ohos.app'
apply from: "./infra/config_exts.gradle"
ohos {
compileSdkVersion rootProject.ext.version.compileSdk
defaultConfig {
compatibleSdkVersion rootProject.ext.version.compatibleSdk
}
supportSystem "standard"
}
buildscript {
repositories {
maven {
url 'http://repo.ark.tools.huawei.com/artifactory/maven-public/'
allowInsecureProtocol = true
}
maven {
url 'https://mirrors.huaweicloud.com/repository/maven/'
allowInsecureProtocol = true
}
maven {
url 'https://developer.huawei.com/repo/'
allowInsecureProtocol = true
}
}
dependencies {
classpath 'com.huawei.ohos:hap:3.0.5.2'
}
}
allprojects {
repositories {
maven {
url 'http://repo.ark.tools.huawei.com/artifactory/maven-public/'
allowInsecureProtocol = true
}
maven {
url 'https://mirrors.huaweicloud.com/repository/maven/'
allowInsecureProtocol = true
}
maven {
url 'https://developer.huawei.com/repo/'
allowInsecureProtocol = true
}
}
}

View File

@ -0,0 +1,11 @@
{
"apiType": 'stageMode',
"buildOption": {
"arkEnable": true
},
"targets": [
{
"name": "default",
}
]
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
/**
* Copyright (c) 2022 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
@ -13,11 +13,5 @@
* limitations under the License.
*/
export default {
onCreate() {
console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').harTasks

5
common/package-lock.json generated Normal file
View File

@ -0,0 +1,5 @@
{
"name": "@ohos/common",
"version": "1.0.0",
"lockfileVersion": 1
}

12
common/package.json Normal file
View File

@ -0,0 +1,12 @@
{
"devDependencies": {},
"name": "@ohos/common",
"description": "a npm package which contains common function",
"ohos": {
"org": "huawei",
"directoryLevel": "module",
"buildTool": "hvigor"
},
"version": "1.0.0",
"dependencies": {}
}

View File

@ -1,23 +0,0 @@
{
"app": {
"bundleName": "com.ohos.systemui",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
},
"module": {
"package": "com.ohos.commonutil",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "common",
"moduleType": "har"
}
}
}

View File

@ -27,6 +27,7 @@ export default class AbilityManager {
static ABILITY_NAME_NOTIFICATION_PANEL = 'SystemUi_NotificationPanel';
static ABILITY_NAME_CONTROL_PANEL = 'SystemUi_ControlPanel';
static ABILITY_NAME_BANNER_NOTICE = 'SystemUi_BannerNotice';
static ABILITY_NAME_APP_LIST = 'SystemUi_AppList';
static ABILITY_NAME_OWNER_WANT = 'Owner_Want';

View File

@ -26,19 +26,21 @@ export type pluginWorkerListener = {
};
const TAG = "PluginDataSourceAdapter";
const WORKER_JS_URL = "workers/PluginDataSourceWorker.js";
export default class PluginDataSourceAdapter {
mContext: Context;
mWorker: any;
mName: string;
mListener: pluginWorkerListener;
mModuleName: string;
constructor(name: string, context: Context, listener: pluginWorkerListener) {
constructor(name: string, context: Context, listener: pluginWorkerListener, moduleName: string) {
Log.showInfo(TAG, `constructor, name: ${name}`);
this.mName = name;
this.mContext = context;
this.mListener = listener;
this.mModuleName = moduleName;
const WORKER_JS_URL = this.mModuleName + "/ets/workers/PluginDataSourceWorker.js";
this.mWorker = new worker.Worker(WORKER_JS_URL, {
type: "classic",
name: this.mName,

View File

@ -0,0 +1,10 @@
{
"module": {
"name": "common",
"type": "har",
"deviceTypes": [
"phone",
],
"uiSyntax": "ets"
}
}

View File

@ -17,7 +17,7 @@
```
### 环境搭建
安装DevEco Studio
打开DevEco Studio链接下载安装安装步骤及安装说明详见下载地址[下载地址](https://developer.harmonyos.com/cn/develop/deveco-studio#download)
## 基础开发说明
### 系统接口调用

1
entry/pc/.gitignore vendored
View File

@ -1 +0,0 @@
/build

View File

@ -0,0 +1,11 @@
{
"apiType": 'stageMode',
"buildOption": {
"arkEnable": true
},
"targets": [
{
"name": "default",
}
]
}

View File

@ -1,12 +0,0 @@
apply plugin: 'com.huawei.ohos.hap'
ohos {
compileSdkVersion rootProject.ext.version.compileSdk
defaultConfig {
compatibleSdkVersion rootProject.ext.version.compatibleSdk
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
testCompile 'junit:junit:4.12'
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
/**
* Copyright (c) 2022 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
@ -13,11 +13,5 @@
* limitations under the License.
*/
export default {
onCreate() {
console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks

5
entry/pc/package-lock.json generated Normal file
View File

@ -0,0 +1,5 @@
{
"name": "pc_entry",
"version": "1.0.0",
"lockfileVersion": 1
}

View File

@ -1 +1,11 @@
{}
{
"devDependencies": {},
"name": "pc_entry",
"ohos": {
"org": "huawei",
"directoryLevel": "module",
"buildTool": "hvigor"
},
"version": "1.0.0",
"dependencies": {}
}

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import AbilityStage from "@ohos.application.AbilityStage"
import Log from '../../../../../common/src/main/ets/default/Log'
import Log from '../../../../../../common/src/main/ets/default/log'
const TAG = "SystemUI_AbilityStage"

View File

@ -1,24 +0,0 @@
/*
* 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('SystemUI entry Application onDestroy')
},
onDestroy() {
console.info('SystemUI entry Application onDestroy')
},
}

View File

@ -1,52 +1,29 @@
{
"app": {
"bundleName": "com.ohos.systemui",
"vendor": "ohos",
"version": {
"code": 1,
"name": "1.0"
},
"singleton": true
},
"deviceConfig": {},
"module": {
"package": "com.ohos.systemui",
"name": ".MyApplication",
"deviceType": [
"name": "pc_entry",
"type": "entry",
"srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:description_mainability",
"mainElement": "ServiceExtAbility",
"deviceTypes": [
"tablet"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "pc_entry",
"moduleType": "entry"
},
"abilities": [
"deliveryWithInstall": true,
"installationFree": false,
"uiSyntax": "ets",
"pages": "$profile:main_pages",
"extensionAbilities": [
{
"visible": true,
"srcPath": "ServiceExtAbility",
"name": ".ServiceExtAbility",
"srcEntrance": "./ets/ServiceExtAbility/ServiceExtAbility.ts",
"name": "com.ohos.systemui.ServiceExtAbility",
"icon": "$media:icon",
"srcLanguage": "ets",
"description": "$string:description_mainability",
"label": "$string:app_name",
"type": "service"
}
],
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"name": "ServiceExtAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
},
"pages": ["pages/index"]
}
],
"reqPermissions": [
"requestPermissions": [
{
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},

View File

@ -0,0 +1,5 @@
{
"src": [
"pages/index"
]
}

View File

@ -1 +0,0 @@
/build

View File

@ -0,0 +1,11 @@
{
"apiType": 'stageMode',
"buildOption": {
"arkEnable": true
},
"targets": [
{
"name": "default",
}
]
}

View File

@ -1,12 +0,0 @@
apply plugin: 'com.huawei.ohos.hap'
ohos {
compileSdkVersion rootProject.ext.version.compileSdk
defaultConfig {
compatibleSdkVersion rootProject.ext.version.compatibleSdk
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
testCompile 'junit:junit:4.12'
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
/**
* Copyright (c) 2022 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
@ -13,11 +13,5 @@
* limitations under the License.
*/
export default {
onCreate() {
console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks

5
entry/phone/package-lock.json generated Normal file
View File

@ -0,0 +1,5 @@
{
"name": "phone_entry",
"version": "1.0.0",
"lockfileVersion": 1
}

View File

@ -1 +1,11 @@
{}
{
"devDependencies": {},
"name": "phone_entry",
"ohos": {
"org": "huawei",
"directoryLevel": "module",
"buildTool": "hvigor"
},
"version": "1.0.0",
"dependencies": {}
}

View File

@ -1,24 +0,0 @@
/*
* Copyright (c) 2021-2022 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 AbilityStage from "@ohos.application.AbilityStage"
import Log from '../../../../../common/src/main/ets/default/Log'
const TAG = "SystemUI_AbilityStage"
export default class MainAbilityStage extends AbilityStage {
onCreate() {
Log.showInfo(TAG, "onCreate")
}
}

View File

@ -15,7 +15,8 @@
import AbilityStage from "@ohos.application.AbilityStage"
import Log from '../../../../../../common/src/main/ets/default/Log'
const TAG = "StatusBar_AbilityStage"
const TAG = "SystemUI_AbilityStage"
export default class MainAbilityStage extends AbilityStage {
onCreate() {
Log.showInfo(TAG, "onCreate")

View File

@ -1,24 +0,0 @@
/*
* 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('SystemUI entry Application onDestroy')
},
onDestroy() {
console.info('SystemUI entry Application onDestroy')
},
}

View File

@ -1,52 +1,29 @@
{
"app": {
"bundleName": "com.ohos.systemui",
"vendor": "ohos",
"version": {
"code": 1,
"name": "1.0"
},
"singleton": true
},
"deviceConfig": {},
"module": {
"package": "com.ohos.systemui",
"name": ".MyApplication",
"deviceType": [
"name": "phone_entry",
"type": "entry",
"srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:description_mainability",
"mainElement": "ServiceExtAbility",
"deviceTypes": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "phone_entry",
"moduleType": "entry"
},
"abilities": [
"deliveryWithInstall": true,
"installationFree": false,
"uiSyntax": "ets",
"pages": "$profile:main_pages",
"extensionAbilities": [
{
"visible": true,
"srcPath": "ServiceExtAbility",
"name": ".ServiceExtAbility",
"srcEntrance": "./ets/ServiceExtAbility/ServiceExtAbility.ts",
"name": "com.ohos.systemui.ServiceExtAbility",
"icon": "$media:icon",
"srcLanguage": "ets",
"description": "$string:description_mainability",
"label": "$string:app_name",
"type": "service"
}
],
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"name": "ServiceExtAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
},
"pages": ["pages/index"]
}
],
"reqPermissions": [
"requestPermissions": [
{
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
@ -68,6 +45,9 @@
{
"name": "ohos.permission.MANAGE_WIFI_CONNECTION"
},
{
"name": "ohos.permission.GET_NETWORK_INFO"
},
{
"name": "ohos.permission.USE_BLUETOOTH"
},

View File

@ -0,0 +1,5 @@
{
"src": [
"pages/index"
]
}

View File

@ -1 +0,0 @@
build

View File

@ -0,0 +1,11 @@
{
"apiType": 'stageMode',
"buildOption": {
"arkEnable": true
},
"targets": [
{
"name": "default",
}
]
}

View File

@ -1,19 +0,0 @@
apply plugin: 'com.huawei.ohos.library'
ohos {
compileSdkVersion rootProject.ext.version.compileSdk
defaultConfig {
compatibleSdkVersion rootProject.ext.version.compatibleSdk
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
}

View File

@ -0,0 +1,17 @@
/**
* Copyright (c) 2022 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.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks

View File

@ -0,0 +1,12 @@
{
"name": "@ohos/airplanecomponent",
"version": "1.0.0",
"description": "a npm package which contains airplanecomponent function",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"dependencies": {
}
}

View File

@ -1,24 +0,0 @@
{
"app": {
"bundleName": "com.ohos.systemui",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
},
"module": {
"package": "com.ohos.systemui.airplanecomponent",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "airplanecomponent",
"moduleType": "har"
},
"srcPath": "default"
}
}

View File

@ -0,0 +1,10 @@
{
"module": {
"name": "airplanecomponent",
"type": "har",
"deviceTypes": [
"phone",
],
"uiSyntax": "ets"
}
}

View File

@ -1 +0,0 @@
build

View File

@ -0,0 +1,11 @@
{
"apiType": 'stageMode',
"buildOption": {
"arkEnable": true
},
"targets": [
{
"name": "default",
}
]
}

View File

@ -1,19 +0,0 @@
apply plugin: 'com.huawei.ohos.library'
ohos {
compileSdkVersion rootProject.ext.version.compileSdk
defaultConfig {
compatibleSdkVersion rootProject.ext.version.compatibleSdk
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
}

View File

@ -0,0 +1,17 @@
/**
* Copyright (c) 2022 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.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks

View File

@ -0,0 +1,12 @@
{
"name": "@ohos/autorotatecomponent",
"version": "1.0.0",
"description": "a npm package which contains autorotatecomponent function",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"dependencies": {
}
}

View File

@ -1,23 +0,0 @@
{
"app": {
"bundleName": "com.ohos.systemui",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.ohos.systemui.autorotatecomponent",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "autorotatecomponent",
"moduleType": "har"
},
"srcPath": "default"
}
}

View File

@ -0,0 +1,10 @@
{
"module": {
"name": "autorotatecomponent",
"type": "har",
"deviceTypes": [
"phone",
],
"uiSyntax": "ets"
}
}

View File

@ -1 +0,0 @@
build

View File

@ -0,0 +1,11 @@
{
"apiType": 'stageMode',
"buildOption": {
"arkEnable": true
},
"targets": [
{
"name": "default",
}
]
}

View File

@ -1,19 +0,0 @@
apply plugin: 'com.huawei.ohos.library'
ohos {
compileSdkVersion rootProject.ext.version.compileSdk
defaultConfig {
compatibleSdkVersion rootProject.ext.version.compatibleSdk
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
}

View File

@ -0,0 +1,17 @@
/**
* Copyright (c) 2022 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.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks

View File

@ -0,0 +1,12 @@
{
"name": "@ohos/batterycomponent",
"version": "1.0.0",
"description": "a npm package which contains batterycomponent function",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"dependencies": {
}
}

View File

@ -1,23 +0,0 @@
{
"app": {
"bundleName": "com.ohos.systemui",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.ohos.systemui.batterycomponent",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "batterycomponent",
"moduleType": "har"
},
"srcPath": "default"
}
}

View File

@ -0,0 +1,10 @@
{
"module": {
"name": "batterycomponent",
"type": "har",
"deviceTypes": [
"phone",
],
"uiSyntax": "ets"
}
}

View File

@ -1 +0,0 @@
build

View File

@ -0,0 +1,11 @@
{
"apiType": 'stageMode',
"buildOption": {
"arkEnable": true
},
"targets": [
{
"name": "default",
}
]
}

View File

@ -1,19 +0,0 @@
apply plugin: 'com.huawei.ohos.library'
ohos {
compileSdkVersion rootProject.ext.version.compileSdk
defaultConfig {
compatibleSdkVersion rootProject.ext.version.compatibleSdk
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
}

View File

@ -0,0 +1,17 @@
/**
* Copyright (c) 2022 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.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks

View File

@ -0,0 +1,12 @@
{
"name": "@ohos/bluetoothcomponent",
"version": "1.0.0",
"description": "a npm package which contains bluetoothcomponent function",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"dependencies": {
}
}

View File

@ -1,23 +0,0 @@
{
"app": {
"bundleName": "com.ohos.systemui",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.ohos.systemui.bluetoothcomponent",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "bluetoothcomponent",
"moduleType": "har"
},
"srcPath": "default"
}
}

View File

@ -0,0 +1,10 @@
{
"module": {
"name": "bluetoothcomponent",
"type": "har",
"deviceTypes": [
"phone",
],
"uiSyntax": "ets"
}
}

View File

@ -1 +0,0 @@
build

View File

@ -0,0 +1,11 @@
{
"apiType": 'stageMode',
"buildOption": {
"arkEnable": true
},
"targets": [
{
"name": "default",
}
]
}

View File

@ -1,19 +0,0 @@
apply plugin: 'com.huawei.ohos.library'
ohos {
compileSdkVersion rootProject.ext.version.compileSdk
defaultConfig {
compatibleSdkVersion rootProject.ext.version.compatibleSdk
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
}

View File

@ -0,0 +1,17 @@
/**
* Copyright (c) 2022 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.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks

View File

@ -0,0 +1,12 @@
{
"name": "@ohos/brightnesscomponent",
"version": "1.0.0",
"description": "a npm package which contains brightnesscomponent function",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"dependencies": {
}
}

View File

@ -1,24 +0,0 @@
{
"app": {
"bundleName": "com.ohos.systemui",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
},
"module": {
"package": "com.ohos.systemui.brightnesscomponent",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "brightnesscomponent",
"moduleType": "har"
},
"srcPath": "default"
}
}

View File

@ -0,0 +1,10 @@
{
"module": {
"name": "brightnesscomponent",
"type": "har",
"deviceTypes": [
"phone",
],
"uiSyntax": "ets"
}
}

View File

@ -1 +0,0 @@
build

View File

@ -0,0 +1,11 @@
{
"apiType": 'stageMode',
"buildOption": {
"arkEnable": true
},
"targets": [
{
"name": "default",
}
]
}

View File

@ -1,19 +0,0 @@
apply plugin: 'com.huawei.ohos.library'
ohos {
compileSdkVersion rootProject.ext.version.compileSdk
defaultConfig {
compatibleSdkVersion rootProject.ext.version.compatibleSdk
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
}

View File

@ -0,0 +1,17 @@
/**
* Copyright (c) 2022 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.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks

View File

@ -0,0 +1,5 @@
{
"name": "@ohos/capsulecomponent",
"version": "1.0.0",
"lockfileVersion": 1
}

View File

@ -0,0 +1,11 @@
{
"name": "@ohos/capsulecomponent",
"version": "1.0.0",
"description": "a npm package which contains capsulecomponent function",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"dependencies": {}
}

View File

@ -1,33 +0,0 @@
{
"app": {
"bundleName": "com.ohos.systemui",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.ohos.systemui.capsulecomponent",
"deviceType": [
"phone"
],
"reqPermissions": [{
"name": "ohos.permission.COMMONEVENT_STICKY",
"reason": "Obtain the required permission",
"usedScene": {
"ability": [
".MainAbility"
],
"when": "inuse"
}
}],
"distro": {
"deliveryWithInstall": true,
"moduleName": "capsulecomponent",
"moduleType": "har"
},
"srcPath": "default"
}
}

View File

@ -29,7 +29,7 @@ export default class StyleConfiguration {
greenCapsuleTextColor: $r('app.color.green_capsule_text_color'),
greenCapsuleTextMarginLeftRight: $r('app.float.green_capsule_text_left_right'),
greenCapsuleRadius: $r('app.float.green_capsule_radius'),
greenCapsuleBackgroundColor: $r('app.color.background_color'),
greenCapsuleBackgroundColor: $r('app.color.capsule_background_color'),
maxLines:Constants.DEFAULT_MAX_LINES
};
});

View File

@ -29,7 +29,7 @@ function fixInteger(num) {
}
function parseTime(num) {
return fixInteger(Math.floor(num / MIN_VAL)) + ":" + fixInteger(Math.floor((num % MIN_VAL) / SEC_VAL);
return fixInteger(Math.floor(num / MIN_VAL)) + ":" + fixInteger(Math.floor((num % MIN_VAL) / SEC_VAL));
}
export const VIEW_MODEL_ID = "CapsuleViewModelVm";

View File

@ -0,0 +1,10 @@
{
"module": {
"name": "capsulecomponent",
"type": "har",
"deviceTypes": [
"phone",
],
"uiSyntax": "ets"
}
}

View File

@ -1,7 +1,7 @@
{
"color": [
{
"name": "background_color",
"name": "capsule_background_color",
"value": "#64BB5C"
},
{

View File

@ -1 +0,0 @@
build

View File

@ -0,0 +1,11 @@
{
"apiType": 'stageMode',
"buildOption": {
"arkEnable": true
},
"targets": [
{
"name": "default",
}
]
}

View File

@ -1,19 +0,0 @@
apply plugin: 'com.huawei.ohos.library'
ohos {
compileSdkVersion rootProject.ext.version.compileSdk
defaultConfig {
compatibleSdkVersion rootProject.ext.version.compatibleSdk
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
}

View File

@ -0,0 +1,17 @@
/**
* Copyright (c) 2022 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.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks

View File

@ -0,0 +1,12 @@
{
"name": "@ohos/clockcomponent",
"version": "1.0.0",
"description": "a npm package which contains clockcomponent function",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"dependencies": {
}
}

View File

@ -1,23 +0,0 @@
{
"app": {
"bundleName": "com.ohos.systemui",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.ohos.systemui.clockcomponent",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "clockcomponent",
"moduleType": "har"
},
"srcPath": "default"
}
}

View File

@ -0,0 +1,10 @@
{
"module": {
"name": "clockcomponent",
"type": "har",
"deviceTypes": [
"phone",
],
"uiSyntax": "ets"
}
}

View File

@ -1 +0,0 @@
build

View File

@ -0,0 +1,11 @@
{
"apiType": 'stageMode',
"buildOption": {
"arkEnable": true
},
"targets": [
{
"name": "default",
}
]
}

View File

@ -1,26 +0,0 @@
apply plugin: 'com.huawei.ohos.library'
ohos {
compileSdkVersion rootProject.ext.version.compileSdk
defaultConfig {
compatibleSdkVersion rootProject.ext.version.compatibleSdk
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
implementation project(':features:airplanecomponent')
implementation project(':features:autorotatecomponent')
implementation project(':features:bluetoothcomponent')
implementation project(':features:brightnesscomponent')
implementation project(':features:locationcomponent')
implementation project(':features:ringmodecomponent')
implementation project(':features:wificomponent')
}

View File

@ -0,0 +1,17 @@
/**
* Copyright (c) 2022 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.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks

View File

@ -0,0 +1,12 @@
{
"name": "@ohos/controlcentercomponent",
"version": "1.0.0",
"description": "a npm package which contains controlcentercomponent function",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"dependencies": {
}
}

View File

@ -1,24 +0,0 @@
{
"app": {
"bundleName": "com.ohos.systemui",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
},
"module": {
"package": "com.ohos.systemui.controlcentercomponent",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "controlcentercomponent",
"moduleType": "har"
},
"srcPath": "default"
}
}

View File

@ -54,7 +54,8 @@ function parseData(itemData: ItemComponentData): ControlComponentData {
export class ControlCenterService {
mIsStart: boolean = false;
mAdapter: PluginDataSourceAdapter = new PluginDataSourceAdapter(TAG, AbilityManager.getContext(), this);
// mAdapter: PluginDataSourceAdapter = new PluginDataSourceAdapter(TAG, AbilityManager.getContext(), this);
mAdapter: PluginDataSourceAdapter;
mListener: ControlCenterListener | undefined;
mConfig: any;
mComplexToggleLayoutTemplate: string[];
@ -68,7 +69,7 @@ export class ControlCenterService {
Log.showInfo(TAG, `constructor`)
}
startService(config): void {
startService(config, moduleName): void {
if (this.mIsStart) {
return;
}
@ -79,6 +80,7 @@ export class ControlCenterService {
SwitchUserManager.getInstance().registerListener(this);
CONTROLCENTER_SOURCE_CONFIG.filterDatas = config.MetaToggles;
this.mAdapter = new PluginDataSourceAdapter(TAG, AbilityManager.getContext(), this, moduleName);
this.mAdapter.initDataSource(CONTROLCENTER_SOURCE_CONFIG);
}

View File

@ -42,11 +42,12 @@ export default struct ControlCenterComponent {
private mHidingSimpleToggles: string[] = []
private mDefaultDisplaySimpleToggles: string[] = []
private titleDisplayInside: boolean = false
private moduleName: string = ''
aboutToAppear() {
Log.showInfo(TAG, 'aboutToAppear')
Log.showInfo(TAG, `aboutToAppear, mControlCenterComponentConfig: ${JSON.stringify(this.mControlCenterComponentConfig)}`)
ViewModel.initViewModel(this.mControlCenterComponentConfig)
ViewModel.initViewModel(this.mControlCenterComponentConfig, this.moduleName)
}
aboutToDisappear() {
@ -163,7 +164,7 @@ export default struct ControlCenterComponent {
.width('100%')
.onAreaChange((e, e2) => {
Log.showInfo(TAG, `onAreaChange, e: ${JSON.stringify(e)} e2: ${JSON.stringify(e2)}`);
this.mWidthPx = vp2px(e2.width)
this.mWidthPx = vp2px(Number(e2.width))
})
}
}

View File

@ -36,14 +36,14 @@ export class ControlCenterVM {
ControlCenterService.registerListener(this);
}
initViewModel(config) {
initViewModel(config, moduleName) {
if (this.mIsStart) {
return;
}
Log.showInfo(TAG, `initViewModel, config: ${JSON.stringify(config)} `)
this.mIsStart = true;
ControlCenterService.startService(config);
ControlCenterService.startService(config, moduleName);
}
setComplexToggleLayout(layout: string[]): void{

Some files were not shown because too many files have changed in this diff Show More