How to set font custom font to Spinner text programmatically?

This is what worked for me (using ideas both from CommonsWare’s and gsanllorente’s answers): private static class MySpinnerAdapter extends ArrayAdapter<String> { // Initialise custom font, for example: Typeface font = Typeface.createFromAsset(getContext().getAssets(), “fonts/Blambot.otf”); // (In reality I used a manager which caches the Typeface objects) // Typeface font = FontManager.getInstance().getFont(getContext(), BLAMBOT); private MySpinnerAdapter(Context context, int resource, … Read more

Change the font of tab text in android design support TabLayout

If you are using TabLayout and you want to change the font you have to add a new for loop to the previous solution like this: private void changeTabsFont() { ViewGroup vg = (ViewGroup) tabLayout.getChildAt(0); int tabsCount = vg.getChildCount(); for (int j = 0; j < tabsCount; j++) { ViewGroup vgTab = (ViewGroup) vg.getChildAt(j); int … Read more

Font size of TextView in Android application changes on changing font size from native settings

Actually, Settings font size affects only sizes in sp. So all You need to do – define textSize in dp instead of sp, then settings won’t change text size in Your app. Here’s a link to the documentation: Dimensions However please note that the expected behavior is that the fonts in all apps respect the … Read more

How to set default font family for entire Android app

The answer is yes. Global Roboto light for TextView and Button classes: <style name=”AppTheme” parent=”AppBaseTheme”> <item name=”android:textViewStyle”>@style/RobotoTextViewStyle</item> <item name=”android:buttonStyle”>@style/RobotoButtonStyle</item> </style> <style name=”RobotoTextViewStyle” parent=”android:Widget.TextView”> <item name=”android:fontFamily”>sans-serif-light</item> </style> <style name=”RobotoButtonStyle” parent=”android:Widget.Holo.Button”> <item name=”android:fontFamily”>sans-serif-light</item> </style> Just select the style you want from list themes.xml, then create your custom style based on the original one. At the end, apply … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)