Android animation settings to / from AdapterViewFlipper: unknown animation translator name

I have very simple animations that work fine with ViewFlipper, but if I try to install them on the AdapterViewFlipper input / output, I get a "Unknown animator translator name" runtime error. Looking at the appropriate methods for each of them, it looks like the ViewFlipper is expecting a ViewAnimation, and the AdapterViewFlipper is expecting an AdapterViewAnimation. Api is otherwise the same, and both build without errors. Here is the xml for one of the animations:

<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false"> <translate android:fromXDelta="0%" android:toXDelta="-100%" android:fromYDelta="0%" android:toYDelta="0%" android:duration="800"/> </set> 

and I set it to flipp:

 vf.setOutAnimation(this, R.anim.out_to_left); 

I can guess that this could mean that I cannot use translate, type, but then how would I do the same animation? Lame...

+7
source share
1 answer

Found the answer here: stack overflow

It seems that the ViewFlipperAdapter needs an Animator object, not a collection.

Example left_in.xml declared in the animator folder

 <objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:propertyName="x" android:valueType="floatType" android:valueFrom="-1500" android:valueTo="0" android:duration="600"/> 
+2
source

All Articles