/// <summary> /// Retrieve an icon from a key, </summary> /// <returns> The icon, or null if no icon matches the key. </returns> internal static Icon findIconForKey(string iconKey) { for (int i = 0, iconFontDescriptorsSize = iconFontDescriptors.Count; i < iconFontDescriptorsSize; i++) { IconFontDescriptorWrapper iconFontDescriptor = iconFontDescriptors[i]; Icon icon = iconFontDescriptor.getIcon(iconKey); if (icon != null) { return(icon); } } return(null); }
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; }