title: Activity and Fragment Transitions in Lollipop
body: <p>I'm trying to wrap my head around the new <code>Activity</code> <code>Transition</code> framework in <code>Lollipop</code>.
  The Activity Transition works pretty straighforward and there are some <a href="https://developer.android.com/training/material/animations.html">basic info here</a>, but the <code>Fragment</code> <code>Transition</code> is undocumented and I can't get it to work.
  I've tried this use case (very common in Android): </p>
  
  <blockquote>
    <p>case 1: ActA+FragA -> ActB+FragB</p>
  </blockquote>
  
  <p>with the <strong>sharedElement</strong> being an <strong>image</strong> in <code>FragA</code> and <code>FragB</code>. I didn't come up with working code, so I went a step back and tried </p>
  
  <blockquote>
    <p>case 2: ActA+FragA -> ActB</p>
  </blockquote>
  
  <p>with a <strong>sharedElement</strong> on <code>FragA</code> and <code>ActB</code>. The animation won't work, I can only see that when I click the image on FragA, the image disappear and after the animation's duration it pops up in ActB. Shared views outside FragA but inside ActA (the <code>Toolbar</code> for example) animate correctly.</p>
  
  <p>In this case the sharedImage is an imageView in a RecyclerView, could it be that the xml tag <code>android:transitionName="shared_icon"</code> in the item's layout xml doesn't work?</p>
  
  <p>This is my Theme: </p>
  
  <pre><code> &lt;!-- Window Transactions --&gt;
      &lt;item name="android:windowContentTransitions"&gt;true&lt;/item&gt;
      &lt;item name="android:windowAllowEnterTransitionOverlap"&gt;true&lt;/item&gt;
      &lt;item name="android:windowAllowReturnTransitionOverlap"&gt;true&lt;/item&gt;
      &lt;item name="android:fragmentAllowEnterTransitionOverlap"&gt;@bool/true_bool&lt;/item&gt;
      &lt;item name="android:fragmentAllowReturnTransitionOverlap"&gt;@bool/true_bool&lt;/item&gt;
  
      &lt;item name="android:windowEnterTransition"&gt;@transition/window_transition.xml&lt;/item&gt;
      &lt;item name="android:windowExitTransition"&gt;@transition/window_transition.xml&lt;/item&gt;
      &lt;item name="android:fragmentEnterTransition"&gt;@transition/window_transition.xml&lt;/item&gt;
      &lt;item name="android:fragmentReturnTransition"&gt;@transition/window_transition.xml&lt;/item&gt;
      &lt;item name="android:fragmentReenterTransition"&gt;@transition/window_transition.xml&lt;/item&gt;
  
      &lt;!-- Shared Element Transactions --&gt;
      &lt;item name="android:windowSharedElementEnterTransition"&gt;@transition/shared_elements_transform.xml&lt;/item&gt;
      &lt;item name="android:windowSharedElementExitTransition"&gt;@transition/shared_elements_transform.xml&lt;/item&gt;
  
      &lt;item name="android:fragmentSharedElementEnterTransition"&gt;@transition/shared_elements_transform.xml&lt;/item&gt;
      &lt;item name="android:fragmentSharedElementReturnTransition"&gt;@transition/shared_elements_transform.xml&lt;/item&gt;
  </code></pre>
  
  <p>window_transition.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;transitionSet xmlns:android="http://schemas.android.com/apk/res/android"
  android:ordering="together"
  android:duration="@integer/act_transition_duration"&gt;
  &lt;changeBounds  /&gt;
  &lt;changeTransform /&gt;
  &lt;changeClipBounds /&gt;
  &lt;changeImageTransform /&gt;
  &lt;/transitionSet&gt;
  </code></pre>
  
  <p>shared_element_transition.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;transitionSet xmlns:android="http://schemas.android.com/apk/res/android"
  android:ordering="together"
  android:duration="@integer/act_transition_duration"&gt;
  &lt;changeImageTransform /&gt;
  &lt;changeBounds /&gt;
  &lt;/transitionSet&gt;
  </code></pre>