Create Animator Set from duration and Interpolator - Android android.animation

Android examples for android.animation:Animator

Description

Create Animator Set from duration and Interpolator

Demo Code


//package com.java2s;

import android.animation.AnimatorSet;

import android.support.annotation.NonNull;

import android.view.animation.Interpolator;

public class Main {
    @NonNull//from   w w  w.  ja  v a  2  s  .c o  m
    public static AnimatorSet getAnimatorSet(long duration,
            Interpolator interpolator) {
        final AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.setDuration(duration);
        if (interpolator != null) {
            animatorSet.setInterpolator(interpolator);
        }
        return animatorSet;
    }
}

Related Tutorials