Back to project page RobotoViews.
The source code is released under:
Apache License
If you think the Android project RobotoViews 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.pjcorp.robotoview.view; // w w w . ja v a 2 s.c o m import android.content.Context; import android.graphics.Typeface; import android.util.AttributeSet; import com.pjcorp.robotoview.utils.TypefaceManager; /** * Re write RadioButton class integrating Roboto font */ public class RadioButton extends android.widget.RadioButton { public RadioButton(Context context) { super(context); } public RadioButton(Context context, AttributeSet attrs) { super(context, attrs); onInitTypeface(context, attrs, 0); } public RadioButton(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); onInitTypeface(context, attrs, defStyle); } protected void onInitTypeface(Context context, AttributeSet attrs, int defStyle){ if(attrs != null){ Typeface typeface = TypefaceManager.getTypeface(context, attrs, defStyle); if(typeface != null){ setTypeface(typeface, 0); } } } }