title: 3D Flip Animation on android.support.v4.Fragment
body: <p>I am currently reading this tutorial:</p>
  
  <blockquote>
    <p><a href="http://developer.android.com/training/animation/cardflip.html" rel="noreferrer">http://developer.android.com/training/animation/cardflip.html</a></p>
  </blockquote>
  
  <p>on <strong>flip Animations of Fragments</strong>. Unfortunately, the <strong>object-animator</strong> is only available for android.app.Fragment, and not the <strong>support Fragment.</strong></p>
  
  <p>I tried to reconstruct the .xml animations using scale and rotation animations.
  But now the animations are just not executed,  and after the time that I've set in the animations .xml file passes, the other Fragment appears, instead of flipping.</p>
  
  <ul>
  <li>Did I simply make a misstake in implementing the .xml animations? </li>
  <li>Or is it not possible to do a 3D flip animation without object-animator?</li>
  <li>Or is it not possible to do a 3D flip animation with the support
  Fragment?</li>
  </ul>
  
  <p>Here are my .xml animations:
  flip_left_in.xml</p>
  
  <pre><code>&lt;set xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  
    &lt;!-- Before rotating, immediately set the alpha to 0. --&gt;
   &lt;alpha
      android:valueFrom="1.0"
      android:valueTo="0.0"
      android:propertyName="alpha"
      android:duration="0" /&gt;
  
   &lt;!-- Rotate. --&gt;
   &lt;rotate
      android:valueFrom="-180"
      android:valueTo="0"
      android:propertyName="rotationY"
      android:interpolator="@android:anim/accelerate_decelerate_interpolator"
      android:duration="800"/&gt;
  
  &lt;!-- Half-way through the rotation (see startOffset), set the alpha to 1. --&gt;
  &lt;alpha
      android:valueFrom="0.0"
      android:valueTo="1.0"
      android:startOffset="400"
      android:duration="1" /&gt; 
  &lt;/set&gt;
  </code></pre>
  
  <p>flip_left_out.xml</p>
  
  <pre><code> &lt;set xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  
     &lt;!-- Rotate. --&gt;
     &lt;rotate
      android:duration="800"
      android:interpolator="@android:anim/accelerate_decelerate_interpolator"
      android:propertyName="rotationY"
      android:valueFrom="0"
      android:valueTo="180" /&gt;
  
  &lt;!-- Half-way through the rotation (see startOffset), set the alpha to 0. --&gt;
  &lt;alpha
      android:duration="1"
      android:propertyName="alpha"
      android:startOffset="400"
      android:valueFrom="1.0"
      android:valueTo="0.0" /&gt;
  
   &lt;/set&gt;
  </code></pre>
  
  <p>flip_right_in.xml</p>
  
  <pre><code>&lt;set xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  &lt;!-- Before rotating, immediately set the alpha to 0. --&gt;
  &lt;alpha
      android:duration="0"
      android:propertyName="alpha"
      android:valueFrom="1.0"
      android:valueTo="0.0" /&gt;
  
  &lt;!-- Rotate. --&gt;
  &lt;rotate
      android:duration="800"
      android:interpolator="@android:anim/accelerate_decelerate_interpolator"
      android:propertyName="rotationY"
      android:valueFrom="180"
      android:valueTo="0" /&gt;
  
  &lt;!-- Half-way through the rotation (see startOffset), set the alpha to 1. --&gt;
  &lt;alpha
      android:duration="1"
      android:propertyName="alpha"
      android:startOffset="400"
      android:valueFrom="0.0"
      android:valueTo="1.0" /&gt;
  
    &lt;/set&gt;
  </code></pre>
  
  <p>flip_right_out.xml</p>
  
  <pre><code>&lt;set xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  &lt;!-- Rotate. --&gt;
  &lt;rotate
      android:duration="800"
      android:interpolator="@android:anim/accelerate_decelerate_interpolator"
      android:propertyName="rotationY"
      android:valueFrom="0"
      android:valueTo="-180" /&gt;
  
  &lt;!-- Half-way through the rotation (see startOffset), set the alpha to 0. --&gt;
  &lt;alpha
      android:duration="1"
      android:propertyName="alpha"
      android:startOffset="400"
      android:valueFrom="1.0"
      android:valueTo="0.0" /&gt;
  
   &lt;/set&gt;
  </code></pre>
  
  <p>And here is the code where they are executed:</p>
  
  <pre><code>FragmentTransaction trans = getActivity().getSupportFragmentManager().beginTransaction();
  
  trans.setCustomAnimations(R.anim.flip_right_in, R.anim.flip_right_out, 
                             R.anim.flip_left_in, R.anim.flip_left_out);
  trans.addToBackStack(null);
  
  trans.replace(R.id.content_frame, new MyFragment()).commit();
  </code></pre>