Coder Social home page Coder Social logo

fontawesomeandroid's Introduction

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".

Updated to include new fa- namespace instead of icon- namespace to mirror fontawesome.io changes at 4.0

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/fa_thumbs_up"
         android:textSize="30sp" />
    
     <com.FontAwesome.Example.ButtonAwesome
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:text="@string/fa_check" >
    
  2. Create a view programmatically

TextAwesome tvFacebook = new TextAwesome(this);
tvFacebook.setText(this.getResources().getString(R.string.fa_facebook_square));
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

fontawesomeandroid's People

Contributors

bperin avatar aguglielmo avatar

Watchers

Sangu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.