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 getTranslateAnimationToParent(float pivotFromX, float pivotToX,
            float pivotFromY, float pivotToY, int intDuration, boolean boolFillAfter) {
        TranslateAnimation mAnmation = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, pivotFromX,
                Animation.RELATIVE_TO_PARENT, pivotToX, Animation.RELATIVE_TO_PARENT, pivotFromY,
                Animation.RELATIVE_TO_PARENT, pivotToY);
        mAnmation.setDuration(intDuration);
        mAnmation.setFillAfter(boolFillAfter);
        // mAnmation.setRepeatMode(Animation.RESTART);
        // mAnmation.setRepeatCount(intRepeatCount);
        // mAnmation.setInterpolator(AnimationUtils.loadInterpolator(mContext,
        // com.webclient.R.anim.bounce_interpolator));
        return mAnmation;
    }
}