Skip to content

Commit 62ada07

Browse files
committed
添加占位图全局配置
1 parent 47e76dd commit 62ada07

File tree

1 file changed

+29
-31
lines changed

1 file changed

+29
-31
lines changed

README.md

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,35 @@
6161
```
6262

6363
![](https://files.catbox.moe/f27rwx.gif)
64+
## Api总览
65+
66+
67+
| `load: Any?` | 加载资源 |
68+
| ------------------------------------------------------------ | ------------------------------------------------------------ |
69+
| `with: Any?` | Glide.with( )参数,默认用ImageView |
70+
| `placeHolderResId: Int` | 占位图 资源id |
71+
| `placeHolderDrawable: Drawable?` | 占位图 drawable |
72+
| `errorResId: Int` | 错误图 资源id |
73+
| `errorDrawable: Drawable?` | 错误图 drawable |
74+
| `skipMemoryCache: Boolean = false` | 跳过内存缓存 |
75+
| `diskCacheStrategy: ImageOptions.DiskCache` | 磁盘缓存策略 |
76+
| `priority: ImageOptions.LoadPriority` | 加载优先级 |
77+
| `thumbnail: Float = 0f` | 缩略图 缩略系数 |
78+
| ` thumbnailUrl: Any? = null` | 缩略图 url、File等 |
79+
| `size: ImageOptions.OverrideSize?` | override |
80+
| `isAnim: Boolean = true` | 动画 gif动图支持 |
81+
| `isCrossFade: Boolean = false` | crossFade |
82+
| `isCircle: Boolean = false` | 圆形头像 |
83+
| `isGray: Boolean = false` | 黑白图像 |
84+
| `isFitCenter: Boolean = false` | FitCenter |
85+
| `centerCrop: Boolean = false` | centerCrop |
86+
| `format: Bitmap.Config? = null` | 输出图像模式 |
87+
| `borderWidth: Int = 0, borderColor: Int = 0` | 边框宽度,边框颜色 |
88+
| `isBlur: Boolean = false, blurRadius: Int = 25, blurSampling: Int = 4` | 高斯模糊,模糊半径和图像缩放倍数(倍数越高处理速度越快,图像越不清晰) |
89+
| `isRoundedCorners: Boolean = false, roundRadius: Int = 0, cornerType: ImageOptions.CornerType` | 圆角,圆角弧度,圆角模式,单角、对角、四角 |
90+
| `vararg transformation: Transformation<Bitmap>` | 转换器,支持圆角、黑白等和其他自定义 |
91+
| `onProgressListener: OnProgressListener? = null` | 网络资源进度监听,仅网络资源有效 |
92+
| `requestListener: OnImageListener?` | 加载结果监听,成功和失败 |
6493

6594
## 封装实现
6695

@@ -245,37 +274,6 @@ iv_8.load(url2, height = 800)
245274
- Android图片加载库常见的只有几种,其他库可以自行参考实现。Kotlin真香!!!
246275

247276

248-
## Api介绍
249-
250-
251-
| `load: Any?` | 加载资源 |
252-
| ------------------------------------------------------------ | ------------------------------------------------------------ |
253-
| `with: Any?` | Glide.with( )参数,默认用ImageView |
254-
| `placeHolderResId: Int` | 占位图 资源id |
255-
| `placeHolderDrawable: Drawable?` | 占位图 drawable |
256-
| `errorResId: Int` | 错误图 资源id |
257-
| `errorDrawable: Drawable?` | 错误图 drawable |
258-
| `skipMemoryCache: Boolean = false` | 跳过内存缓存 |
259-
| `diskCacheStrategy: ImageOptions.DiskCache` | 磁盘缓存策略 |
260-
| `priority: ImageOptions.LoadPriority` | 加载优先级 |
261-
| `thumbnail: Float = 0f` | 缩略图 缩略系数 |
262-
| ` thumbnailUrl: Any? = null` | 缩略图 url、File等 |
263-
| `size: ImageOptions.OverrideSize?` | override |
264-
| `isAnim: Boolean = true` | 动画 gif动图支持 |
265-
| `isCrossFade: Boolean = false` | crossFade |
266-
| `isCircle: Boolean = false` | 圆形头像 |
267-
| `isGray: Boolean = false` | 黑白图像 |
268-
| `isFitCenter: Boolean = false` | FitCenter |
269-
| `centerCrop: Boolean = false` | centerCrop |
270-
| `format: Bitmap.Config? = null` | 输出图像模式 |
271-
| `borderWidth: Int = 0, borderColor: Int = 0` | 边框宽度,边框颜色 |
272-
| `isBlur: Boolean = false, blurRadius: Int = 25, blurSampling: Int = 4` | 高斯模糊,模糊半径和图像缩放倍数(倍数越高处理速度越快,图像越不清晰) |
273-
| `isRoundedCorners: Boolean = false, roundRadius: Int = 0, cornerType: ImageOptions.CornerType` | 圆角,圆角弧度,圆角模式,单角、对角、四角 |
274-
| `vararg transformation: Transformation<Bitmap>` | 转换器,支持圆角、黑白等和其他自定义 |
275-
| `onProgressListener: OnProgressListener? = null` | 网络资源进度监听,仅网络资源有效 |
276-
| `requestListener: OnImageListener?` | 加载结果监听,成功和失败 |
277-
278-
279277
## CircleProgressView 仿微博图片加载
280278
就是原封不动来自[GlideImageView](https://github.com/sunfusheng/GlideImageView) ,在布局中加入即可,有三种样式可供选择。
281279
```xml

0 commit comments

Comments
 (0)