public class IconCache extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CACHE_SIZE
Default max number of icon bitmaps to retain in cache
|
| Constructor and Description |
|---|
IconCache()
Constructor, created with cache size of
DEFAULT_CACHE_SIZE |
IconCache(int size)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the cache
|
Bitmap |
createIcon(IconRow icon)
Create or retrieve from cache an icon bitmap for the icon row
|
Bitmap |
createIcon(IconRow icon,
float density)
Create or retrieve from cache an icon bitmap for the icon row
|
static Bitmap |
createIcon(IconRow icon,
float density,
IconCache iconCache)
Create or retrieve from cache an icon bitmap for the icon row
|
static Bitmap |
createIcon(IconRow icon,
IconCache iconCache)
Create or retrieve from cache an icon bitmap for the icon row
|
static Bitmap |
createIconNoCache(IconRow icon)
Create an icon bitmap for the icon row without caching
|
static Bitmap |
createIconNoCache(IconRow icon,
float density)
Create an icon bitmap for the icon row without caching
|
Bitmap |
get(IconRow iconRow)
Get the cached bitmap for the icon row or null if not cached
|
Bitmap |
get(long iconRowId)
Get the cached bitmap for the icon row id or null if not cached
|
Bitmap |
put(IconRow iconRow,
Bitmap bitmap)
Cache the icon bitmap for the icon row
|
Bitmap |
put(long iconRowId,
Bitmap bitmap)
Cache the icon bitmap for the icon row id
|
Bitmap |
remove(IconRow iconRow)
Remove the cached bitmap for the icon row
|
Bitmap |
remove(long iconRowId)
Remove the cached bitmap for the icon row id
|
void |
resize(int maxSize)
Resize the cache
|
public static final int DEFAULT_CACHE_SIZE
public IconCache()
DEFAULT_CACHE_SIZEpublic IconCache(int size)
size - max icon bitmaps to retain in the cachepublic Bitmap get(IconRow iconRow)
iconRow - icon rowpublic Bitmap get(long iconRowId)
iconRowId - icon row idpublic Bitmap put(IconRow iconRow, Bitmap bitmap)
iconRow - icon rowbitmap - icon bitmappublic Bitmap put(long iconRowId, Bitmap bitmap)
iconRowId - icon row idbitmap - icon bitmappublic Bitmap remove(IconRow iconRow)
iconRow - icon rowpublic Bitmap remove(long iconRowId)
iconRowId - icon row idpublic void clear()
public void resize(int maxSize)
maxSize - max sizepublic Bitmap createIcon(IconRow icon)
icon - icon rowpublic Bitmap createIcon(IconRow icon, float density)
icon - icon rowdensity - display density: DisplayMetrics.densitypublic static Bitmap createIconNoCache(IconRow icon)
icon - icon rowpublic static Bitmap createIconNoCache(IconRow icon, float density)
icon - icon rowdensity - display density: DisplayMetrics.densitypublic static Bitmap createIcon(IconRow icon, IconCache iconCache)
icon - icon rowiconCache - icon cachepublic static Bitmap createIcon(IconRow icon, float density, IconCache iconCache)
icon - icon rowdensity - display density: DisplayMetrics.densityiconCache - icon cache