Skip to content
nostra13 edited this page Jan 20, 2013 · 9 revisions

ImageLoader Configuration (ImageLoaderConfiguration) is global for application. You should set it once.

All options in Configuration builder are optional. Use only those you really want to customize.
See default values for config options in Java docs for every option.

// DON'T COPY THIS CODE TO YOUR PROJECT! This is just example of ALL options using.
File cacheDir = StorageUtils.getCacheDirectory(context);
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
		.memoryCacheExtraOptions(480, 800) // default = device screen dimensions
		.discCacheExtraOptions(480, 800, CompressFormat.JPEG, 75)
		.threadPoolSize(3) // default
		.threadPriority(Thread.NORM_PRIORITY - 1) // default
		.denyCacheImageMultipleSizesInMemory()
		.offOutOfMemoryHandling()
		.memoryCache(new UsingFreqLimitedMemoryCache(2 * 1024 * 1024)) // default
		.discCache(new UnlimitedDiscCache(cacheDir)) // default
		.discCacheSize(50 * 1024 * 1024)
		.discCacheFileCount(100)
		.discCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
		.imageDownloader(new URLConnectionImageDownloader()) // default
		.tasksProcessingOrder(QueueProcessingType.FIFO) // default
		.defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default
		.enableLogging()
		.build();
Clone this wiki locally