Giter Club home page Giter Club logo

android-iconify's People

Contributors

1zaman avatar days avatar devnied avatar joanzapata avatar john990 avatar lccxx avatar makubi avatar mikepenz avatar msneujink avatar synapticvoid avatar tasomaniac avatar weiyin avatar william-lohan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-iconify's Issues

Make icon size and color independent of the text

Expand the {icon_**} pattern to encapsulate more info like

{icon_thumbs_up #99 0.8f} for a blue small icon
or
{icon_twitter #999999} for a gray normal sized icon
or
{icon_globe #990000 5.0f} for a red large icon

I have implemented this (check the forked repo) but still need to figure out how we can

  • make center_vertical work (text is now always in bottom)
  • make it work with IconTextView ( now only works with addIcons() or setText() )

Maybe you want to take a look at it? =D
Thanks for the nice project, really like your approach on embedding the icon in the text.

Use icons in EditText as drawables

This is somewhat of a question/feature request as I'm not sure if this is already possible. But what I would like to achieve in the first instance would be to have something like:

Where the drawableLeft could be taken from font awesome, alternatively a programmatic way would suffice. I tried using:
loginId.setCompoundDrawablesWithIntrinsicBounds(new IconDrawable(getActivity(), Iconify.IconValue.fa_adjust),0,0,0);

but it expects a drawable resource id.

Cheers

Support for spinning icons?

I was wondering how do i use spinning icons.

I tried with {fa-spinner fa-spin} and {fa-spinner} {fa-spin} but none of them worked.

So, am I going wrong somewhere or iconify doesn't support spinning icons?

Button Icon

hy,
im trade to do this..

< Button
android:id="@+id/BtnAceptar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/descripcion_app"
android:layout_alignParentRight="true"
android:text="{fa-android}"
/>

but this render "{fa-android}" like button text, instead the icon

can someone help me please?

Change the TTF file

Hi there!

I would like to extend your project to allow the addition/usage of more TTF files. How can I open the library project on eclipse, edit it and then generate a new .jar file?

Wrong icon name: fa_users

The icon "fa-group" is an alias for "fa-users", as seen here:
http://fortawesome.github.io/Font-Awesome/icon/users/

I understand that android-iconify will not support aliases for now. (+1 for that feature request, though!)

The problem is, the current version of android-iconify supports "fa-group" (the alias) and does NOT support "fa-users" (the actual non-alias icon). This causes me to need to support that one icon as an exception to the rule.

Icon and text in two different lines

This is not an issue but rather a small silly doubt.
I want the text to appear below the icon and not on the left or right of the icon, how do i achieve this?

Improve README

The README should highlight

  • Scalability
  • Shadows
  • Text colors

Compilation issue on second execution

I all the time got error "Multiple dex files define Landroid/widget/IconButton"

when i rebuild the project - everything works, but when i try to run second time, it fails.

I use gradle dependency:

compile 'com.joanzapata.android:android-iconify:1.0.6'

Any idea what can make this problem?

Possible memory inefficiency

I am wondering if assigning a new Drawable resource on each OnCreateOptionsMenu() in activity would lead to a new instance of the same Drawable being created (and the previous one floating around somewhere and causing memory leak). Is it better to create a Drawable myDrawable = new IconDrawable() in the activity constructor and re-use it?

    menu.findItem(R.id.action_notification).setIcon(
            new IconDrawable(this, Iconify.IconValue.fa_bell)
                    .colorRes(R.color.em_active_green)
                    .actionBarSize());

Visualizing icon on Graphics Preview

This is more a question then any other thing.

Can't see the icons rendered on the Graphics Preview, keep getting the following error:

The following classes could not be found:

  • IconTextView (Fix Build Path, Edit XML)

Is this the right thing? I'm doing something terrible wrong?
Eclipse ADT and Android Studio shows the same message error.

thanks

What about Internationalization?

Is there any way to set the text from strings.xml ?

For example,

<IconTextView
    android:text="{fa-android} @string/string_name"
    ... />

String Resource File

I've created a string resource file that can be included in your android project to make the icon values easy to reference reference. I know you can use the enum within the library, but I needed an easy way to be able to alias the icon names.

https://gist.github.com/keannan5390/9487918

Then you can use it like this:

TextView icon = (TextView)findViewById(R.id.icon_name);
icon.setText(R.string.icon_user);
Iconify.addIcons(icon);

or this:

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="12sp"
    android:id="@+id/icon_name"
    android:text="@string/icon_user"/>

IconTextView and IconButton should implement setText()

Currently the user has to call Iconify.addIcons() after each setText().
While this is fine for standard TextView, it should be implicit on IconTextView and IconButton.

Maybe I should add a listener on the provided TextView, but then I should provide a removeIcons() just in case.

Cut word Kitkat

Cut out some words when I use IconTextView, if I use TextView works perfectly

screenshot_2014-09-15-13-47-08

screenshot_2014-09-15-13-49-06

XML

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:orientation="horizontal"
android:padding="10sp" >
<android.widget.IconTextView
android:id="@+id/iconTextView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>

tested on Android 4.4.4 Moto G

minimum sdk version

What is the minimum Android SDK Version for this to work? Will work with ActionBarCompact?

Add IconDrawable.getPaint()

This method could be useful in some case where developer want to set himself some configuration to Paint class, like setAntiAlias.

Of course you could provide a fluent API for each of Paint methods, but... I'm not sure it's a good solution :)

Exception while Running

I've been working on an application that uses android-iconify recently and was using IconButton and IconTextView which worked a few days ago. I noticed a new commit was made 2 hours ago and I believe is the cause of the issue. It looks like the Font was moved but the name was not updated and causes the following exception.

10-21 18:06:49.410 1741-1741/net.codesector.Mileage E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: net.codesector.Mileage, PID: 1741
java.lang.RuntimeException: Unable to start activity ComponentInfo{net.codesector.Mileage/net.codesector.Mileage.LoginActivity}: android.view.InflateException: Binary XML file line #36: Error inflating class android.widget.IconTextView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #36: Error inflating class android.widget.IconTextView
at android.view.LayoutInflater.createView(LayoutInflater.java:621)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:756)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
at android.app.Activity.setContentView(Activity.java:1929)
at net.codesector.Mileage.LoginActivity.onCreate(LoginActivity.java:14)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5017)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
            at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:595)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:756)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
            at android.app.Activity.setContentView(Activity.java:1929)
            at net.codesector.Mileage.LoginActivity.onCreate(LoginActivity.java:14)
            at android.app.Activity.performCreate(Activity.java:5231)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5017)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
            at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: native typeface cannot be made
at android.graphics.Typeface.(Typeface.java:175)
at android.graphics.Typeface.createFromFile(Typeface.java:159)
at com.joanzapata.android.iconify.Iconify.getTypeface(Iconify.java:80)
at com.joanzapata.android.iconify.Iconify.addIcons(Iconify.java:53)
at android.widget.IconTextView.init(IconTextView.java:46)
at android.widget.IconTextView.(IconTextView.java:36)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at android.view.LayoutInflater.createView(LayoutInflater.java:595)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:756)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
            at android.app.Activity.setContentView(Activity.java:1929)
            at net.codesector.Mileage.LoginActivity.onCreate(LoginActivity.java:14)
            at android.app.Activity.performCreate(Activity.java:5231)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5017)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
            at dalvik.system.NativeStart.main(Native Method)

Set font size of icon different from text

I use the IconButton to display a button with text and an icon. Works well, but font-awesome tends to be a little smaller than the actual text. Therefore it would be nice to change the size of the icon only.
Something like

<android.widget.IconButton
            android:text="{fa-icon} text"
            android:textSize="22sp"
            android:iconSize="30sp"
... />

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.