All Projects → ravi8x → Android Font Awesome

ravi8x / Android Font Awesome

Android library to use the Font Awesome icons in android apps

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Android Font Awesome

Font Awesome Scss
Font Awesome Scss Core (Unofficial)
Stars: ✭ 119 (+29.35%)
Mutual labels:  font-awesome, font-icons
Swifticons
🎢Swift Library for Font Icons - ★ this library
Stars: ✭ 747 (+711.96%)
Mutual labels:  font-awesome, font-icons
rofi-fontawesome
fontawesome icon list for rofi dmenu
Stars: ✭ 58 (-36.96%)
Mutual labels:  font-awesome, font-icons
Font Awesome Swift
Font Awesome swift library for iOS.
Stars: ✭ 743 (+707.61%)
Mutual labels:  font-awesome, font-icons
Vectoriconsroundup
A comparison between popular vectorial icon fonts
Stars: ✭ 126 (+36.96%)
Mutual labels:  font-awesome, font-icons
Imguifontstudio
Font Helper Gui Tool for programming
Stars: ✭ 149 (+61.96%)
Mutual labels:  font-awesome, font-icons
Iconfontcppheaders
C, C++ headers and C# classes for icon fonts: Font Awesome, Fork Awesome, Material Design, Kenney game icons and Fontaudio
Stars: ✭ 509 (+453.26%)
Mutual labels:  font-awesome, font-icons
Pandoc Latex Tip
A pandoc filter for adding tip in LaTeX
Stars: ✭ 7 (-92.39%)
Mutual labels:  font-awesome
Bootstrapcdn
Free Bootstrap CDN hosting
Stars: ✭ 1,075 (+1068.48%)
Mutual labels:  font-awesome
Cnode Ionic
A third party app for Node.js中文社区 https://cnodejs.org/
Stars: ✭ 6 (-93.48%)
Mutual labels:  font-awesome
Alfred Font Awesome Workflow
🎩 Font Awesome workflow for Alfred
Stars: ✭ 714 (+676.09%)
Mutual labels:  font-awesome
Overwatch Heroes Icon Font
Icon font for all 21 Overwatch heroes
Stars: ✭ 17 (-81.52%)
Mutual labels:  font-icons
Spring Boot Fx
🎈Spring Boot, JavaFX, bootstrap3, mongoDB
Stars: ✭ 57 (-38.04%)
Mutual labels:  font-awesome
Fontawesome Module
Module to use Font Awesome icons in Nuxt.js
Stars: ✭ 79 (-14.13%)
Mutual labels:  font-awesome
Sense Navigation
Sheet Navigation + Actions for Qlik Sense.
Stars: ✭ 85 (-7.61%)
Mutual labels:  font-awesome
Font Awesome Stylus
Stylus port for font-awesome 4.7.0
Stars: ✭ 77 (-16.3%)
Mutual labels:  font-awesome
All The Icons.el
A utility package to collect various Icon Fonts and propertize them within Emacs.
Stars: ✭ 1,048 (+1039.13%)
Mutual labels:  font-icons
Font Awesome Php
A PHP library for Font Awesome 4.7.
Stars: ✭ 47 (-48.91%)
Mutual labels:  font-awesome
Iconify Sketch
Sketch plug-in for importing over 70,000 icons from 80+ icon sets, including Material Design Icons, FontAwesome, Jam Icons, Open Emoji and many others.
Stars: ✭ 76 (-17.39%)
Mutual labels:  font-awesome
Fork Awesome
A fork of the iconic font and CSS toolkit
Stars: ✭ 878 (+854.35%)
Mutual labels:  font-awesome

Android - Font Awesome Icon

Awesome Android library to use the Font Awesome Icon collection in your android apps. This library contains the latest font awesome icon collection (v5.7.2).

Download

Demo

Tutorial

Here you can find detailed explain of the library and the usage of it considering multiple scenarios. Or you can refer this example project.

How to Use

Include the fontawesome dependency in app's build.gradle and you are good to go.

dependencies {
    // font awesome library
    implementation 'info.androidhive:fontawesome:0.0.5'
}

Referring Icon:

Font Awesome provides three set of icons Regular, Solid and Brand. All the icons can be referred from Strings resource file. For example,

@string/fa_map - Regular map icon

@string/fa_heart_solid - Solid heart icon

@string/fa_facebook - Facebook brand icon.

Displaying Text Icon: FontTextView

To display an icon in xml layout, use the FontTextView widget. This class is extended from TextView, so all the TextView related properties will apply.

<info.androidhive.fontawesome.FontTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/fa_calendar_check_solid"
            android:textColor="@color/icon_color"
            android:textSize="@dimen/icon_size"
            app:solid_icon="true" />

solid_icon: Use this attribute to display a solid icon (true / false). brand_icon: Use this attribute to display a brand icon (true / false).

Displaying drawable Icon: FontDrawable

If you want to set an icon to a widget (buttons, menus, bottom sheet, navigation drawer), use the FontDrawable class to create font awesome drawable.

Here Paper Plane icon is set to Floating Action Button

FloatingActionButton fab = findViewById(R.id.fab);

// using paper plane icon for FAB
FontDrawable drawable = new FontDrawable(this, R.string.fa_paper_plane_solid, true, false);

// white color to icon
drawable.setTextColor(ContextCompat.getColor(this, android.R.color.white));
fab.setImageDrawable(drawable);

Displaying Icons in Menus (Bottom Navigation, Navigation Drawer, Toolbar etc.,)

You can also display Font Awesome icons in UI elements those use menu file to render items. In the below example, font awesome icons are set to Navigation Drawer items.

public class MainActivity extends AppCompatActivity
        implements NavigationView.OnNavigationItemSelectedListener {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        intDrawerLayout();
    }

    /**
     * Changing navigation drawer icons
     * This involves looping through menu items and applying icons
     */
    private void intDrawerLayout() {
        NavigationView navigationView = findViewById(R.id.nav_view);
        navigationView.setNavigationItemSelectedListener(this);

        ImageView iconHeader = navigationView.getHeaderView(0).findViewById(R.id.nav_header_icon);
        FontDrawable drawable = new FontDrawable(this, R.string.fa_font_awesome, false, true);
        drawable.setTextColor(ContextCompat.getColor(this, android.R.color.white));
        drawable.setTextSize(50);
        iconHeader.setImageDrawable(drawable);

        int[] icons = {
                R.string.fa_home_solid, R.string.fa_calendar_alt_solid, R.string.fa_user_solid,
                R.string.fa_heart_solid, R.string.fa_comment_solid, R.string.fa_dollar_sign_solid, R.string.fa_gift_solid
        };
        renderMenuIcons(navigationView.getMenu(), icons, true, false);

        int[] iconsSubmenu = {R.string.fa_cog_solid, R.string.fa_sign_out_alt_solid};

        renderMenuIcons(navigationView.getMenu().getItem(7).getSubMenu(), iconsSubmenu, true, false);
    }

    /**
     * Looping through menu icons are applying font drawable
     */
    private void renderMenuIcons(Menu menu, int[] icons, boolean isSolid, boolean isBrand) {
        for (int i = 0; i < menu.size(); i++) {
            MenuItem menuItem = menu.getItem(i);
            if (!menuItem.hasSubMenu()) {
                FontDrawable drawable = new FontDrawable(this, icons[i], isSolid, isBrand);
                drawable.setTextColor(ContextCompat.getColor(this, R.color.icon_nav_drawer));
                drawable.setTextSize(22);
                menu.getItem(i).setIcon(drawable);
            }
        }
    }
}

Demo

Note:

This library includes the Free font awesome icons only, premium icons are not available.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].