Advertisement
Guest User

Untitled

a guest
Jan 26th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. public class MyTextView extends TextView {
  2.  
  3.     public MyTextView(Context context, AttributeSet attrs, int defStyle) {
  4.         super(context, attrs, defStyle);
  5.         init();
  6.     }
  7.  
  8.     public MyTextView(Context context, AttributeSet attrs) {
  9.         super(context, attrs);
  10.         init();
  11.     }
  12.  
  13.     public MyTextView(Context context) {
  14.         super(context);
  15.         init();
  16.     }
  17.  
  18.     public void init() {
  19.         Typeface tf = Typeface.createFromAsset(getContext().getAssets(), "fonts/Munro.ttf");
  20.         setTypeface(tf ,1);
  21.  
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement