コード例 #1
0
        /// <summary>
        /// Create an IconDrawable. </summary>
        /// <param name="context"> Your activity or application context. </param>
        /// <param name="iconKey"> The icon key you want this drawable to display. </param>
        /// <exception cref="IllegalArgumentException"> if the key doesn't match any icon. </exception>
        public IconDrawable(Context context, string iconKey)
        {
            Icon icon = Iconify.findIconForKey(iconKey);

            if (icon == null)
            {
                throw new System.ArgumentException("No icon with that key \"" + iconKey + "\".");
            }
            init(context, icon);
        }
コード例 #2
0
 private void init(Context context, Icon icon)
 {
     this.context        = context;
     this.icon           = icon;
     paint               = new TextPaint();
     paint.Typeface      = Iconify.findTypefaceOf(icon).getTypeface(context);
     paint.Style         = Paint.Style.FILL;
     paint.TextAlign     = Paint.Align.CENTER;
     paint.UnderlineText = false;
     paint.Color         = Color.BLACK;
     paint.AntiAlias     = true;
 }
コード例 #3
0
ファイル: Iconify.cs プロジェクト: resilientred/xiconify
 /// <summary>
 /// Add support for a new icon font. </summary>
 /// <param name="iconFontDescriptor"> The IconDescriptor holding the ttf file reference and its mappings. </param>
 /// <returns> An initializer instance for chain calls. </returns>
 public virtual IconifyInitializer with(IconFontDescriptor iconFontDescriptor)
 {
     Iconify.addIconFontDescriptor(iconFontDescriptor);
     return(this);
 }
コード例 #4
0
ファイル: Iconify.cs プロジェクト: resilientred/xiconify
 public IconifyInitializer(IconFontDescriptor iconFontDescriptor)
 {
     Iconify.addIconFontDescriptor(iconFontDescriptor);
 }