title: How can you animate within Android's TabLayout?
body: <p>I've implemented <code>TabLayout</code> with a <code>viewPager</code>, for four tabs.
  The tabs have a <code>customView</code>, since there are two <code>textView</code>'s (text + unseen count) for each tab.
  So, I'm able to handle a lot of UI stuff when changing tabs, but, I can't animate the unseen <code>textView</code>.</p>
  
  <p>My custom XML has <code>android:animateLayoutChanges="true"</code> for both the <code>textView</code> and its parent <code>RelativeLayout</code>.</p>
  
  <p>Plus, I've tried setting this feature on the actual tab, tried a variation of animations, none works.
  Ps - without animation, I'm just setting the visibility (gone, visible), which works.</p>
  
  <pre><code>private void updateUnseenOnTab(int position, int unseen) {
      ViewGroup vg = (ViewGroup) mTabLayout.getChildAt(0);
  
      ViewGroup vgTab = (ViewGroup) vg.getChildAt(position);
      View view = vgTab.getChildAt(0);
  
      if (view != null &amp;&amp; view.findViewById(R.id.tab_unseen) instanceof TextView) {
          final TextView unseenText = (TextView) view.findViewById(R.id.tab_unseen);
          if (unseen &lt;= 0) {
              unseenText.setText("0");
              Animation fadeOut = new AlphaAnimation(0, 1);
              fadeOut.setDuration(1000);
              unseenText.setAnimation(fadeOut);
          } else {
              String currentText = unseenText.getText().toString();
              try {
                  Animation fadeIn = new AlphaAnimation(0, 1);
                  fadeIn.setDuration(1000);
                  unseenText.setAnimation(fadeIn);
                  unseenText.setText("" + ((TextUtils.isEmpty(currentText) ? 0 : unseen) + Integer.valueOf(currentText)));
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }
  </code></pre>