public class UserIconDatabase
extends SQLiteOpenHelper
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATABASE_NAME |
protected static int |
DATABASE_VERSION |
static java.lang.String |
TABLE_ICONS |
static java.lang.String |
TABLE_ICONSETS |
Modifier and Type | Method and Description |
---|---|
boolean |
addIcon(UserIcon icon,
byte[] bitMap)
Add icon to DB and associate with the specified iconset
|
long |
addIconSet(UserIconSet iconset)
Add iconset to DB
Does not process icons.
|
void |
dropTables() |
UserIcon |
getIcon(int iconId,
boolean bBitmap) |
UserIcon |
getIcon(java.lang.String iconsetUid,
java.lang.String filename,
boolean bBitmap) |
android.graphics.Bitmap |
getIconBitmap(int id) |
byte[] |
getIconBytes(int id) |
UserIconSet |
getIconSet(java.lang.String uid,
boolean bIcons,
boolean bBitmaps)
Get the specified iconset.
|
UserIconSet |
getIconSetByName(java.lang.String name,
boolean bIcons,
boolean bBitmaps)
Get the specified iconset, lookup by name.
|
java.util.List<UserIconSet> |
getIconSets(boolean bIcons,
boolean bBitmaps)
Get all iconsets.
|
UserIcon |
getMostUsedIcon(java.lang.String group)
Select most used icon, optionally within a group
Note, currently MapGroup hierarchy does not track iconsets
So, its possible two different iconsets have provided icons in the same group
Note, in DB iconset UID is tracked
|
void |
incrementIconUseCount(UserIcon icon)
Increment the database useCount by 1 for the specified icon
|
static UserIconDatabase |
instance(android.content.Context context) |
void |
onCreate(DatabaseIface database) |
void |
onUpgrade(DatabaseIface database,
int oldVersion,
int newVersion) |
boolean |
removeIconSet(java.lang.String uid) |
boolean |
removeIconSet(UserIconSet iconset) |
boolean |
setSelectedGroup(UserIconSet iconset)
Update the selected group for the iconset
|
protected static final int DATABASE_VERSION
public static final java.lang.String TABLE_ICONS
public static final java.lang.String TABLE_ICONSETS
public static final java.lang.String DATABASE_NAME
public static UserIconDatabase instance(android.content.Context context)
public void onCreate(DatabaseIface database)
public void onUpgrade(DatabaseIface database, int oldVersion, int newVersion)
public void dropTables()
public UserIconSet getIconSet(java.lang.String uid, boolean bIcons, boolean bBitmaps)
bIcons
- bBitmaps
- public UserIconSet getIconSetByName(java.lang.String name, boolean bIcons, boolean bBitmaps)
bIcons
- bBitmaps
- public java.util.List<UserIconSet> getIconSets(boolean bIcons, boolean bBitmaps)
bIcons
- bBitmaps
- public android.graphics.Bitmap getIconBitmap(int id)
public byte[] getIconBytes(int id)
public UserIcon getIcon(java.lang.String iconsetUid, java.lang.String filename, boolean bBitmap)
public UserIcon getIcon(int iconId, boolean bBitmap)
public long addIconSet(UserIconSet iconset)
iconset
- public boolean removeIconSet(UserIconSet iconset)
public boolean removeIconSet(java.lang.String uid)
public boolean addIcon(UserIcon icon, byte[] bitMap)
icon
- must have valid iconsetIdbitMap
- public void incrementIconUseCount(UserIcon icon)
icon
- public boolean setSelectedGroup(UserIconSet iconset)
iconset
- public UserIcon getMostUsedIcon(java.lang.String group)
group
-