public static class DiskLruBasedCache.ImageCacheParams
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
android.graphics.Bitmap.CompressFormat |
compressFormat |
int |
compressQuality |
java.io.File |
diskCacheDir |
boolean |
diskCacheEnabled |
int |
diskCacheSize |
boolean |
initDiskCacheOnCreate |
int |
memCacheSize |
boolean |
memoryCacheEnabled |
| Constructor and Description |
|---|
DiskLruBasedCache.ImageCacheParams(android.content.Context context,
java.lang.String rootDirectory)
Create a set of image cache parameters
|
DiskLruBasedCache.ImageCacheParams(android.content.Context context,
java.lang.String rootDirectory,
int maxCacheSizeInBytes)
Create a set of image cache parameters
|
DiskLruBasedCache.ImageCacheParams(java.io.File rootDirectory)
Create a set of image cache parameters
|
DiskLruBasedCache.ImageCacheParams(java.io.File rootDirectory,
int maxCacheSizeInBytes)
Create a set of image cache parameters that can be provided to
|
| Modifier and Type | Method and Description |
|---|---|
void |
setMemCacheSizePercent(float percent)
Sets the memory cache size based on a percentage of the max available VM memory.
|
public int memCacheSize
public int diskCacheSize
public java.io.File diskCacheDir
public android.graphics.Bitmap.CompressFormat compressFormat
public int compressQuality
public boolean memoryCacheEnabled
public boolean diskCacheEnabled
public boolean initDiskCacheOnCreate
public DiskLruBasedCache.ImageCacheParams(java.io.File rootDirectory,
int maxCacheSizeInBytes)
maxCacheSizeInBytes - cache size in bytes.public DiskLruBasedCache.ImageCacheParams(android.content.Context context,
java.lang.String rootDirectory,
int maxCacheSizeInBytes)
context - A context to use.rootDirectory - A unique subdirectory name that will be appended to the
application cache directory. Usually "cache" or "images"
is sufficient.maxCacheSizeInBytes - cache size in bytes.public DiskLruBasedCache.ImageCacheParams(android.content.Context context,
java.lang.String rootDirectory)
context - A context to use.rootDirectory - A unique subdirectory name that will be appended to the
application cache directory. Usually "cache" or "images"
is sufficient.public DiskLruBasedCache.ImageCacheParams(java.io.File rootDirectory)
rootDirectory - A unique subdirectory name that will be appended to the
application cache directory. Usually "cache" or "images"
is sufficient.public void setMemCacheSizePercent(float percent)
IllegalArgumentException if percent is < 0.01 or > .8.
memCacheSize is stored in kilobytes instead of bytes as this will eventually be passed
to construct a LruCache which takes an int in its constructor.
This value should be chosen carefully based on a number of factors
Refer to the corresponding Android Training class for more discussion:
http://developer.android.com/training/displaying-bitmaps/percent - Percent of available app memory to use to size memory cache