diff --git a/NdkDrawing/entry/oh_modules/libndkDrawing.so/Index.d.ts b/NdkDrawing/entry/oh_modules/libndkDrawing.so/Index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..25f15c498de567f29f1bbeec7384257b8b901c2a --- /dev/null +++ b/NdkDrawing/entry/oh_modules/libndkDrawing.so/Index.d.ts @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 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 { DrawContext } from '@ohos.arkui.node'; +import image from '@ohos.multimedia.image'; + +export const nativeOnDraw: (id: number, context: DrawContext, width: number, height: number, type: number, + imagePixel: image.PixelMap) => number; \ No newline at end of file diff --git a/NdkDrawing/entry/oh_modules/libndkDrawing.so/oh-package.json5 b/NdkDrawing/entry/oh_modules/libndkDrawing.so/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..112a3e08d2d5200cc34db14bb3f092c63408fab3 --- /dev/null +++ b/NdkDrawing/entry/oh_modules/libndkDrawing.so/oh-package.json5 @@ -0,0 +1,6 @@ +{ + "name": "libndkDrawing.so", + "types": "./Index.d.ts", + "version": "1.0.0", + "description": "Please describe the basic information." +} \ No newline at end of file diff --git a/NdkDrawing/entry/src/main/ets/pages/Index.ets b/NdkDrawing/entry/src/main/ets/pages/Index.ets index f85358b4a74b2a92b179fae3b19fabf145c8adb2..d2e27569b2eb8bf3c39bea18d284bd6e8e05b167 100644 --- a/NdkDrawing/entry/src/main/ets/pages/Index.ets +++ b/NdkDrawing/entry/src/main/ets/pages/Index.ets @@ -90,7 +90,7 @@ struct Index { private myNodeController: MyNodeController = new MyNodeController(); aboutToAppear(): void { - const context: Context = this.getUIContext().getHostContext(); + const context: Context = this.getUIContext().getHostContext()!; const resourceMgr: resourceManager.ResourceManager = context.resourceManager; resourceMgr.getRawFileContent('drawImage.jpg').then((fileData: Uint8Array) => { console.info('success in getRawFileContent'); diff --git a/NdkDrawing/entry/src/main/ets/view/Index.ets b/NdkDrawing/entry/src/main/ets/view/Index.ets index 82b53297691bfc264d357a061eb97deb42b83367..6a16b81767ba83bfcd1d77f76378b14aab202547 100644 --- a/NdkDrawing/entry/src/main/ets/view/Index.ets +++ b/NdkDrawing/entry/src/main/ets/view/Index.ets @@ -18,7 +18,7 @@ struct Index { build() { Stack() { - Image($r('app.media.drawImage')) + Image($r('app.media.layered_image')) .width('100%') .height('100%') // Transparent circle custom component, in which 1000 transparent circles are drawn diff --git a/StabilityCodingSpecification/NDKDevelopArkTS1/oh-package.json5 b/StabilityCodingSpecification/NDKDevelopArkTS1/oh-package.json5 index 68c1f331660ac39b2df183576c149a3ed0348b94..956af6495088096748df8886d0c70dde82c6909f 100644 --- a/StabilityCodingSpecification/NDKDevelopArkTS1/oh-package.json5 +++ b/StabilityCodingSpecification/NDKDevelopArkTS1/oh-package.json5 @@ -1,8 +1,3 @@ -/** - * 最佳实践:NDK开发ArkTS侧编码规范 - */ - -// [Start NDKDevelopArkTSohPackage1] { "name": "entry", "version": "1.0.0", @@ -14,5 +9,4 @@ // Dependent so "libentry.so": "file:./src/main/cpp/types/libentry" } -} -// [End NDKDevelopArkTSohPackage1] \ No newline at end of file +} \ No newline at end of file diff --git a/StabilityCodingSpecification/NDKDevelopArkTS2/oh-package.json5 b/StabilityCodingSpecification/NDKDevelopArkTS2/oh-package.json5 index f5748ea18844624f143868cebdabb32c9ced83a2..b0bcfbf11d2a8e9831b9435bb734bcca1844124d 100644 --- a/StabilityCodingSpecification/NDKDevelopArkTS2/oh-package.json5 +++ b/StabilityCodingSpecification/NDKDevelopArkTS2/oh-package.json5 @@ -1,8 +1,3 @@ -/** - * 最佳实践:NDK开发ArkTS侧编码规范 - */ - -// [Start NDKDevelopArkTSohPackage4] { "name": "entry", "version": "1.0.0", @@ -12,7 +7,6 @@ "license": "", "dependencies": { // Dependent on other modules under the current project - "library": "file:../library" + "library": "../library" } -} -// [End NDKDevelopArkTSohPackage4] \ No newline at end of file +} \ No newline at end of file diff --git a/StabilityCodingSpecification/code-linter1.json5 b/StabilityCodingSpecification/code-linter1.json5 index 49b14df202ffc5bf8a6976fd65b7c894e087fefc..fcb418a38456a7170a0f77829d5a07acabdb5b19 100644 --- a/StabilityCodingSpecification/code-linter1.json5 +++ b/StabilityCodingSpecification/code-linter1.json5 @@ -1,8 +1,3 @@ -/** - * 最佳实践:使用DevEco Studio静态检测编码规范 - */ - -// [Start codeLinterJson1] { "files": //A glob pattern array used to represent the file range applicable to the configuration. Apply default configuration without specification [ @@ -54,5 +49,4 @@ } } ] -} -// [End codeLinterJson1] \ No newline at end of file +} \ No newline at end of file diff --git a/StabilityCodingSpecification/code-linter2.json5 b/StabilityCodingSpecification/code-linter2.json5 index 7e8bf05ebeebdec43ef6bc433679c727e75d2187..4093b16cafa1170487005edc6c13755caed42023 100644 --- a/StabilityCodingSpecification/code-linter2.json5 +++ b/StabilityCodingSpecification/code-linter2.json5 @@ -1,8 +1,3 @@ -/** - * 最佳实践:使用DevEco Studio静态检测编码规范 - */ - -// [Start codeLinterJson2] { "rules": { "@typescript-eslint/no-restricted-syntax": [ @@ -19,5 +14,4 @@ } ] }, -} -// [End codeLinterJson2] \ No newline at end of file +} \ No newline at end of file diff --git a/StabilityCodingSpecification/code-linter3.json5 b/StabilityCodingSpecification/code-linter3.json5 index 230a7d7a0839ba42345456e36b32fb7af22e2b4d..de4c8f442cde55f522cab58e4b30d3a24928ed08 100644 --- a/StabilityCodingSpecification/code-linter3.json5 +++ b/StabilityCodingSpecification/code-linter3.json5 @@ -1,8 +1,3 @@ -/** - * 最佳实践:使用DevEco Studio静态检测编码规范 - */ - -// [Start codeLinterJson3] { "rules": { "@typescript-eslint/naming-convention": [ @@ -22,5 +17,4 @@ } ] }, -} -// [End codeLinterJson3] \ No newline at end of file +} \ No newline at end of file diff --git a/StabilityCodingSpecification/code-linter4.json5 b/StabilityCodingSpecification/code-linter4.json5 index 37e1f210a6ade83d1052214321f02f8d4ec984b2..2706d51e68d3d0cebc06d084dcec7a07a30ee4d3 100644 --- a/StabilityCodingSpecification/code-linter4.json5 +++ b/StabilityCodingSpecification/code-linter4.json5 @@ -1,8 +1,3 @@ -/** - * 最佳实践:使用DevEco Studio静态检测编码规范 - */ - -// [Start codeLinterJson4] { "rules": { "@hw-stylistic/file-naming-convention": [ @@ -17,4 +12,3 @@ ] }, } -// [End codeLinterJson4] \ No newline at end of file diff --git a/VideoPlayerSample/MediaService/src/main/module.json5 b/VideoPlayerSample/MediaService/src/main/module.json5 index ea54a53ce7e8b97304eac106955379724f57e70e..db1a8f3315249dfd7d19b532b2c324f0a82314cf 100644 --- a/VideoPlayerSample/MediaService/src/main/module.json5 +++ b/VideoPlayerSample/MediaService/src/main/module.json5 @@ -5,7 +5,6 @@ "deviceTypes": [ "default" ], - // [Start request1] "requestPermissions": [ { "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", @@ -18,6 +17,5 @@ } } ], - // [End request1] } } diff --git a/VideoPlayerSample/entry/src/main/module.json5 b/VideoPlayerSample/entry/src/main/module.json5 index 522b369c739baa5e21c84e4bf8cc143d6cf0ba5a..d7daadcb98cba0fb37404ad651818f56389e5a00 100644 --- a/VideoPlayerSample/entry/src/main/module.json5 +++ b/VideoPlayerSample/entry/src/main/module.json5 @@ -10,12 +10,8 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", - // [Start ability] - // [Start request1] "abilities": [ { - // [End request1] - // [StartExclude ability] "name": "EntryAbility", "srcEntry": "./ets/entryability/EntryAbility.ets", "description": "$string:EntryAbility_desc", @@ -24,11 +20,9 @@ "startWindowIcon": "$media:startIcon", "startWindowBackground": "$color:start_window_background", "exported": true, - // [Start request1] "backgroundModes": [ "audioPlayback" ], - // [End request1] "skills": [ { "entities": [ @@ -39,13 +33,9 @@ ] } ], - // [StartExclude ability] "preferMultiWindowOrientation": "landscape_auto", - // [Start request1] } ] - // [End request1] - // [End ability] , "requestPermissions": [ {