com.nostra13.universalimageloader.core.DefaultConfigurationFactory Java Examples

The following examples show how to use com.nostra13.universalimageloader.core.DefaultConfigurationFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainActivity.java    From MutiPhotoChoser with Mozilla Public License 2.0 6 votes vote down vote up
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());
    }

}
 
Example #2
Source File: GalleryActivity.java    From MutiPhotoChoser with Mozilla Public License 2.0 5 votes vote down vote up
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());
    }

}
 
Example #3
Source File: LimitedAgeDiscCache.java    From letv with Apache License 2.0 4 votes vote down vote up
public LimitedAgeDiscCache(File cacheDir, long maxAge) {
    this(cacheDir, null, DefaultConfigurationFactory.createFileNameGenerator(), maxAge);
}
 
Example #4
Source File: LimitedAgeDiscCache.java    From letv with Apache License 2.0 4 votes vote down vote up
public LimitedAgeDiscCache(File cacheDir, File reserveCacheDir, long maxAge) {
    this(cacheDir, reserveCacheDir, DefaultConfigurationFactory.createFileNameGenerator(), maxAge);
}
 
Example #5
Source File: BaseDiscCache.java    From letv with Apache License 2.0 4 votes vote down vote up
public BaseDiscCache(File cacheDir, File reserveCacheDir) {
    this(cacheDir, reserveCacheDir, DefaultConfigurationFactory.createFileNameGenerator());
}
 
Example #6
Source File: BaseDiscCache.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public BaseDiscCache(File file, File file1)
{
    this(file, file1, DefaultConfigurationFactory.createFileNameGenerator());
}
 
Example #7
Source File: LimitedAgeDiscCache.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public LimitedAgeDiscCache(File file, File file1, long l)
{
    this(file, file1, DefaultConfigurationFactory.createFileNameGenerator(), l);
}
 
Example #8
Source File: LimitedAgeDiscCache.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public LimitedAgeDiscCache(File file, long l)
{
    this(file, null, DefaultConfigurationFactory.createFileNameGenerator(), l);
}
 
Example #9
Source File: LimitedAgeDiskCache.java    From WliveTV with Apache License 2.0 2 votes vote down vote up
/**
 * @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);
}
 
Example #10
Source File: BaseDiscCache.java    From android-open-project-demo with Apache License 2.0 2 votes vote down vote up
/**
 * @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());
}
 
Example #11
Source File: LimitedAgeDiscCache.java    From android-open-project-demo with Apache License 2.0 2 votes vote down vote up
/**
 * @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);
}
 
Example #12
Source File: LimitedAgeDiscCache.java    From android-open-project-demo with Apache License 2.0 2 votes vote down vote up
/**
 * @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);
}
 
Example #13
Source File: BaseDiskCache.java    From Android-Universal-Image-Loader-Modify with Apache License 2.0 2 votes vote down vote up
/**
 * 构造方法   传入缓存文件夹 以及备用缓存文件夹
 * @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());
}
 
Example #14
Source File: LimitedAgeDiskCache.java    From Android-Universal-Image-Loader-Modify with Apache License 2.0 2 votes vote down vote up
/**
 * 构造器   需要传入缓存文件夹,备用缓存文件夹,以及最大的缓存时间
 * @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);
}
 
Example #15
Source File: LimitedAgeDiskCache.java    From Android-Universal-Image-Loader-Modify with Apache License 2.0 2 votes vote down vote up
/**
 * 构造器  需要传入文件的最大缓存时间
 * @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);
}
 
Example #16
Source File: BaseDiskCache.java    From WliveTV with Apache License 2.0 2 votes vote down vote up
/**
 * @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());
}
 
Example #17
Source File: LimitedAgeDiskCache.java    From candybar with Apache License 2.0 2 votes vote down vote up
/**
 * @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);
}
 
Example #18
Source File: LimitedAgeDiskCache.java    From WliveTV with Apache License 2.0 2 votes vote down vote up
/**
 * @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);
}
 
Example #19
Source File: BaseDiskCache.java    From BigApp_WordPress_Android with Apache License 2.0 2 votes vote down vote up
/**
 * @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());
}
 
Example #20
Source File: LimitedAgeDiskCache.java    From BigApp_WordPress_Android with Apache License 2.0 2 votes vote down vote up
/**
 * @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);
}
 
Example #21
Source File: LimitedAgeDiskCache.java    From BigApp_WordPress_Android with Apache License 2.0 2 votes vote down vote up
/**
 * @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);
}
 
Example #22
Source File: BaseDiscCache.java    From mobile-manager-tool with MIT License 2 votes vote down vote up
/**
 * @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());
}
 
Example #23
Source File: LimitedAgeDiscCache.java    From mobile-manager-tool with MIT License 2 votes vote down vote up
/**
 * @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);
}
 
Example #24
Source File: LimitedAgeDiscCache.java    From mobile-manager-tool with MIT License 2 votes vote down vote up
/**
 * @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);
}
 
Example #25
Source File: BaseDiskCache.java    From candybar with Apache License 2.0 2 votes vote down vote up
/**
 * @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());
}
 
Example #26
Source File: LimitedAgeDiskCache.java    From candybar with Apache License 2.0 2 votes vote down vote up
/**
 * @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);
}