Create fly in Scale Animation - Android Animation

Android examples for Animation:Scale Animation

Description

Create fly in Scale Animation

Demo Code


//package com.java2s;
import android.view.animation.AccelerateInterpolator;

import android.view.animation.Animation;

import android.view.animation.ScaleAnimation;

public class Main {
    public static Animation inScaleAnimation(float pivotX, float pivotY) {
        Animation scale = new ScaleAnimation(0.0f, //fromX   ?? X ???
                1.0f, //toX      ?? X ???
                0.0f, //fromY   ?? Y ???
                1.0f, //toY      ?? Y ???
                pivotX, pivotY);/*from  ww w.jav  a2  s  . c  o  m*/
        scale.setDuration(1000);
        scale.setInterpolator(new AccelerateInterpolator());
        return scale;
    }
}

Related Tutorials