Android examples for Animation:Spin Animation
centre Spin View In Animation
//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 centreSpinViewInAnimation() { Animation spin = new ScaleAnimation(0, 1, 1, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); spin.setStartOffset(SPIN_HALFPOINT); spin.setDuration(SPIN_HALFPOINT); spin.setInterpolator(new AccelerateDecelerateInterpolator()); return spin; }//from w w w . j a v a 2s . c o m }