title: How can I observe whether a fragment manager currently has an animation running?
body: <p>I have two fragments, <code>CatFragment</code> and <code>DogFragment</code>. I got a new dog and don't love my cat anymore, so I want to add <code>DogFragment()</code> on top of <code>CatFragment</code>, and do a crossfade animation between them.</p>
  
  <pre><code>fragmentManager!!.beginTransaction()
                  .setCustomAnimations(
                      R.anim.fade_in,
                      R.anim.fade_out,
                      R.anim.fade_in,
                      R.anim.fade_out
                  )
                  .add(R.id.frame, DogFragment())
                  .addToBackStack(null)
                  .hide(fragmentManager!!.findFragmentByTag(CatFragment.TAG))
                  .commitAllowingStateLoss()
  </code></pre>
  
  <p>My <code>CatFragment()</code> has two states:</p>
  
  <ol>
  <li><code>Cat</code> (a beautiful picture of my cat)</li>
  <li><code>LoadingABetterPet</code> (just a progress bar)</li>
  </ol>
  
  <p>Internally the fragment's views crossfade when switching between these states. </p>
  
  <p>My <code>DogFragment()</code> has 1 state: a beautiful picture of my brand new dog.</p>
  
  <h2>Flow:</h2>
  
  <p>The user sees the following flow:</p>
  
  <p><code>CatFragment.Cat</code> --(internal crossfade)-> <code>CatFragment.LoadingABetterPet</code> --
   (fragment manager crossfade)--> <code>DogFragment</code>.</p>
  
  <p>When the user hits back while <code>DogFragment</code> is visible, I want them to see <code>CatFragment</code> in its <code>Cat</code> state.</p>
  
  <p>However, while <code>DogFragment</code> is animating onto the screen, <code>CatFragment</code> in parallel internally runs its own crossfade animation from <code>LoadingABetterPet</code> to <code>Cat</code>. This causes some artifacting during the <code>.add()</code> fragment manager animation where the user partially sees my cat.</p>
  
  <p>To avoid this, I would like <code>CatFragment</code> to delay animating from <code>LoadingABetterPet</code> back to <code>Cat</code> while <code>fragmentManager</code> is running animations. How can I do this?</p>
  
  <p>Does the support fragment manager expose whether an animation is currently running?</p>