centre Spin View Out Animation - Android Animation

Android examples for Animation:Spin Animation

Description

centre Spin View Out Animation

Demo Code


//package com.java2s;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.ScaleAnimation;

public class Main {
    private static final long SPIN_HALFPOINT = 500;

    public static Animation centreSpinViewOutAnimation() {
        Animation spin = new ScaleAnimation(1, 0, 1, 1,
                Animation.RELATIVE_TO_SELF, 0.5f,
                Animation.RELATIVE_TO_SELF, 0.5f);
        spin.setDuration(SPIN_HALFPOINT);
        spin.setInterpolator(new AccelerateDecelerateInterpolator());
        return spin;
    }//from  w ww. j  a  va  2  s  .  c o m
}

Related Tutorials