Fork me on GitHub
Index

Font Awesome Ti.Widget 1.4.1

OMG! It's the Offical Font Awesome 4.3.0 by Dave Gandy for Titanium Alloy!

Overview

This is a widget for the Appcelerator Alloy MVC framework which provides easy implementation of the Offical Font Awesome 4.1.0 icons found at fontawesome.io

Features

  • 100% Free to use and open source to boot
  • Simply drop the widget into your view XML file
  • Add Icons to any Label, View, or Button with a simple xml attribute.
  • Vector Icons from a font file, scale to any size, give it any color.
  • Works on Android, iOS
  • Compatibile with other fonts and icon sets.

Working Example

Imgur

Quick Start

  • Download the latest version of the widget as a ZIP file.
  • Unzip the folder to your project under app/widgets/com.mattmcfarland.fontawesome.
  • ANDROID: Copy fontAwesome.ttf from com.mattmcfarland.fontawesome/assets/fonts to app/assets/fonts
  • Add the widget as a dependency to your app/config.json file:
"dependencies": {
    "com.mattmcfarland.fontawesome":"1.2.0"
}

Alloy

  • Add the widget as the last item in the view container you want to apply icons styles to, so your main window or view, just above the closing Window or View tags.
<Alloy>
    <Window title="Tab 1">
        <Label icon = "fa-car" >I am Window 1</Label>
        <Widget id="fa" src="com.mattmcfarland.fontawesome"/>
    </Window>
</Alloy>

That's it. You simply add your Icons in a very similar way we do it with HTML 5.

<Label icon = "fa-glass"></Label>

Titanium

    var fa = Alloy.createWidget("com.mattmcfarland.fontawesome");
    win.add(fa);

Using Titanium API with Javascript to add icons on the fly:

$.fa.add(MyLabel,'fa-star');

Find latest news on our github page.