get Drop Down Animation - Android Animation

Android examples for Animation:Animation Creation

Description

get Drop Down Animation

Demo Code


//package com.java2s;

import android.view.animation.AccelerateInterpolator;

import android.view.animation.Animation;

import android.view.animation.Interpolator;

import android.view.animation.TranslateAnimation;

public class Main {

    public static Animation getDropDownAnimation() {

        Animation animation = new TranslateAnimation(
                Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
                0, Animation.RELATIVE_TO_SELF, -1,
                Animation.RELATIVE_TO_SELF, 0);
        Interpolator ait = new AccelerateInterpolator(1.5f);
        animation.setInterpolator(ait);/* w  w w.j ava  2s . c  o m*/
        animation.setDuration(100);
        return animation;
    }
}

Related Tutorials