slide View To Top - Android User Interface

Android examples for User Interface:View Slide

Description

slide View To Top

Demo Code


//package com.java2s;
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 a v  a2  s .co m*/
        animate.setDuration(500);
        animate.setFillAfter(true);
        view.startAnimation(animate);
        view.setVisibility(View.GONE);
    }
}

Related Tutorials