Skip to content

Latest commit

 

History

History
85 lines (63 loc) · 2.37 KB

README_EN.md

File metadata and controls

85 lines (63 loc) · 2.37 KB

Doodle

Maven Central中文文档

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.

Getting Start

Download

implementation 'io.github.billywei01:doodle:2.1.6'

Global Config

Doodle.config()
    .setLogger(Logger)
    .setExecutor(IOExecutor)
    .setHttpSourceFetcher(OkHttpSourceFetcher)
    .addAnimatedDecoders(GifDecoder)

Any option in the global configuration is optional

Image Loading

  1. Load image to View (ImageView or custom View)
Doodle.load(path).into(view)
  1. 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
    }
});
  1. Get bitmap
Bitmap bitmap = Doodle.load(path).get()
  1. 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.

License

See the LICENSE file for license rights and limitations.