package c.a.m;

import android.view.View;
import android.view.animation.Interpolator;
import c.f.l.x;
import c.f.l.y;
import c.f.l.z;
import java.util.ArrayList;
import java.util.Iterator;

/* JADX INFO: compiled from: ViewPropertyAnimatorCompatSet.java */
/* JADX INFO: loaded from: classes.dex */
public class h {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private Interpolator f1258c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    y f1259d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private boolean f1260e;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private long f1257b = -1;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private final z f1261f = new a();
    final ArrayList<x> a = new ArrayList<>();

    /* JADX INFO: compiled from: ViewPropertyAnimatorCompatSet.java */
    class a extends z {
        private boolean a = false;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private int f1262b = 0;

        a() {
        }

        @Override // c.f.l.y
        public void b(View view) {
            int i2 = this.f1262b + 1;
            this.f1262b = i2;
            if (i2 == h.this.a.size()) {
                y yVar = h.this.f1259d;
                if (yVar != null) {
                    yVar.b(null);
                }
                d();
            }
        }

        @Override // c.f.l.z, c.f.l.y
        public void c(View view) {
            if (this.a) {
                return;
            }
            this.a = true;
            y yVar = h.this.f1259d;
            if (yVar != null) {
                yVar.c(null);
            }
        }

        void d() {
            this.f1262b = 0;
            this.a = false;
            h.this.b();
        }
    }

    public void a() {
        if (this.f1260e) {
            Iterator<x> it = this.a.iterator();
            while (it.hasNext()) {
                it.next().b();
            }
            this.f1260e = false;
        }
    }

    void b() {
        this.f1260e = false;
    }

    public h c(x xVar) {
        if (!this.f1260e) {
            this.a.add(xVar);
        }
        return this;
    }

    public h d(x xVar, x xVar2) {
        this.a.add(xVar);
        xVar2.h(xVar.c());
        this.a.add(xVar2);
        return this;
    }

    public h e(long j2) {
        if (!this.f1260e) {
            this.f1257b = j2;
        }
        return this;
    }

    public h f(Interpolator interpolator) {
        if (!this.f1260e) {
            this.f1258c = interpolator;
        }
        return this;
    }

    public h g(y yVar) {
        if (!this.f1260e) {
            this.f1259d = yVar;
        }
        return this;
    }

    public void h() {
        if (this.f1260e) {
            return;
        }
        for (x xVar : this.a) {
            long j2 = this.f1257b;
            if (j2 >= 0) {
                xVar.d(j2);
            }
            Interpolator interpolator = this.f1258c;
            if (interpolator != null) {
                xVar.e(interpolator);
            }
            if (this.f1259d != null) {
                xVar.f(this.f1261f);
            }
            xVar.j();
        }
        this.f1260e = true;
    }
}
