JoanZapata / android-iconify

Android integration of multiple icon providers such as FontAwesome, Entypo, Typicons,...
http://joanzapata.com/android-iconify
Other
3.93k stars 527 forks source link

Add font awesome icons to a button in code #168

Open matthewkrueger opened 8 years ago

matthewkrueger commented 8 years ago

Hi there - great library, been using it a long time.

I finally transitioned to 2.x from 1.x and I cannot get this code to work - it used to. What's going on?

    StringBuilder builder = new StringBuilder();
    builder.append("{");
    builder.append(fontAwesomeIcon.key());
    builder.append("}");
    builder.append("  ");
    builder.append(context.getString(buttonTextResource).toUpperCase());
    button.setText(builder.toString());
    Iconify.addIcons(button);

I see that "Iconify.addIcons" only takes TextViews, but this compiles, and it used to work on 1.x. Why doesn't it work anymore? The result now is that the icon will show as a small x inside a rectangle instead of the desired font awesome icon.

Note that if I change my Button to an IconButton, it works - however, this requires me to change about 100 buttons throughout my app. Why did it work before but not now? Is there a workaround?

JoanZapata commented 8 years ago

It should work.