hardcodet / Iconize

Use icon fonts in your Xamarin.Android, Xamarin.iOS, or Xamarin.Forms application!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Iconize Plugin for Xamarin

A .NET for Xamarin port of the android-iconify project. Use icon fonts in your Xamarin.Android, Xamarin.iOS, or Xamarin.Forms application!

NuGet

Build Status

Icon Fonts

Font Requests
If you have an icon font or series of svg pictograms you'd like included, just submit an issue or pull request and we'll work to add it.

Extensibility
In case you can't find the icon you want, you can extend the available icon directly from your app. All you need to do is to implement IIconModule with a .ttf file in your assets/resources and provide the mapping between keys and special characters, then give it to Iconize.With().

There are no constraints on the icon keys, but I strongly suggest you use a unique prefix like my- or anything, to avoid conflicts with other modules. FYI, if there is a conflict, the first module declared with Iconize.With() has priority.

Controls

Xamarin.Android (AppCompat)

  • IconButton (AppCompatButton)
  • IconDrawable (Drawable)
  • IconTextView (TextView)
  • IconToggleButton (ToggleButton)

Xamarin.iOS (Unified)

  • IconButton (UIButton)
  • IconLabel (UILabel)
  • UIImage (extension)

Xamarin.Forms

  • IconButton (Button)
  • IconImage (Image)
  • IconLabel (Label)
  • IconTabbedPage (TabbedPage)
  • IconToolbarItem (ToolbarItem)
    • Requires IconNavigationPage

UWP (Coming Soon)

  • IconButton (Button)
  • IconLabel (TextBlock)
  • Bitmap (extension)

Setup

Install

Nuget
All packages are provided via NuGet.

Configure

Xamarin.Android (AppCompat)
Initialize any number of modules in Application.OnCreate() or Activity.OnCreate().

public override void OnCreate()
{
    base.OnCreate();

    Plugin.Iconize.Iconize.With(new Plugin.Iconize.Fonts.FontAwesomeModule())
                          .With(new Plugin.Iconize.Fonts.MaterialModule())
                          .With(new Plugin.Iconize.Fonts.MeteoconsModule())
                          .With(new Plugin.Iconize.Fonts.TypiconsModule());
    ...
}

OR

protected override void OnCreate(Bundle bundle)
{
    base.OnCreate(bundle);

    Plugin.Iconize.Iconize.With(new Plugin.Iconize.Fonts.FontAwesomeModule())
                          .With(new Plugin.Iconize.Fonts.MaterialModule())
                          .With(new Plugin.Iconize.Fonts.MeteoconsModule())
                          .With(new Plugin.Iconize.Fonts.TypiconsModule());
    ...
}

Xamarin.iOS (Unified)
Initialize any number of modules in AppDelegate.FinishedLaunching().

public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
    Plugin.Iconize.Iconize.With(new Plugin.Iconize.Fonts.FontAwesomeModule())
                          .With(new Plugin.Iconize.Fonts.MaterialModule())
                          .With(new Plugin.Iconize.Fonts.MeteoconsModule())
                          .With(new Plugin.Iconize.Fonts.TypiconsModule());

    ...
}

Add the UIAppFonts key to Info.plist.

<key>UIAppFonts</key>
<array>
    <string>iconize-fontawesome.ttf</string>
    <string>iconize-material.ttf</string>
    <string>iconize-meteocons.ttf</string>
    <string>iconize-typicons.ttf</string>
</array>

Xamarin.Forms
Follow the instructions for the specific platforms above and add the following:

Android (AppCompat):

Xamarin.Forms.Forms.Init(this, savedInstanceState);
...
FormsPlugin.Iconize.Droid.IconControls.Init(Resource.Id.toolbar, Resource.Id.tabs);
...
LoadApplication(new App());

iOS (Unified):

Xamarin.Forms.Forms.Init();
...
FormsPlugin.Iconize.iOS.IconControls.Init();
...
LoadApplication(new App());

Contributions

License

This work is licensed under the Apache License, Version 2.0.

Entypo+
Entypo+ is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA 4.0)

Font Awesome
Font Awesome is licensed under the SIL Open Font License 1.1.

Ionicons
Ionicons is licensed under the MIT License.

Material design icons
Material design icons are licensed under the Apache License, Version 2.0.

Meteocons
Meteocons are provided as free icons by the creator, Alessio Atzeni.

Simple Line Icons
Simple Line Icons are licensed under the MIT License.

Typicons
Typicons is licensed under the SIL Open Font License 1.1.

Weather Icons
Weather Icons are licensed under the SIL Open Font License 1.1.

Brand Icons
All brand icons are trademarks of their respective owners. The use of these trademarks does not indicate endorsement of the trademark holder by Iconize, nor vice versa. Brand icons should only be used to represent the company or product to which they refer.

About

Use icon fonts in your Xamarin.Android, Xamarin.iOS, or Xamarin.Forms application!

License:Other


Languages

Language:C# 98.2%Language:PowerShell 1.8%