Skip to content

Instantly share code, notes, and snippets.

@pwittchen
Created January 31, 2013 23:25
Show Gist options
  • Save pwittchen/4687667 to your computer and use it in GitHub Desktop.
Save pwittchen/4687667 to your computer and use it in GitHub Desktop.
public class MyEditText extends EditText{
public MyEditView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
public MyEditView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public MyEditView(Context context) {
super(context);
init();
}
private void init() {
if (!isInEditMode()) {
Typeface tf = Typeface.createFromAsset(getContext().getAssets(), "font.ttf");
setTypeface(tf);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment