public static final class BitmapLruCache.Builder extends Object
BitmapLruCache. An example call:
BitmapLruCache.Builder builder = new BitmapLruCache.Builder(); builder.setMemoryCacheEnabled(true).setMemoryCacheMaxSizeUsingHeapSize(this); builder.setDiskCacheEnabled(true).setDiskCacheLocation(...); BitmapLruCache cache = builder.build();
| Constructor and Description |
|---|
BitmapLruCache.Builder()
Deprecated.
You should now use
Builder(Context). This is so that we can reliably
set up correctly. |
BitmapLruCache.Builder(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
BitmapLruCache |
build() |
BitmapLruCache.Builder |
setDiskCacheEnabled(boolean enabled)
Set whether the Disk Cache should be enabled.
|
BitmapLruCache.Builder |
setDiskCacheLocation(File location)
Set the Disk Cache location.
|
BitmapLruCache.Builder |
setDiskCacheMaxSize(long maxSize)
Set the maximum number of bytes the Disk Cache should use to store values.
|
BitmapLruCache.Builder |
setMemoryCacheEnabled(boolean enabled)
Set whether the Memory Cache should be enabled.
|
BitmapLruCache.Builder |
setMemoryCacheMaxSize(int size)
Set the maximum number of bytes the Memory Cache should use to store values.
|
BitmapLruCache.Builder |
setMemoryCacheMaxSizeUsingHeapSize()
Sets the Memory Cache maximum size to be the default value of % of heap size.
|
BitmapLruCache.Builder |
setMemoryCacheMaxSizeUsingHeapSize(float percentageOfHeap)
Sets the Memory Cache maximum size to be the given percentage of heap size.
|
BitmapLruCache.Builder |
setRecyclePolicy(BitmapLruCache.RecyclePolicy recyclePolicy)
Sets the recycle policy.
|
public BitmapLruCache.Builder()
Builder(Context). This is so that we can reliably
set up correctly.public BitmapLruCache.Builder(android.content.Context context)
public BitmapLruCache build()
BitmapLruCache created with the arguments supplied to this
builder.public BitmapLruCache.Builder setDiskCacheEnabled(boolean enabled)
false.public BitmapLruCache.Builder setDiskCacheLocation(File location)
public BitmapLruCache.Builder setDiskCacheMaxSize(long maxSize)
public BitmapLruCache.Builder setMemoryCacheEnabled(boolean enabled)
true.public BitmapLruCache.Builder setMemoryCacheMaxSize(int size)
public BitmapLruCache.Builder setMemoryCacheMaxSizeUsingHeapSize()
public BitmapLruCache.Builder setMemoryCacheMaxSizeUsingHeapSize(float percentageOfHeap)
percentageOfHeap - - percentage of heap size. Valid values are 0.0 <= x <= .public BitmapLruCache.Builder setRecyclePolicy(BitmapLruCache.RecyclePolicy recyclePolicy)
Bitmap.recycle() is
called.recyclePolicy - - New recycle policy, can not be null.Copyright © 2013. All Rights Reserved.