Back to project page LASA-Schedules.
The source code is released under:
GNU General Public License
If you think the Android project LASA-Schedules listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.asdar.lasaschedules; //from ww w . jav a 2 s .co m import android.content.Context; import android.graphics.Typeface; import android.util.AttributeSet; import android.util.Log; import android.widget.TextView; /** * Created by Ehsan on 4/18/2014. */ public class RobotoTextView extends TextView { Context context; public RobotoTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); this.context = context; } public RobotoTextView(Context context, AttributeSet attrs) { super(context, attrs); this.context = context; } public RobotoTextView(Context context) { super(context); this.context = context; } public void setTypeface(Typeface tf, int style) { if (style == Typeface.NORMAL) { super.setTypeface(Typeface.createFromAsset(getContext().getAssets(), "fonts/Roboto-Regular.ttf")); } else if (style == Typeface.ITALIC) { super.setTypeface(Typeface.createFromAsset(getContext().getAssets(), "fonts/Roboto-Italic.ttf")); } else if (style == Typeface.BOLD) { super.setTypeface(Typeface.createFromAsset(getContext().getAssets(), "fonts/Roboto-Medium.ttf")); } } }