Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void changeTabsFont(Context context, TabLayout tabLayout, int color) {
- ViewGroup vg = (ViewGroup) tabLayout.getChildAt(0);
- tabLayout.setBackgroundColor(color);
- int tabsCount = vg.getChildCount();
- for (int j = 0; j < tabsCount; j++) {
- ViewGroup vgTab = (ViewGroup) vg.getChildAt(j);
- int tabChildsCount = vgTab.getChildCount();
- for (int i = 0; i < tabChildsCount; i++) {
- View tabViewChild = vgTab.getChildAt(i);
- if (tabViewChild instanceof TextView) {
- ((TextView) tabViewChild).setTypeface(Typeface.createFromAsset(context.getAssets(), "Lato-Regular.ttf"));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement