diff --git a/UI/Stack/README.md b/UI/Stack/README.md new file mode 100644 index 0000000000000000000000000000000000000000..064cfeb0cb7ae260a713c1d3a27e407bffced2e2 --- /dev/null +++ b/UI/Stack/README.md @@ -0,0 +1,14 @@ +# Stack + +### Introduction + +The **** component provides a stack container where child components are successively stacked and the latter one overwrites the previous one. + +### Usage + +This sample app shows stacked color blocks, which are red, orange, yellow, and green from bottom to top. + +### Constraints + +This sample can only be run on standard-system devices. + diff --git a/UI/Stack/README_zh.md b/UI/Stack/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..c4a2d379d1d79f4bcfc50a5effcb2d4ba8a95e96 --- /dev/null +++ b/UI/Stack/README_zh.md @@ -0,0 +1,14 @@ +# Stack容器 + +### 简介 + +堆叠容器stack,子组件按照顺序依次入栈,后一个子组件覆盖前一个子组件。 + +### 使用说明 + +本示例页面显示色块堆叠,从下往上颜色依次为红色,橙色,黄色、绿色。 + +### 约束与限制 + +本示例仅支持在标准系统上运行。 + diff --git a/UI/Stack/build.gradle b/UI/Stack/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..d45348af3401adb65bea584cb8e04da996b29edd --- /dev/null +++ b/UI/Stack/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() + } +} diff --git a/UI/Stack/entry/build.gradle b/UI/Stack/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..41fab7380560292547ee899fd231951bb37fad92 --- /dev/null +++ b/UI/Stack/entry/build.gradle @@ -0,0 +1,18 @@ +apply plugin: 'com.huawei.ohos.hap' + +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 6 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } + supportSystem "standard" +} + diff --git a/UI/Stack/entry/src/main/config.json b/UI/Stack/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..c8605e69fc7291963791f602d9b25c69cb0be9c0 --- /dev/null +++ b/UI/Stack/entry/src/main/config.json @@ -0,0 +1,54 @@ +{ + "app": { + "bundleName": "ohos.samples.stack", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.stack", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "ohos.samples.stack.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": true + } + } + ] + } +} \ No newline at end of file diff --git a/UI/Stack/entry/src/main/js/default/app.js b/UI/Stack/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..8e47afff13e928a74fdcc01a108e4422404b9ac9 --- /dev/null +++ b/UI/Stack/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/Stack/entry/src/main/js/default/pages/index/index.css b/UI/Stack/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..48629a8b0f75a4bb182e2234ea3b3a4b96eb33f8 --- /dev/null +++ b/UI/Stack/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,55 @@ +/* + * 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; + justify-content: center; + align-items: center; +} + +.stack { + width: 100%; + height: 60%; + display: flex; + align-content: center; + justify-content: center; +} + +.box-green { + width: 55%; + height: 300px; + margin-top: 75px; + background-color: #DAF7A6; +} + +.box-yellow { + width: 70%; + height: 350px; + margin-top: 50px; + background-color: #FFC300; +} + +.box-origin { + width: 85%; + height: 400px; + margin-top: 25px; + background-color: #FF5733; +} + +.box-red { + width: 100%; + height: 450px; + background-color: #C70039; +} diff --git a/UI/Stack/entry/src/main/js/default/pages/index/index.hml b/UI/Stack/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..9350de12211af57123bf6c07bdf648e9201b2f31 --- /dev/null +++ b/UI/Stack/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,23 @@ + + +
+ +
+
+
+
+
+
diff --git a/UI/Stack/entry/src/main/resources/base/element/string.json b/UI/Stack/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..0bae6bd40f7360d5d818998221b199d3ec0f69c0 --- /dev/null +++ b/UI/Stack/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "mainability_description", + "value": "JS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/UI/Stack/entry/src/main/resources/base/media/icon.png b/UI/Stack/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/UI/Stack/entry/src/main/resources/base/media/icon.png differ diff --git a/UI/Stack/entry/src/main/resources/en/element/string.json b/UI/Stack/entry/src/main/resources/en/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e1780282cb9b095ed393358fcb56c054c74dbd0e --- /dev/null +++ b/UI/Stack/entry/src/main/resources/en/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "Stack Container" + }, + { + "name": "mainability_description", + "value": "Java_Empty Ability" + } + ] +} diff --git a/UI/Stack/entry/src/main/resources/zh/element/string.json b/UI/Stack/entry/src/main/resources/zh/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..d3032f939a95c8d9745cf58d4393375334010971 --- /dev/null +++ b/UI/Stack/entry/src/main/resources/zh/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "堆叠容器" + }, + { + "name": "mainability_description", + "value": "Java_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/UI/Stack/screenshot/devices/stack.png b/UI/Stack/screenshot/devices/stack.png new file mode 100644 index 0000000000000000000000000000000000000000..569d38488a4ecb2f649f280095c5c283f7eeb74b Binary files /dev/null and b/UI/Stack/screenshot/devices/stack.png differ diff --git a/UI/Stack/settings.gradle b/UI/Stack/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4773db73233a570c2d0c01a22e75321acfbf7a07 --- /dev/null +++ b/UI/Stack/settings.gradle @@ -0,0 +1 @@ +include ':entry'