move Up Animation - Android Animation

Android examples for Animation:Move Animation

Description

move Up Animation

Demo Code


//package com.java2s;

import android.view.animation.Animation;

import android.view.animation.LinearInterpolator;

import android.view.animation.TranslateAnimation;

public class Main {
    public static Animation moveUp(int height) {
        // TODO Auto-generated method stub
        Animation moveUp = new TranslateAnimation(

        Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT,
                0.0f,//from ww w . jav  a  2 s  . com

                Animation.ABSOLUTE, height, Animation.ABSOLUTE, 0

        );

        moveUp.setDuration(200);

        moveUp.setInterpolator(new LinearInterpolator());

        return moveUp;
    }
}

Related Tutorials