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.TranslateAnimation;

public class Main {
    public static TranslateAnimation getTranslation(int fromX, int toX, int fromY, int toY, int duration,
            Animation.AnimationListener listener) {

        TranslateAnimation anim = new TranslateAnimation(fromX, toX, fromY, toY);
        anim.setDuration(duration);
        anim.setFillAfter(true);

        anim.setAnimationListener(listener);
        return anim;
    }
}