Icon represents one icon in an icon font. key: The key of icon, for example 'fa-ok' value: The character matching the key in the font, for example '\u4354'
Beispiel #1
0
 private void Init(Context context, Icon icon)
 {
     _context = context;
     _icon = icon;
     _paint = new TextPaint();
     _paint.SetTypeface(Iconify.FindTypefaceOf(icon).GetTypeface(context));
     _paint.SetStyle(Paint.Style.Fill);
     _paint.TextAlign = Paint.Align.Center;
     _paint.UnderlineText = false;
     _paint.Color = Color.Black;
     _paint.AntiAlias = true;
 }
Beispiel #2
0
 /// <summary>
 ///     Create an IconDrawable.
 /// </summary>
 /// <param name="context"> Your activity or application context. </param>
 /// <param name="icon">    The icon you want this drawable to display. </param>
 public IconDrawable(Context context, Icon icon)
 {
     Init(context, icon);
 }
Beispiel #3
0
 /// <summary>
 ///     Finds the Typeface to apply for a given icon.
 /// </summary>
 /// <param name="icon"> The icon for which you need the typeface. </param>
 /// <returns>
 ///     The font descriptor which contains info about the typeface to apply, or null
 ///     if the icon cannot be found. In that case, check that you properly added the modules
 ///     using <seealso cref="#With(IconFontDescriptor)" />} prior to calling this method.
 /// </returns>
 public static IconFontDescriptorWrapper FindTypefaceOf(Icon icon)
 {
     return iconFontDescriptors.FirstOrDefault(iconFontDescriptor => iconFontDescriptor.HasIcon(icon));
 }