If you want to use a TextView in so many places with same font family, extend the TextView class and set your font like this:-
public class ProximaNovaTextView extends TextView {
public ProximaNovaTextView(Context context) {
super(context);
applyCustomFont(context);
}
public ProximaNovaTextView(Context context, AttributeSet attrs) {
super(context, attrs);
applyCustomFont(context);
}
public ProximaNovaTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
applyCustomFont(context);
}
private void applyCustomFont(Context context) {
Typeface customFont = FontCache.getTypeface("proximanova_regular.otf", context);
setTypeface(customFont);
}
}
And then use this custom class in xml for the TextView like this:-
<com.myapp.customview.ProximaNovaTextView
android:id="@+id/feed_list_item_name_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
/>