From baf80b0791f01537d5d9244c0b9670fa345583d6 Mon Sep 17 00:00:00 2001 From: gaohui Date: Mon, 14 Feb 2022 14:53:57 +0800 Subject: [PATCH 1/3] update sample JsBasicComponents Signed-off-by: gaohui --- UI/JsBasicComponents/build.gradle | 9 +- UI/JsBasicComponents/entry/build.gradle | 9 +- .../entry/src/main/config.json | 21 +- .../entry/src/main/js/MainAbility/app.js | 8 + .../common/images/Wallpaper.png | Bin .../common/images/bg-tv.jpg | Bin .../common/images/like_space.png | Bin .../common/images/like_yellow.png | Bin .../{default => MainAbility}/i18n/en-US.json | 6 +- .../{default => MainAbility}/i18n/zh-CN.json | 6 +- .../pages/index/index.css | 6 +- .../main/js/MainAbility/pages/index/index.hml | 314 ++++++++++++++++++ .../pages/index/index.js | 0 .../entry/src/main/js/default/app.js | 22 -- .../src/main/js/default/pages/index/index.hml | 274 --------------- .../main/resources/base/element/string.json | 2 +- 16 files changed, 356 insertions(+), 321 deletions(-) create mode 100644 UI/JsBasicComponents/entry/src/main/js/MainAbility/app.js rename UI/JsBasicComponents/entry/src/main/js/{default => MainAbility}/common/images/Wallpaper.png (100%) rename UI/JsBasicComponents/entry/src/main/js/{default => MainAbility}/common/images/bg-tv.jpg (100%) rename UI/JsBasicComponents/entry/src/main/js/{default => MainAbility}/common/images/like_space.png (100%) rename UI/JsBasicComponents/entry/src/main/js/{default => MainAbility}/common/images/like_yellow.png (100%) rename UI/JsBasicComponents/entry/src/main/js/{default => MainAbility}/i18n/en-US.json (93%) rename UI/JsBasicComponents/entry/src/main/js/{default => MainAbility}/i18n/zh-CN.json (93%) rename UI/JsBasicComponents/entry/src/main/js/{default => MainAbility}/pages/index/index.css (99%) create mode 100644 UI/JsBasicComponents/entry/src/main/js/MainAbility/pages/index/index.hml rename UI/JsBasicComponents/entry/src/main/js/{default => MainAbility}/pages/index/index.js (100%) delete mode 100644 UI/JsBasicComponents/entry/src/main/js/default/app.js delete mode 100644 UI/JsBasicComponents/entry/src/main/js/default/pages/index/index.hml diff --git a/UI/JsBasicComponents/build.gradle b/UI/JsBasicComponents/build.gradle index b2d91b2309..f350f30a90 100644 --- a/UI/JsBasicComponents/build.gradle +++ b/UI/JsBasicComponents/build.gradle @@ -1,11 +1,12 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. apply plugin: 'com.huawei.ohos.app' + //For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 ohos { - compileSdkVersion 7 + compileSdkVersion 8 supportSystem "standard" } - + buildscript { repositories { maven { @@ -16,7 +17,8 @@ buildscript { } } dependencies { - classpath 'com.huawei.ohos:hap:3.0.3.2' + classpath 'com.huawei.ohos:hap:3.0.5.2' + classpath 'com.huawei.ohos:decctest:1.2.7.2' } } @@ -28,6 +30,5 @@ allprojects { maven { url 'https://developer.huawei.com/repo/' } - jcenter() } } diff --git a/UI/JsBasicComponents/entry/build.gradle b/UI/JsBasicComponents/entry/build.gradle index cb1b043b0a..cef7b37de8 100644 --- a/UI/JsBasicComponents/entry/build.gradle +++ b/UI/JsBasicComponents/entry/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.huawei.ohos.hap' //For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 ohos { - compileSdkVersion 7 + compileSdkVersion 8 defaultConfig { compatibleSdkVersion 7 } @@ -13,4 +13,9 @@ ohos { } } } -} \ No newline at end of file +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) + testImplementation 'junit:junit:4.13.1' +} diff --git a/UI/JsBasicComponents/entry/src/main/config.json b/UI/JsBasicComponents/entry/src/main/config.json index 9d4eb918d1..819890c13a 100644 --- a/UI/JsBasicComponents/entry/src/main/config.json +++ b/UI/JsBasicComponents/entry/src/main/config.json @@ -1,16 +1,17 @@ { "app": { - "bundleName": "ohos.samples.jsbasiccomponent", + "bundleName": "ohos.samples.jsbasiccomponents", + "vendor": "samples", "version": { "code": 1000000, - "name": "1.0" + "name": "1.0.0" } }, "deviceConfig": {}, "module": { - "package": "ohos.samples.jsbasiccomponent", + "package": "ohos.samples.jsbasiccomponents", "name": ".MyApplication", - "mainAbility": ".default", + "mainAbility": ".MainAbility", "deviceType": [ "phone" ], @@ -32,12 +33,14 @@ ] } ], + "orientation": "unspecified", "visible": true, - "name": ".default", - "icon": "$media:icon", - "srcPath": "default", + "srcPath": "MainAbility", + "name": ".MainAbility", "srcLanguage": "js", - "description": "$string:mainability_description", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, "label": "$string:app_name", "type": "page", "launchType": "standard" @@ -48,7 +51,7 @@ "pages": [ "pages/index/index" ], - "name": ".default" + "name": ".MainAbility" } ] } diff --git a/UI/JsBasicComponents/entry/src/main/js/MainAbility/app.js b/UI/JsBasicComponents/entry/src/main/js/MainAbility/app.js new file mode 100644 index 0000000000..6d060ffe56 --- /dev/null +++ b/UI/JsBasicComponents/entry/src/main/js/MainAbility/app.js @@ -0,0 +1,8 @@ +export default { + onCreate() { + console.info("Application onCreate"); + }, + onDestroy() { + console.info("Application onDestroy"); + } +}; diff --git a/UI/JsBasicComponents/entry/src/main/js/default/common/images/Wallpaper.png b/UI/JsBasicComponents/entry/src/main/js/MainAbility/common/images/Wallpaper.png similarity index 100% rename from UI/JsBasicComponents/entry/src/main/js/default/common/images/Wallpaper.png rename to UI/JsBasicComponents/entry/src/main/js/MainAbility/common/images/Wallpaper.png diff --git a/UI/JsBasicComponents/entry/src/main/js/default/common/images/bg-tv.jpg b/UI/JsBasicComponents/entry/src/main/js/MainAbility/common/images/bg-tv.jpg similarity index 100% rename from UI/JsBasicComponents/entry/src/main/js/default/common/images/bg-tv.jpg rename to UI/JsBasicComponents/entry/src/main/js/MainAbility/common/images/bg-tv.jpg diff --git a/UI/JsBasicComponents/entry/src/main/js/default/common/images/like_space.png b/UI/JsBasicComponents/entry/src/main/js/MainAbility/common/images/like_space.png similarity index 100% rename from UI/JsBasicComponents/entry/src/main/js/default/common/images/like_space.png rename to UI/JsBasicComponents/entry/src/main/js/MainAbility/common/images/like_space.png diff --git a/UI/JsBasicComponents/entry/src/main/js/default/common/images/like_yellow.png b/UI/JsBasicComponents/entry/src/main/js/MainAbility/common/images/like_yellow.png similarity index 100% rename from UI/JsBasicComponents/entry/src/main/js/default/common/images/like_yellow.png rename to UI/JsBasicComponents/entry/src/main/js/MainAbility/common/images/like_yellow.png diff --git a/UI/JsBasicComponents/entry/src/main/js/default/i18n/en-US.json b/UI/JsBasicComponents/entry/src/main/js/MainAbility/i18n/en-US.json similarity index 93% rename from UI/JsBasicComponents/entry/src/main/js/default/i18n/en-US.json rename to UI/JsBasicComponents/entry/src/main/js/MainAbility/i18n/en-US.json index b80fa99caf..2a03ef877b 100644 --- a/UI/JsBasicComponents/entry/src/main/js/default/i18n/en-US.json +++ b/UI/JsBasicComponents/entry/src/main/js/MainAbility/i18n/en-US.json @@ -1,15 +1,15 @@ { "strings": { - "title_case1":"Case 1:Button", + "title_case1":"Case 1:Button", "title_case2": "Case 2:Image And Text", "title_case3": "Case 3:Marquee", "title_case4": "Case 4:Input", "title_case5": "Case 5:Progress", "title_case6": "Case 6:Select", "title_case7": "Case 7:Piece", - "title_case8": "Case 8: Qrcode", + "title_case8": "Case 8:Qrcode", "title_case9": "Case 9:Toggle", - "title_case10": "Case 10 Switch", + "title_case10": "Case 10:Switch", "title_case11": "Case 11:Rating", "content_case1_t1":"Primary button", diff --git a/UI/JsBasicComponents/entry/src/main/js/default/i18n/zh-CN.json b/UI/JsBasicComponents/entry/src/main/js/MainAbility/i18n/zh-CN.json similarity index 93% rename from UI/JsBasicComponents/entry/src/main/js/default/i18n/zh-CN.json rename to UI/JsBasicComponents/entry/src/main/js/MainAbility/i18n/zh-CN.json index ce267275d5..0e350f80ad 100644 --- a/UI/JsBasicComponents/entry/src/main/js/default/i18n/zh-CN.json +++ b/UI/JsBasicComponents/entry/src/main/js/MainAbility/i18n/zh-CN.json @@ -1,15 +1,15 @@ { "strings": { - "title_case1":"Case 1:Button", + "title_case1":"Case 1:Button", "title_case2": "Case 2:Image And Text", "title_case3": "Case 3:Marquee", "title_case4": "Case 4:Input", "title_case5": "Case 5:Progress", "title_case6": "Case 6:Select", "title_case7": "Case 7:Piece", - "title_case8": "Case 8: Qrcode", + "title_case8": "Case 8:Qrcode", "title_case9": "Case 9:Toggle", - "title_case10": "Case 10 Switch", + "title_case10": "Case 10:Switch", "title_case11": "Case 11:Rating", "content_case1_t1":"基本按钮", diff --git a/UI/JsBasicComponents/entry/src/main/js/default/pages/index/index.css b/UI/JsBasicComponents/entry/src/main/js/MainAbility/pages/index/index.css similarity index 99% rename from UI/JsBasicComponents/entry/src/main/js/default/pages/index/index.css rename to UI/JsBasicComponents/entry/src/main/js/MainAbility/pages/index/index.css index aea3139a3f..85aaf6132d 100644 --- a/UI/JsBasicComponents/entry/src/main/js/default/pages/index/index.css +++ b/UI/JsBasicComponents/entry/src/main/js/MainAbility/pages/index/index.css @@ -30,12 +30,12 @@ margin-right : 24px; } -.item-class { +.item-div{ flex-direction: column; } .case-title { - font-size: 40px; + font-size: 30px; color: black; font-weight: 900; margin-top: 40px; @@ -350,7 +350,7 @@ align-items : center; width : 100%; margin-top : 20px; - padding-bottom : 400px; + padding-bottom : 300px; } .btn-input { diff --git a/UI/JsBasicComponents/entry/src/main/js/MainAbility/pages/index/index.hml b/UI/JsBasicComponents/entry/src/main/js/MainAbility/pages/index/index.hml new file mode 100644 index 0000000000..99f11ef4ec --- /dev/null +++ b/UI/JsBasicComponents/entry/src/main/js/MainAbility/pages/index/index.hml @@ -0,0 +1,314 @@ + +
+ + +
+
+ {{ $t('strings.title_case1') }} +
+
+ {{ $t('strings.content_case1_t1') }} +
+ + + +
+ +
+ + + + +
+ + {{ $t('strings.content_case1_t2') }} + +
+ + + + +
+
+
+
+ + +
+
+ {{ $t('strings.title_case2') }} +
+ +
+
+ + {{ headTitle }} + {{ paragraphFirst }} +
+
+
+
+ + +
+
+ {{ $t('strings.title_case3') }} +
+ +
+
+ {{ $t('strings.marqueeCustomData') }} + +
+ + +
+
+
+
+
+ + +
+
+ {{ $t('strings.title_case4') }} +
+ +
+
+
+ +
+ + {{ $t('strings.input_sure') + }} +
+
+ +
+ {{ showValue }} +
+ + {{ $t('strings.input_clean') + }} +
+
+ +
+ {{ $t('strings.multi_select_button') }} +
+ +
+ + + + + +
+ +
+ {{ $t('strings.single_choice_button') }} +
+ +
+ + + + + +
+
+
+
+
+ + +
+
+ {{ $t('strings.title_case5') }} +
+ +
+
+
+
+ + + {{ $t('strings.progress_scale_ring') }} +
+
+ + {{ $t('strings.progress_circular') }} +
+
+ +
+
+ + {{ $t('strings.progress_arc') }} +
+
+ + + {{ $t('strings.progress_ring') }} +
+
+ + + + {{ $t('strings.progress_horizontal') }} +
+
+
+
+ + +
+
+ {{ $t('strings.title_case6') }} +
+ +
+
+ +
+
+
+
+ + +
+
+ {{ $t('strings.title_case7') }} +
+ +
+
+ + +
+
+
+
+ + +
+
+ {{ $t('strings.title_case8') }} +
+ +
+ +
+
+
+ + +
+
+ {{ $t('strings.title_case9') }} +
+ +
+ {{ $t('strings.toggle_multiple') }} +
+ +
+ {{ $t('strings.toggle_single') }} +
+ +
+
+
+
+ + +
+
+ {{ $t('strings.title_case10') }} +
+ +
+
+
+ + {{ $t('strings.switch_default') }} +
+ +
+ + {{ $t('strings.switch_text') }} +
+
+ +
+
+ + + {{ $t('strings.switch_changed_status') }} +
+ +
+ + {{ $t('strings.switch_custom_text') }} +
+
+
+
+
+ + +
+
+ {{ $t('strings.title_case11') }} +
+ +
+ {{ $t('strings.rating_txt1') }} + + +
+ +
+ {{ $t('strings.rating_txt2') }} + +
+ +
+ {{ $t('strings.rating_txt3') }} + +
+
+
+
+
\ No newline at end of file diff --git a/UI/JsBasicComponents/entry/src/main/js/default/pages/index/index.js b/UI/JsBasicComponents/entry/src/main/js/MainAbility/pages/index/index.js similarity index 100% rename from UI/JsBasicComponents/entry/src/main/js/default/pages/index/index.js rename to UI/JsBasicComponents/entry/src/main/js/MainAbility/pages/index/index.js diff --git a/UI/JsBasicComponents/entry/src/main/js/default/app.js b/UI/JsBasicComponents/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201..0000000000 --- a/UI/JsBasicComponents/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +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('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/UI/JsBasicComponents/entry/src/main/js/default/pages/index/index.hml b/UI/JsBasicComponents/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 7d1d6ff528..0000000000 --- a/UI/JsBasicComponents/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,274 +0,0 @@ - -
- - -
- {{$t('strings.title_case1')}} -
-
- {{$t('strings.content_case1_t1')}} -
- - - -
- -
- - - - -
- - {{$t('strings.content_case1_t2')}} - -
- - - - -
-
-
- - -
- {{ $t('strings.title_case2') }} -
- -
-
- - {{ headTitle }} - {{ paragraphFirst }} -
-
-
- - -
- {{ $t('strings.title_case3') }} -
- -
-
- {{ $t('strings.marqueeCustomData') }} - -
- - -
-
-
-
- - -
- {{$t('strings.title_case4')}} -
- -
-
-
- -
- - {{$t('strings.input_sure')}} -
-
- -
- {{showValue}} -
- - {{$t('strings.input_clean')}} -
-
- -
- {{$t('strings.multi_select_button')}} -
- -
- - - - - -
- -
- {{$t('strings.single_choice_button')}} -
- -
- - - - - -
-
-
-
- - -
- {{$t('strings.title_case5')}} -
- -
-
-
-
- - {{$t('strings.progress_scale_ring')}} -
-
- - {{$t('strings.progress_circular')}} -
-
- -
-
- - {{$t('strings.progress_arc')}} -
-
- - {{ $t('strings.progress_ring') }} -
-
- - - {{$t('strings.progress_horizontal')}} -
-
-
- - -
- {{ $t('strings.title_case6') }} -
- -
-
- -
-
-
- - -
- {{ $t('strings.title_case7') }} -
- -
-
- - -
-
-
- - -
- {{ $t('strings.title_case8')}} -
- -
- -
-
- - -
- {{ $t('strings.title_case9')}} -
- -
- {{ $t('strings.toggle_multiple')}} -
- -
- {{ $t('strings.toggle_single')}} -
- -
-
-
- - -
- {{ $t('strings.title_case10') }} -
- -
-
-
- - {{$t('strings.switch_default')}} -
- -
- - {{$t('strings.switch_text')}} -
-
- -
-
- - {{$t('strings.switch_changed_status')}} -
- -
- - {{$t('strings.switch_custom_text')}} -
-
-
-
- - -
- {{ $t('strings.title_case11') }} -
- -
- {{ $t('strings.rating_txt1') }} - -
- -
- {{ $t('strings.rating_txt2') }} - -
- -
- {{ $t('strings.rating_txt3') }} - -
-
-
-
\ No newline at end of file diff --git a/UI/JsBasicComponents/entry/src/main/resources/base/element/string.json b/UI/JsBasicComponents/entry/src/main/resources/base/element/string.json index f61504dbb4..57b71e36cf 100644 --- a/UI/JsBasicComponents/entry/src/main/resources/base/element/string.json +++ b/UI/JsBasicComponents/entry/src/main/resources/base/element/string.json @@ -5,7 +5,7 @@ "value": "JsBasicComponents" }, { - "name": "mainability_description", + "name": "description_mainability", "value": "JS_Empty Ability" } ] -- Gitee From ec7ecbf978ebaf59843bdaf749053d8d33df675d Mon Sep 17 00:00:00 2001 From: gaohui Date: Mon, 14 Feb 2022 15:06:51 +0800 Subject: [PATCH 2/3] update sample JsBasicComponents Signed-off-by: gaohui --- UI/JsBasicComponents/build.gradle | 1 - UI/JsBasicComponents/entry/build.gradle | 5 ----- 2 files changed, 6 deletions(-) diff --git a/UI/JsBasicComponents/build.gradle b/UI/JsBasicComponents/build.gradle index f350f30a90..544c600aea 100644 --- a/UI/JsBasicComponents/build.gradle +++ b/UI/JsBasicComponents/build.gradle @@ -18,7 +18,6 @@ buildscript { } dependencies { classpath 'com.huawei.ohos:hap:3.0.5.2' - classpath 'com.huawei.ohos:decctest:1.2.7.2' } } diff --git a/UI/JsBasicComponents/entry/build.gradle b/UI/JsBasicComponents/entry/build.gradle index cef7b37de8..e7ab61a295 100644 --- a/UI/JsBasicComponents/entry/build.gradle +++ b/UI/JsBasicComponents/entry/build.gradle @@ -14,8 +14,3 @@ ohos { } } } - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) - testImplementation 'junit:junit:4.13.1' -} -- Gitee From 8d8542e2d060960db23e69f8139ed8deddfebe8d Mon Sep 17 00:00:00 2001 From: gaohui Date: Wed, 16 Feb 2022 09:15:13 +0800 Subject: [PATCH 3/3] update JsBasicComponents readme Signed-off-by: gaohui --- UI/JsBasicComponents/README_zh.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UI/JsBasicComponents/README_zh.md b/UI/JsBasicComponents/README_zh.md index 7838c0e7ec..c35ab02551 100644 --- a/UI/JsBasicComponents/README_zh.md +++ b/UI/JsBasicComponents/README_zh.md @@ -6,8 +6,8 @@ ### 使用说明 -通过滑动列表,点击组件,查看各组件的视图效果和点击效果,以及与组件交互的是实现方法。 -组件之间相互独立,可以在需求相同的地方重复是使用。 +通过滑动列表,点击组件,查看各组件的视图效果和点击效果,以及与组件交互的实现方法。 +组件之间相互独立,可以在需求相同的地方重复使用。 ### 约束与限制 -- Gitee