title: Changing TabLayout icons on left, top, right or bottom in com.android.support:design:23.1.0
body: <p>I'm pretty new to android development. So bear with me.</p>
  
  <p>I've been trying to align the icon and text in same line in <strong>com.android.support:design:23.1.0</strong> for a day.</p>
  
  <p>Apparently in com.android.support:design:<strong>23.1.0</strong> they've changed the default icon position to top and text on the bottom.</p>
  
  <p>Previously in com.android.support:design:<strong>23.0.1</strong> the default was the icon on left and text in same line as the icon</p>
  
  <p>So here's an <em>easy way</em> to solve it (though it might have drawbacks, idk tbh):</p>
  
  <pre><code>change the version in your app's build.gradle. ex: 23.1.0 to 23.0.1 and build.
  </code></pre>
  
  <p>And there's a better way to do it (this way you can also align icons on left,right,top,bottom):</p>
  
  <ol>
  <li>create a <strong>custom_tab.xml</strong> in <strong>res/layout</strong></li>
  </ol>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/tab"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAlignment="center"/&gt;
  </code></pre>
  
  <p>2. in your activity java</p>
  
  <pre class="lang-java prettyprint-override"><code>TextView newTab = (TextView) LayoutInflater.from(this).inflate(R.layout.custom_tab, null);
  newTab.setText("tab1"); //tab label txt
  newTab.setCompoundDrawablesWithIntrinsicBounds(your_drawable_icon_here, 0, 0, 0);
  tabLayout.getTabAt(tab_index_here_).setCustomView(newTab);
  </code></pre>
  
  <p>So far I've achieved to make icons appear on any side like this:</p>
  
  <p><a href="https://i.stack.imgur.com/NcWf6.png"><img src="https://i.stack.imgur.com/NcWf6.png" alt="TabLayout icons"></a></p>
  
  <p>PS: <strong>setCompoundDrawablesWithIntrinsicBounds</strong> function arguments are 4 side icons like this:
  </p>
  
  <pre><code>setCompoundDrawablesWithIntrinsicBounds(leftDrawable, topDrawable, rightDrawable, bottomDrawable)
  </code></pre>