title: the setColorFilter doesn't work in onTabSelected event in android 5
body: <p>I have Tablayout that works with ViewPager. I used custom tab for tabs. But the problem with that is the Colorfilter doesn't work on onTabSelected event in android 5 but it works in andrid 4.4 very well.
  This is my custom layout for tab:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;ImageView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:layout_marginTop="10dp"
          android:id="@+id/imageView" /&gt;
  
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:text="New Text"
          android:textColor="@color/custom_selector"
          android:gravity="center"
          android:id="@+id/tabText" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and this is what i did on for selected tab icon:</p>
  
  <pre><code>  protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main_page);
           tf = Typeface.createFromAsset(getAssets(), "IRANSans_Bold.ttf");
  
          tabCustomization();
          /*changeTabsFont();*/
          setupTabIcons();
          tabLayout.getTabAt(0).getIcon().setColorFilter(Color.parseColor("#a8a8a8"), PorterDuff.Mode.SRC_IN);
      }
  
      private void tabCustomization() {
          viewPager = (CustomViewPager) findViewById(R.id.viewPager);
          viewPager.setPagingEnabled(false);
  
          setupViewPager(viewPager);
          tabLayout = (TabLayout) findViewById(R.id.tabs);
  
          tabLayout.setupWithViewPager(viewPager);
          ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
  
  
          adapter.addFragment(new MenuFragment(), "menu");
  
          adapter.addFragment(new AddressFragment(), "Address");
          adapter.addFragment(new SearchFragment(), "Search");
          adapter.addFragment(new IssueFragment(), "Issue");
  
          viewPager.setAdapter(adapter);
          for (int i = 0; i &lt; tabLayout.getTabCount(); i++) {
              TabLayout.Tab tab = tabLayout.getTabAt(i);
  
  
              tab.setCustomView(adapter.getTabView(tabLayout,i));
  
          }
  
  
          ViewGroup vg = (ViewGroup) tabLayout.getChildAt(0);
          int tabsCount = vg.getChildCount();
          Log.i("TabChild",String.valueOf(tabsCount));
  
  
  // Iterate over all tabs and set the custom view
  
      }
      public void setupViewPager(ViewPager viewPager) {
  
      }
      private void setupTabIcons() {
  
          tabLayout.getTabAt(0).setIcon(tabIcons[0]);
          tabLayout.getTabAt(1).setIcon(tabIcons[1]);
          tabLayout.getTabAt(2).setIcon(tabIcons[2]);
          tabLayout.getTabAt(3).setIcon(tabIcons[3]);
  
  
          tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener(){
  
  
              @Override
                  public void onTabSelected(TabLayout.Tab tab) {
                  tab.getIcon().setColorFilter(Color.parseColor("#a8a8a8"), PorterDuff.Mode.SRC_IN);
              }
  
              @Override
              public void onTabUnselected(TabLayout.Tab tab) {
                  tab.getIcon().setColorFilter(Color.WHITE, PorterDuff.Mode.SRC_IN);
              }
  
              @Override
              public void onTabReselected(TabLayout.Tab tab) {
              }
          });
      }
  
  
      class ViewPagerAdapter extends FragmentPagerAdapter {
  
          private final List&lt;Fragment&gt; mFragmentList = new ArrayList&lt;&gt;();
          private final List&lt;String&gt; mFragmentTitleList = new ArrayList&lt;&gt;();
  
          public ViewPagerAdapter(FragmentManager manager) {
              super(manager);
          }
  
  
          @Override
          public Fragment getItem(int position) {
              return mFragmentList.get(position);
          }
          @Override
          public int getCount() {
              return mFragmentList.size();
          }
  
          public void addFragment(Fragment fragment, String title) {
              mFragmentList.add(fragment);
              mFragmentTitleList.add(title);
          }
          public View getTabView(TabLayout tabLayout,int position) {
              // Given you have a custom layout in `res/layout/custom_tab.xml` with a TextView and ImageView
  
              View view = LayoutInflater.from(getApplicationContext())
                      .inflate(R.layout.custom_tab, tabLayout, false);
              TextView textView= (TextView) view.findViewById(R.id.tabText);
  
              textView.setText(getPageTitle(position));
              textView.setTypeface(tf);
  
              ImageView imageView = (ImageView) view.findViewById(R.id.imageView);
              imageView.setImageResource(tabIcons[position]);
  
              return view;
          }
  
          @Override
          public CharSequence getPageTitle(int position) {
              return mFragmentTitleList.get(position);
          }
  
      }
  </code></pre>