Skip to content

gitssie/android-iconify

 
 

Repository files navigation

Alt

Alt

Iconify makes it easy to include any of the 361 FontAwesome icons in a native Android application.

If you're not familiar with it, FontAwesome is a font in which some special characters draw vectorial icons instead of letters. That means you can scale them as much as you want, and you can apply text transforms on these icons, just like you would do with texts. These icons will never ever become fuzzy.

How to use

Wrap icon names with { } where you want the icon to appear in the text.

<IconTextView
    android:text="FontAwesome {icon_flag} in Android {icon_android} !"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

Alt

You can use any icon from FontAwesome 3.2.0

Transforms

The good thing is that you can scale and apply shadows and colors to the icon, like any text.

<IconTextView
    android:text="{icon_android}"
    android:shadowColor="#22000000"
    android:shadowDx="3"
    android:shadowDy="3"
    android:shadowRadius="1"
    android:textSize="90dp"
    android:textColor="#FF33B5E5"
    ... />

Alt

Buttons

It plays nice with buttons, just use IconButton instead of Button.

<IconButton
    android:text="{icon_retweet} Retweet"
    ... />

Alt

Other views

Any View that extends TextView can be iconified programmatically.

TextView myTextView = (TextView) findViewById(R.id.myTextView);
Iconify.addIcons(myTextView);

Or via Maven Central

<dependency>
    <groupId>com.joanzapata.android</groupId>
    <artifactId>android-iconify</artifactId>
    <version>1.0.0</version>
</dependency>

License

Copyright 2013 Joan Zapata

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

It uses FontAwesome font, licensed under OFL 1.1, which is compatible
with this library's license.

    http://scripts.sil.org/cms/scripts/render_download.php?format=file&media_id=OFL_plaintext&filename=OFL.txt
    

About

Integration of FontAwesome for Android

Resources

License

Stars

Watchers

Forks

Packages

No packages published