Create Scale Animation - Android Animation

Android examples for Animation:Scale Animation

Description

Create Scale Animation

Demo Code


//package com.java2s;

import android.view.animation.Animation;

import android.view.animation.ScaleAnimation;

public class Main {

    public static Animation getScaleAnimation(float scaleXY,
            long durationMillis) {
        ScaleAnimation scale = new ScaleAnimation(1.0f, scaleXY, 1.0f,
                scaleXY, Animation.RELATIVE_TO_SELF, 0.5f,
                Animation.RELATIVE_TO_SELF, 0.5f);
        scale.setDuration(durationMillis);
        return scale;
    }/*from  ww w  . j  a  v  a2 s .  c o  m*/
}

Related Tutorials