package o;

import android.animation.TimeInterpolator;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public class Kg0 extends AbstractC3019yg0 {
    public int O;
    public ArrayList M = new ArrayList();
    public boolean N = true;
    public boolean P = false;
    public int Q = 0;

    @Override // o.AbstractC3019yg0
    public final void A(View view) {
        super.A(view);
        int size = this.M.size();
        for (int i = 0; i < size; i++) {
            ((AbstractC3019yg0) this.M.get(i)).A(view);
        }
    }

    @Override // o.AbstractC3019yg0
    public final void B() {
        if (this.M.isEmpty()) {
            I();
            n();
            return;
        }
        Jg0 jg0 = new Jg0();
        jg0.b = this;
        ArrayList arrayList = this.M;
        int size = arrayList.size();
        int i = 0;
        int i2 = 0;
        while (i2 < size) {
            Object obj = arrayList.get(i2);
            i2++;
            ((AbstractC3019yg0) obj).a(jg0);
        }
        this.O = this.M.size();
        if (this.N) {
            ArrayList arrayList2 = this.M;
            int size2 = arrayList2.size();
            while (i < size2) {
                Object obj2 = arrayList2.get(i);
                i++;
                ((AbstractC3019yg0) obj2).B();
            }
            return;
        }
        for (int i3 = 1; i3 < this.M.size(); i3++) {
            ((AbstractC3019yg0) this.M.get(i3 - 1)).a(new Jg0((AbstractC3019yg0) this.M.get(i3)));
        }
        AbstractC3019yg0 abstractC3019yg0 = (AbstractC3019yg0) this.M.get(0);
        if (abstractC3019yg0 != null) {
            abstractC3019yg0.B();
        }
    }

    @Override // o.AbstractC3019yg0
    public final void C(long j) {
        ArrayList arrayList;
        this.n = j;
        if (j < 0 || (arrayList = this.M) == null) {
            return;
        }
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            ((AbstractC3019yg0) this.M.get(i)).C(j);
        }
    }

    @Override // o.AbstractC3019yg0
    public final void D(C2887xC c2887xC) {
        this.G = c2887xC;
        this.Q |= 8;
        int size = this.M.size();
        for (int i = 0; i < size; i++) {
            ((AbstractC3019yg0) this.M.get(i)).D(c2887xC);
        }
    }

    @Override // o.AbstractC3019yg0
    public final void E(TimeInterpolator timeInterpolator) {
        this.Q |= 1;
        ArrayList arrayList = this.M;
        if (arrayList != null) {
            int size = arrayList.size();
            for (int i = 0; i < size; i++) {
                ((AbstractC3019yg0) this.M.get(i)).E(timeInterpolator);
            }
        }
        this.f808o = timeInterpolator;
    }

    @Override // o.AbstractC3019yg0
    public final void F(C2616uQ c2616uQ) {
        super.F(c2616uQ);
        this.Q |= 4;
        if (this.M != null) {
            for (int i = 0; i < this.M.size(); i++) {
                ((AbstractC3019yg0) this.M.get(i)).F(c2616uQ);
            }
        }
    }

    @Override // o.AbstractC3019yg0
    public final void G() {
        this.Q |= 2;
        int size = this.M.size();
        for (int i = 0; i < size; i++) {
            ((AbstractC3019yg0) this.M.get(i)).G();
        }
    }

    @Override // o.AbstractC3019yg0
    public final void H(long j) {
        this.m = j;
    }

    @Override // o.AbstractC3019yg0
    public final String J(String str) {
        String strJ = super.J(str);
        for (int i = 0; i < this.M.size(); i++) {
            StringBuilder sb = new StringBuilder();
            sb.append(strJ);
            sb.append("\n");
            sb.append(((AbstractC3019yg0) this.M.get(i)).J(str + "  "));
            strJ = sb.toString();
        }
        return strJ;
    }

    public final void K(AbstractC3019yg0 abstractC3019yg0) {
        this.M.add(abstractC3019yg0);
        abstractC3019yg0.t = this;
        long j = this.n;
        if (j >= 0) {
            abstractC3019yg0.C(j);
        }
        if ((this.Q & 1) != 0) {
            abstractC3019yg0.E(this.f808o);
        }
        if ((this.Q & 2) != 0) {
            abstractC3019yg0.G();
        }
        if ((this.Q & 4) != 0) {
            abstractC3019yg0.F(this.H);
        }
        if ((this.Q & 8) != 0) {
            abstractC3019yg0.D(this.G);
        }
    }

    @Override // o.AbstractC3019yg0
    public final void b(View view) {
        for (int i = 0; i < this.M.size(); i++) {
            ((AbstractC3019yg0) this.M.get(i)).b(view);
        }
        this.q.add(view);
    }

    @Override // o.AbstractC3019yg0
    public final void d() {
        super.d();
        int size = this.M.size();
        for (int i = 0; i < size; i++) {
            ((AbstractC3019yg0) this.M.get(i)).d();
        }
    }

    @Override // o.AbstractC3019yg0
    public final void e(Ng0 ng0) {
        View view = ng0.b;
        if (u(view)) {
            ArrayList arrayList = this.M;
            int size = arrayList.size();
            int i = 0;
            while (i < size) {
                Object obj = arrayList.get(i);
                i++;
                AbstractC3019yg0 abstractC3019yg0 = (AbstractC3019yg0) obj;
                if (abstractC3019yg0.u(view)) {
                    abstractC3019yg0.e(ng0);
                    ng0.c.add(abstractC3019yg0);
                }
            }
        }
    }

    @Override // o.AbstractC3019yg0
    public final void g(Ng0 ng0) {
        int size = this.M.size();
        for (int i = 0; i < size; i++) {
            ((AbstractC3019yg0) this.M.get(i)).g(ng0);
        }
    }

    @Override // o.AbstractC3019yg0
    public final void h(Ng0 ng0) {
        View view = ng0.b;
        if (u(view)) {
            ArrayList arrayList = this.M;
            int size = arrayList.size();
            int i = 0;
            while (i < size) {
                Object obj = arrayList.get(i);
                i++;
                AbstractC3019yg0 abstractC3019yg0 = (AbstractC3019yg0) obj;
                if (abstractC3019yg0.u(view)) {
                    abstractC3019yg0.h(ng0);
                    ng0.c.add(abstractC3019yg0);
                }
            }
        }
    }

    @Override // o.AbstractC3019yg0
    /* renamed from: k */
    public final AbstractC3019yg0 clone() {
        Kg0 kg0 = (Kg0) super.clone();
        kg0.M = new ArrayList();
        int size = this.M.size();
        for (int i = 0; i < size; i++) {
            AbstractC3019yg0 abstractC3019yg0Clone = ((AbstractC3019yg0) this.M.get(i)).clone();
            kg0.M.add(abstractC3019yg0Clone);
            abstractC3019yg0Clone.t = kg0;
        }
        return kg0;
    }

    @Override // o.AbstractC3019yg0
    public final void m(ViewGroup viewGroup, S60 s60, S60 s602, ArrayList arrayList, ArrayList arrayList2) {
        long j = this.m;
        int size = this.M.size();
        for (int i = 0; i < size; i++) {
            AbstractC3019yg0 abstractC3019yg0 = (AbstractC3019yg0) this.M.get(i);
            if (j > 0 && (this.N || i == 0)) {
                long j2 = abstractC3019yg0.m;
                if (j2 > 0) {
                    abstractC3019yg0.H(j2 + j);
                } else {
                    abstractC3019yg0.H(j);
                }
            }
            abstractC3019yg0.m(viewGroup, s60, s602, arrayList, arrayList2);
        }
    }

    @Override // o.AbstractC3019yg0
    public final void x(View view) {
        super.x(view);
        int size = this.M.size();
        for (int i = 0; i < size; i++) {
            ((AbstractC3019yg0) this.M.get(i)).x(view);
        }
    }

    @Override // o.AbstractC3019yg0
    public final AbstractC3019yg0 y(InterfaceC2829wg0 interfaceC2829wg0) {
        super.y(interfaceC2829wg0);
        return this;
    }

    @Override // o.AbstractC3019yg0
    public final void z(View view) {
        for (int i = 0; i < this.M.size(); i++) {
            ((AbstractC3019yg0) this.M.get(i)).z(view);
        }
        this.q.remove(view);
    }
}
