The following issues were encountered when developing Android animator:
1. Circular playback of Animator:
in animator animation has looping settings setrepeatcount (valueanimator. INFINITE animatorset :
Private Atomicboolean Isstart = new Atomicboolean (false);
Animatorset.addlistener (New animator.animatorlistener () { @ Override public void onanimationstart (Animator animation) { } @Override public void onanimationend (animator animation) { if (Isstart.get ()) { Animation.start (); } } @Override public void onanimationcancel (Animator Animation) { } @Override public void onanimatIonrepeat (animator animation) { }); AnimatorSet.start ();p Ublic void stoprecognizerviewanim () { isstart.set (false);}
2. About the zoom of a view:
Scale is generally used for zoom for view. If the Groupview is scaled, the internal components are scaled as well. If you do not want to scale the internal view, but only the width or height of the zoom, the implementation of the following code:
Manimatorset = new animatorset (); Valueanimator height = valueanimator.ofobject (New widthevaluator (), mCurrWidth, Mprewidth); height.setduration (DURATION); manimatorset.playtogether (height); Manimatorset.addlistener (new Animator.animatorlistener () { @Override public void onanimationstart (animator animation) { } @Override public void Onanimationend (animator animation) { } @Override public void onanimationcancel ( animator animation) { } @Override public void onanimationrepeat (animator animation)  {    }}); Manimatorset.start ();
Private class Widthevaluator extends Intevaluator {@Override Public integer evaluate (float fraction, integer STARTV Alue, Integer endvalue) {int value = super.evaluate (fraction, Startvalue, endvalue); Viewgroup.layoutparams layoutparams = Getlayoutparams (); Layoutparams.width = value; Setlayoutparams (Layoutparams); return value; }}
3. If multiple animator in the same animatorset need to set before () or after (), no more before () or after () can be set in the same animatorset. For example, Play (Aanimator). Before (Banimator). Before (Canimator): Is wrong. This is my personal understanding, if not correct, please leave a message to inform.
This article is from the Android-meditation blog, be sure to keep this source http://6246534.blog.51cto.com/6236534/1860430
Android animation animator Development issues