Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.
/ FontAwesomeAndroid Public archive

Use the font awesome icon library in android projects

License

Notifications You must be signed in to change notification settings

0xBEEB/FontAwesomeAndroid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FontAwesomeAndroid

Leverage the font awesome icon library (http://fortawesome.github.io/Font-Awesome/) in your android projects. The vector images will remain crisp and clear on all device sizes

Based on "Font Awesome by Dave Gandy - http://fontawesome.io".

How to include

  1. Add the fontawesome-webfont.ttf file into your assets directory
  2. Add the font_awesome.xml file to your res folder
  3. Add the two classes ButtonAwesome.java and TextAwesome.java to your package path

How to use

There are two ways to use the icons

  1. XML layouts, just include the extended textview or button in your layout, set the text to the string resource icon

     <com.FontAwesome.Example.TextAwesome
         android:id="@+id/tvThumb"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/icon_thumbs_up"
         android:textSize="30sp" />
    
     <com.FontAwesome.Example.ButtonAwesome
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:text="@string/icon_check_sign" >
    
  2. Create a view programmatically

TextAwesome tvFacebook = new TextAwesome(this);
tvFacebook.setText(this.getResources().getString(R.string.icon_facebook_sign));
tvFacebook.setTextSize(TypedValue.COMPLEX_UNIT_SP,50);
layoutMain.addView(tvFacebook, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));

See the example project for more details

About

Use the font awesome icon library in android projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages