public IconDrawable(Context context, string iconKey) { IIcon icon = Iconify.FindIconForKey(iconKey); if (icon == null) { throw new ArgumentException("No icon with that key \"" + iconKey + "\"."); } Init(context, icon); }
private void Init(Context context, IIcon icon) { this.context = context; this.icon = icon; paint = new TextPaint(); IconFontDescriptorWrapper descriptor = Iconify.FindTypefaceOf(icon); if (descriptor == null) { throw new IllegalStateException("Unable to find the module associated " + "with icon " + icon.Key + ", have you registered the module " + "you are trying to use with Iconify.with(...) in your Application?"); } paint.SetTypeface(descriptor.GetTypeface(context)); paint.SetStyle(Paint.Style.Fill); paint.TextAlign = Paint.Align.Center; paint.UnderlineText = false; paint.Color = new Android.Graphics.Color(0, 0, 0); //paint.Color = Color.Black; paint.AntiAlias = true; }
/** * Add support for a new icon font. * @param iconFontDescriptor The IconDescriptor holding the ttf file reference and its mappings. * @return An initializer instance for chain calls. */ public IconifyInitializer With(IIconFontDescriptor iconFontDescriptor) { Iconify.AddIconFontDescriptor(iconFontDescriptor); return(this); }
public IconifyInitializer(IIconFontDescriptor iconFontDescriptor) { Iconify.AddIconFontDescriptor(iconFontDescriptor); }