To Small Animation via ScaleAnimation - Android android.view.animation

Android examples for android.view.animation:Scale Animation

Description

To Small Animation via ScaleAnimation

Demo Code

import android.view.View;
import android.view.animation.Animation;
import android.view.animation.ScaleAnimation;

public class Main {

  public static void toSmallAnim(View view) {
    ScaleAnimation animation = new ScaleAnimation(1.0f, 0.0f, 1.0f, 0.0f, Animation.RELATIVE_TO_SELF, 0.5f,
        Animation.RELATIVE_TO_SELF, 0.0f);
    animation.setDuration(1000);/*from w ww .  jav  a  2  s .c o m*/
    animation.setStartOffset(1000);
    animation.setFillAfter(true);
    view.setAnimation(animation);
    animation.start();
    view.setVisibility(View.GONE);
  }

}

Related Tutorials