Code Monkey home page Code Monkey logo

android-iconify's Introduction

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
    

android-iconify's People

Contributors

joanzapata avatar

Watchers

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