Search in sources :

Example 11 with ITypeface

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;
}
Also used : ITypeface(com.mikepenz.iconics.typeface.ITypeface)

Example 12 with ITypeface

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;
}
Also used : ITypeface(com.mikepenz.iconics.typeface.ITypeface)

Aggregations

ITypeface (com.mikepenz.iconics.typeface.ITypeface)12 GridLayoutManager (android.support.v7.widget.GridLayoutManager)4 RecyclerView (android.support.v7.widget.RecyclerView)4 Toolbar (android.support.v7.widget.Toolbar)4 ArrayList (java.util.ArrayList)4 SlideDownAlphaAnimator (com.mikepenz.itemanimators.SlideDownAlphaAnimator)3 MaterializeBuilder (com.mikepenz.materialize.MaterializeBuilder)3 SearchView (android.support.v7.widget.SearchView)2 FastAdapter (com.mikepenz.fastadapter.FastAdapter)2 GenericItemAdapter (com.mikepenz.fastadapter.adapters.GenericItemAdapter)2 GenericIconItem (com.mikepenz.fastadapter.app.generic.GenericIconItem)2 IconModel (com.mikepenz.fastadapter.app.generic.IconModel)2 IIcon (com.mikepenz.iconics.typeface.IIcon)2 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)1 SpannableString (android.text.SpannableString)1 MenuInflater (android.view.MenuInflater)1 MenuItem (android.view.MenuItem)1 View (android.view.View)1 IItem (com.mikepenz.fastadapter.IItem)1 FastScrollIndicatorAdapter (com.mikepenz.fastadapter.app.adapters.FastScrollIndicatorAdapter)1