FileDocCategorySizeDatePackage
ViewPropertyAnimatorCompatSet.javaAPI DocAndroid 5.1 API3950Thu Mar 12 22:22:56 GMT 2015android.support.v7.internal.view

ViewPropertyAnimatorCompatSet

public class ViewPropertyAnimatorCompatSet extends Object
A very naive implementation of a set of {@link android.support.v4.view.ViewPropertyAnimatorCompat}.
hide

Fields Summary
private final ArrayList
mAnimators
private long
mDuration
private android.view.animation.Interpolator
mInterpolator
private android.support.v4.view.ViewPropertyAnimatorListener
mListener
private boolean
mIsStarted
private final android.support.v4.view.ViewPropertyAnimatorListenerAdapter
mProxyListener
Constructors Summary
public ViewPropertyAnimatorCompatSet()


      
        mAnimators = new ArrayList<ViewPropertyAnimatorCompat>();
    
Methods Summary
public voidcancel()

        if (!mIsStarted) {
            return;
        }
        for (ViewPropertyAnimatorCompat animator : mAnimators) {
            animator.cancel();
        }
        mIsStarted = false;
    
private voidonAnimationsEnded()

        mIsStarted = false;
    
public android.support.v7.internal.view.ViewPropertyAnimatorCompatSetplay(android.support.v4.view.ViewPropertyAnimatorCompat animator)

        if (!mIsStarted) {
            mAnimators.add(animator);
        }
        return this;
    
public android.support.v7.internal.view.ViewPropertyAnimatorCompatSetsetDuration(long duration)

        if (!mIsStarted) {
            mDuration = duration;
        }
        return this;
    
public android.support.v7.internal.view.ViewPropertyAnimatorCompatSetsetInterpolator(android.view.animation.Interpolator interpolator)

        if (!mIsStarted) {
            mInterpolator = interpolator;
        }
        return this;
    
public android.support.v7.internal.view.ViewPropertyAnimatorCompatSetsetListener(android.support.v4.view.ViewPropertyAnimatorListener listener)

        if (!mIsStarted) {
            mListener = listener;
        }
        return this;
    
public voidstart()

        if (mIsStarted) return;
        for (ViewPropertyAnimatorCompat animator : mAnimators) {
            if (mDuration >= 0) {
                animator.setDuration(mDuration);
            }
            if (mInterpolator != null) {
                animator.setInterpolator(mInterpolator);
            }
            if (mListener != null) {
                animator.setListener(mProxyListener);
            }
            animator.start();
        }

        mIsStarted = true;