Animation to slide To Top - Android android.view.animation

Android examples for android.view.animation:slide Animation

Description

Animation to slide To Top

Demo Code

import android.view.View;
import android.view.animation.TranslateAnimation;

public class Main{

    public static void slideToTop(View view) {
        TranslateAnimation animate = new TranslateAnimation(0, 0, 0,
                -view.getHeight());/*from w w w  .j  ava2 s .  c  o m*/
        animate.setDuration(500);
        animate.setFillAfter(true);
        view.startAnimation(animate);
        view.setVisibility(View.GONE);
    }

}

Related Tutorials