diff --git a/UI/Badge/build.gradle b/UI/Badge/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..ad33f7c014a76f9b635c1e497c19e278f2aef9da --- /dev/null +++ b/UI/Badge/build.gradle @@ -0,0 +1,36 @@ +// 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 'https://repo.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 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} \ No newline at end of file diff --git a/UI/Badge/entry/build.gradle b/UI/Badge/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..88e1fd7d4aad2df8c0b60bc3fd818690ace968bf --- /dev/null +++ b/UI/Badge/entry/build.gradle @@ -0,0 +1,16 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 6 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } + supportSystem "standard" +} \ No newline at end of file diff --git a/UI/Badge/entry/screenshots/badge.jpg b/UI/Badge/entry/screenshots/badge.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2a5beea6178e960447c7ef3f9fce82462bda215f Binary files /dev/null and b/UI/Badge/entry/screenshots/badge.jpg differ diff --git a/UI/Badge/entry/src/main/config.json b/UI/Badge/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..483c4f758a8f60afe1dc6866f74d86277a00b181 --- /dev/null +++ b/UI/Badge/entry/src/main/config.json @@ -0,0 +1,56 @@ +{ + "app": { + "bundleName": "ohos.samples.badge", + "version": { + "code": 1000000, + "name": "1.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.badge", + "name": ".MyApplication", + "mainAbility": "ohos.samples.badge.MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "ohos.samples.badge.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/UI/Badge/entry/src/main/js/default/app.js b/UI/Badge/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..8e47afff13e928a74fdcc01a108e4422404b9ac9 --- /dev/null +++ b/UI/Badge/entry/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/UI/Badge/entry/src/main/js/default/common/images/Image1.jpg b/UI/Badge/entry/src/main/js/default/common/images/Image1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3af559f74358e9f54aebbb6f765bf9f5f493760e Binary files /dev/null and b/UI/Badge/entry/src/main/js/default/common/images/Image1.jpg differ diff --git a/UI/Badge/entry/src/main/js/default/common/images/Image2.jpg b/UI/Badge/entry/src/main/js/default/common/images/Image2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d26a30caccb7c77a7b37f21b0d819cf7b969bf9c Binary files /dev/null and b/UI/Badge/entry/src/main/js/default/common/images/Image2.jpg differ diff --git a/UI/Badge/entry/src/main/js/default/common/images/Image3.jpg b/UI/Badge/entry/src/main/js/default/common/images/Image3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d13ed7e5c8391eef6dd9614743e0eee1b0463986 Binary files /dev/null and b/UI/Badge/entry/src/main/js/default/common/images/Image3.jpg differ diff --git a/UI/Badge/entry/src/main/js/default/i18n/en-US.json b/UI/Badge/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..ef3c9099e069efd52cec9d3458250f432b333606 --- /dev/null +++ b/UI/Badge/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "contacts": "Contacts", + "message": "Message content" + } +} \ No newline at end of file diff --git a/UI/Badge/entry/src/main/js/default/i18n/zh-CN.json b/UI/Badge/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..8a3c229eed905cc1db191c5172c5830269cd3ab3 --- /dev/null +++ b/UI/Badge/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "contacts": "联系人", + "message": "消息内容" + } +} \ No newline at end of file diff --git a/UI/Badge/entry/src/main/js/default/pages/index/index.css b/UI/Badge/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..4a6f83740c507cdd98742e52fe160dc34081c18f --- /dev/null +++ b/UI/Badge/entry/src/main/js/default/pages/index/index.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. + */ + + +.container { + flex-direction: column; + align-items: center; + background-color: #F2F3F5; +} +.item { + height: 72px; + width: 100%; + display: flex; + align-items:center; + margin-right: 12px; + margin-left: 12px; + margin-bottom: 2px; + background-color: white; +} +.img { + height: 40px; + width: 40px; + margin-left: 12px; + margin-right: 12px; + border-radius: 20px; +} +.content { + display: flex; + flex-direction: column; + flex-shrink: 3; + display: flex; + justify-content: space-between; + align-content: flex-start; +} +.badge { + position: absolute; + height: 100%; + width: 10%; + left: 70%; + margin-right: 10px; +} +.title { + font-size: 16px; + color: #e6000000; + opacity: 0.9; + margin-top: 8px; + margin-bottom: 1px; +} +.text { + font-size: 14px; + color: #99000000; + opacity: 0.6; + margin-top: 1px; + margin-bottom: 8px; +} diff --git a/UI/Badge/entry/src/main/js/default/pages/index/index.hml b/UI/Badge/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..868b98e36bd03af9b7ce62ed4b2625de28e96827 --- /dev/null +++ b/UI/Badge/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,47 @@ + + +