title: Android Swipe Tab customize the Tab Indicator color
body: <p>I need to change the tab indicator color (see image below):</p>
  
  <p><a href="https://i.stack.imgur.com/N8IoN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N8IoN.png" alt="enter image description here"></a></p>
  
  <p>Even if I follow the following official tutorial: <a href="https://developer.android.com/training/basics/actionbar/styling.html#CustomTabs" rel="nofollow noreferrer">https://developer.android.com/training/basics/actionbar/styling.html#CustomTabs</a> I still can't make it work.</p>
  
  <p>The application compile version is: <em>compileSdkVersion 22</em></p>
  
  <p>The application theme is: <em>Theme.AppCompat.Light.DarkActionBar</em></p>
  
  <p><strong>...res/values/styles.xml</strong> (theme customizations file)</p>
  
  <pre><code>&lt;resources&gt;
  &lt;!-- Base application theme. --&gt;
  &lt;style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar"&gt;
      &lt;!-- Customize your theme here. --&gt;
      &lt;item name="colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name="colorPrimaryDark"&gt;@color/colorDark&lt;/item&gt;
      &lt;item name="android:actionBarTabBarStyle"&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name="android:actionBarTabStyle"&gt;@style/ActionBarTabStyle.Example&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;!-- ActionBar tabs styles --&gt;
  &lt;style name="ActionBarTabStyle.Example" parent="@style/Widget.AppCompat.Light.ActionBar.TabText"&gt;
      &lt;item name="android:background"&gt;@drawable/tab_indicator_ab_example&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;color name="colorDark"&gt;#ff9800&lt;/color&gt;
  &lt;color name="colorPrimary"&gt;#ffc107&lt;/color&gt;
  &lt;color name="happy"&gt;#ffeb3b&lt;/color&gt;
  &lt;color name="normal"&gt;#fff176&lt;/color&gt;
  &lt;color name="sad"&gt;#fff59d&lt;/color&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p><strong>...res/drawable/tab_indicator_ab_example.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;!-- Non focused states --&gt;
  &lt;item android:drawable="@android:color/transparent" android:state_focused="false" android:state_pressed="false" android:state_selected="false" /&gt;
  &lt;item android:drawable="@drawable/tab_selected_example" android:state_focused="false" android:state_pressed="false" android:state_selected="true" /&gt;
  
  &lt;!-- Focused states --&gt;
  &lt;item android:drawable="@drawable/tab_unselected_focused_example" android:state_focused="true" android:state_pressed="false" android:state_selected="false" /&gt;
  &lt;item android:drawable="@drawable/tab_selected_focused_example" android:state_focused="true" android:state_pressed="false" android:state_selected="true" /&gt;
  
  &lt;!-- Pressed --&gt;
  &lt;!--    Non focused states --&gt;
  &lt;item android:drawable="@drawable/tab_unselected_pressed_example" android:state_focused="false" android:state_pressed="true" android:state_selected="false" /&gt;
  &lt;item android:drawable="@drawable/tab_selected_pressed_example" android:state_focused="false" android:state_pressed="true" android:state_selected="true" /&gt;
  
  &lt;!--    Focused states --&gt;
  &lt;item android:drawable="@drawable/tab_unselected_pressed_example" android:state_focused="true" android:state_pressed="true" android:state_selected="false" /&gt;
  &lt;item android:drawable="@drawable/tab_selected_pressed_example" android:state_focused="true" android:state_pressed="true" android:state_selected="true" /&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>Can't figure out where is the problem, everything compiles without errors and the code follows step by step the official documentation. Thx.</p>