public static class ImageCache.ImageCacheParams
extends java.lang.Object
| 限定符和类型 | 字段和说明 |
|---|---|
android.graphics.Bitmap.CompressFormat |
compressFormat |
int |
compressQuality |
java.io.File |
diskCacheDir |
boolean |
diskCacheEnabled |
int |
diskCacheSize |
boolean |
initDiskCacheOnCreate |
int |
memCacheSize |
| 构造器和说明 |
|---|
ImageCacheParams(android.content.Context context,
java.lang.String diskCacheDirectoryName)
Create a set of image cache parameters that can be provided to
ImageCache.getInstance(android.support.v4.app.FragmentManager, ImageCacheParams) or |
| 限定符和类型 | 方法和说明 |
|---|---|
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 diskCacheEnabled
public boolean initDiskCacheOnCreate
public ImageCacheParams(android.content.Context context,
java.lang.String diskCacheDirectoryName)
ImageCache.getInstance(android.support.v4.app.FragmentManager, ImageCacheParams) orcontext - A context to use.diskCacheDirectoryName - 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 below 0.01 or more than .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