How to find animation is finished playing in android
here is my piece of Code
if(e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
mWebView.startAnimation(AnimationUtils.loadAnimation(context, R.anim.page_slide_left_in));
mWebView.startAnimation(AnimationUtils.loadAnimation(context,R.anim.page_slide_left_out));
mWebView.scrollBy(mWebView.getWidth(),0);
}
The android.view.animation.Animation
class (returned by AnimationUtils.loadAnimation
has a nested interface called AnimationListener
which you can use to determine when an animation has completed. Specifically, you'd be interested in implementing the onAnimationEnd
method of the listener interface.
Obviously, you'd also have to call setAnimationListener
on the Animation
instance returned by loadAnimation
.
精彩评论