Skip to content

String resources for the free FontAwesome icons for use with AndroidStudio.

License

Notifications You must be signed in to change notification settings

wrgallo/AndroidFontAwesomeStrings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AndroidFontAwesomeStrings

String resources for the free FontAwesome icons for use with AndroidStudio.

  1. First create your Font Resource Directory

    1. Right-click the res folder and go to New > Android resource directory
    2. In the Resource type list, select font, and then click OK
    3. Check this guide for more details
  2. Download the FontAwesome TTF files

  3. Add your font files in the font folder

    1. Right-click the font folder and go to Show in Explorer
    2. Move your desired TTF files to this folder
  4. Create your icon dictionary:

    1. Right-click the values resources folder and go to Show in Explorer
    2. Move the XML Files to this folder:
      • XML for Brands Icons: strings_fa_brands.xml
      • XML for Regular Icons: strings_fa_regular.xml
      • XML for Solid Icons: strings_fa_solid.xml
    3. Or check the FontAwesome Cheatsheet to create your own, the XML will look like this:
    <resources>
       <string name="fa_regular_sun">&#xf185;</string>
       <string name="fa_regular_surprise">&#xf5c2;</string>
       <string name="fa_regular_thumbs_up">&#xf164;</string>
    </resources>
  5. In the layout XML file, set the text and fontFamily attribute to the icon you want

    <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/fa_regular_thumbs_up"
            android:fontFamily="@font/fa-regular-400"/>

About

String resources for the free FontAwesome icons for use with AndroidStudio.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published