make Click AnimatorSet - Android android.animation

Android examples for android.animation:AnimatorSet

Description

make Click AnimatorSet

Demo Code


//package com.java2s;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.view.View;

public class Main {

    public static void makeClick(View v) {
        ObjectAnimator clickX = ObjectAnimator.ofFloat(v, "scaleX", 1,
                0.7f, 1).setDuration(100);
        ObjectAnimator clickY = ObjectAnimator.ofFloat(v, "scaleY", 1,
                0.7f, 1).setDuration(100);
        AnimatorSet click = new AnimatorSet();
        click.playTogether(clickX, clickY);
        click.start();//  w  ww .ja  va 2s .c o m
    }
}

Related Tutorials