focus Animation - Android android.view.animation

Android examples for android.view.animation:Effect Animation

Description

focus Animation

Demo Code

import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.view.View;

public class Main{

    public static void focusAnim(View view) {
        float toValue = 1.1f;
        ObjectAnimator animatorX = ObjectAnimator.ofFloat(view, "scaleX",
                toValue);/*  w w  w  . ja  va  2 s.com*/
        ObjectAnimator animatorY = ObjectAnimator.ofFloat(view, "scaleY",
                toValue);
        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.setDuration(300);
        animatorSet.playTogether(animatorX, animatorY);
        animatorSet.start();

    }

}

Related Tutorials