title: Why there are different animation when performing hamburger to arrow animation on toolbar?
body: <p>I have 2 different apps, which will perform hamburger to arrow animation on toolbar.</p>
  
  <p>Both app are using <code>implementation 'com.android.support:design:27.1.1'</code></p>
  
  <h2>First app - Simple hamburger to arrow animation</h2>
  
  <p><a href="https://www.youtube.com/watch?v=i0-vmhOQPB0&amp;feature=youtu.be" rel="nofollow noreferrer">https://www.youtube.com/watch?v=i0-vmhOQPB0&amp;feature=youtu.be</a></p>
  
  <h2>Second app - Hamburger to arrow, with rotation animation</h2>
  
  <p><a href="https://www.youtube.com/watch?v=1DljB0rskWE&amp;feature=youtu.be" rel="nofollow noreferrer">https://www.youtube.com/watch?v=1DljB0rskWE&amp;feature=youtu.be</a></p>
  
  <p>What really confused me is that, why there are 2 different animation. Both app are using same support library, with same animation code.</p>
  
  <pre><code>private static class ActionBarDrawerToggleEx extends android.support.v7.app.ActionBarDrawerToggle {
      public ActionBarDrawerToggleEx(Activity activity, DrawerLayout drawerLayout,
                                     Toolbar toolbar, @StringRes int openDrawerContentDescRes,
                                     @StringRes int closeDrawerContentDescRes) {
          super(activity, drawerLayout, toolbar, openDrawerContentDescRes, closeDrawerContentDescRes);
      }
  
      public void enableAnimation(boolean enable) {
          enableAnimation = enable;
      }
  
      @Override
      public void onDrawerSlide(View drawerView, float slideOffset) {
          super.onDrawerSlide(drawerView, enableAnimation ? slideOffset : 0);
      }
  
      private volatile boolean enableAnimation = true;
  }
  
  private void animateHamburgerToArrow() {
      actionBarDrawerToggle.enableAnimation(true);
  
      drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
  
      ValueAnimator anim = ValueAnimator.ofFloat(0f, 1f);
      anim.addListener(new ValueAnimator.AnimatorListener() {
  
          @Override
          public void onAnimationStart(Animator animator) {
  
          }
  
          @Override
          public void onAnimationEnd(Animator animator) {
              actionBarDrawerToggle.enableAnimation(false);
              arrowVisible = true;
          }
  
          @Override
          public void onAnimationCancel(Animator animator) {
  
          }
  
          @Override
          public void onAnimationRepeat(Animator animator) {
  
          }
      });
  
      anim.addUpdateListener(valueAnimator -&gt; {
          float slideOffset = (Float) valueAnimator.getAnimatedValue();
          actionBarDrawerToggle.onDrawerSlide(null, slideOffset);
      });
      anim.setInterpolator(new DecelerateInterpolator());
      // You can change this duration to more closely match that of the default animation.
      anim.setDuration(300);
      anim.start();
  }
  </code></pre>
  
  <p>Any idea why same code will yield different animations?</p>