Class MemorySizeCalculator.Builder
- java.lang.Object
-
- com.bumptech.glide.load.engine.cache.MemorySizeCalculator.Builder
-
- Enclosing class:
- MemorySizeCalculator
public static final class MemorySizeCalculator.Builder extends java.lang.ObjectConstructs anMemorySizeCalculatorwith reasonable defaults that can be optionally overridden.
-
-
Constructor Summary
Constructors Constructor Description Builder(android.content.Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MemorySizeCalculatorbuild()MemorySizeCalculator.BuildersetArrayPoolSize(int arrayPoolSizeBytes)Sets the size in bytes of theArrayPoolto use to store temporary arrays while decoding data and returns this builder.MemorySizeCalculator.BuildersetBitmapPoolScreens(float bitmapPoolScreens)Sets the number of device screens worth of pixels theBitmapPoolshould be able to hold and returns this Builder.MemorySizeCalculator.BuildersetLowMemoryMaxSizeMultiplier(float lowMemoryMaxSizeMultiplier)Sets the maximum percentage of the device's memory class for low ram devices that can be taken up by Glide'sMemoryCacheandBitmapPoolput together, and returns this builder.MemorySizeCalculator.BuildersetMaxSizeMultiplier(float maxSizeMultiplier)Sets the maximum percentage of the device's memory class for standard devices that can be taken up by Glide'sMemoryCacheandBitmapPoolput together, and returns this builder.MemorySizeCalculator.BuildersetMemoryCacheScreens(float memoryCacheScreens)Sets the number of device screens worth of pixels theMemoryCacheshould be able to hold and returns this Builder.
-
-
-
Method Detail
-
setMemoryCacheScreens
public MemorySizeCalculator.Builder setMemoryCacheScreens(float memoryCacheScreens)
Sets the number of device screens worth of pixels theMemoryCacheshould be able to hold and returns this Builder.
-
setBitmapPoolScreens
public MemorySizeCalculator.Builder setBitmapPoolScreens(float bitmapPoolScreens)
Sets the number of device screens worth of pixels theBitmapPoolshould be able to hold and returns this Builder.
-
setMaxSizeMultiplier
public 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'sMemoryCacheandBitmapPoolput together, and returns this builder.
-
setLowMemoryMaxSizeMultiplier
public 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'sMemoryCacheandBitmapPoolput together, and returns this builder.- See Also:
ActivityManager.isLowRamDevice()
-
setArrayPoolSize
public MemorySizeCalculator.Builder setArrayPoolSize(int arrayPoolSizeBytes)
Sets the size in bytes of theArrayPoolto use to store temporary arrays while decoding data and returns this builder.This number will be halved on low memory devices that return
truefromActivityManager.isLowRamDevice().
-
build
public MemorySizeCalculator build()
-
-