Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 /**
  * 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);
 }
Ejemplo n.º 4
0
 public IconifyInitializer(IIconFontDescriptor iconFontDescriptor)
 {
     Iconify.AddIconFontDescriptor(iconFontDescriptor);
 }