Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.view.animation.AnimationSet;

import android.view.animation.OvershootInterpolator;

import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;

public class Main {
    public static AnimationSet startInfoAnimation(int AnimationType, float fromX, float toX, float fromY, float toY,
            float scaleX, float scaleToX, float scaleY, float scaleToY, float pinX, float pinY) {
        OvershootInterpolator overshootInterpolator = new OvershootInterpolator(2f);
        AnimationSet animationSet = new AnimationSet(true);
        TranslateAnimation translateAnimation = new TranslateAnimation(AnimationType, fromX, AnimationType, toX,
                AnimationType, fromY, AnimationType, toY);
        ScaleAnimation scaleAnimation = new ScaleAnimation(scaleX, scaleToX, scaleY, scaleToY, AnimationType, pinX,
                AnimationType, pinY);
        animationSet.addAnimation(translateAnimation);
        animationSet.addAnimation(scaleAnimation);
        animationSet.setDuration(300);
        animationSet.setFillAfter(true);
        animationSet.setInterpolator(overshootInterpolator);
        return animationSet;
    }
}