From eee2d84e2f4b3038bf7505cf1eb9096490d0e7c9 Mon Sep 17 00:00:00 2001 From: zhoulisheng1 Date: Wed, 22 Feb 2023 17:40:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=20DevEco=20Studio=E7=89=88=E6=9C=AC?= =?UTF-8?q?=EF=BC=8CDevEco=20Studio=203.1Beta1=E5=8F=8A=E4=BB=A5=E4=B8=8A?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E3=80=82=20=20=20=20OpenHarmony=20SDK?= =?UTF-8?q?=E7=89=88=E6=9C=AC=EF=BC=9AAPI=20version=209=E5=8F=8A=E4=BB=A5?= =?UTF-8?q?=E4=B8=8A=E7=89=88=E6=9C=AC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +- .../{hvigorfile.js => hvigorfile.ts} | 0 RoundedImageView/package.json | 51 +++++++------- build-profile.json5 | 5 +- entry/package.json | 30 ++++----- .../src/main/ets/Application/AbilityStage.ts | 22 ------- entry/src/main/ets/MainAbility/MainAbility.ts | 66 ------------------- entry/src/main/module.json5 | 10 ++- package.json | 38 +++++------ 9 files changed, 72 insertions(+), 154 deletions(-) rename RoundedImageView/{hvigorfile.js => hvigorfile.ts} (100%) delete mode 100644 entry/src/main/ets/Application/AbilityStage.ts delete mode 100644 entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/README.md b/README.md index 7360a22..1de86de 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,8 @@ RoundedImageView支持圆角(和椭圆或圆形)的快速 ImageView。它支 ## 兼容性 -支持OpenHarmony API version 9 及以上版本 +- [DevEco Studio版本](https://developer.harmonyos.com/cn/develop/deveco-studio#download):DevEco Studio 3.1Beta1及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 ## 目录结构 @@ -161,4 +162,3 @@ RoundedImageView支持圆角(和椭圆或圆形)的快速 ImageView。它支 本项目基于 [Apache License 2.0](https://gitee.com/openharmony-sig/RoundedImageView/blob/master/LICENSE) ,请自由地享受和参与开源。 - diff --git a/RoundedImageView/hvigorfile.js b/RoundedImageView/hvigorfile.ts similarity index 100% rename from RoundedImageView/hvigorfile.js rename to RoundedImageView/hvigorfile.ts diff --git a/RoundedImageView/package.json b/RoundedImageView/package.json index cb77195..415b8d9 100644 --- a/RoundedImageView/package.json +++ b/RoundedImageView/package.json @@ -1,26 +1,27 @@ { - "types":"", - "keywords":[ - "OpenHarmony", - "RoundedImage" - ], - "author":"hihope", - "description":"圆角图片设置组件", - "ohos":{ - "org":"opensource" - }, - "main":"index", - "repository":"https://gitee.com/openharmony-sig/RoundedImageView", - "version":"1.0.3", - "tags":[ - "OpenHarmony", - "RoundedImage", - "UI" - ], - "dependencies":{ - "@ohos/svg":"1.1.0" - }, - "license":"Apache License 2.0", - "devDependencies":{}, - "name":"@ohos/roundedimageview" -} \ No newline at end of file + "types": "", + "keywords": [ + "OpenHarmony", + "RoundedImage" + ], + "author": "hihope", + "description": "圆角图片设置组件", + "ohos": { + "org": "opensource" + }, + "main": "index", + "repository": "https://gitee.com/openharmony-sig/RoundedImageView", + "type": "module", + "version": "1.0.3", + "tags": [ + "OpenHarmony", + "RoundedImage", + "UI" + ], + "dependencies": { + "@ohos/svg": "1.1.0" + }, + "license": "Apache License 2.0", + "devDependencies": {}, + "name": "@ohos/roundedimageview" +} diff --git a/build-profile.json5 b/build-profile.json5 index c040477..57d0ac0 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -1,14 +1,13 @@ { "app": { - "signingConfigs": [], "compileSdkVersion": 9, "compatibleSdkVersion": 9, "products": [ { "name": "default", - "signingConfig": "default", + "signingConfig": "default" } - ] + ], }, "modules": [ { diff --git a/entry/package.json b/entry/package.json index 1cc5670..c51a2cb 100644 --- a/entry/package.json +++ b/entry/package.json @@ -1,16 +1,16 @@ { - "license":"Apache License 2.0", - "devDependencies":{}, - "name":"entry", - "ohos":{ - "org":"huawei", - "directoryLevel":"module", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.3", - "dependencies":{ - "@ohos/roundedimageview":"file:../Roundedimageview" - } -} \ No newline at end of file + "license": "Apache License 2.0", + "devDependencies": {}, + "name": "entry", + "ohos": { + "org": "huawei", + "directoryLevel": "module", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.3", + "dependencies": { + "@ohos/roundedimageview": "file:../Roundedimageview" + } +} diff --git a/entry/src/main/ets/Application/AbilityStage.ts b/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index ab26829..0000000 --- a/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2022 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 AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/entry/src/main/ets/MainAbility/MainAbility.ts b/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 28d5173..0000000 --- a/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2022 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 Ability from '@ohos.application.Ability' -import display from '@ohos.display'; - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - globalThis.globalFilesDir = this.context.filesDir - let displayWH = display.getDefaultDisplaySync() - globalThis.deviceW = displayWH.width; - globalThis.deviceH = displayWH.height; - globalThis.resourceManager = this.context.resourceManager; - globalThis.context = this.context - } - - // requestPermission() { - // let array: Array = ["ohos.permission.READ_MEDIA", "ohos.permission.WRITE_MEDIA"]; - // this.context.requestPermissionsFromUser(array).then(function (data) { - // console.log("data permissions:" + data.permissions); - // console.log("data result:" + data.authResults); - // }, (err) => { - // console.error('Failed to start ability', err.code); - // }); - // } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -} diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 index 39d79d3..d8fe77f 100644 --- a/entry/src/main/module.json5 +++ b/entry/src/main/module.json5 @@ -2,7 +2,6 @@ "module": { "name": "entry", "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", "description": "$string:entry_desc", "mainElement": "MainAbility", "deviceTypes": [ @@ -12,6 +11,13 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "uiSyntax": "ets", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], "requestPermissions": [ { "name": "ohos.permission.INTERNET" @@ -20,7 +26,7 @@ "abilities": [ { "name": "MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "srcEntrance": "./ets/entryability/EntryAbility.ts", "description": "$string:MainAbility_desc", "icon": "$media:icon", "label": "$string:MainAbility_label", diff --git a/package.json b/package.json index 895a6ac..adb6a8c 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,20 @@ { - "license":"Apache License 2.0", - "private":true, - "devDependencies":{}, - "name":"roundimageview", - "ohos":{ - "org":"huawei", - "directoryLevel":"project", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.3", - "dependencies":{ - "@ohos/hypium":"1.0.2", - "@ohos/hvigor-ohos-plugin":"1.2.2", - "hypium":"^1.0.0", - "@ohos/hvigor":"1.2.2" - } -} \ No newline at end of file + "license": "Apache License 2.0", + "private": true, + "devDependencies": {}, + "name": "roundimageview", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.3", + "dependencies": { + "@ohos/hypium": "1.0.2", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "hypium": "^1.0.0", + "@ohos/hvigor": "1.4.0" + } +} -- Gitee From 00b3d188a948c1d55dc83fbaf04dac596a4969d1 Mon Sep 17 00:00:00 2001 From: zhoulisheng1 Date: Thu, 23 Feb 2023 10:26:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=20DevEco=20Studio=E7=89=88=E6=9C=AC?= =?UTF-8?q?=EF=BC=8CDevEco=20Studio=203.1Beta1=E5=8F=8A=E4=BB=A5=E4=B8=8A?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E3=80=82=20=20=20=20OpenHarmony=20SDK?= =?UTF-8?q?=E7=89=88=E6=9C=AC=EF=BC=9AAPI=20version=209=E5=8F=8A=E4=BB=A5?= =?UTF-8?q?=E4=B8=8A=E7=89=88=E6=9C=AC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhoulisheng1 --- README.md | 4 +- .../{hvigorfile.js => hvigorfile.ts} | 0 RoundedImageView/package.json | 51 +++++++------- entry/package.json | 30 ++++----- .../src/main/ets/Application/AbilityStage.ts | 22 ------- entry/src/main/ets/MainAbility/MainAbility.ts | 66 ------------------- entry/src/main/module.json5 | 10 ++- package.json | 38 +++++------ 8 files changed, 70 insertions(+), 151 deletions(-) rename RoundedImageView/{hvigorfile.js => hvigorfile.ts} (100%) delete mode 100644 entry/src/main/ets/Application/AbilityStage.ts delete mode 100644 entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/README.md b/README.md index 7360a22..1de86de 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,8 @@ RoundedImageView支持圆角(和椭圆或圆形)的快速 ImageView。它支 ## 兼容性 -支持OpenHarmony API version 9 及以上版本 +- [DevEco Studio版本](https://developer.harmonyos.com/cn/develop/deveco-studio#download):DevEco Studio 3.1Beta1及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 ## 目录结构 @@ -161,4 +162,3 @@ RoundedImageView支持圆角(和椭圆或圆形)的快速 ImageView。它支 本项目基于 [Apache License 2.0](https://gitee.com/openharmony-sig/RoundedImageView/blob/master/LICENSE) ,请自由地享受和参与开源。 - diff --git a/RoundedImageView/hvigorfile.js b/RoundedImageView/hvigorfile.ts similarity index 100% rename from RoundedImageView/hvigorfile.js rename to RoundedImageView/hvigorfile.ts diff --git a/RoundedImageView/package.json b/RoundedImageView/package.json index cb77195..415b8d9 100644 --- a/RoundedImageView/package.json +++ b/RoundedImageView/package.json @@ -1,26 +1,27 @@ { - "types":"", - "keywords":[ - "OpenHarmony", - "RoundedImage" - ], - "author":"hihope", - "description":"圆角图片设置组件", - "ohos":{ - "org":"opensource" - }, - "main":"index", - "repository":"https://gitee.com/openharmony-sig/RoundedImageView", - "version":"1.0.3", - "tags":[ - "OpenHarmony", - "RoundedImage", - "UI" - ], - "dependencies":{ - "@ohos/svg":"1.1.0" - }, - "license":"Apache License 2.0", - "devDependencies":{}, - "name":"@ohos/roundedimageview" -} \ No newline at end of file + "types": "", + "keywords": [ + "OpenHarmony", + "RoundedImage" + ], + "author": "hihope", + "description": "圆角图片设置组件", + "ohos": { + "org": "opensource" + }, + "main": "index", + "repository": "https://gitee.com/openharmony-sig/RoundedImageView", + "type": "module", + "version": "1.0.3", + "tags": [ + "OpenHarmony", + "RoundedImage", + "UI" + ], + "dependencies": { + "@ohos/svg": "1.1.0" + }, + "license": "Apache License 2.0", + "devDependencies": {}, + "name": "@ohos/roundedimageview" +} diff --git a/entry/package.json b/entry/package.json index 1cc5670..c51a2cb 100644 --- a/entry/package.json +++ b/entry/package.json @@ -1,16 +1,16 @@ { - "license":"Apache License 2.0", - "devDependencies":{}, - "name":"entry", - "ohos":{ - "org":"huawei", - "directoryLevel":"module", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.3", - "dependencies":{ - "@ohos/roundedimageview":"file:../Roundedimageview" - } -} \ No newline at end of file + "license": "Apache License 2.0", + "devDependencies": {}, + "name": "entry", + "ohos": { + "org": "huawei", + "directoryLevel": "module", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.3", + "dependencies": { + "@ohos/roundedimageview": "file:../Roundedimageview" + } +} diff --git a/entry/src/main/ets/Application/AbilityStage.ts b/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index ab26829..0000000 --- a/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2022 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 AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/entry/src/main/ets/MainAbility/MainAbility.ts b/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 28d5173..0000000 --- a/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2022 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 Ability from '@ohos.application.Ability' -import display from '@ohos.display'; - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - globalThis.globalFilesDir = this.context.filesDir - let displayWH = display.getDefaultDisplaySync() - globalThis.deviceW = displayWH.width; - globalThis.deviceH = displayWH.height; - globalThis.resourceManager = this.context.resourceManager; - globalThis.context = this.context - } - - // requestPermission() { - // let array: Array = ["ohos.permission.READ_MEDIA", "ohos.permission.WRITE_MEDIA"]; - // this.context.requestPermissionsFromUser(array).then(function (data) { - // console.log("data permissions:" + data.permissions); - // console.log("data result:" + data.authResults); - // }, (err) => { - // console.error('Failed to start ability', err.code); - // }); - // } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -} diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 index 39d79d3..d8fe77f 100644 --- a/entry/src/main/module.json5 +++ b/entry/src/main/module.json5 @@ -2,7 +2,6 @@ "module": { "name": "entry", "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", "description": "$string:entry_desc", "mainElement": "MainAbility", "deviceTypes": [ @@ -12,6 +11,13 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "uiSyntax": "ets", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], "requestPermissions": [ { "name": "ohos.permission.INTERNET" @@ -20,7 +26,7 @@ "abilities": [ { "name": "MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "srcEntrance": "./ets/entryability/EntryAbility.ts", "description": "$string:MainAbility_desc", "icon": "$media:icon", "label": "$string:MainAbility_label", diff --git a/package.json b/package.json index 895a6ac..adb6a8c 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,20 @@ { - "license":"Apache License 2.0", - "private":true, - "devDependencies":{}, - "name":"roundimageview", - "ohos":{ - "org":"huawei", - "directoryLevel":"project", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.3", - "dependencies":{ - "@ohos/hypium":"1.0.2", - "@ohos/hvigor-ohos-plugin":"1.2.2", - "hypium":"^1.0.0", - "@ohos/hvigor":"1.2.2" - } -} \ No newline at end of file + "license": "Apache License 2.0", + "private": true, + "devDependencies": {}, + "name": "roundimageview", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.3", + "dependencies": { + "@ohos/hypium": "1.0.2", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "hypium": "^1.0.0", + "@ohos/hvigor": "1.4.0" + } +} -- Gitee