package c.a.f;

import android.view.View;
import android.view.animation.Interpolator;
import c.c.i.q;
import c.c.i.r;
import c.c.i.s;
import java.util.ArrayList;
import java.util.Iterator;

/* JADX INFO: loaded from: classes.dex */
public class c {

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public r f4804d;

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

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final s f4806f = new a();

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final ArrayList<q> f4801a = new ArrayList<>();

    public class a extends s {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public boolean f4807a = false;

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

        public a() {
        }

        @Override // c.c.i.r
        public void b(View view) {
            int i2 = this.f4808b + 1;
            this.f4808b = i2;
            if (i2 == c.this.f4801a.size()) {
                r rVar = c.this.f4804d;
                if (rVar != null) {
                    rVar.b(null);
                }
                this.f4808b = 0;
                this.f4807a = false;
                c.this.f4805e = false;
            }
        }

        @Override // c.c.i.r
        public void c(View view) {
            if (this.f4807a) {
                return;
            }
            this.f4807a = true;
            r rVar = c.this.f4804d;
            if (rVar != null) {
                rVar.c(null);
            }
        }
    }

    public void a() {
        if (this.f4805e) {
            Iterator<q> it = this.f4801a.iterator();
            while (it.hasNext()) {
                it.next().a();
            }
            this.f4805e = false;
        }
    }

    public void b() {
        View view;
        if (this.f4805e) {
            return;
        }
        for (q qVar : this.f4801a) {
            long j2 = this.f4802b;
            if (j2 >= 0) {
                qVar.b(j2);
            }
            Interpolator interpolator = this.f4803c;
            if (interpolator != null && (view = qVar.f5296a.get()) != null) {
                view.animate().setInterpolator(interpolator);
            }
            if (this.f4804d != null) {
                qVar.c(this.f4806f);
            }
            View view2 = qVar.f5296a.get();
            if (view2 != null) {
                view2.animate().start();
            }
        }
        this.f4805e = true;
    }
}
