If you think the Android project MagicViews listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.ivankocijan.magicviews.views;
//www.java2s.comimport android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;
import com.ivankocijan.magicviews.utils.FontUtils;
/**
* Created by ivankocijan on 17.05.2014.
*/publicclass MagicTextView extends TextView {
public MagicTextView (Context context) {
super(context);
init(context, null);
}
public MagicTextView (Context context, AttributeSet attrs) {
super(context, attrs);
if (!isInEditMode()) {
init(context, attrs);
}
}
public MagicTextView (Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
if (!isInEditMode()) {
init(context, attrs);
}
}
privatevoid init (Context ctx, AttributeSet attrs) {
FontUtils.setTypeface(ctx, attrs, this);
}
}