Reputation: 121
I am going to use font icons instead of pngs in my native android app. I cant find any recommendation to use or not to use font icons.
So is it a bad practice or a good one to use font icons in native android apps?
(By native i mean i don't use webview for user interface)
Upvotes: 4
Views: 981
Reputation: 16010
As any other practice in the world, it has its own pros and cons.
Pros:
Cons:
It's not readable:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="\uE118"/>
\uE118
and other unicodes are barely something you can keep in memory
You're forced to use custom typefaces everywhere you use icons, which leads to spaghetti code:
you set Typefaces everywhere in the code-behind
(or, as I did, extend TextView
class and setting Typeface based on the custom string attribute(with font path) you're passing in the xml)
My personal observation:
png's are better for prototyping, for building up something fast; icon-fonts are better, once you develop production-quality, stable from design perspective application.
Upvotes: 6