title: Android - ActivityOptionsCompat - Custom Expand Animation
body: <p>I'm currently trying to figure out how to make a custom expand animation and using ActivityOptionsCompat seems like the best method for this; however, I'm not really sure on how to write a custom transition animation to do the effect I want.</p>
  
  <p>I have a button on top of a list 'Open', which when pressed will shift the ListView below it down, expanding and showing a screen with options. I hope this image explains what I'm trying to accomplish.</p>
  
  <p><a href="https://i.stack.imgur.com/GRj0H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GRj0H.png" alt="Expand Transition Animation"></a></p>
  
  <p>What I'm trying to do is:</p>
  
  <ul>
  <li>Set the top "Open" bar to the top bar in the second screen "Title"
  called "FILTERS"</li>
  <li>Set a 0px height view that's directly under the "Open" bar to the
  expanded options list called "FRAME"</li>
  <li>Set the ViewPager to a 0px height view below the expanded options
  called "LIST"</li>
  </ul>
  
  <p>But the List doesn't get pushed away, the new screen is just overlayed on top of it.</p>
  
  <pre><code>ViewCompat.setTransitionName( filters, "FILTERS" );
  ViewCompat.setTransitionName( frame, "FRAME" );
  ViewCompat.setTransitionName( viewPager, "LIST" );
  
  ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(
              getActivity(), new Pair&lt;&gt;( filters, "FILTERS" ), new Pair&lt;&gt;( frame, "FRAME" ), new Pair&lt;&gt;( (View)viewPager, "LIST" ) );
  
  
  ActivityCompat.startActivity( getActivity(), new Intent( getActivity(), Filters.class ),
              options.toBundle() );
  </code></pre>
  
  <p>Does anyone know how to accomplish this style of transition animation? </p>
  
  <p>Thanks for your time and help.</p>