title: Android ViewFlipper auto animation / looping breaks at last child view
body: <p>I have made a ViewFlipper to simulate a slideshow component looping the slides continuously.
  I configured it be:</p>
  
  <pre><code>mViewFlipper.setAnimateFirstView(true);
  mViewFlipper.setAutoStart(true);
  </code></pre>
  
  <p><strong>Everything works fine until the last slide (or child view).
  At this moment the first slide appears abruptly without sliding !!!</strong></p>
  
  <p>I checked the ViewFlipper and ViewAnimation source code and found the following:</p>
  
  <pre><code>   void showOnly(int childIndex, boolean animate) {
         final int count = getChildCount();
         for (int i = 0; i &lt; count; i++) {
             final View child = getChildAt(i);
             if (i == childIndex) {
                 if (animate &amp;&amp; mInAnimation != null) {
                     child.startAnimation(mInAnimation);
                 }
                 child.setVisibility(View.VISIBLE);
                 mFirstTime = false;
             } else {
                 if (animate &amp;&amp; mOutAnimation != null &amp;&amp; child.getVisibility() == View.VISIBLE) {
                     child.startAnimation(mOutAnimation);
                 } else if (child.getAnimation() == mInAnimation)
                     child.clearAnimation();
                 child.setVisibility(View.GONE);
             }
         }
     }
  </code></pre>
  
  <p>As you can see this method always starts with the lowest index to animate-in.</p>
  
  <p>For example if I have 5 slides:</p>
  
  <p>when the slide #4 is visible and should be replaced by slide #0, the slide #0 is animated-in before slide #4 is animated-out, which makes the animation sudden and not smooth at all.</p>
  
  <p>Does anybody have any workaround to this problem ?</p>
  
  <p>Thanks</p>