From b27a5ebb074a5bc7304e9c22838a801ea97f84d0 Mon Sep 17 00:00:00 2001 From: zhoulisheng1 Date: Wed, 14 Dec 2022 02:00:47 -0800 Subject: [PATCH] 1.update README.md CHANGELOG.md 2.publish version 1.0.5 Signed-off-by: zhoulisheng1 --- CHANGELOG.md | 25 ++++++++++++++++--- README.md | 15 +++++------ imageknife/package.json | 2 +- .../components/imageknife/utils/LogUtil.ets | 14 +++++++++++ 4 files changed, 42 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2e93e1..1513f95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,29 @@ +## 1.0.5 +- 自定义组件已支持通用属性和通用事件绑定,因此ImageKnifeComponent将删除相关内容,相关内容由用户自定义实现,提高扩展能力 + +- ImageKnifeOption 支持列表绑定 + +- ImageKnifeOption + + 新增 + + - 1.onClick事件属性 + + 删除 + + - 1.size(设置大小) + - 2.sizeAnimated 显式动画 + - 3.backgroundColor背景色 + - 4.margin 组件外间距 等属性,删除的属性将由通用属性提供支持,可支持在ImageKnifeComponent自定义组件上链式调用 ## 1.0.4 -渲染显示部分使用Canvas组件替代Image组件 +- 渲染显示部分使用Canvas组件替代Image组件 -重构渲染封装层ImageKnifeComponent自定义组件 +- 重构渲染封装层ImageKnifeComponent自定义组件 -新增GIF图片解析能力 +- 新增GIF图片解析能力 -新增SVG图片解析能力 +- 新增SVG图片解析能力 ## 1.0.3 diff --git a/README.md b/README.md index e6e2a54..a9f03fd 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,6 @@ struct Index { @State imageKnifeOption1: ImageKnifeOption = { // 加载一张本地的jpg资源(必选) loadSrc: $r('app.media.jpgSample'), - // 组件宽设置为300,高设置为300(必选) - size: { width: '300', height: '300' }, // 占位图使用本地资源icon_loading(可选) placeholderSrc: $r('app.media.icon_loading'), // 失败占位图使用本地资源icon_failed(可选) @@ -63,6 +61,8 @@ struct Index { Scroll() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { ImageKnifeComponent({ imageKnifeOption: $imageKnifeOption1 }) + .width(300) // 自定义组件支持通用属性链式调用,可以直接设置宽高 + .height(300) } } .width('100%') @@ -99,7 +99,6 @@ struct IndexFunctionDemo { @State imageKnifeOption: ImageKnifeOption = { loadSrc: $r('app.media.gifSample'), - size: { width: '300', height: '300' }, placeholderSrc: $r('app.media.icon_loading'), errorholderSrc: $r('app.media.icon_failed') }; @@ -109,6 +108,8 @@ struct IndexFunctionDemo { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Text("简单示例:加载一张gif图片").fontSize(15) ImageKnifeComponent({ imageKnifeOption: $imageKnifeOption }) + .width(300) // 自定义组件支持通用属性链式调用,可以直接设置宽高 + .height(300) } } .width('100%') @@ -188,7 +189,6 @@ arkWorker.parentPort.onmessage = gifHandler; | 参数名称 | 入参内容 | 功能简介 | | ---------------------------- | ------------------------------------------------------------ | ----------------------------------- | -| size | { width: string, height: string } | 设置组件宽高(必选) | | loadSrc | string \| PixelMap \| Resource | 设置主图资源(必选) | | mainScaleType | ScaleType | 设置主图展示样式(可选) | | strategy | DiskStrategy | 设置磁盘缓存策略(可选) | @@ -210,9 +210,6 @@ arkWorker.parentPort.onmessage = gifHandler; | transformation | BaseTransform | 单个变换(可选) | | transformations | Array> | 多个变换,目前仅支持单个变换(可选) | | allCacheInfoCallback | IAllCacheInfoCallback | 输出缓存相关内容和信息(可选) | -| backgroundColor | Color \| number \| string \| Resource | 组件背景颜色(可选) | -| margin | {
top?: number \| string \| Resource,
right?: number \| string \| Resource,
bottom?: number \| string \| Resource,
left?: number \| string \| Resource
} \| number \| string \| Resource | 组件间距(可选) | -| sizeAnimate | AnimateParam | 组件大小变化显式动画效果(可选) | | **drawLifeCycle** | **IDrawLifeCycle** | **用户自定义实现绘制方案(可选)** | 其他参数只需要在ImageKnifeOption对象上按需添加即可。 @@ -311,7 +308,7 @@ export default class MyAbilityStage extends AbilityStage { 下面我们会着重指导用户如何复用图片加载逻辑,重构自定义组件ImageKnifeComponent。 -首先我们先看看RequestOption构建的内容,如下表格所示: +首先我们先看看RequestOption构建的内容,如下所示: ### 数据加载 @@ -482,7 +479,7 @@ request.skipMemoryCache(true) /entry/src/ - main/ets/MainAbility - pages # 测试page页面列表 - - basicTestFeatureAbilityPage.ets # 测试元能力 + - basicTestFeatureAbilityPage.ets # 测试列表加载 - basicTestFileIOPage.ets # 测试fileio - basicTestMediaImage.ets # 测试媒体image - basicTestResourceManagerPage.ets # 测试本地资源解析 diff --git a/imageknife/package.json b/imageknife/package.json index 1615a48..40edd3c 100644 --- a/imageknife/package.json +++ b/imageknife/package.json @@ -12,7 +12,7 @@ }, "main": "index.ets", "repository": "https://gitee.com/openharmony-tpc/ImageKnife", - "version": "1.0.4", + "version": "1.0.5", "dependencies": { "pako": "^1.0.5", "js-binary-schema-parser": "^2.0.3", diff --git a/imageknife/src/main/ets/components/imageknife/utils/LogUtil.ets b/imageknife/src/main/ets/components/imageknife/utils/LogUtil.ets index 28419f6..21add41 100644 --- a/imageknife/src/main/ets/components/imageknife/utils/LogUtil.ets +++ b/imageknife/src/main/ets/components/imageknife/utils/LogUtil.ets @@ -1,3 +1,17 @@ +/* + * 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. + */ export class LogUtil { public static isDebug = false;