Adam Katz Adam Katz - 3 months ago 32
Android Question

is there a TranslateAnimation onComplete?

I am animating a view to move off the screen, on complete i would like to call another function but I cant seem to find a onComplete method.

int originalPos[] = new int[2];
icons.getLocationOnScreen( originalPos );
layoutMoved = originalPos[0]+icons.getWidth();
TranslateAnimation anim = new TranslateAnimation( 0, -layoutMoved , 0, 0);
anim.setFillAfter( true );


Set an AnimationListener, you'll have access to OnAnimationEnd.

anim.setAnimationListener(new Animation.AnimationListener() {
    public void onAnimationStart(Animation animation) {


    public void onAnimationEnd(Animation animation) {
       // do your stuff

    public void onAnimationRepeat(Animation animation) {