|中文文档
Doodle is a lightweight, efficient and powerful image loading library for Android.
Doodle's aar package is only 94K, much smaller than Glide/Fresco.
Doodle is not depend on third-party libraries, not require annotations , no need to configure proguard obfuscation.
In brief, It's easy to use.
The functions implemented by Doodle include but are not limited to the following list:
- Support loading images with File, Uri, Resource(raw/drawable), assets, http, etc.
- Support static images, animated images, and taking video frames.
- Support the acceleration of loading media thumbnails.
- Support custom data loading.
- Support custom decoding.
- Support applying result to custom view.
- Support custom transformation.
- Support observing lifecycle of activity to take actions (For example: Canceling the loading when the activity destroyed).
- Support pause/resume loading.
- Support disk cache (including source cache and result cache).
- Support memory cache (including LRU cache and weak reference cache).
- Support setting placeholder and animations.
- Supports down-sampling/up-sampling, clipping.
implementation 'io.github.billywei01:doodle:2.1.6'
Doodle.config()
.setLogger(Logger)
.setExecutor(IOExecutor)
.setHttpSourceFetcher(OkHttpSourceFetcher)
.addAnimatedDecoders(GifDecoder)
Any option in the global configuration is optional
- Load image to View (ImageView or custom View)
Doodle.load(path).into(view)
- Get the result by callback
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
}
});
- Get bitmap
Bitmap bitmap = Doodle.load(path).get()
- Preload
Doodle.load(path).preload()
When loading images with Doodle,start from "load",end with "into", "get" or "preload".
After the "load" method, you could apply more options, check API for more details.
See the LICENSE file for license rights and limitations.