private void initImageLoader() { if (!ImageLoader.getInstance().isInited()) { DisplayImageOptions.Builder displayBuilder = new DisplayImageOptions.Builder(); displayBuilder.cacheInMemory(true); displayBuilder.cacheOnDisk(true); displayBuilder.showImageOnLoading(com.ns.mutiphotochoser.R.drawable.default_photo); displayBuilder.showImageForEmptyUri(com.ns.mutiphotochoser.R.drawable.default_photo); displayBuilder.considerExifParams(true); displayBuilder.bitmapConfig(Bitmap.Config.RGB_565); displayBuilder.imageScaleType(ImageScaleType.EXACTLY); displayBuilder.displayer(new FadeInBitmapDisplayer(300)); ImageLoaderConfiguration.Builder loaderBuilder = new ImageLoaderConfiguration.Builder(getApplication()); loaderBuilder.defaultDisplayImageOptions(displayBuilder.build()); loaderBuilder.memoryCacheSize(getMemoryCacheSize()); try { File cacheDir = new File(getExternalCacheDir() + File.separator + CacheConstant.IMAGE_CACHE_DIRECTORY); loaderBuilder.diskCache(new LruDiscCache(cacheDir, DefaultConfigurationFactory.createFileNameGenerator(), 500 * 1024 * 1024)); } catch (IOException e) { e.printStackTrace(); } ImageLoader.getInstance().init(loaderBuilder.build()); } }
private void initImageLoader() { if (options == null) { DisplayImageOptions.Builder displayBuilder = new DisplayImageOptions.Builder(); displayBuilder.cacheInMemory(true); displayBuilder.cacheOnDisk(true); displayBuilder.showImageOnLoading(R.drawable.default_photo); displayBuilder.showImageForEmptyUri(R.drawable.default_photo); displayBuilder.considerExifParams(true); displayBuilder.bitmapConfig(Bitmap.Config.RGB_565); displayBuilder.imageScaleType(ImageScaleType.EXACTLY); displayBuilder.displayer(new FadeInBitmapDisplayer(300)); options = displayBuilder.build(); } if (!ImageLoader.getInstance().isInited()) { ImageLoaderConfiguration.Builder loaderBuilder = new ImageLoaderConfiguration.Builder(getApplication()); loaderBuilder.memoryCacheSize(getMemoryCacheSize()); try { File cacheDir = new File(getExternalCacheDir() + File.separator + CacheConstant.IMAGE_CACHE_DIRECTORY); loaderBuilder.diskCache(new LruDiscCache(cacheDir, DefaultConfigurationFactory.createFileNameGenerator(), 500 * 1024 * 1024)); } catch (IOException e) { e.printStackTrace(); } ImageLoader.getInstance().init(loaderBuilder.build()); } }
public LimitedAgeDiscCache(File cacheDir, long maxAge) { this(cacheDir, null, DefaultConfigurationFactory.createFileNameGenerator(), maxAge); }
public LimitedAgeDiscCache(File cacheDir, File reserveCacheDir, long maxAge) { this(cacheDir, reserveCacheDir, DefaultConfigurationFactory.createFileNameGenerator(), maxAge); }
public BaseDiscCache(File cacheDir, File reserveCacheDir) { this(cacheDir, reserveCacheDir, DefaultConfigurationFactory.createFileNameGenerator()); }
public LimitedAgeDiskCache(File cacheDir, long maxAge) { this(cacheDir, null, DefaultConfigurationFactory.createFileNameGenerator(), maxAge); }
public LimitedAgeDiskCache(File cacheDir, File reserveCacheDir, long maxAge) { this(cacheDir, reserveCacheDir, DefaultConfigurationFactory.createFileNameGenerator(), maxAge); }
public BaseDiskCache(File cacheDir, File reserveCacheDir) { this(cacheDir, reserveCacheDir, DefaultConfigurationFactory.createFileNameGenerator()); }
public LimitedAgeDiscCache(File file, long l) { this(file, null, DefaultConfigurationFactory.createFileNameGenerator(), l); }
public LimitedAgeDiscCache(File file, File file1, long l) { this(file, file1, DefaultConfigurationFactory.createFileNameGenerator(), l); }
public BaseDiscCache(File file, File file1) { this(file, file1, DefaultConfigurationFactory.createFileNameGenerator()); }
public BaseDiscCache(File cacheDir) { this(cacheDir, DefaultConfigurationFactory.createFileNameGenerator()); }
/** @param cacheDir Directory for file caching */ public UnlimitedDiscCache(File cacheDir) { this(cacheDir, DefaultConfigurationFactory.createFileNameGenerator()); }
/** * @param cacheDir Directory for file caching * @param maxAge Max file age (in seconds). If file age will exceed this value then it'll be removed on next * treatment (and therefore be reloaded). */ public LimitedAgeDiskCache(File cacheDir, long maxAge) { this(cacheDir, null, DefaultConfigurationFactory.createFileNameGenerator(), maxAge); }
/** * @param cacheDir Directory for file caching * @param maxAge Max file age (in seconds). If file age will exceed this value then it'll be removed on next * treatment (and therefore be reloaded). */ public LimitedAgeDiskCache(File cacheDir, File reserveCacheDir, long maxAge) { this(cacheDir, reserveCacheDir, DefaultConfigurationFactory.createFileNameGenerator(), maxAge); }
/** * @param cacheDir Directory for file caching * @param reserveCacheDir null-ok; Reserve directory for file caching. It's used when the primary directory isn't available. */ public BaseDiskCache(File cacheDir, File reserveCacheDir) { this(cacheDir, reserveCacheDir, DefaultConfigurationFactory.createFileNameGenerator()); }
/** * @param cacheDir Directory for file caching * @param maxAge Max file age (in seconds). If file age will exceed this value then it'll be removed on next * treatment (and therefore be reloaded). */ public LimitedAgeDiscCache(File cacheDir, long maxAge) { this(cacheDir, null, DefaultConfigurationFactory.createFileNameGenerator(), maxAge); }
/** * @param cacheDir Directory for file caching * @param maxAge Max file age (in seconds). If file age will exceed this value then it'll be removed on next * treatment (and therefore be reloaded). */ public LimitedAgeDiscCache(File cacheDir, File reserveCacheDir, long maxAge) { this(cacheDir, reserveCacheDir, DefaultConfigurationFactory.createFileNameGenerator(), maxAge); }
/** * @param cacheDir Directory for file caching * @param reserveCacheDir null-ok; Reserve directory for file caching. It's used when the primary directory isn't available. */ public BaseDiscCache(File cacheDir, File reserveCacheDir) { this(cacheDir, reserveCacheDir, DefaultConfigurationFactory.createFileNameGenerator()); }