title: Don't understand how to use animation with adapterViewFlipper
body: <p>I don't understand how to use animation with adapterViewflipper.
  I'm in API13, and I use an adapterViewFlipper in a Fragment. </p>
  
  <p>So in My xml file I only have:</p>
  
  <pre><code>        &lt;AdapterViewFlipper
              android:id="@+id/avfPicturesSite"
              android:layout_width="match_parent"
                  android:layout_height="300dp"
                  android:background="@drawable/gradientbackground"
               &gt;
  
          &lt;/AdapterViewFlipper&gt;
  </code></pre>
  
  <p>and I dynamically create ImageView in getView().</p>
  
  <pre><code>@Override
  public View getView(int position, View convertView, ViewGroup parent) {
      View view = null;
  
      if (convertView == null) {
          final ViewHolder viewHolder = new ViewHolder();
          view = new ImageView(context);
          viewHolder.img = (ImageView) view;
          view.setTag(viewHolder);
      } else {
          view = convertView;
      }
  
  
      ViewHolder viewHolder = (ViewHolder)view.getTag();
  
      viewHolder.img.setImageURI(getItem(position));
  
      return view;
  }
  </code></pre>
  
  <p>I browse images with buttons where I try to set the animations. It seems that sitePicturesFlipper.setInAnimation(Context context, int resourceID) is waiting for an AnimatorSet.</p>
  
  <pre><code>    nextSitePicture.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View arg0) {
  
              //sitePicturesFlipper.setInAnimation(R.animator.right_in);
              sitePicturesFlipper.setInAnimation(getActivity(), R.anim.left_in);
              sitePicturesFlipper.setOutAnimation(getActivity(), R.anim.right_out);
              sitePicturesFlipper.showNext();
          }
      });
  </code></pre>
  
  <p>and the animators are declared like that:</p>
  
  <p>left_in.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"
       android:shareInterpolator="false" &gt;
      &lt;translate android:duration="5000" android:fromXDelta="-100%" android:toXDelta="0%"/&gt;
      &lt;alpha android:duration="5000" android:fromAlpha="0.0" android:toAlpha="1.0" /&gt;
   &lt;/set&gt;
  </code></pre>
  
  <p>right_out.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"
      android:shareInterpolator="false" &gt;
      &lt;translate android:duration="5000" android:fromXDelta="0%" android:toXDelta="100%"/&gt;
      &lt;alpha android:duration="5000" android:fromAlpha="1.0" android:toAlpha="0.0" /&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>But when I click on the button, I get a RuntimeException Unknown animator name: translate!</p>
  
  <p>I also tried to use ObjectAnimator instead, like that:</p>
  
  <pre><code>    nextSitePicture.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View arg0) {
  
              sitePicturesFlipper.setInAnimation(getActivity(), R.animator.left_in);
              sitePicturesFlipper.setInAnimation(getActivity(), R.animator.right_out);
              sitePicturesFlipper.showNext();
          }
      });
  </code></pre>
  
  <p>and the xml files are:</p>
  
  <p>left_in2.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set&gt;
  &lt;objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
                  android:interpolator="@android:anim/accelerate_decelerate_interpolator"
                  android:propertyName="yFraction"
                  android:valueType="floatType"
                  android:valueFrom="-1"
                  android:valueTo="0"
                  android:duration="600"/&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>right_out2.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set&gt;
  &lt;objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
                  android:interpolator="@android:anim/accelerate_decelerate_interpolator"
                  android:propertyName="yFraction"
                  android:valueType="floatType"
                  android:valueFrom="0"
                  android:valueTo="1"
                  android:duration="600"/&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>but in that case I get java.lang.ClassCastException: android.animation.AnimatorSet cannot be cast to android.animation.ObjectAnimator</p>
  
  <p>So I don't understand to set and use it correctly and it's quite difficult to find example using adapterViewFlipper on Internet, except in Thai, but I'm not very comfortable with Thai language...</p>
  
  <p>So, how to use animation with adapterViewFlipper?</p>