本文整理了Java中com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache类的一些代码示例,展示了UnlimitedDiskCache类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UnlimitedDiskCache类的具体详情如下:包路径:com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache类名称:UnlimitedDiskCache
UnlimitedDiskCache介绍
[英]Default implementation of com.nostra13.universalimageloader.cache.disc.DiskCache. Cache size is unlimited.[中]com的默认实现。诺斯特拉13。universalimageloader。隐藏物圆盘磁盘缓存。缓存大小是无限的。
代码示例
代码示例来源:origin: nostra13/Android-Universal-Image-Loader
/** * Creates default implementation of {@link DiskCache} depends on incoming parameters */public static DiskCache createDiskCache(Context context, FileNameGenerator diskCacheFileNameGenerator, long diskCacheSize, int diskCacheFileCount) { File reserveCacheDir = createReserveDiskCacheDir(context); if (diskCacheSize > 0 || diskCacheFileCount > 0) { File individualCacheDir = StorageUtils.getIndividualCacheDirectory(context); try { return new LruDiskCache(individualCacheDir, reserveCacheDir, diskCacheFileNameGenerator, diskCacheSize, diskCacheFileCount); } catch (IOException e) { L.e(e); // continue and create unlimited cache } } File cacheDir = StorageUtils.getCacheDirectory(context); return new UnlimitedDiskCache(cacheDir, reserveCacheDir, diskCacheFileNameGenerator);}
代码示例来源:origin: stackoverflow.com
File cacheDir = StorageUtils.getCacheDirectory(context);ImageLoaderConfiguration cOnfig= new ImageLoaderConfiguration.Builder(context) .memoryCacheExtraOptions(480, 800) // default = device screen dimensions .diskCacheExtraOptions(480, 800, null) .taskExecutor(...) .taskExecutorForCachedImages(...) .threadPoolSize(3) // default .threadPriority(Thread.NORM_PRIORITY - 2) // default .tasksProcessingOrder(QueueProcessingType.FIFO) // default .denyCacheImageMultipleSizesInMemory() .memoryCache(new LruMemoryCache(2 * 1024 * 1024)) .memoryCacheSize(2 * 1024 * 1024) .memoryCacheSizePercentage(13) // default .diskCache(new UnlimitedDiskCache(cacheDir)) // default .diskCacheSize(50 * 1024 * 1024) .diskCacheFileCount(100) .diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default .imageDownloader(new BaseImageDownloader(context)) // default .imageDecoder(new BaseImageDecoder()) // default .defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default .writeDebugLogs() .build();
代码示例来源:origin: wanliyang1990/WliveTV
/** * Creates default implementation of {@link DiskCache} depends on incoming parameters */public static DiskCache createDiskCache(Context context, FileNameGenerator diskCacheFileNameGenerator, long diskCacheSize, int diskCacheFileCount) { File reserveCacheDir = createReserveDiskCacheDir(context); if (diskCacheSize > 0 || diskCacheFileCount > 0) { File individualCacheDir = StorageUtils.getIndividualCacheDirectory(context); try { return new LruDiskCache(individualCacheDir, reserveCacheDir, diskCacheFileNameGenerator, diskCacheSize, diskCacheFileCount); } catch (IOException e) { L.e(e); // continue and create unlimited cache } } File cacheDir = StorageUtils.getCacheDirectory(context); return new UnlimitedDiskCache(cacheDir, reserveCacheDir, diskCacheFileNameGenerator);}
代码示例来源:origin: com.nostra13.universalimageloader/universal-image-loader
/** * Creates default implementation of {@link DiskCache} depends on incoming parameters */public static DiskCache createDiskCache(Context context, FileNameGenerator diskCacheFileNameGenerator, long diskCacheSize, int diskCacheFileCount) { File reserveCacheDir = createReserveDiskCacheDir(context); if (diskCacheSize > 0 || diskCacheFileCount > 0) { File individualCacheDir = StorageUtils.getIndividualCacheDirectory(context); try { return new LruDiskCache(individualCacheDir, reserveCacheDir, diskCacheFileNameGenerator, diskCacheSize, diskCacheFileCount); } catch (IOException e) { L.e(e); // continue and create unlimited cache } } File cacheDir = StorageUtils.getCacheDirectory(context); return new UnlimitedDiskCache(cacheDir, reserveCacheDir, diskCacheFileNameGenerator);}
代码示例来源:origin: jiangqqlmj/Android-Universal-Image-Loader-Modify
/** * 默认图片 本地路径缓存 * Creates default implementation of {@link DiskCache} depends on incoming parameters */public static DiskCache createDiskCache(Context context, FileNameGenerator diskCacheFileNameGenerator, long diskCacheSize, int diskCacheFileCount) { //创建备用缓存文件 File reserveCacheDir = createReserveDiskCacheDir(context); if (diskCacheSize > 0 || diskCacheFileCount > 0) { File individualCacheDir = StorageUtils.getIndividualCacheDirectory(context); try { //创建本地文件系统缓存器 return new LruDiskCache(individualCacheDir, reserveCacheDir, diskCacheFileNameGenerator, diskCacheSize, diskCacheFileCount); } catch (IOException e) { L.e(e); // continue and create unlimited cache } } //创建无限制的文件缓存器 File cacheDir = StorageUtils.getCacheDirectory(context); return new UnlimitedDiskCache(cacheDir, reserveCacheDir, diskCacheFileNameGenerator);}
代码示例来源:origin: Hankkin/TaoSchool
.memoryCacheSize(2 * 1024 * 1024).memoryCacheSizePercentage(13) // default.diskCache(new UnlimitedDiskCache(file)) // default.diskCacheSize(50 * 1024 * 1024).diskCacheFileCount(1000)
代码示例来源:origin: qiushi123/VideoDemoQcl
private void initUniversalImageLoader() { DisplayImageOptions optiOns= new DisplayImageOptions.Builder() .showImageOnLoading(new ColorDrawable(Color.parseColor("#f0f0f0"))) .resetViewBeforeLoading(true) .cacheInMemory(true) .cacheOnDisk(true) .considerExifParams(true) .imageScaleType(ImageScaleType.EXACTLY_STRETCHED) .bitmapConfig(Bitmap.Config.RGB_565) .build(); int memClass = ((ActivityManager) getSystemService(Context.ACTIVITY_SERVICE)) .getMemoryClass(); int memCacheSize = 1024 * 1024 * memClass / 8; File cacheDir = new File(Environment.getExternalStorageDirectory().getPath() + "/jiecao/cache"); ImageLoaderConfiguration cOnfig= new ImageLoaderConfiguration.Builder(this) .threadPoolSize(3) .threadPriority(Thread.NORM_PRIORITY - 2) .denyCacheImageMultipleSizesInMemory() .diskCacheFileNameGenerator(new Md5FileNameGenerator()) .memoryCache(new UsingFreqLimitedMemoryCache(memCacheSize)) .memoryCacheSize(memCacheSize) .diskCacheSize(50 * 1024 * 1024) .tasksProcessingOrder(QueueProcessingType.LIFO) .diskCache(new UnlimitedDiskCache(cacheDir)) .imageDownloader(new BaseImageDownloader(this, 5 * 1000, 30 * 1000)) .defaultDisplayImageOptions(options) .build(); ImageLoader.getInstance().init(config);}
代码示例来源:origin: gaolonglong/Banner
private void initUIL() { File cacheDir = StorageUtils.getOwnCacheDirectory(this,"Banner/cache/image"); ImageLoaderConfiguration cOnfig= new ImageLoaderConfiguration.Builder(this) .memoryCache(new LruMemoryCache(2*1024*1024)) .memoryCacheSize(2*1024*1024) .diskCache(new UnlimitedDiskCache(cacheDir)) .diskCacheSize(50*1024*1024) .imageDownloader(new BaseImageDownloader(this,20*60*60,30*60*60)) .diskCacheFileCount(100) .denyCacheImageMultipleSizesInMemory() .build(); ImageLoader.getInstance().init(config); }}
代码示例来源:origin: q422013/IMChat
.discCache(new UnlimitedDiskCache(cacheDir))
代码示例来源:origin: MyLifeMyTravel/AndroidDemo
private void initUIL(Context context) { String cacheDir = Constants.PATH_CACHE_FOLDER; if (cacheDir != null) { File file = new File(cacheDir); ImageLoaderConfiguration cOnfig= new ImageLoaderConfiguration.Builder(context)// .memoryCache(new LruMemoryCache(2 * 1024 * 1024)) .memoryCache(new WeakMemoryCache()) .memoryCacheSize(5 * 1024 * 1024) .memoryCacheSizePercentage(13) // default .diskCache(new UnlimitedDiskCache(file)) // default .diskCacheSize(100 * 1024 * 1024) .diskCacheFileCount(100) .diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default .imageDownloader(new BaseImageDownloader(context)) // default .imageDecoder(new BaseImageDecoder(true)) // default .defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default .writeDebugLogs() .build(); ImageLoader.getInstance().init(config); } }
代码示例来源:origin: xiangyunwan/ImageEditor-Android-master
/** * 初始化图片载入框架 */private void initImageLoader() { File cacheDir = StorageUtils.getCacheDirectory(this); int MAXMEMOnRY= (int) (Runtime.getRuntime().maxMemory()); // System.out.println("dsa-->"+MAXMEMONRY+" "+(MAXMEMONRY/5));//.memoryCache(new // LruMemoryCache(50 * 1024 * 1024)) DisplayImageOptions defaultOptiOns= new DisplayImageOptions.Builder() .cacheInMemory(true) .cacheOnDisk(true) .build(); ImageLoaderConfiguration cOnfig= new ImageLoaderConfiguration.Builder( this).memoryCacheExtraOptions(480, 800).defaultDisplayImageOptions(defaultOptions) .diskCacheExtraOptions(480, 800, null).threadPoolSize(3) .threadPriority(Thread.NORM_PRIORITY - 2) .tasksProcessingOrder(QueueProcessingType.FIFO) .denyCacheImageMultipleSizesInMemory() .memoryCache(new LruMemoryCache(MAXMEMONRY / 5)) .diskCache(new UnlimitedDiskCache(cacheDir)) .diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default .imageDownloader(new BaseImageDownloader(this)) // default .imageDecoder(new BaseImageDecoder(false)) // default .defaultDisplayImageOptions(DisplayImageOptions.createSimple()).build(); ImageLoader.getInstance().init(config);}
代码示例来源:origin: maks/MGit
private void setupImageLoader() { DisplayImageOptions mDisplayOptiOns= new DisplayImageOptions.Builder() .cacheInMemory(true) .cacheOnDisk(true) .showImageForEmptyUri(VectorDrawableCompat.create(getResources(), R.drawable.ic_default_author, getTheme())) .showImageOnFail(VectorDrawableCompat.create(getResources(), R.drawable.ic_default_author, getTheme())) .build(); File cacheDir = StorageUtils.getCacheDirectory(this); ImageLoaderConfiguration cOnfiguration= new ImageLoaderConfiguration.Builder(this) .defaultDisplayImageOptions(mDisplayOptions) .diskCache(new UnlimitedDiskCache(cacheDir)) .diskCacheSize(SIZE) .imageDownloader(new AvatarDownloader(this)) .build(); mImageLoader = ImageLoader.getInstance(); mImageLoader.init(configuration);}
代码示例来源:origin: LiqiNew/MyUtils
.diskCache(new UnlimitedDiskCache(cacheDir))
代码示例来源:origin: bhavesh-hirpara/MultipleImagePick
ImageLoaderConfiguration.Builder builder = new ImageLoaderConfiguration.Builder( mContext).defaultDisplayImageOptions(defaultOptions) .diskCache(new UnlimitedDiskCache(cacheDir)) .memoryCache(new WeakMemoryCache());