Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.view.View;

import android.view.animation.Animation;

import android.view.animation.TranslateAnimation;

public class Main {

    public static void setTranslateAnimationToParent(View view, 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));
        view.startAnimation(mAnmation);
    }
}