java类com.squareup.picasso.UrlConnectionDownloader的实例源码

Cache.java 文件源码 项目:photo-paper 阅读 19 收藏 0 点赞 0 评论 0
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);
    }
}
TracedPicassoDownloader.java 文件源码 项目:android-gluten 阅读 20 收藏 0 点赞 0 评论 0
private static Downloader createDefaultDownloader(Context context) {
  try {
    Class.forName("com.squareup.okhttp.OkHttpClient");
    return OkHttpLoaderCreator.create(context);
  } catch (ClassNotFoundException e) {
    return new UrlConnectionDownloader(context);
  }
}
ImageLoaderManager.java 文件源码 项目:MyAnimeViewer 阅读 21 收藏 0 点赞 0 评论 0
private void initPicasso() {
    mPicasso = new Picasso.Builder(mContext)
            .downloader(new UrlConnectionDownloader(mContext))
            .loggingEnabled(WriteLog.IsEnabled())
            .build();
}


问题


面经


文章

微信
公众号

扫码关注公众号