animate Zoom effect - Android android.view.animation

Android examples for android.view.animation:Zoom Animation

Description

animate Zoom effect

Demo Code

import android.annotation.TargetApi;
import android.os.Build;
import android.view.View;
import android.view.ViewPropertyAnimator;

public class Main {

  @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
  public static void animZoom(final View view, float scale) {
    ViewPropertyAnimator viewPropertyAnimator = view.animate();
    viewPropertyAnimator.scaleX(scale);/* ww w.j av a 2s. co m*/
    viewPropertyAnimator.scaleY(scale);
    viewPropertyAnimator.setDuration(100l);
    viewPropertyAnimator.start();
  }

}

Related Tutorials