I got it to work by starting the second animation in the onAnimationEnd() 
method of an AnimationListener assigned to the first animation.  Seems like 
kind of a hack as the documentation suggest the original approach I took 
should work.

On Thursday, March 15, 2012 9:34:28 PM UTC-7, rdietrick wrote:
>
> I'm using an AnimationSet to fade an ImageView out (alpha 1->0) and 
> then fade it back in (alpha 0->1).  I can't seem to get the 
> AlphaAnimations to run sequentially, however.  From the logs, I can 
> see that both animations always start simultaneously, even though I'm 
> adding a start offset to the second one.  Can anyone tell me what I'm 
> doing wrong? 
>
>                 AnimationSet aSet = new AnimationSet(true); 
>
>                 // first fade the current image out 
>                 AlphaAnimation aa = new AlphaAnimation(1f, 0f); 
>                 aa.setDuration(350); 
>                 aSet.addAnimation(aa); 
>
>                 // next fade the last trick's card in 
>                 AlphaAnimation a2 = new AlphaAnimation(0f, 1f); 
>                 a2.setStartOffset(351); 
>                 a2.setDuration(350); 
>                 aSet.addAnimation(a2); 
>
>                 cardView.setAnimation(aSet); 
>                 cardView.invalidate(); 
>
> I've got animation listeners assigned that log the start/end times of 
> each animation, and they confirm that both animations always start 
> simultaneously. 
>
> Thanks. 
>
> -rob

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to