Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Animation Listener

Tags:

android

OnTouch of an ImageView I'm starting a fade in animation:

    myImageView.setOnTouchListener(new View.OnTouchListener() {     public boolean onTouch(View v, MotionEvent event) {     v.startAnimation(fadeInAnimation); 

I know it's need an animation listener to find out when the animation is complete but how do I attach this so that I can get the view that the animation has just completed on... I want to set the visibility of the view after the animation is done.

Thanks

like image 292
beans Avatar asked Sep 30 '11 11:09

beans


Video Answer


1 Answers

I think you need this.

fadeInAnimation.setAnimationListener(new Animation.AnimationListener() {     @Override     public void onAnimationStart(Animation animation) {      }      @Override     public void onAnimationEnd(Animation animation) {      }      @Override     public void onAnimationRepeat(Animation animation) {      } }); 
like image 70
peanut Avatar answered Sep 28 '22 03:09

peanut