0

I am using a ViewFlipper to display a series of images, however the animation I am trying to apply (zoom+fade) is only shown on the very last image in the ViewFlipper. Anyone know where I'm going wrong? Below is my code:

mViewFlipper = (ViewFlipper) fragmentView.findViewById(R.id.view_flipper);
mViewFlipper.setVisibility(View.VISIBLE);
for(int i=0;i<galleryGridImages.size();i++)
{
    setFlipperImage(galleryGridImages.get(i));
}

AnimationSet as = new AnimationSet(false);

fade = new AlphaAnimation(1.0f,0.0f);
fade.setDuration(transitionSpeed);
as.addAnimation(fade);

zoom = new ScaleAnimation(1, 3, 1, 3, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
zoom.setDuration(transitionSpeed);
as.addAnimation(zoom);

mViewFlipper.setOutAnimation(as);
mViewFlipper.setAutoStart(true);
mViewFlipper.setFlipInterval(interval);
mViewFlipper.startFlipping();
user2060733
  • 123
  • 3
  • 9
  • try with `mViewFlipper.setInAnimation()` and `mViewFlipper.setOutAnimation()` have a look [here](http://stackoverflow.com/a/6673365/2591002) – SweetWisher ツ Sep 24 '14 at 11:09
  • @SweetWisher ツ Thanks for the suggestion. I've used setOutAnimation() but dont want an in animation for the images. Could this be why it only works for the final photo? – user2060733 Sep 24 '14 at 11:12
  • might be..I have never used just given you the link...Once try with both.. – SweetWisher ツ Sep 24 '14 at 11:13

0 Answers0