slide In Down - Android Animation

Android examples for Animation:Slide Animation

Description

slide In Down

Demo Code


//package com.java2s;

import android.view.View;

import android.view.animation.AccelerateDecelerateInterpolator;

public class Main {
    public final static int ANIMATION_DURATION = 300;

    public static void slideInDown(View v) {
        v.setTranslationY(-v.getMeasuredHeight());
        v.setVisibility(View.VISIBLE);
        v.animate().setInterpolator(new AccelerateDecelerateInterpolator())
                .setDuration(ANIMATION_DURATION).translationY(0).start();
    }/*from   w w  w .  j a v a  2 s .c  o m*/
}

Related Tutorials