I would like to use the Roboto font in my Android application and make sure it works for earlier versions of Android that don’t have the font installed. I know I can do this by using Typeface.createFromAsset() and then manually setting the font for each of my TextViews/Buttons/Other-Objects. It seems like a big pain to do this for every object I show on the screen though.
My question is, is there a better way to do this? Some helper class or a way to set a custom font in a .xml theme file? Anything automated would be better than manually listing out every object on each screen and changing the font.
Thanks!
Retrieve all views inside activity, check its type and apply appropriate action.