Skip to content

Instantly share code, notes, and snippets.

@Ansh1234
Last active January 2, 2018 17:31
Show Gist options
  • Save Ansh1234/71895bbd1ea6d6d060a41b649adfcbdf to your computer and use it in GitHub Desktop.
Save Ansh1234/71895bbd1ea6d6d060a41b649adfcbdf to your computer and use it in GitHub Desktop.
public Picasso build() {
Context context = this.context;
if (downloader == null) {
downloader = new OkHttp3Downloader(context);
}
if (cache == null) {
cache = new LruCache(context);
}
if (service == null) {
service = new PicassoExecutorService();
}
if (transformer == null) {
transformer = RequestTransformer.IDENTITY;
}
Stats stats = new Stats(cache);
Dispatcher dispatcher = new Dispatcher(context, service, HANDLER, downloader, cache, stats);
return new Picasso(context, dispatcher, cache, listener, transformer, requestHandlers, stats,
defaultBitmapConfig, indicatorsEnabled, loggingEnabled);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment