ViewPropertyAnimatorCompatSet.java 3.72 KB
package android.support.v7.view;

import android.support.annotation.RestrictTo;
import android.support.v4.view.ViewPropertyAnimatorCompat;
import android.support.v4.view.ViewPropertyAnimatorListener;
import android.support.v4.view.ViewPropertyAnimatorListenerAdapter;
import android.view.View;
import android.view.animation.Interpolator;
import java.util.ArrayList;
import java.util.Iterator;

@RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
public class ViewPropertyAnimatorCompatSet
{
  final ArrayList<ViewPropertyAnimatorCompat> a = new ArrayList();
  ViewPropertyAnimatorListener b;
  boolean c;
  private long d = -1L;
  private Interpolator e;
  private final ViewPropertyAnimatorListenerAdapter f = new ViewPropertyAnimatorListenerAdapter()
  {
    private boolean b = false;
    private int c = 0;
    
    public final void onAnimationEnd(View paramAnonymousView)
    {
      int i = this.c + 1;
      this.c = i;
      if (i == ViewPropertyAnimatorCompatSet.this.a.size())
      {
        if (ViewPropertyAnimatorCompatSet.this.b != null) {
          ViewPropertyAnimatorCompatSet.this.b.onAnimationEnd(null);
        }
        this.c = 0;
        this.b = false;
        ViewPropertyAnimatorCompatSet.this.c = false;
      }
    }
    
    public final void onAnimationStart(View paramAnonymousView)
    {
      if (this.b) {}
      do
      {
        return;
        this.b = true;
      } while (ViewPropertyAnimatorCompatSet.this.b == null);
      ViewPropertyAnimatorCompatSet.this.b.onAnimationStart(null);
    }
  };
  
  public void cancel()
  {
    if (!this.c) {
      return;
    }
    Iterator localIterator = this.a.iterator();
    while (localIterator.hasNext()) {
      ((ViewPropertyAnimatorCompat)localIterator.next()).cancel();
    }
    this.c = false;
  }
  
  public ViewPropertyAnimatorCompatSet play(ViewPropertyAnimatorCompat paramViewPropertyAnimatorCompat)
  {
    if (!this.c) {
      this.a.add(paramViewPropertyAnimatorCompat);
    }
    return this;
  }
  
  public ViewPropertyAnimatorCompatSet playSequentially(ViewPropertyAnimatorCompat paramViewPropertyAnimatorCompat1, ViewPropertyAnimatorCompat paramViewPropertyAnimatorCompat2)
  {
    this.a.add(paramViewPropertyAnimatorCompat1);
    paramViewPropertyAnimatorCompat2.setStartDelay(paramViewPropertyAnimatorCompat1.getDuration());
    this.a.add(paramViewPropertyAnimatorCompat2);
    return this;
  }
  
  public ViewPropertyAnimatorCompatSet setDuration(long paramLong)
  {
    if (!this.c) {
      this.d = paramLong;
    }
    return this;
  }
  
  public ViewPropertyAnimatorCompatSet setInterpolator(Interpolator paramInterpolator)
  {
    if (!this.c) {
      this.e = paramInterpolator;
    }
    return this;
  }
  
  public ViewPropertyAnimatorCompatSet setListener(ViewPropertyAnimatorListener paramViewPropertyAnimatorListener)
  {
    if (!this.c) {
      this.b = paramViewPropertyAnimatorListener;
    }
    return this;
  }
  
  public void start()
  {
    if (this.c) {
      return;
    }
    Iterator localIterator = this.a.iterator();
    while (localIterator.hasNext())
    {
      ViewPropertyAnimatorCompat localViewPropertyAnimatorCompat = (ViewPropertyAnimatorCompat)localIterator.next();
      if (this.d >= 0L) {
        localViewPropertyAnimatorCompat.setDuration(this.d);
      }
      if (this.e != null) {
        localViewPropertyAnimatorCompat.setInterpolator(this.e);
      }
      if (this.b != null) {
        localViewPropertyAnimatorCompat.setListener(this.f);
      }
      localViewPropertyAnimatorCompat.start();
    }
    this.c = true;
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/android/support/v7/view/ViewPropertyAnimatorCompatSet.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */