Customize Android TabLayout

There are more than one way to customize android.support.design.widget.TabLayout. It depends on what needs to be customized.

Change just more than background color

background color can be changed either by below attributes
app:tabBackground="@drawable/tab_bgcolor" app:tabBackground="@color/tab_bgcolor" android:background="@color/tab_bgcolor"

With style attribute a lot can be customized.

 <style name="CustomTabLayoutStyle" parent="Base.Widget.Design.TabLayout">
   <item name="tabTextAppearance">@style/CustomTabTextStyle</item>
   <item name="tabSelectedTextColor">@color/color_tab_selected</item>
    </style>

<style name="CustomTabTextStyle" parent="TextAppearance.Design.Tab">  
   <item name="android:textSize">14sp</item>
   <item name="android:textColor">@color/color_tab_text</item>
</style>  

Finally, add custom style to TabLayout as style="@style/CustomTabLayoutStyle"

Also, textColor can be directly manipulated as below without the need for creating new style.

<android.support.design.widget.TabLayout  
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                app:tabTextColor="@color/color_tab_text"
                app:tabSelectedTextColor="@color/color_tab_selected"
                android:layout_height="wrap_content" />