Java 类com.squareup.picasso.UrlConnectionDownloader 实例源码

项目:photo-paper    文件:Cache.java   
public static Downloader createCacheDownloader(Context context) {
    try {
        Class.forName("com.squareup.okhttp.OkHttpClient");
        File cacheDir = createDefaultCacheDir(context, CACHE_PATH);
        long cacheSize = calculateDiskCacheSize(cacheDir);
        return new OkHttpDownloader(cacheDir, cacheSize);
    } catch (ClassNotFoundException e) {
        return new UrlConnectionDownloader(context);
    }
}
项目:android-gluten    文件:TracedPicassoDownloader.java   
private static Downloader createDefaultDownloader(Context context) {
  try {
    Class.forName("com.squareup.okhttp.OkHttpClient");
    return OkHttpLoaderCreator.create(context);
  } catch (ClassNotFoundException e) {
    return new UrlConnectionDownloader(context);
  }
}
项目:MyAnimeViewer    文件:ImageLoaderManager.java   
private void initPicasso() {
    mPicasso = new Picasso.Builder(mContext)
            .downloader(new UrlConnectionDownloader(mContext))
            .loggingEnabled(WriteLog.IsEnabled())
            .build();
}