Create Smaller Animation - Android Animation

Android examples for Animation:Animation Creation

Description

Create Smaller Animation

Demo Code


//package com.java2s;

import android.view.animation.Animation;

import android.view.animation.ScaleAnimation;

public class Main {
    public static Animation getSmallerAnimation(int duration) {
        Animation animation = new ScaleAnimation(1.0f, 0f, 1.0f, 0f,
                Animation.RELATIVE_TO_SELF, 0.5f,
                Animation.RELATIVE_TO_SELF, 0.5f);
        animation.setDuration(duration);
        animation.setFillAfter(true);/*from  w ww  .  j  a  v a2  s .  c  o m*/
        return animation;
    }
}

Related Tutorials