1.适配 DevEco Studio 3.1Beta1及以上版本。

OpenHarmony SDK版本:API version 9及以上版本。

Signed-off-by: zhoulisheng1 <zhoulisheng1@huawei.com>
This commit is contained in:
zhoulisheng1 2023-02-24 15:08:33 +08:00
parent 8a611a8c6b
commit 7311a146a4
10 changed files with 146 additions and 154 deletions

View File

@ -1,3 +1,5 @@
## 1.0.6
- 变换能力的图片处理默认使用GPU提升处理效率。
## 1.0.5
- 自定义组件已支持通用属性和通用事件绑定,因此ImageKnifeComponent将删除相关内容,相关内容由用户自定义实现,提高扩展能力

View File

@ -441,7 +441,8 @@ request.skipMemoryCache(true)
## 兼容性
支持 OpenHarmony API version 9 及以上版本。
- [DevEco Studio版本](https://developer.harmonyos.com/cn/develop/deveco-studio#download)DevEco Studio 3.1Beta1及以上版本。
- OpenHarmony SDK版本API version 9及以上版本。
## 目录结构

View File

@ -1,16 +1,16 @@
{
"license": "ISC",
"devDependencies": {},
"name": "entry",
"ohos": {
"org": "huawei",
"directoryLevel": "module",
"buildTool": "hvigor"
},
"description": "example description",
"repository": {},
"version": "1.0.0",
"dependencies": {
"@ohos/imageknife": "file:../imageknife"
}
"license": "ISC",
"devDependencies": {},
"name": "entry",
"ohos": {
"org": "huawei",
"directoryLevel": "module",
"buildTool": "hvigor"
},
"description": "example description",
"repository": {},
"version": "1.0.0",
"dependencies": {
"@ohos/imageknife": "file:../imageknife"
}
}

View File

@ -1,27 +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'
import { ImageKnife,ImageKnifeDrawFactory} from '@ohos/imageknife'
import ArkWorker from '@ohos.worker'
export default class MyAbilityStage extends AbilityStage {
onCreate() {
globalThis.ImageKnife = ImageKnife.with(this.context);
// 全局配置网络加载进度条
globalThis.ImageKnife.setDefaultLifeCycle(ImageKnifeDrawFactory.createProgressLifeCycle("#10a5ff", 0.5))
}
}

View File

@ -1,37 +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 {ImageKnife} from '@ohos/imageknife'
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
globalThis.abilityWant = want;
}
onDestroy() {
}
onWindowStageCreate(windowStage) {
windowStage.setUIContent(this.context, "pages/index", null)
}
onWindowStageDestroy() {
}
onForeground() {
}
onBackground() {
}
};

View File

@ -0,0 +1,45 @@
import UIAbility from '@ohos.app.ability.UIAbility';
import hilog from '@ohos.hilog';
import window from '@ohos.window';
import { ImageKnife,ImageKnifeDrawFactory} from '@ohos/imageknife'
export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
globalThis.ImageKnife = ImageKnife.with(this.context);
// 全局配置网络加载进度条
globalThis.ImageKnife.setDefaultLifeCycle(ImageKnifeDrawFactory.createProgressLifeCycle("#10a5ff", 0.5))
}
onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');
}
onWindowStageCreate(windowStage: window.WindowStage) {
// Main window is created, set main page for this ability
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
windowStage.loadContent('pages/index', (err, data) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? '');
});
}
onWindowStageDestroy() {
// Main window is destroyed, release UI related resources
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
}
onForeground() {
// Ability has brought to foreground
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
}
onBackground() {
// Ability has back to background
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
}
}

View File

@ -2,7 +2,7 @@
"module": {
"name": "entry",
"type": "entry",
"srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
@ -12,12 +12,17 @@
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "true"
}
],
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"srcEntrance": "./ets/entryability/EntryAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",

View File

@ -1,24 +1,25 @@
{
"license":"Apache License 2.0",
"types":"",
"devDependencies":{},
"keywords":[
"OpenHarmony",
"transformation",
"gpu_transform"
],
"name":"@ohos/gpu_transform",
"description":"based on OpenHarmony system, it can quickly realize image blur, Mosaic, sketch and other transformation effects through GPU",
"author":"ohos_tpc",
"ohos":{
"org":"opensource"
},
"tags":[
"Tool"
],
"main":"index.ets",
"repository":"https://gitee.com/openharmony-tpc/ImageKnife",
"type":"module",
"version":"1.0.0",
"dependencies":{}
}
"types": "",
"keywords": [
"OpenHarmony",
"transformation",
"gpuTransform",
"HarmonyOS"
],
"author": "ohos_tpc",
"description": "based on OpenHarmony system, it can quickly realize image blur, Mosaic, sketch and other transformation effects through GPU",
"ohos": {
"org": "opensource"
},
"main": "index.ets",
"repository": "https://gitee.com/openharmony-tpc/ImageKnife",
"type": "module",
"version": "0.1.0",
"tags": [
"Tool"
],
"dependencies": {},
"license": "Apache License 2.0",
"devDependencies": {},
"name": "@ohos/gpu_transform"
}

View File

@ -1,33 +1,34 @@
{
"types": "",
"keywords": [
"OpenHarmony",
"ImageKnife",
"glide"
],
"author": "ohos_tpc",
"description": "专门为OpenHarmony打造的一款图像加载缓存库致力于更高效、更轻便、更简单",
"ohos": {
"org": "opensource"
},
"main": "index.ets",
"repository": "https://gitee.com/openharmony-tpc/ImageKnife",
"type": "module",
"version": "1.0.5",
"dependencies": {
"pako": "^1.0.5",
"js-binary-schema-parser": "^2.0.3",
"@ohos/disklrucache": "^1.0.0",
"@ohos/svg": "1.1.0",
"crc-32": "^1.2.0",
"spark-md5": "^3.0.2",
"@ohos/gpu_transform": "file:../gpu_transform"
},
"tags": [
"ImageCache",
"UI"
],
"license": "Apache License 2.0",
"devDependencies": {},
"name": "@ohos/imageknife"
"types": "",
"keywords": [
"OpenHarmony",
"ImageKnife",
"glide",
"HarmonyOS"
],
"author": "ohos_tpc",
"description": "专门为OpenHarmony打造的一款图像加载缓存库致力于更高效、更轻便、更简单",
"ohos": {
"org": "opensource"
},
"main": "index.ets",
"repository": "https://gitee.com/openharmony-tpc/ImageKnife",
"type": "module",
"version": "1.0.6",
"dependencies": {
"pako": "^1.0.5",
"js-binary-schema-parser": "^2.0.3",
"@ohos/disklrucache": "^1.0.0",
"@ohos/svg": "1.1.0",
"crc-32": "^1.2.0",
"spark-md5": "^3.0.2",
"@ohos/gpu_transform": "^0.1.0"
},
"tags": [
"ImageCache",
"UI"
],
"license": "Apache License 2.0",
"devDependencies": {},
"name": "@ohos/imageknife"
}

View File

@ -1,19 +1,20 @@
{
"license":"ISC",
"devDependencies":{},
"name":"imageknife",
"ohos":{
"org":"huawei",
"directoryLevel":"project",
"buildTool":"hvigor"
},
"description":"example description",
"repository":{},
"version":"1.0.0",
"dependencies":{
"@ohos/hypium":"1.0.3",
"@ohos/hvigor-ohos-plugin":"1.3.1",
"hypium":"^1.0.0",
"@ohos/hvigor":"1.3.1"
}
}
"license": "ISC",
"devDependencies": {},
"name": "imageknife",
"ohos": {
"org": "huawei",
"directoryLevel": "project",
"buildTool": "hvigor"
},
"description": "example description",
"repository": {},
"version": "1.0.0",
"dependencies": {
"@ohos/hypium": "1.0.3",
"@ohos/hvigor-ohos-plugin": "1.4.0",
"hypium": "^1.0.0",
"@ohos/hvigor": "1.4.0",
"@ohos/gpu_transform": "^0.1.0"
}
}