use of com.mikepenz.iconics.typeface.ITypeface in project Android-Iconics by mikepenz.
the class Iconics method iconExists.
/**
* Test if the icon exists in the currently loaded fonts
*
* @param context A context to access application resources
* @param icon The icon to verify
* @return true if the icon is available
*/
public static boolean iconExists(Context context, String icon) {
try {
ITypeface font = findFont(context, icon.substring(0, 3));
icon = icon.replace("-", "_");
font.getIcon(icon);
return true;
} catch (Exception ignore) {
}
return false;
}
use of com.mikepenz.iconics.typeface.ITypeface in project Android-Iconics by mikepenz.
the class IconicsDrawable method icon.
/**
* Loads and draws given.
*
* @param icon
* @return The current IconExtDrawable for chaining.
*/
public IconicsDrawable icon(IIcon icon) {
mIcon = icon;
mPlainIcon = null;
ITypeface typeface = icon.getTypeface();
mIconPaint.setTypeface(typeface.getTypeface(mContext));
invalidateSelf();
return this;
}
Aggregations