package com.gertherb.view;
import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.TextView;
import com.gertherb.base.TypefaceFactory;
public class FontTextView extends TextView {
private final TypefaceFactory typeFaceFactory;
public FontTextView(Context context, AttributeSet attrs) {
super(context, attrs);
this.typeFaceFactory = new TypefaceFactory();
initTypeface(context, attrs);
}
public FontTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
this.typeFaceFactory = new TypefaceFactory();
initTypeface(context, attrs);
}
private void initTypeface(Context context, AttributeSet attrs) {
Typeface typeface = typeFaceFactory.createFrom(context, attrs);
setTypeface(typeface);
}
}