create Scale Animation from float value - Android Animation

Android examples for Animation:Scale Animation

Description

create Scale Animation from float value

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 createScaleAnimation(float f, float f1,
            float f2, float f3, long l) {
        ScaleAnimation scaleanimation = new ScaleAnimation(f, f1, f2, f3,
                1, 0.5F, 1, 0.5F);// w  w w .  j  ava 2s  .c  o m
        scaleanimation.setFillAfter(true);
        scaleanimation.setInterpolator(new AccelerateInterpolator());
        scaleanimation.setDuration(l);
        return scaleanimation;
    }
}

Related Tutorials