Pre Merge pull request !183 from zgf/3.x

This commit is contained in:
zgf 2024-04-12 02:21:46 +00:00 committed by Gitee
commit 82dd5d02b1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 20 additions and 4 deletions

View File

@ -18,6 +18,7 @@
- 支持生命周期已销毁的图片,不再发起请求
待实现特性
- svg图片显示
- gif/webp动图显示与控制
- 内存降采样优化,节约内存的占用
- 支持自定义图片加载

View File

@ -17,7 +17,7 @@ import hilog from '@ohos.hilog';
import UIAbility from '@ohos.app.ability.UIAbility';
import Want from '@ohos.app.ability.Want';
import window from '@ohos.window';
import { ImageKnife } from '@ohos/imageknife';
import { ImageKnife,LogUtil } from '@ohos/imageknife';
export default class EntryAbility extends UIAbility {
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
@ -34,7 +34,7 @@ export default class EntryAbility extends UIAbility {
// 初始化ImageKnife的文件缓存
await ImageKnife.getInstance().initFileCache(this.context, 256, 256 * 1024 * 1024)
LogUtil.ALL
windowStage.loadContent('pages/Index', (err, data) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');

View File

@ -8,4 +8,6 @@ export { ImageKnifeRequest } from './src/main/ets/ImageKnifeRequest'
export { FileUtils } from './src/main/ets/utils/FileUtils'
export { LogUtil } from "./src/main/ets/utils/LogUtil"

View File

@ -1,5 +1,5 @@
{
"lockfileVersion": 3,
"lockfileVersion": 1,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {},
"packages": {}

View File

@ -20,7 +20,7 @@ export class LogUtil {
public static WARN: number = 5
public static ERROR: number = 6
public static ALL: number = 7
public static mLogLevel: number = LogUtil.ALL;
public static mLogLevel: number = LogUtil.OFF;
public static TAG: string = "ImageKnife:: ";
public static debug(message: string, ...args: Object[]) {

13
oh-package-lock.json5 Normal file
View File

@ -0,0 +1,13 @@
{
"lockfileVersion": 3,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {
"@ohos/hypium@1.0.13": "@ohos/hypium@1.0.13"
},
"packages": {
"@ohos/hypium@1.0.13": {
"resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.13.tgz",
"integrity": "sha512-d0+XvDeAYk5Vgl6JQ8Q1G+NPmTyJI8qgZ1PwPfcUbx/dfyKVAAv9lz1XtVNhYypyWEKqAzu8zMAC9GuHo2Y53Q=="
}
}
}