public static final class MemorySizeCalculator.Builder
extends java.lang.Object
MemorySizeCalculator
with reasonable defaults that can be optionally
overridden.Constructor and Description |
---|
Builder(android.content.Context context) |
Modifier and Type | Method and Description |
---|---|
MemorySizeCalculator |
build() |
MemorySizeCalculator.Builder |
setArrayPoolSize(int arrayPoolSizeBytes)
Sets the size in bytes of the
ArrayPool
to use to store temporary arrays while decoding data and returns this builder. |
MemorySizeCalculator.Builder |
setBitmapPoolScreens(float bitmapPoolScreens)
Sets the number of device screens worth of pixels the
BitmapPool should be able to hold and returns
this Builder. |
MemorySizeCalculator.Builder |
setLowMemoryMaxSizeMultiplier(float lowMemoryMaxSizeMultiplier)
Sets the maximum percentage of the device's memory class for low ram devices that can be
taken up by Glide's
MemoryCache and BitmapPool put together, and returns this
builder. |
MemorySizeCalculator.Builder |
setMaxSizeMultiplier(float maxSizeMultiplier)
Sets the maximum percentage of the device's memory class for standard devices that can be
taken up by Glide's
MemoryCache and BitmapPool put together, and returns this
builder. |
MemorySizeCalculator.Builder |
setMemoryCacheScreens(float memoryCacheScreens)
Sets the number of device screens worth of pixels the
MemoryCache should be able to hold and returns this
Builder. |
public MemorySizeCalculator.Builder setMemoryCacheScreens(float memoryCacheScreens)
MemoryCache
should be able to hold and returns this
Builder.public MemorySizeCalculator.Builder setBitmapPoolScreens(float bitmapPoolScreens)
BitmapPool
should be able to hold and returns
this Builder.public MemorySizeCalculator.Builder setMaxSizeMultiplier(float maxSizeMultiplier)
MemoryCache
and BitmapPool
put together, and returns this
builder.public MemorySizeCalculator.Builder setLowMemoryMaxSizeMultiplier(float lowMemoryMaxSizeMultiplier)
MemoryCache
and BitmapPool
put together, and returns this
builder.ActivityManager.isLowRamDevice()
public MemorySizeCalculator.Builder setArrayPoolSize(int arrayPoolSizeBytes)
ArrayPool
to use to store temporary arrays while decoding data and returns this builder.
This number will be halved on low memory devices that return true
from ActivityManager.isLowRamDevice()
.
public MemorySizeCalculator build()