Created
August 15, 2017 18:12
-
-
Save zalito12/fa147c24876562bc69b83229daf564fb to your computer and use it in GitHub Desktop.
Android Custom Font TextView
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
public class CooperTextView extends AppCompatTextView { | |
protected CooperTextView(Context context) { | |
super(context); | |
if(!isInEditMode()) | |
this.setTypeface(Typeface.createFromAsset(context.getAssets(), "fonts/cooper_std.ttf")); | |
} | |
public CooperTextView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
if(!isInEditMode()) | |
this.setTypeface(Typeface.createFromAsset(context.getAssets(), "fonts/cooper_std.ttf")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment