Created
March 27, 2019 11:22
-
-
Save Frederikos/7f699e9beb63d6c3146bf016e8cc12bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@BindingAdapter({"bind:font"}) | |
public static void setFont(TextView textView, String fontName) { | |
Typeface typeface = Typeface.createFromAsset(context.getAssets(), "fonts/" + fontName); | |
textView.setTypeface(typeface); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment