title: How to set Tab width in Tab layout?
body: <p>I'm trying to create a <code>tab layout</code> which has two <code>tabs</code>. When I run the app on small mobile the <code>tab layout</code> looks fine but when I run the same application on <code>Tablet</code> it shows like this.</p>
  
  <p>It looks like this on Tablet:</p>
  
  <p><a href="https://i.stack.imgur.com/U08Sz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/U08Sz.png" alt="enter image description here"></a></p>
  
  <p>I want each tab to occupy entire space without any gaps on both the ends. I have created <code>tab layout</code> like this...</p>
  
  <pre><code>private void drawTabLayout() {
      tabLayout = (TabLayout) findViewById(R.id.tabs);
      tabLayout.addTab(tabLayout.newTab().setText("Imprint") );
      tabLayout.addTab(tabLayout.newTab().setText("Legal"));
      tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
      tabLayout.setTabMode(TabLayout.MODE_FIXED);
      tabLayout.setSelectedTabIndicatorHeight(10);
      tabLayout.setBackgroundColor(Color.WHITE);
  }
  </code></pre>
  
  <p>I have searched many sites but couldn't find the right <strong>answer</strong>. </p>