JoanZapata / android-iconify

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

No rendered icon #84

Closed Cartman34 closed 9 years ago

Cartman34 commented 9 years ago

Hi,

I was glad to find your lib, as i often use font-awesome for web apps... But i'm still unable to use it, the icon does not render, there is only an empty gap instead of displaying the given icon (i tried with fa-android and fa-male). It seems the cause is the custom font i am using for my app...

JoanZapata commented 9 years ago

Yep, that's the problem. At the current state of the library you can't set a custom typeface on the views you want to display icons because they have to use the FontAwesome typeface to work. You have to use separate views if you want a custom typeface on your text.

A workaround for this would be to re-write the library using Spans and setting the FontAwesome typeface only to those spans. That would require a lot of time dealing with edge cases, unfortunately I don't have that time. Don't expect it soon unless someone is willing to contribute with a pull request, which would be really appreciated.

Cartman34 commented 9 years ago

I think, the icons and the text are 2 differents things, they should be independants, i am not an expert of Android but maybe the IconTextView should not be only a child class of TextView and should in fact render one TextView per separated text in the given string an one icon per icon declaration. Obsviously all font properties (size, color...) are inherited from the IconTextView. It may need the IconTextView is no more a TextView but a (Relative/Linear ?)Layout. This is only one solution for the current implementation of FontAwesome and i don't even know if this is possible. Some other programming solutions are:

I hope it could help... I also have the time problem... There is not enough hours in one day.

JoanZapata commented 9 years ago

Fixed by v2.