animate Zoom with ViewPropertyAnimator - Android android.animation

Android examples for android.animation:Animator

Description

animate Zoom with ViewPropertyAnimator

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 animZomm(final View view, float scale) {
    ViewPropertyAnimator viewPropertyAnimator = view.animate();
    viewPropertyAnimator.scaleX(scale);//from  ww w  .  j  a v a2s .  c o m
    viewPropertyAnimator.scaleY(scale);
    viewPropertyAnimator.setDuration(100l);
    viewPropertyAnimator.start();
  }
}

Related Tutorials