diff --git a/common/DistributeCalc/build.gradle b/common/DistributeCalc/build.gradle index 3c7d48fcaa641d9156caad6f91773a5cf92c4685..8a6ebff430f75f4e09eb0462900d2b247643d987 100644 --- a/common/DistributeCalc/build.gradle +++ b/common/DistributeCalc/build.gradle @@ -2,10 +2,8 @@ apply plugin: 'com.huawei.ohos.app' ohos { - compileSdkVersion 6 - defaultConfig { - compatibleSdkVersion 6 - } + compileSdkVersion 7 + supportSystem "standard" } buildscript { @@ -16,11 +14,9 @@ buildscript { maven { url 'https://developer.huawei.com/repo/' } - jcenter() } dependencies { - classpath 'com.huawei.ohos:hap:2.4.5.0' - classpath 'com.huawei.ohos:decctest:1.2.4.1' + classpath 'com.huawei.ohos:hap:3.0.3.2' } } @@ -32,6 +28,5 @@ allprojects { maven { url 'https://developer.huawei.com/repo/' } - jcenter() } } diff --git a/common/DistributeCalc/entry/build.gradle b/common/DistributeCalc/entry/build.gradle index 8f4fb4dc437b13d5159de737fab6d1b296422d13..23858519f83c168b1aed612cdd5764584e9688ce 100644 --- a/common/DistributeCalc/entry/build.gradle +++ b/common/DistributeCalc/entry/build.gradle @@ -1,9 +1,9 @@ apply plugin: 'com.huawei.ohos.hap' -apply plugin: 'com.huawei.ohos.decctest' + ohos { - compileSdkVersion 6 + compileSdkVersion 7 defaultConfig { - compatibleSdkVersion 6 + compatibleSdkVersion 7 } buildTypes { release { @@ -13,11 +13,4 @@ ohos { } } } - supportSystem "standard" - -} - -dependencies {} -decc { - supportType = ['html', 'xml'] -} +} \ No newline at end of file diff --git a/common/DistributeCalc/entry/src/main/config.json b/common/DistributeCalc/entry/src/main/config.json index 59b1bc2c672db8bcbe40012b4038838fddac4746..1d85085a13669389cdb2e822aeb5a13cf3d88184 100644 --- a/common/DistributeCalc/entry/src/main/config.json +++ b/common/DistributeCalc/entry/src/main/config.json @@ -34,9 +34,10 @@ ], "name": "com.example.distributedcalc.MainAbility", "icon": "$media:icon", + "srcPath": "default", + "srcLanguage": "js", "description": "$string:mainability_description", "label": "$string:app_name", - "visible": true, "type": "page", "launchType": "standard" } @@ -55,4 +56,4 @@ } ] } -} +} \ No newline at end of file diff --git a/common/DistributeCalc/entry/src/main/js/default/pages/calc/calc.css b/common/DistributeCalc/entry/src/main/js/default/pages/calc/calc.css index 9cdbe8880a3ff2d1447b0ec3a15d34f04fd81f52..4716272fa56fc04b4a1b7586045810a488c612ea 100644 --- a/common/DistributeCalc/entry/src/main/js/default/pages/calc/calc.css +++ b/common/DistributeCalc/entry/src/main/js/default/pages/calc/calc.css @@ -12,6 +12,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/* + * 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. + */ + .calc-container { height: 100%; width: 100%; @@ -44,29 +59,30 @@ } .calc-expr { - font-size: 72px; color: #000000; width: 100%; - height: 13%; + font-size: 50px; + height: 50px; + margin-top:10px } .calc-rsl { color: #999; - font-size: 38px; width: 100%; - height: 8%; + font-size: 38px; + height: 40px; } .input-area { width: 100%; height: 65%; - margin-top: 22%; + margin-top: 10px; } .calc-text-btn, .calc-op-btn, .calc-equals-btn { border-radius: 16px; - height: 106px; width: 18%; + height: 40px; font-size: 38px; } @@ -98,19 +114,22 @@ } .calc-btn-row-1 { - top: 112px; + top: 20px; } .calc-btn-row-2 { - top: 226px; + top: 60px; + margin-top: 3px; } .calc-btn-row-3 { - top: 340px; + top: 100px; + margin-top: 6px; } .calc-btn-row-4 { - top: 454px; + top: 140px; + margin-top: 9px; } .calc-btn-col-1 { @@ -138,23 +157,23 @@ } .calc-btn-col-span-2 { - height: 220px; + height: 86px; } .calc-icon-row-1 { - top: 152px; + top: 24px; } .calc-icon-row-2 { - top: 266px; + top: 66px; } .calc-icon-row-3 { - top: 380px; + top: 110px; } .calc-icon-row-4 { - top: 484px; + top: 150px; } .calc-icon-col-1 { diff --git a/common/DistributeCalc/entry/src/main/js/default/pages/index/index.css b/common/DistributeCalc/entry/src/main/js/default/pages/index/index.css index 7a9423c256f6ef397e1baa0f0bf727f0cb15b937..deb64ff037a7bc57dfc073e69e60f4c906dc4115 100644 --- a/common/DistributeCalc/entry/src/main/js/default/pages/index/index.css +++ b/common/DistributeCalc/entry/src/main/js/default/pages/index/index.css @@ -1,215 +1,217 @@ -/* - * 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. - */ - -.calc-container { - height: 100%; - width: 100%; - flex-direction: column; -} - -.calc-icon { - width: 36px; - height: 36px; -} - -.calc-titlebar { - width: 100%; - height: 10%; -} - -.calc-back-btn { - left: 39px; - top: 10px; -} - -.calc-select-device-btn { - left:90%; - top: 10px; -} - -.calc-select-device-dialog { - width: 90%; - height: 33%; -} - -.calc-select-device-wrapper { - width: 95%; - margin-left: 5%; - height: 100%; - flex-direction: column; -} - -.calc-select-device-item { - width: 100%; - height: 50%; -} - -.calc-select-device-item-cancel-btn { - text-align: center; - color: #0000ff; -} - -.calc-select-device-item-title { - text-align: left; - font-size: 40px; -} - -.calc-select-device-item-left { - width: 90%; - height: 100%; - text-align: left; - font-size: 32px; -} - -.calc-select-device-item-right { - width: 10%; - height: 100%; -} - -.calc-title { - left: 96px; - font-size: 30px; - top: 10px; -} - -.calc-expr, .calc-rsl { - padding: 0 3%; -} - -.calc-expr { - font-size: 72px; - color: #000000; - width: 100%; - height: 13%; -} - -.calc-rsl { - color: #999; - font-size: 38px; - width: 100%; - height: 8%; -} - -.input-area { - width: 100%; - height: 65%; - margin-top: 22%; -} - -.calc-text-btn, .calc-op-btn, .calc-equals-btn { - border-radius: 16px; - height: 106px; - width: 18%; - font-size: 38px; -} - -.calc-text-btn { - background-color: #f2f2f2; - color: #000000; -} - -.calc-text-btn:active { - background-color: rgb(72, 72, 72); -} - -.calc-op-btn { - background-color: #4D3F97E9; - color: #FF3F97E9; -} - -.calc-op-btn:active { - background-color: rgb(54, 76, 97); -} - -.calc-equals-btn { - background-color: #FF006CDE; - color: #fff; -} - -.calc-equals-btn:active { - background-color: rgb(38, 129, 226); -} - -.calc-btn-row-1 { - top: 112px; -} - -.calc-btn-row-2 { - top: 226px; -} - -.calc-btn-row-3 { - top: 340px; -} - -.calc-btn-row-4 { - top: 454px; -} - -.calc-btn-col-1 { - left: 3%; -} - -.calc-btn-col-2 { - left: 22%; -} - -.calc-btn-col-3 { - left: 41%; -} - -.calc-btn-col-4 { - left: 60%; -} - -.calc-btn-col-5 { - left: 79%; -} - -.calc-btn-row-span-2 { - width: 37%; -} - -.calc-btn-col-span-2 { - height: 220px; -} - -.calc-icon-row-1 { - top: 152px; -} - -.calc-icon-row-2 { - top: 266px; -} - -.calc-icon-row-3 { - top: 380px; -} - -.calc-icon-row-4 { - top: 484px; -} - -.calc-icon-col-1 { - left: 69%; - transform: translateX(-50%); -} - -.calc-icon-col-2 { - left: 88%; - transform: translateX(-50%); -} - - +/* + * 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. + */ + +.calc-container { + height: 100%; + width: 100%; + flex-direction: column; +} + +.calc-icon { + width: 36px; + height: 36px; +} + +.calc-titlebar { + width: 100%; + height: 10%; +} + +.calc-back-btn { + left: 39px; + top: 10px; +} + +.calc-select-device-btn { + left:90%; + top: 10px; +} + +.calc-select-device-dialog { + width: 90%; + height: 33%; +} + +.calc-select-device-wrapper { + width: 95%; + margin-left: 5%; + height: 100%; + flex-direction: column; +} + +.calc-select-device-item { + width: 100%; + height: 200px; +} + +.calc-select-device-item-cancel-btn { + text-align: center; + color: #0000ff; +} + +.calc-select-device-item-title { + text-align: left; + font-size: 30px; +} + +.calc-select-device-item-left { + width: 90%; + height: 100%; + text-align: left; + font-size: 32px; +} + +.calc-select-device-item-right { + width: 10%; + height: 100%; +} + +.calc-title { + left: 96px; + font-size: 30px; + top: 10px; +} + +.calc-expr, .calc-rsl { + padding: 0 3%; +} + +.calc-expr { + color: #000000; + width: 100%; + font-size: 50px; + height: 50px; + margin-top:10px +} + +.calc-rsl { + color: #999; + width: 100%; + font-size: 38px; + height: 40px; +} + +.input-area { + width: 100%; + height: 65%; + margin-top: 10px; +} + +.calc-text-btn, .calc-op-btn, .calc-equals-btn { + border-radius: 16px; + width: 18%; + height: 40px; + font-size: 38px; +} + +.calc-text-btn { + background-color: #f2f2f2; + color: #000000; +} + +.calc-text-btn:active { + background-color: rgb(72, 72, 72); +} + +.calc-op-btn { + background-color: #4D3F97E9; + color: #FF3F97E9; +} + +.calc-op-btn:active { + background-color: rgb(54, 76, 97); +} + +.calc-equals-btn { + background-color: #FF006CDE; + color: #fff; +} + +.calc-equals-btn:active { + background-color: rgb(38, 129, 226); +} + +.calc-btn-row-1 { + top: 20px; +} + +.calc-btn-row-2 { + top: 60px; + margin-top: 3px; +} + +.calc-btn-row-3 { + top: 100px; + margin-top: 6px; +} + +.calc-btn-row-4 { + top: 140px; + margin-top: 9px; +} + +.calc-btn-col-1 { + left: 3%; +} + +.calc-btn-col-2 { + left: 22%; +} + +.calc-btn-col-3 { + left: 41%; +} + +.calc-btn-col-4 { + left: 60%; +} + +.calc-btn-col-5 { + left: 79%; +} + +.calc-btn-row-span-2 { + width: 37%; +} + +.calc-btn-col-span-2 { + height: 86px; +} + +.calc-icon-row-1 { + top: 24px; +} + +.calc-icon-row-2 { + top: 66px; +} + +.calc-icon-row-3 { + top: 110px; +} + +.calc-icon-row-4 { + top: 150px; +} + +.calc-icon-col-1 { + left: 69%; + transform: translateX(-50%); +} + +.calc-icon-col-2 { + left: 88%; + transform: translateX(-50%); +} \ No newline at end of file diff --git a/common/DistributeCalc/entry/src/main/js/default/pages/index/index.hml b/common/DistributeCalc/entry/src/main/js/default/pages/index/index.hml index baffadc22af2b3bd9c273ce96f1f78c9365f9d69..56dd42d5c6b87008abd9a776f662bece18b729f6 100644 --- a/common/DistributeCalc/entry/src/main/js/default/pages/index/index.hml +++ b/common/DistributeCalc/entry/src/main/js/default/pages/index/index.hml @@ -1,67 +1,91 @@ - - -
- - - - {{title}} - - - - - {{expression}} - - - {{result}} - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 选择设备 - - - {{$item.deviceName}} - - - - 取消 -
-
-
+ + +
+ + + + {{ title }} + + + + + {{ expression }} + + + {{ result }} + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 选择设备 + + + {{ $item.deviceName }} + + + + 取消 + +
+
+
\ No newline at end of file