animate ObjectAnimators With Duration - Android Animation

Android examples for Animation:Animation Creation

Description

animate ObjectAnimators With Duration

Demo Code


//package com.java2s;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import java.util.List;

public class Main {
    public static AnimatorSet animateObjectAnimatorsWithDuration(
            List<ObjectAnimator> objectAnimators, int durationInMilliSeconds) {
        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.playTogether((ObjectAnimator[]) objectAnimators
                .toArray());/*from w w w.  j av  a  2  s  .  co m*/
        animatorSet.setDuration(durationInMilliSeconds);
        animatorSet.start();

        return animatorSet;
    }
}

Related Tutorials