package d.b.f;

import android.view.View;
import android.view.animation.Interpolator;
import d.h.j.d0;
import d.h.j.e0;
import d.h.j.f0;
import java.util.ArrayList;
import java.util.Iterator;

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

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

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

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

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

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

    public class a extends f0 {
        public boolean a = false;

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

        public a() {
        }

        @Override // d.h.j.e0
        public void b(View view) {
            int i2 = this.f1722b + 1;
            this.f1722b = i2;
            if (i2 == g.this.a.size()) {
                e0 e0Var = g.this.f1719d;
                if (e0Var != null) {
                    e0Var.b(null);
                }
                this.f1722b = 0;
                this.a = false;
                g.this.f1720e = false;
            }
        }

        @Override // d.h.j.f0, d.h.j.e0
        public void c(View view) {
            if (this.a) {
                return;
            }
            this.a = true;
            e0 e0Var = g.this.f1719d;
            if (e0Var != null) {
                e0Var.c(null);
            }
        }
    }

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

    public void b() {
        View view;
        if (this.f1720e) {
            return;
        }
        for (d0 d0Var : this.a) {
            long j2 = this.f1717b;
            if (j2 >= 0) {
                d0Var.c(j2);
            }
            Interpolator interpolator = this.f1718c;
            if (interpolator != null && (view = d0Var.a.get()) != null) {
                view.animate().setInterpolator(interpolator);
            }
            if (this.f1719d != null) {
                d0Var.d(this.f1721f);
            }
            View view2 = d0Var.a.get();
            if (view2 != null) {
                view2.animate().start();
            }
        }
        this.f1720e = true;
    }
}
