com.bumptech.glide
Class GlideBuilder

java.lang.Object
  extended by com.bumptech.glide.GlideBuilder

public class GlideBuilder
extends Object

A builder class for setting default structural classes for Glide to use.


Constructor Summary
GlideBuilder(Context context)
           
 
Method Summary
 GlideBuilder setBitmapPool(BitmapPool bitmapPool)
          Sets the BitmapPool implementation to use to store and retrieve reused Bitmaps.
 GlideBuilder setDecodeFormat(DecodeFormat decodeFormat)
          Sets the DecodeFormat that will be the default format for all the default decoders that can change the Bitmap.Config of the Bitmaps they decode.
 GlideBuilder setDiskCache(DiskCache.Factory diskCacheFactory)
          Sets the DiskCache.Factory implementation to use to construct the DiskCache to use to store Resource data on disk.
 GlideBuilder setDiskCache(DiskCache diskCache)
          Deprecated. Creating a disk cache directory on the main thread causes strict mode violations, use setDiskCache(com.bumptech.glide.load.engine.cache.DiskCache.Factory) instead. Scheduled to be removed in Glide 4.0.
 GlideBuilder setDiskCacheService(ExecutorService service)
          Sets the ExecutorService implementation to use when retrieving Resources that are currently in cache.
 GlideBuilder setMemoryCache(MemoryCache memoryCache)
          Sets the MemoryCache implementation to store Resources that are not currently in use.
 GlideBuilder setResizeService(ExecutorService service)
          Sets the ExecutorService implementation to use when retrieving Resources that are not already in the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlideBuilder

public GlideBuilder(Context context)
Method Detail

setBitmapPool

public GlideBuilder setBitmapPool(BitmapPool bitmapPool)
Sets the BitmapPool implementation to use to store and retrieve reused Bitmaps.

Parameters:
bitmapPool - The pool to use.
Returns:
This builder.

setMemoryCache

public GlideBuilder setMemoryCache(MemoryCache memoryCache)
Sets the MemoryCache implementation to store Resources that are not currently in use.

Parameters:
memoryCache - The cache to use.
Returns:
This builder.

setDiskCache

@Deprecated
public GlideBuilder setDiskCache(DiskCache diskCache)
Deprecated. Creating a disk cache directory on the main thread causes strict mode violations, use setDiskCache(com.bumptech.glide.load.engine.cache.DiskCache.Factory) instead. Scheduled to be removed in Glide 4.0.

Sets the DiskCache implementation to use to store Resource data and thumbnails.

Parameters:
diskCache - The disk cache to use.
Returns:
This builder.

setDiskCache

public GlideBuilder setDiskCache(DiskCache.Factory diskCacheFactory)
Sets the DiskCache.Factory implementation to use to construct the DiskCache to use to store Resource data on disk.

Parameters:
diskCacheFactory - The disk cche factory to use.
Returns:
This builder.

setResizeService

public GlideBuilder setResizeService(ExecutorService service)
Sets the ExecutorService implementation to use when retrieving Resources that are not already in the cache.

Any implementation must order requests based on their Priority for thumbnail requests to work properly.

Parameters:
service - The ExecutorService to use.
Returns:
This builder.
See Also:
setDiskCacheService(java.util.concurrent.ExecutorService), FifoPriorityThreadPoolExecutor

setDiskCacheService

public GlideBuilder setDiskCacheService(ExecutorService service)
Sets the ExecutorService implementation to use when retrieving Resources that are currently in cache.

Any implementation must order requests based on their Priority for thumbnail requests to work properly.

Parameters:
service - The ExecutorService to use.
Returns:
This builder.
See Also:
setResizeService(java.util.concurrent.ExecutorService), FifoPriorityThreadPoolExecutor

setDecodeFormat

public GlideBuilder setDecodeFormat(DecodeFormat decodeFormat)
Sets the DecodeFormat that will be the default format for all the default decoders that can change the Bitmap.Config of the Bitmaps they decode.

Decode format is always a suggestion, not a requirement. See DecodeFormat for more details.

If you instantiate and use a custom decoder, it will use DecodeFormat.DEFAULT as its default.

Calls to this method are ignored on KitKat and Lollipop. See #301.

Parameters:
decodeFormat - The format to use.
Returns:
This builder.