Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.TranslateAnimation;

public class Main {

    public static AnimationSet translate(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta,
            int duration) {
        Animation animation = new TranslateAnimation(fromXDelta, toXDelta, fromYDelta, toYDelta);
        animation.setDuration(duration);

        AnimationSet animationSet = new AnimationSet(true);
        // animationSet.setInterpolator(new AccelerateInterpolator());
        animationSet.addAnimation(animation);
        return animationSet;
    }
}