My question is quite simple:
In every of my textview, I am currently using the attribute
android:fontFamily="sans-serif-light"
to provide a gorgeous look on post HC devices.
Unfortunately, this doesn't work with every widget and for my Spinners, I need to overwrite the Adapter.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
//You can use the new tf here.
if(convertView == null || convertView.getTag() == null) {
// new view - populate
convertView = inflater.inflate(android.R.layout.simple_spinner_dropdown_item, parent, false);
convertView.setTag(new Object());
}
CheckedTextView spinner_text=(CheckedTextView) convertView.findViewById(android.R.id.text1);
//Typeface should be set here...
return spinner_text;
}
}
So, is there a way to get exactly the same result by code?
PS: No, I don't want to put a typeface in asset folder, I just want to use system one.