I have added TabLayout (from support library v22.2.1) to my Fragment as:
TabLayout
I didn't care about the tabs filling the width, but I cared that the background color wasn't expanding to the full width. So I thought of this solution, where I put a FrameLayout behind it with the same background color as the tabs.