A lightweight, efficient and powerful image loading library for Android
| English
Doodle是一个轻量,高效,功能丰富的图片加载库。
Doodle依赖包仅94K,远小于Glide等其他加载库,实现了绝大部分Glide所支持的功能。
Doodle不依赖第三方库,不需要注解和配置混淆,开箱即用。
Doodle实现的功能包括但不限于以下列表:
BitmapFactory本身可以解码JPG, PNG, WEBP,静态GIF等图片格式,高版本Android还支持HEIF格式。
通过自定义解码,可以实现处理任意格式的文件。
本项目的测试用例中实现了动态GIF, SVG, PAG以及动态WEBP等格式的解码。
implementation 'io.github.billywei01:doodle:2.1.6'
Doodle.config()
.setLogger(Logger)
.setExecutor(IOExecutor)
.setHttpSourceFetcher(OkHttpSourceFetcher)
.addAnimatedDecoders(GifDecoder)
全局配置中的各个选项都是可选的(可以不设置)。
Doodle.load(path).into(view)
Doodle.load(path).into(result -> {
if (result instanceof Bitmap) {
// handle bitmap
} else if (result instanceof Drawable) {
// handle drawable
} else {
// handle result with other type or null
}
});
Bitmap bitmap = Doodle.load(path).get()
Doodle.load(path).preload()
Doodle加载图片,从load()方法开始,到into(), get() 或者 preload()方法结束。
在into()/get()/preload()之前,可以添加更多的参数。
具体可以查看API获取更多详情。
https://juejin.cn/post/6844903695902064653
See the LICENSE file for license rights and limitations.