diff --git a/README.md b/README.md index 4e37f6c..0aa52b9 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ - 支持生命周期已销毁的图片,不再发起请求 待实现特性 +- svg图片显示 - gif/webp动图显示与控制 - 内存降采样优化,节约内存的占用 - 支持自定义图片加载 diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 3066439..84ce1b1 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -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) ?? ''); diff --git a/library/index.ets b/library/index.ets index 7a3fa16..caacc8d 100644 --- a/library/index.ets +++ b/library/index.ets @@ -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" + diff --git a/library/oh-package-lock.json5 b/library/oh-package-lock.json5 index 3245bae..d5892e3 100644 --- a/library/oh-package-lock.json5 +++ b/library/oh-package-lock.json5 @@ -1,5 +1,5 @@ { - "lockfileVersion": 3, + "lockfileVersion": 1, "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", "specifiers": {}, "packages": {} diff --git a/library/src/main/ets/utils/LogUtil.ets b/library/src/main/ets/utils/LogUtil.ets index 11a3645..02c2d39 100644 --- a/library/src/main/ets/utils/LogUtil.ets +++ b/library/src/main/ets/utils/LogUtil.ets @@ -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[]) { diff --git a/oh-package-lock.json5 b/oh-package-lock.json5 new file mode 100644 index 0000000..078cc87 --- /dev/null +++ b/oh-package-lock.json5 @@ -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==" + } + } +} \ No newline at end of file