Guest User

Untitled

a guest
Mar 14th, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. public class MyEditText extends EditText {
  2.  
  3.     public MyEditText(Context context, AttributeSet attrs, int defStyle) {
  4.         super(context, attrs, defStyle);
  5.         init();
  6.     }
  7.  
  8.     public MyEditText(Context context, AttributeSet attrs) {
  9.         super(context, attrs);
  10.         init();
  11.     }
  12.  
  13.     public MyEditText(Context context) {
  14.         super(context);
  15.         init();
  16.     }
  17.  
  18.     private void init() {
  19.         if (!isInEditMode()) {
  20.             Typeface tf = Typeface.createFromAsset(getContext().getAssets(), "font.ttf");
  21.             setTypeface(tf);
  22.         }
  23.     }
  24.  
  25. }
Add Comment
Please, Sign In to add comment