title: Scene transition with nested shared element
body: <p>I'm trying to use the Transitions API to animate a shared element between two ViewGroups. The goal is that the green view travels 'out of its parent's bounds' towards the new position.</p>
  
  <p><a href="https://i.stack.imgur.com/AfC0b.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AfC0b.png" alt="enter image description here"></a> <a href="https://i.stack.imgur.com/ktNCk.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ktNCk.png" alt="enter image description here"></a> <a href="https://i.stack.imgur.com/gGkeC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/gGkeC.png" alt="enter image description here"></a>  </p>
  
  <p>I have the following layouts:</p>
  
  <p><code>first.xml</code>:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;
  
    &lt;FrameLayout
      android:layout_width="200dp"
      android:layout_height="200dp"
      android:background="#f00" /&gt;
  
    &lt;FrameLayout
      android:layout_width="200dp"
      android:layout_height="200dp"
      android:layout_alignParentBottom="true"
      android:layout_alignParentRight="true"
      android:background="#00f"&gt;
  
      &lt;View
        android:id="@+id/myview"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_gravity="center"
        android:background="#0f0" /&gt;
  
    &lt;/FrameLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><code>second.xml</code>:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;
  
    &lt;FrameLayout
      android:layout_width="200dp"
      android:layout_height="200dp"
      android:background="#f00"&gt;
  
      &lt;View
        android:id="@+id/myview"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_gravity="center"
        android:background="#0f0" /&gt;
  
    &lt;/FrameLayout&gt;
  
    &lt;FrameLayout
      android:layout_width="200dp"
      android:layout_height="200dp"
      android:layout_alignParentBottom="true"
      android:layout_alignParentRight="true"
      android:background="#00f" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>However, I can't get this to work properly. The default transition just fades everything out and in, the <code>ChangeBounds</code> transition does nothing at all, and the <code>ChangeTransform</code> does not look right either.</p>
  
  <p>The code I'm using:</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      final ViewGroup root = (ViewGroup) findViewById(android.R.id.content);
  
      setContentView(R.layout.first);
      View myView1 = findViewById(R.id.myview);
      myView1.setTransitionName("MYVIEW");
  
      new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
          View second = LayoutInflater.from(MainActivity.this).inflate(R.layout.second, root, false);
          View myView2 = second.findViewById(R.id.myview);
          myView2.setTransitionName("MYVIEW");
  
          Scene scene = new Scene(root, second);
          Transition transition = new ChangeTransform();
          transition.addTarget("MYVIEW");
          transition.setDuration(3000);
  
          TransitionManager.go(scene, transition);
        }
      }, 2000);
    }
  </code></pre>
  
  <p>Now I am manually able to do this by creating the animation myself using a <code>ViewOverlay</code>. However, I'm looking for a solution using the Transitions API. Is this even possible?</p>
  
  <p>Also, I am not looking to 'flatten' the hierarchy. I am intentionally nesting the View to account for more complex use cases.</p>