public static class ImageLoaderConfiguration.Builder extends Object
ImageLoaderConfiguration
限定符和类型 | 字段和说明 |
---|---|
static QueueProcessingType |
DEFAULT_TASK_PROCESSING_TYPE |
static int |
DEFAULT_THREAD_POOL_SIZE
3
|
static int |
DEFAULT_THREAD_PRIORITY
3
|
构造器和说明 |
---|
Builder(android.content.Context context) |
限定符和类型 | 方法和说明 |
---|---|
ImageLoaderConfiguration |
build()
Builds configured
ImageLoaderConfiguration object |
ImageLoaderConfiguration.Builder |
defaultDisplayImageOptions(DisplayImageOptions defaultDisplayImageOptions)
Sets default display image options for image displaying.
|
ImageLoaderConfiguration.Builder |
denyCacheImageMultipleSizesInMemory()
When you display an image in a small
ImageView and later you try to display
this image (from identical URI) in a larger ImageView so decoded image of
bigger size will be cached in memory as a previous decoded image of smaller size. |
ImageLoaderConfiguration.Builder |
discCache(DiskCache diskCache)
|
ImageLoaderConfiguration.Builder |
discCacheExtraOptions(int maxImageWidthForDiskCache,
int maxImageHeightForDiskCache,
BitmapProcessor processorForDiskCache)
已过时。
Use
diskCacheExtraOptions(int, int, BitmapProcessor)
instead |
ImageLoaderConfiguration.Builder |
discCacheFileCount(int maxFileCount)
已过时。
Use
diskCacheFileCount(int) instead |
ImageLoaderConfiguration.Builder |
discCacheFileNameGenerator(FileNameGenerator fileNameGenerator)
|
ImageLoaderConfiguration.Builder |
discCacheSize(int maxCacheSize)
已过时。
Use
diskCacheSize(int) instead |
ImageLoaderConfiguration.Builder |
diskCache(DiskCache diskCache)
Sets disk cache for images.
|
ImageLoaderConfiguration.Builder |
diskCacheExtraOptions(int maxImageWidthForDiskCache,
int maxImageHeightForDiskCache,
BitmapProcessor processorForDiskCache)
Sets options for resizing/compressing of downloaded images before saving to disk cache.
|
ImageLoaderConfiguration.Builder |
diskCacheFileCount(int maxFileCount)
Sets maximum file count in disk cache directory.
|
ImageLoaderConfiguration.Builder |
diskCacheFileNameGenerator(FileNameGenerator fileNameGenerator)
Sets name generator for files cached in disk cache.
|
ImageLoaderConfiguration.Builder |
diskCacheSize(int maxCacheSize)
Sets maximum disk cache size for images (in bytes).
|
ImageLoaderConfiguration.Builder |
imageDecoder(ImageDecoder imageDecoder)
Sets utility which will be responsible for decoding of image stream.
|
ImageLoaderConfiguration.Builder |
imageDownloader(ImageDownloader imageDownloader)
Sets utility which will be responsible for downloading of image.
|
ImageLoaderConfiguration.Builder |
memoryCache(MemoryCache memoryCache)
Sets memory cache for
bitmaps . |
ImageLoaderConfiguration.Builder |
memoryCacheExtraOptions(int maxImageWidthForMemoryCache,
int maxImageHeightForMemoryCache)
Sets options for memory cache
|
ImageLoaderConfiguration.Builder |
memoryCacheSize(int memoryCacheSize)
Sets maximum memory cache size for
bitmaps (in bytes). |
ImageLoaderConfiguration.Builder |
memoryCacheSizePercentage(int availableMemoryPercent)
Sets maximum memory cache size (in percent of available app memory) for
bitmaps . |
ImageLoaderConfiguration.Builder |
taskExecutor(Executor executor)
Sets custom executor for tasks of loading and displaying images.
|
ImageLoaderConfiguration.Builder |
taskExecutorForCachedImages(Executor executorForCachedImages)
Sets custom executor for tasks of displaying cached on disk images (these tasks
are executed quickly so UIL prefer to use separate executor for them).
|
ImageLoaderConfiguration.Builder |
tasksProcessingOrder(QueueProcessingType tasksProcessingType)
Sets type of queue processing for tasks for loading and displaying images.
|
ImageLoaderConfiguration.Builder |
threadPoolSize(int threadPoolSize)
Sets thread pool size for image display tasks.
|
ImageLoaderConfiguration.Builder |
threadPriority(int threadPriority)
Sets the priority for image loading threads.
|
ImageLoaderConfiguration.Builder |
writeDebugLogs()
Enables detail logging of
ImageLoader work. |
public static final int DEFAULT_THREAD_POOL_SIZE
public static final int DEFAULT_THREAD_PRIORITY
public static final QueueProcessingType DEFAULT_TASK_PROCESSING_TYPE
public ImageLoaderConfiguration.Builder memoryCacheExtraOptions(int maxImageWidthForMemoryCache, int maxImageHeightForMemoryCache)
maxImageWidthForMemoryCache
- Maximum image width which will be used for memory saving during decoding
an image to Bitmap
. Default value - device's screen widthmaxImageHeightForMemoryCache
- Maximum image height which will be used for memory saving during decoding
an image to Bitmap
. Default value - device's screen height@Deprecated public ImageLoaderConfiguration.Builder discCacheExtraOptions(int maxImageWidthForDiskCache, int maxImageHeightForDiskCache, BitmapProcessor processorForDiskCache)
diskCacheExtraOptions(int, int, BitmapProcessor)
insteadpublic ImageLoaderConfiguration.Builder diskCacheExtraOptions(int maxImageWidthForDiskCache, int maxImageHeightForDiskCache, BitmapProcessor processorForDiskCache)
maxImageWidthForDiskCache
- Maximum width of downloaded images for saving at disk cachemaxImageHeightForDiskCache
- Maximum height of downloaded images for saving at disk cacheprocessorForDiskCache
- null-ok; Bitmap processor which process images before saving them in disc cachepublic ImageLoaderConfiguration.Builder taskExecutor(Executor executor)
public ImageLoaderConfiguration.Builder taskExecutorForCachedImages(Executor executorForCachedImages)
taskExecutor(Executor)
public ImageLoaderConfiguration.Builder threadPoolSize(int threadPoolSize)
this
public ImageLoaderConfiguration.Builder threadPriority(int threadPriority)
Thread.MAX_PRIORITY
or
less than Thread.MIN_PRIORITY
this
public ImageLoaderConfiguration.Builder denyCacheImageMultipleSizesInMemory()
ImageView
and later you try to display
this image (from identical URI) in a larger ImageView
so decoded image of
bigger size will be cached in memory as a previous decoded image of smaller size.public ImageLoaderConfiguration.Builder tasksProcessingOrder(QueueProcessingType tasksProcessingType)
QueueProcessingType.FIFO
public ImageLoaderConfiguration.Builder memoryCacheSize(int memoryCacheSize)
bitmaps
(in bytes).LruMemoryCache
will be used as
memory cache. You can use memoryCache(MemoryCache)
method to set your own implementation of
MemoryCache
.public ImageLoaderConfiguration.Builder memoryCacheSizePercentage(int availableMemoryPercent)
bitmaps
.LruMemoryCache
will be used as
memory cache. You can use memoryCache(MemoryCache)
method to set your own implementation of
MemoryCache
.public ImageLoaderConfiguration.Builder memoryCache(MemoryCache memoryCache)
bitmaps
.LruMemoryCache
with limited memory cache size (size = 1/8 of available app memory)@Deprecated public ImageLoaderConfiguration.Builder discCacheSize(int maxCacheSize)
diskCacheSize(int)
insteadpublic ImageLoaderConfiguration.Builder diskCacheSize(int maxCacheSize)
LruDiskCache
will be used as disk cache. You can use diskCache(DiskCache)
method for introduction your own
implementation of DiskCache
@Deprecated public ImageLoaderConfiguration.Builder discCacheFileCount(int maxFileCount)
diskCacheFileCount(int)
insteadpublic ImageLoaderConfiguration.Builder diskCacheFileCount(int maxFileCount)
LruDiskCache
will be used as disk cache. You can use diskCache(DiskCache)
method for introduction your own
implementation of DiskCache
@Deprecated public ImageLoaderConfiguration.Builder discCacheFileNameGenerator(FileNameGenerator fileNameGenerator)
public ImageLoaderConfiguration.Builder diskCacheFileNameGenerator(FileNameGenerator fileNameGenerator)
DefaultConfigurationFactory.createFileNameGenerator()
@Deprecated public ImageLoaderConfiguration.Builder discCache(DiskCache diskCache)
public ImageLoaderConfiguration.Builder diskCache(DiskCache diskCache)
UnlimitedDiskCache
. Cache directory is defined by
StorageUtils.getCacheDirectory(Context)
.public ImageLoaderConfiguration.Builder imageDownloader(ImageDownloader imageDownloader)
DefaultConfigurationFactory.createImageDownloader()
public ImageLoaderConfiguration.Builder imageDecoder(ImageDecoder imageDecoder)
DefaultConfigurationFactory.createImageDecoder()
public ImageLoaderConfiguration.Builder defaultDisplayImageOptions(DisplayImageOptions defaultDisplayImageOptions)
Simple options
public ImageLoaderConfiguration.Builder writeDebugLogs()
ImageLoader
work. To prevent detail logs don't call this method.
Consider L.disableLogging()
to disable
ImageLoader logging completely (even error logs)public ImageLoaderConfiguration build()
ImageLoaderConfiguration
object