diff --git a/UI/Grid/build.gradle b/UI/Grid/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..ad33f7c014a76f9b635c1e497c19e278f2aef9da --- /dev/null +++ b/UI/Grid/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/Grid/entry/build.gradle b/UI/Grid/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..88e1fd7d4aad2df8c0b60bc3fd818690ace968bf --- /dev/null +++ b/UI/Grid/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/Grid/entry/src/main/config.json b/UI/Grid/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..4d7b7c2e8a6f4557feffa0a9b0eac94cbcd0bdb4 --- /dev/null +++ b/UI/Grid/entry/src/main/config.json @@ -0,0 +1,56 @@ +{ + "app": { + "bundleName": "ohos.samples.grid", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.grid", + "name": ".MainAbility", + "mainAbility": "ohos.samples.grid.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.grid.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "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/Grid/entry/src/main/js/default/app.js b/UI/Grid/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..8e47afff13e928a74fdcc01a108e4422404b9ac9 --- /dev/null +++ b/UI/Grid/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/Grid/entry/src/main/js/default/common/images/ic_discover_10.png b/UI/Grid/entry/src/main/js/default/common/images/ic_discover_10.png new file mode 100644 index 0000000000000000000000000000000000000000..be82243e941264bcc0763f9381644b5a4fdbd767 Binary files /dev/null and b/UI/Grid/entry/src/main/js/default/common/images/ic_discover_10.png differ diff --git a/UI/Grid/entry/src/main/js/default/common/images/ic_game.png b/UI/Grid/entry/src/main/js/default/common/images/ic_game.png new file mode 100644 index 0000000000000000000000000000000000000000..0b6966a63c2d1aeaa839de82377f9a3822f48670 Binary files /dev/null and b/UI/Grid/entry/src/main/js/default/common/images/ic_game.png differ diff --git a/UI/Grid/entry/src/main/js/default/common/images/ic_hot.png b/UI/Grid/entry/src/main/js/default/common/images/ic_hot.png new file mode 100644 index 0000000000000000000000000000000000000000..30378aa5d1dfa729e417319d4b601edff890aa22 Binary files /dev/null and b/UI/Grid/entry/src/main/js/default/common/images/ic_hot.png differ diff --git a/UI/Grid/entry/src/main/js/default/common/images/ic_me_purchased_items.png b/UI/Grid/entry/src/main/js/default/common/images/ic_me_purchased_items.png new file mode 100644 index 0000000000000000000000000000000000000000..73d460f3f0d9f3a33ce6bdf153986b78ec604ed3 Binary files /dev/null and b/UI/Grid/entry/src/main/js/default/common/images/ic_me_purchased_items.png differ diff --git a/UI/Grid/entry/src/main/js/default/common/images/ic_public_community_messages_filled.png b/UI/Grid/entry/src/main/js/default/common/images/ic_public_community_messages_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..fc2b28030b7206e966ade496b94b04f6f71457b4 Binary files /dev/null and b/UI/Grid/entry/src/main/js/default/common/images/ic_public_community_messages_filled.png differ diff --git a/UI/Grid/entry/src/main/js/default/common/images/ic_public_contacts_filled.png b/UI/Grid/entry/src/main/js/default/common/images/ic_public_contacts_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..5908b247785bb4841b21452a11d2dab2f1137c37 Binary files /dev/null and b/UI/Grid/entry/src/main/js/default/common/images/ic_public_contacts_filled.png differ diff --git a/UI/Grid/entry/src/main/js/default/common/images/ic_scan.png b/UI/Grid/entry/src/main/js/default/common/images/ic_scan.png new file mode 100644 index 0000000000000000000000000000000000000000..946b57fa40af5978da1e1203f2ebfb16637329c3 Binary files /dev/null and b/UI/Grid/entry/src/main/js/default/common/images/ic_scan.png differ diff --git a/UI/Grid/entry/src/main/js/default/common/images/ic_shortcut_discover.png b/UI/Grid/entry/src/main/js/default/common/images/ic_shortcut_discover.png new file mode 100644 index 0000000000000000000000000000000000000000..a30c880eed0c234c2edef846bc342a8eb6a8bbf7 Binary files /dev/null and b/UI/Grid/entry/src/main/js/default/common/images/ic_shortcut_discover.png differ diff --git a/UI/Grid/entry/src/main/js/default/i18n/en-US.json b/UI/Grid/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..6d1f587e3c5658578fccb7dc07500ab3c98aec75 --- /dev/null +++ b/UI/Grid/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,12 @@ +{ + "strings": { + "game" : "Game", + "hot_search": "Hot Search", + "discover": "Discover", + "wallet": "Wallet", + "scan": "Scan", + "browser": "Browser", + "contact": "Contact", + "message": "Message" + } +} \ No newline at end of file diff --git a/UI/Grid/entry/src/main/js/default/i18n/zh-CN.json b/UI/Grid/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..ea630d7c1803aba78507990c09b52347fc1cd6b3 --- /dev/null +++ b/UI/Grid/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,12 @@ +{ + "strings": { + "game" : "游戏中心", + "hot_search": "热搜", + "discover": "发现", + "wallet": "钱包", + "scan": "扫一扫", + "browser": "浏览器", + "contact": "联系人", + "message": "信息" + } +} \ No newline at end of file diff --git a/UI/Grid/entry/src/main/js/default/pages/index/index.css b/UI/Grid/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..303e927309720acd1e1fe418330103272b1d1056 --- /dev/null +++ b/UI/Grid/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,65 @@ +/* + * 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; + padding-top: 80px; + background-color: #fff; +} + +.grid-col { + margin-left: 12px; +} + +.grid-row { + height: 96px; + justify-content: space-between; +} + +.grid-container { + border-width: 1px; + margin-bottom: 24px; +} + +.div { + height: 72px; + width: 100%; + margin-top: 12px; + margin-bottom: 12px; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.box { + height: 72px; + width: 100%; + margin-top: 12px; + margin-bottom: 12px; + flex-direction: column; + border-width: 1px; + justify-content: center; + align-items: center; +} + +.img { + width: 24px; + height: 24px; +} + +.text { + font-size: 14px; + margin-top: 5px; +} \ No newline at end of file diff --git a/UI/Grid/entry/src/main/js/default/pages/index/index.hml b/UI/Grid/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..c9a0910e90e7421e670492b2b82d89e20fa59e01 --- /dev/null +++ b/UI/Grid/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,135 @@ + + +
+ + + +
+ + {{ $t('strings.game') }} +
+
+ +
+ + {{ $t('strings.hot_search') }} +
+
+ +
+ + {{ $t('strings.discover') }} +
+
+
+ + +
+ + + {{ $t('strings.wallet') }} +
+
+ +
+ + {{ $t('strings.scan') }} +
+
+ +
+ + {{ $t('strings.browser') }} +
+
+
+ + +
+ + + {{ $t('strings.contact') }} +
+
+ +
+ + {{ $t('strings.message') }} +
+
+
+
+ + + +
+ + {{ $t('strings.game') }} +
+
+ +
+ + {{ $t('strings.hot_search') }} +
+
+
+ + +
+ + {{ $t('strings.discover') }} +
+
+ +
+ + + {{ $t('strings.wallet') }} +
+
+ +
+ + {{ $t('strings.scan') }} +
+
+
+ + +
+ + {{ $t('strings.browser') }} +
+
+ +
+ + + {{ $t('strings.contact') }} +
+
+ +
+ + {{ $t('strings.message') }} +
+
+
+
+
\ No newline at end of file diff --git a/UI/Grid/entry/src/main/js/default/pages/index/index.js b/UI/Grid/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..08df7006d0fbf89b2e061036fd08e0bc2b6869d8 --- /dev/null +++ b/UI/Grid/entry/src/main/js/default/pages/index/index.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 prompt from '@system.prompt'; + +export default { + getCol(e) { + this.$element('myGrid').getColumns(function (result) { + prompt.showToast({ + message: e.target.id + ' result = ' + result, + duration: 3000, + }); + }) + }, + getColWidth(e) { + this.$element('myGrid').getColumnWidth(function (result) { + prompt.showToast({ + message: e.target.id + ' result = ' + result, + duration: 3000, + }); + }) + }, + getGutWidth(e) { + this.$element('myGrid').getGutterWidth(function (result) { + prompt.showToast({ + message: e.target.id + ' result = ' + result, + duration: 3000, + }); + }) + } +} \ No newline at end of file diff --git a/UI/Grid/entry/src/main/resources/base/element/string.json b/UI/Grid/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..6576229ac85f1d7fff63d685d50ad351924ceada --- /dev/null +++ b/UI/Grid/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "Grid" + }, + { + "name": "mainability_description", + "value": "JS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/UI/Grid/entry/src/main/resources/base/media/icon.png b/UI/Grid/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/UI/Grid/entry/src/main/resources/base/media/icon.png differ diff --git a/UI/Grid/screenshots/device/mian.png b/UI/Grid/screenshots/device/mian.png new file mode 100644 index 0000000000000000000000000000000000000000..a2001d734a9841251dd257e4080e464c2e1e0a20 Binary files /dev/null and b/UI/Grid/screenshots/device/mian.png differ diff --git a/UI/JsGrid/README_zh.md b/UI/JsGrid/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..90034c2755447f03b0a9e5d7a6191e41353067a4 --- /dev/null +++ b/UI/JsGrid/README_zh.md @@ -0,0 +1,14 @@ +# 栅格布局 + +### 简介 + +本示例通过栅格系统进行元素布局,主要由标签来实现。 + +### 使用说明 + +示例显示了2组应用,上下两组应用均采用栅格布局,来展示不同的效果,点击应用图标、文字分别弹出对应的通知。 + +### 约束与限制 + +本示例仅支持在标准系统上运行。 + diff --git a/UI/JsGrid/build.gradle b/UI/JsGrid/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..ad33f7c014a76f9b635c1e497c19e278f2aef9da --- /dev/null +++ b/UI/JsGrid/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/JsGrid/entry/build.gradle b/UI/JsGrid/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..88e1fd7d4aad2df8c0b60bc3fd818690ace968bf --- /dev/null +++ b/UI/JsGrid/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/JsGrid/entry/src/main/config.json b/UI/JsGrid/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..4d7b7c2e8a6f4557feffa0a9b0eac94cbcd0bdb4 --- /dev/null +++ b/UI/JsGrid/entry/src/main/config.json @@ -0,0 +1,56 @@ +{ + "app": { + "bundleName": "ohos.samples.grid", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.grid", + "name": ".MainAbility", + "mainAbility": "ohos.samples.grid.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.grid.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "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/JsGrid/entry/src/main/js/default/app.js b/UI/JsGrid/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..8e47afff13e928a74fdcc01a108e4422404b9ac9 --- /dev/null +++ b/UI/JsGrid/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/JsGrid/entry/src/main/js/default/common/images/ic_discover_10.png b/UI/JsGrid/entry/src/main/js/default/common/images/ic_discover_10.png new file mode 100644 index 0000000000000000000000000000000000000000..be82243e941264bcc0763f9381644b5a4fdbd767 Binary files /dev/null and b/UI/JsGrid/entry/src/main/js/default/common/images/ic_discover_10.png differ diff --git a/UI/JsGrid/entry/src/main/js/default/common/images/ic_game.png b/UI/JsGrid/entry/src/main/js/default/common/images/ic_game.png new file mode 100644 index 0000000000000000000000000000000000000000..0b6966a63c2d1aeaa839de82377f9a3822f48670 Binary files /dev/null and b/UI/JsGrid/entry/src/main/js/default/common/images/ic_game.png differ diff --git a/UI/JsGrid/entry/src/main/js/default/common/images/ic_hot.png b/UI/JsGrid/entry/src/main/js/default/common/images/ic_hot.png new file mode 100644 index 0000000000000000000000000000000000000000..30378aa5d1dfa729e417319d4b601edff890aa22 Binary files /dev/null and b/UI/JsGrid/entry/src/main/js/default/common/images/ic_hot.png differ diff --git a/UI/JsGrid/entry/src/main/js/default/common/images/ic_me_purchased_items.png b/UI/JsGrid/entry/src/main/js/default/common/images/ic_me_purchased_items.png new file mode 100644 index 0000000000000000000000000000000000000000..73d460f3f0d9f3a33ce6bdf153986b78ec604ed3 Binary files /dev/null and b/UI/JsGrid/entry/src/main/js/default/common/images/ic_me_purchased_items.png differ diff --git a/UI/JsGrid/entry/src/main/js/default/common/images/ic_public_community_messages_filled.png b/UI/JsGrid/entry/src/main/js/default/common/images/ic_public_community_messages_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..fc2b28030b7206e966ade496b94b04f6f71457b4 Binary files /dev/null and b/UI/JsGrid/entry/src/main/js/default/common/images/ic_public_community_messages_filled.png differ diff --git a/UI/JsGrid/entry/src/main/js/default/common/images/ic_public_contacts_filled.png b/UI/JsGrid/entry/src/main/js/default/common/images/ic_public_contacts_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..5908b247785bb4841b21452a11d2dab2f1137c37 Binary files /dev/null and b/UI/JsGrid/entry/src/main/js/default/common/images/ic_public_contacts_filled.png differ diff --git a/UI/JsGrid/entry/src/main/js/default/common/images/ic_scan.png b/UI/JsGrid/entry/src/main/js/default/common/images/ic_scan.png new file mode 100644 index 0000000000000000000000000000000000000000..946b57fa40af5978da1e1203f2ebfb16637329c3 Binary files /dev/null and b/UI/JsGrid/entry/src/main/js/default/common/images/ic_scan.png differ diff --git a/UI/JsGrid/entry/src/main/js/default/common/images/ic_shortcut_discover.png b/UI/JsGrid/entry/src/main/js/default/common/images/ic_shortcut_discover.png new file mode 100644 index 0000000000000000000000000000000000000000..a30c880eed0c234c2edef846bc342a8eb6a8bbf7 Binary files /dev/null and b/UI/JsGrid/entry/src/main/js/default/common/images/ic_shortcut_discover.png differ diff --git a/UI/JsGrid/entry/src/main/js/default/i18n/en-US.json b/UI/JsGrid/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..6d1f587e3c5658578fccb7dc07500ab3c98aec75 --- /dev/null +++ b/UI/JsGrid/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,12 @@ +{ + "strings": { + "game" : "Game", + "hot_search": "Hot Search", + "discover": "Discover", + "wallet": "Wallet", + "scan": "Scan", + "browser": "Browser", + "contact": "Contact", + "message": "Message" + } +} \ No newline at end of file diff --git a/UI/JsGrid/entry/src/main/js/default/i18n/zh-CN.json b/UI/JsGrid/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..ea630d7c1803aba78507990c09b52347fc1cd6b3 --- /dev/null +++ b/UI/JsGrid/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,12 @@ +{ + "strings": { + "game" : "游戏中心", + "hot_search": "热搜", + "discover": "发现", + "wallet": "钱包", + "scan": "扫一扫", + "browser": "浏览器", + "contact": "联系人", + "message": "信息" + } +} \ No newline at end of file diff --git a/UI/JsGrid/entry/src/main/js/default/pages/index/index.css b/UI/JsGrid/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..303e927309720acd1e1fe418330103272b1d1056 --- /dev/null +++ b/UI/JsGrid/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,65 @@ +/* + * 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; + padding-top: 80px; + background-color: #fff; +} + +.grid-col { + margin-left: 12px; +} + +.grid-row { + height: 96px; + justify-content: space-between; +} + +.grid-container { + border-width: 1px; + margin-bottom: 24px; +} + +.div { + height: 72px; + width: 100%; + margin-top: 12px; + margin-bottom: 12px; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.box { + height: 72px; + width: 100%; + margin-top: 12px; + margin-bottom: 12px; + flex-direction: column; + border-width: 1px; + justify-content: center; + align-items: center; +} + +.img { + width: 24px; + height: 24px; +} + +.text { + font-size: 14px; + margin-top: 5px; +} \ No newline at end of file diff --git a/UI/JsGrid/entry/src/main/js/default/pages/index/index.hml b/UI/JsGrid/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..c9a0910e90e7421e670492b2b82d89e20fa59e01 --- /dev/null +++ b/UI/JsGrid/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,135 @@ + + +
+ + + +
+ + {{ $t('strings.game') }} +
+
+ +
+ + {{ $t('strings.hot_search') }} +
+
+ +
+ + {{ $t('strings.discover') }} +
+
+
+ + +
+ + + {{ $t('strings.wallet') }} +
+
+ +
+ + {{ $t('strings.scan') }} +
+
+ +
+ + {{ $t('strings.browser') }} +
+
+
+ + +
+ + + {{ $t('strings.contact') }} +
+
+ +
+ + {{ $t('strings.message') }} +
+
+
+
+ + + +
+ + {{ $t('strings.game') }} +
+
+ +
+ + {{ $t('strings.hot_search') }} +
+
+
+ + +
+ + {{ $t('strings.discover') }} +
+
+ +
+ + + {{ $t('strings.wallet') }} +
+
+ +
+ + {{ $t('strings.scan') }} +
+
+
+ + +
+ + {{ $t('strings.browser') }} +
+
+ +
+ + + {{ $t('strings.contact') }} +
+
+ +
+ + {{ $t('strings.message') }} +
+
+
+
+
\ No newline at end of file diff --git a/UI/JsGrid/entry/src/main/js/default/pages/index/index.js b/UI/JsGrid/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..08df7006d0fbf89b2e061036fd08e0bc2b6869d8 --- /dev/null +++ b/UI/JsGrid/entry/src/main/js/default/pages/index/index.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 prompt from '@system.prompt'; + +export default { + getCol(e) { + this.$element('myGrid').getColumns(function (result) { + prompt.showToast({ + message: e.target.id + ' result = ' + result, + duration: 3000, + }); + }) + }, + getColWidth(e) { + this.$element('myGrid').getColumnWidth(function (result) { + prompt.showToast({ + message: e.target.id + ' result = ' + result, + duration: 3000, + }); + }) + }, + getGutWidth(e) { + this.$element('myGrid').getGutterWidth(function (result) { + prompt.showToast({ + message: e.target.id + ' result = ' + result, + duration: 3000, + }); + }) + } +} \ No newline at end of file diff --git a/UI/JsGrid/entry/src/main/resources/base/element/string.json b/UI/JsGrid/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..6576229ac85f1d7fff63d685d50ad351924ceada --- /dev/null +++ b/UI/JsGrid/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "Grid" + }, + { + "name": "mainability_description", + "value": "JS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/UI/JsGrid/entry/src/main/resources/base/media/icon.png b/UI/JsGrid/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/UI/JsGrid/entry/src/main/resources/base/media/icon.png differ diff --git a/UI/JsGrid/screenshots/device/mian.png b/UI/JsGrid/screenshots/device/mian.png new file mode 100644 index 0000000000000000000000000000000000000000..a2001d734a9841251dd257e4080e464c2e1e0a20 Binary files /dev/null and b/UI/JsGrid/screenshots/device/mian.png differ diff --git a/UI/JsGrid/settings.gradle b/UI/JsGrid/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4773db73233a570c2d0c01a22e75321acfbf7a07 --- /dev/null +++ b/UI/JsGrid/settings.gradle @@ -0,0 +1 @@ +include ':entry'