public class GlideBuilder extends Object
Constructor and Description |
---|
GlideBuilder(Context context) |
Modifier and Type | Method and Description |
---|---|
GlideBuilder |
setBitmapPool(BitmapPool bitmapPool)
Sets the
BitmapPool implementation to use to store and
retrieve reused Bitmap s. |
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 Bitmap s 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
Resource s that are currently in cache. |
GlideBuilder |
setMemoryCache(MemoryCache memoryCache)
Sets the
MemoryCache implementation to store
Resource s that are not currently in use. |
GlideBuilder |
setResizeService(ExecutorService service)
Sets the
ExecutorService implementation to use when retrieving
Resource s that are not already in the cache. |
public GlideBuilder(Context context)
public GlideBuilder setBitmapPool(BitmapPool bitmapPool)
BitmapPool
implementation to use to store and
retrieve reused Bitmap
s.bitmapPool
- The pool to use.public GlideBuilder setMemoryCache(MemoryCache memoryCache)
MemoryCache
implementation to store
Resource
s that are not currently in use.memoryCache
- The cache to use.@Deprecated public GlideBuilder setDiskCache(DiskCache diskCache)
setDiskCache(com.bumptech.glide.load.engine.cache.DiskCache.Factory)
instead. Scheduled to be removed
in Glide 4.0.diskCache
- The disk cache to use.public GlideBuilder setDiskCache(DiskCache.Factory diskCacheFactory)
DiskCache.Factory
implementation to use to construct
the DiskCache
to use to store
Resource
data on disk.diskCacheFactory
- The disk cche factory to use.public GlideBuilder setResizeService(ExecutorService service)
ExecutorService
implementation to use when retrieving
Resource
s that are not already in the cache.
Any implementation must order requests based on their Priority
for thumbnail
requests to work properly.
service
- The ExecutorService to use.setDiskCacheService(java.util.concurrent.ExecutorService)
,
FifoPriorityThreadPoolExecutor
public GlideBuilder setDiskCacheService(ExecutorService service)
ExecutorService
implementation to use when retrieving
Resource
s that are currently in cache.
Any implementation must order requests based on their Priority
for thumbnail
requests to work properly.
service
- The ExecutorService to use.setResizeService(java.util.concurrent.ExecutorService)
,
FifoPriorityThreadPoolExecutor
public GlideBuilder setDecodeFormat(DecodeFormat decodeFormat)
DecodeFormat
that will be the default format for all the default
decoders that can change the Bitmap.Config
of the Bitmap
s 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.
decodeFormat
- The format to use.