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