package androidx.transition;

import X6FRs_4.IMuAHx_6.X6FRs_4.PGPF6hQ_2.IMuAHx_6;
import X6FRs_4.JZJr_16.Eps4cJe_18;
import X6FRs_4.JZJr_16.H5YG8fq_22;
import X6FRs_4.JZJr_16.NQvZgp_17;
import X6FRs_4.JZJr_16.SI64pbG_23;
import X6FRs_4.JZJr_16.ZzDuCHW_20;
import android.animation.TimeInterpolator;
import android.content.Context;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.util.AndroidRuntimeException;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import androidx.transition.Transition;
import java.util.ArrayList;
import java.util.Iterator;
/* loaded from: classes.dex */
public class TransitionSet extends Transition {
    public int KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public ArrayList<Transition> f2602KQgRr5e_0;
    public boolean PGPF6hQ_2;
    public int QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public boolean f2603QxJ9d_1;

    /* loaded from: classes.dex */
    public class KQgRr5e_0 extends Eps4cJe_18 {
        public final /* synthetic */ Transition KQgRr5e_0;

        public KQgRr5e_0(TransitionSet transitionSet, Transition transition) {
            this.KQgRr5e_0 = transition;
        }

        @Override // androidx.transition.Transition.IMuAHx_6
        public void X6FRs_4(Transition transition) {
            this.KQgRr5e_0.runAnimators();
            transition.removeListener(this);
        }
    }

    /* loaded from: classes.dex */
    public static class QxJ9d_1 extends Eps4cJe_18 {
        public TransitionSet KQgRr5e_0;

        public QxJ9d_1(TransitionSet transitionSet) {
            this.KQgRr5e_0 = transitionSet;
        }

        @Override // X6FRs_4.JZJr_16.Eps4cJe_18, androidx.transition.Transition.IMuAHx_6
        public void PGPF6hQ_2(Transition transition) {
            TransitionSet transitionSet = this.KQgRr5e_0;
            if (transitionSet.PGPF6hQ_2) {
                return;
            }
            transitionSet.start();
            this.KQgRr5e_0.PGPF6hQ_2 = true;
        }

        @Override // androidx.transition.Transition.IMuAHx_6
        public void X6FRs_4(Transition transition) {
            TransitionSet transitionSet = this.KQgRr5e_0;
            int i = transitionSet.KQgRr5e_0 - 1;
            transitionSet.KQgRr5e_0 = i;
            if (i == 0) {
                transitionSet.PGPF6hQ_2 = false;
                transitionSet.end();
            }
            transition.removeListener(this);
        }
    }

    public TransitionSet() {
        this.f2602KQgRr5e_0 = new ArrayList<>();
        this.f2603QxJ9d_1 = true;
        this.PGPF6hQ_2 = false;
        this.QxJ9d_1 = 0;
    }

    public TransitionSet KQgRr5e_0(Transition transition) {
        this.f2602KQgRr5e_0.add(transition);
        transition.mParent = this;
        long j = this.mDuration;
        if (j >= 0) {
            transition.setDuration(j);
        }
        if ((this.QxJ9d_1 & 1) != 0) {
            transition.setInterpolator(getInterpolator());
        }
        if ((this.QxJ9d_1 & 2) != 0) {
            transition.setPropagation(getPropagation());
        }
        if ((this.QxJ9d_1 & 4) != 0) {
            transition.setPathMotion(getPathMotion());
        }
        if ((this.QxJ9d_1 & 8) != 0) {
            transition.setEpicenterCallback(getEpicenterCallback());
        }
        return this;
    }

    public TransitionSet PGPF6hQ_2(int i) {
        if (i == 0) {
            this.f2603QxJ9d_1 = true;
        } else if (i == 1) {
            this.f2603QxJ9d_1 = false;
        } else {
            throw new AndroidRuntimeException("Invalid parameter for TransitionSet ordering: " + i);
        }
        return this;
    }

    @Override // androidx.transition.Transition
    /* renamed from: QxJ9d_1 */
    public TransitionSet setStartDelay(long j) {
        return (TransitionSet) super.setStartDelay(j);
    }

    @Override // androidx.transition.Transition
    public void cancel() {
        super.cancel();
        int size = this.f2602KQgRr5e_0.size();
        for (int i = 0; i < size; i++) {
            this.f2602KQgRr5e_0.get(i).cancel();
        }
    }

    @Override // androidx.transition.Transition
    public void captureEndValues(H5YG8fq_22 h5YG8fq_22) {
        if (isValidTarget(h5YG8fq_22.KQgRr5e_0)) {
            Iterator<Transition> it = this.f2602KQgRr5e_0.iterator();
            while (it.hasNext()) {
                Transition next = it.next();
                if (next.isValidTarget(h5YG8fq_22.KQgRr5e_0)) {
                    next.captureEndValues(h5YG8fq_22);
                    h5YG8fq_22.f565KQgRr5e_0.add(next);
                }
            }
        }
    }

    @Override // androidx.transition.Transition
    public void capturePropagationValues(H5YG8fq_22 h5YG8fq_22) {
        super.capturePropagationValues(h5YG8fq_22);
        int size = this.f2602KQgRr5e_0.size();
        for (int i = 0; i < size; i++) {
            this.f2602KQgRr5e_0.get(i).capturePropagationValues(h5YG8fq_22);
        }
    }

    @Override // androidx.transition.Transition
    public void captureStartValues(H5YG8fq_22 h5YG8fq_22) {
        if (isValidTarget(h5YG8fq_22.KQgRr5e_0)) {
            Iterator<Transition> it = this.f2602KQgRr5e_0.iterator();
            while (it.hasNext()) {
                Transition next = it.next();
                if (next.isValidTarget(h5YG8fq_22.KQgRr5e_0)) {
                    next.captureStartValues(h5YG8fq_22);
                    h5YG8fq_22.f565KQgRr5e_0.add(next);
                }
            }
        }
    }

    @Override // androidx.transition.Transition
    public void createAnimators(ViewGroup viewGroup, SI64pbG_23 sI64pbG_23, SI64pbG_23 sI64pbG_232, ArrayList<H5YG8fq_22> arrayList, ArrayList<H5YG8fq_22> arrayList2) {
        long startDelay = getStartDelay();
        int size = this.f2602KQgRr5e_0.size();
        for (int i = 0; i < size; i++) {
            Transition transition = this.f2602KQgRr5e_0.get(i);
            if (startDelay > 0 && (this.f2603QxJ9d_1 || i == 0)) {
                long startDelay2 = transition.getStartDelay();
                if (startDelay2 > 0) {
                    transition.setStartDelay(startDelay2 + startDelay);
                } else {
                    transition.setStartDelay(startDelay);
                }
            }
            transition.createAnimators(viewGroup, sI64pbG_23, sI64pbG_232, arrayList, arrayList2);
        }
    }

    @Override // androidx.transition.Transition
    public Transition excludeTarget(View view, boolean z) {
        for (int i = 0; i < this.f2602KQgRr5e_0.size(); i++) {
            this.f2602KQgRr5e_0.get(i).excludeTarget(view, z);
        }
        return super.excludeTarget(view, z);
    }

    @Override // androidx.transition.Transition
    public void forceToEnd(ViewGroup viewGroup) {
        super.forceToEnd(viewGroup);
        int size = this.f2602KQgRr5e_0.size();
        for (int i = 0; i < size; i++) {
            this.f2602KQgRr5e_0.get(i).forceToEnd(viewGroup);
        }
    }

    @Override // androidx.transition.Transition
    public void pause(View view) {
        super.pause(view);
        int size = this.f2602KQgRr5e_0.size();
        for (int i = 0; i < size; i++) {
            this.f2602KQgRr5e_0.get(i).pause(view);
        }
    }

    @Override // androidx.transition.Transition
    public void resume(View view) {
        super.resume(view);
        int size = this.f2602KQgRr5e_0.size();
        for (int i = 0; i < size; i++) {
            this.f2602KQgRr5e_0.get(i).resume(view);
        }
    }

    @Override // androidx.transition.Transition
    public void runAnimators() {
        if (this.f2602KQgRr5e_0.isEmpty()) {
            start();
            end();
            return;
        }
        m990KQgRr5e_0();
        if (!this.f2603QxJ9d_1) {
            for (int i = 1; i < this.f2602KQgRr5e_0.size(); i++) {
                this.f2602KQgRr5e_0.get(i - 1).addListener(new KQgRr5e_0(this, this.f2602KQgRr5e_0.get(i)));
            }
            Transition transition = this.f2602KQgRr5e_0.get(0);
            if (transition != null) {
                transition.runAnimators();
                return;
            }
            return;
        }
        Iterator<Transition> it = this.f2602KQgRr5e_0.iterator();
        while (it.hasNext()) {
            it.next().runAnimators();
        }
    }

    @Override // androidx.transition.Transition
    public void setCanRemoveViews(boolean z) {
        super.setCanRemoveViews(z);
        int size = this.f2602KQgRr5e_0.size();
        for (int i = 0; i < size; i++) {
            this.f2602KQgRr5e_0.get(i).setCanRemoveViews(z);
        }
    }

    @Override // androidx.transition.Transition
    public /* bridge */ /* synthetic */ Transition setDuration(long j) {
        KQgRr5e_0(j);
        return this;
    }

    @Override // androidx.transition.Transition
    public void setEpicenterCallback(Transition.IFxWkV_5 iFxWkV_5) {
        super.setEpicenterCallback(iFxWkV_5);
        this.QxJ9d_1 |= 8;
        int size = this.f2602KQgRr5e_0.size();
        for (int i = 0; i < size; i++) {
            this.f2602KQgRr5e_0.get(i).setEpicenterCallback(iFxWkV_5);
        }
    }

    @Override // androidx.transition.Transition
    public void setPathMotion(PathMotion pathMotion) {
        super.setPathMotion(pathMotion);
        this.QxJ9d_1 |= 4;
        for (int i = 0; i < this.f2602KQgRr5e_0.size(); i++) {
            this.f2602KQgRr5e_0.get(i).setPathMotion(pathMotion);
        }
    }

    @Override // androidx.transition.Transition
    public void setPropagation(ZzDuCHW_20 zzDuCHW_20) {
        super.setPropagation(zzDuCHW_20);
        this.QxJ9d_1 |= 2;
        int size = this.f2602KQgRr5e_0.size();
        for (int i = 0; i < size; i++) {
            this.f2602KQgRr5e_0.get(i).setPropagation(zzDuCHW_20);
        }
    }

    @Override // androidx.transition.Transition
    public /* bridge */ /* synthetic */ Transition setSceneRoot(ViewGroup viewGroup) {
        KQgRr5e_0(viewGroup);
        return this;
    }

    @Override // androidx.transition.Transition
    public String toString(String str) {
        String transition = super.toString(str);
        for (int i = 0; i < this.f2602KQgRr5e_0.size(); i++) {
            StringBuilder sb = new StringBuilder();
            sb.append(transition);
            sb.append("\n");
            sb.append(this.f2602KQgRr5e_0.get(i).toString(str + "  "));
            transition = sb.toString();
        }
        return transition;
    }

    @Override // androidx.transition.Transition
    /* renamed from: QxJ9d_1 */
    public TransitionSet removeTarget(int i) {
        for (int i2 = 0; i2 < this.f2602KQgRr5e_0.size(); i2++) {
            this.f2602KQgRr5e_0.get(i2).removeTarget(i);
        }
        return (TransitionSet) super.removeTarget(i);
    }

    @Override // androidx.transition.Transition
    public Transition clone() {
        TransitionSet transitionSet = (TransitionSet) super.m988clone();
        transitionSet.f2602KQgRr5e_0 = new ArrayList<>();
        int size = this.f2602KQgRr5e_0.size();
        for (int i = 0; i < size; i++) {
            transitionSet.KQgRr5e_0(this.f2602KQgRr5e_0.get(i).m988clone());
        }
        return transitionSet;
    }

    @Override // androidx.transition.Transition
    public Transition excludeTarget(String str, boolean z) {
        for (int i = 0; i < this.f2602KQgRr5e_0.size(); i++) {
            this.f2602KQgRr5e_0.get(i).excludeTarget(str, z);
        }
        return super.excludeTarget(str, z);
    }

    @Override // androidx.transition.Transition
    /* renamed from: QxJ9d_1 */
    public TransitionSet removeTarget(View view) {
        for (int i = 0; i < this.f2602KQgRr5e_0.size(); i++) {
            this.f2602KQgRr5e_0.get(i).removeTarget(view);
        }
        return (TransitionSet) super.removeTarget(view);
    }

    public TransitionSet(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        this.f2602KQgRr5e_0 = new ArrayList<>();
        this.f2603QxJ9d_1 = true;
        this.PGPF6hQ_2 = false;
        this.QxJ9d_1 = 0;
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, NQvZgp_17.f3132IMuAHx_6);
        PGPF6hQ_2(IMuAHx_6.QxJ9d_1(obtainStyledAttributes, (XmlResourceParser) attributeSet, "transitionOrdering", 0, 0));
        obtainStyledAttributes.recycle();
    }

    @Override // androidx.transition.Transition
    public Transition excludeTarget(int i, boolean z) {
        for (int i2 = 0; i2 < this.f2602KQgRr5e_0.size(); i2++) {
            this.f2602KQgRr5e_0.get(i2).excludeTarget(i, z);
        }
        return super.excludeTarget(i, z);
    }

    @Override // androidx.transition.Transition
    /* renamed from: QxJ9d_1 */
    public TransitionSet removeTarget(Class cls) {
        for (int i = 0; i < this.f2602KQgRr5e_0.size(); i++) {
            this.f2602KQgRr5e_0.get(i).removeTarget(cls);
        }
        return (TransitionSet) super.removeTarget(cls);
    }

    @Override // androidx.transition.Transition
    public Transition excludeTarget(Class cls, boolean z) {
        for (int i = 0; i < this.f2602KQgRr5e_0.size(); i++) {
            this.f2602KQgRr5e_0.get(i).excludeTarget(cls, z);
        }
        return super.excludeTarget(cls, z);
    }

    @Override // androidx.transition.Transition
    /* renamed from: QxJ9d_1 */
    public TransitionSet removeTarget(String str) {
        for (int i = 0; i < this.f2602KQgRr5e_0.size(); i++) {
            this.f2602KQgRr5e_0.get(i).removeTarget(str);
        }
        return (TransitionSet) super.removeTarget(str);
    }

    public int KQgRr5e_0() {
        return this.f2602KQgRr5e_0.size();
    }

    public Transition KQgRr5e_0(int i) {
        if (i < 0 || i >= this.f2602KQgRr5e_0.size()) {
            return null;
        }
        return this.f2602KQgRr5e_0.get(i);
    }

    @Override // androidx.transition.Transition
    /* renamed from: QxJ9d_1 */
    public TransitionSet removeListener(Transition.IMuAHx_6 iMuAHx_6) {
        return (TransitionSet) super.removeListener(iMuAHx_6);
    }

    public TransitionSet KQgRr5e_0(long j) {
        super.setDuration(j);
        if (this.mDuration >= 0) {
            int size = this.f2602KQgRr5e_0.size();
            for (int i = 0; i < size; i++) {
                this.f2602KQgRr5e_0.get(i).setDuration(j);
            }
        }
        return this;
    }

    @Override // androidx.transition.Transition
    /* renamed from: KQgRr5e_0 */
    public TransitionSet setInterpolator(TimeInterpolator timeInterpolator) {
        this.QxJ9d_1 |= 1;
        ArrayList<Transition> arrayList = this.f2602KQgRr5e_0;
        if (arrayList != null) {
            int size = arrayList.size();
            for (int i = 0; i < size; i++) {
                this.f2602KQgRr5e_0.get(i).setInterpolator(timeInterpolator);
            }
        }
        return (TransitionSet) super.setInterpolator(timeInterpolator);
    }

    @Override // androidx.transition.Transition
    /* renamed from: KQgRr5e_0 */
    public TransitionSet addTarget(View view) {
        for (int i = 0; i < this.f2602KQgRr5e_0.size(); i++) {
            this.f2602KQgRr5e_0.get(i).addTarget(view);
        }
        return (TransitionSet) super.addTarget(view);
    }

    @Override // androidx.transition.Transition
    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public TransitionSet addTarget(int i) {
        for (int i2 = 0; i2 < this.f2602KQgRr5e_0.size(); i2++) {
            this.f2602KQgRr5e_0.get(i2).addTarget(i);
        }
        return (TransitionSet) super.addTarget(i);
    }

    @Override // androidx.transition.Transition
    /* renamed from: KQgRr5e_0 */
    public TransitionSet addTarget(String str) {
        for (int i = 0; i < this.f2602KQgRr5e_0.size(); i++) {
            this.f2602KQgRr5e_0.get(i).addTarget(str);
        }
        return (TransitionSet) super.addTarget(str);
    }

    @Override // androidx.transition.Transition
    /* renamed from: KQgRr5e_0 */
    public TransitionSet addTarget(Class cls) {
        for (int i = 0; i < this.f2602KQgRr5e_0.size(); i++) {
            this.f2602KQgRr5e_0.get(i).addTarget(cls);
        }
        return (TransitionSet) super.addTarget(cls);
    }

    @Override // androidx.transition.Transition
    /* renamed from: KQgRr5e_0 */
    public TransitionSet addListener(Transition.IMuAHx_6 iMuAHx_6) {
        return (TransitionSet) super.addListener(iMuAHx_6);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public final void m990KQgRr5e_0() {
        QxJ9d_1 qxJ9d_1 = new QxJ9d_1(this);
        Iterator<Transition> it = this.f2602KQgRr5e_0.iterator();
        while (it.hasNext()) {
            it.next().addListener(qxJ9d_1);
        }
        this.KQgRr5e_0 = this.f2602KQgRr5e_0.size();
    }

    public TransitionSet KQgRr5e_0(ViewGroup viewGroup) {
        super.setSceneRoot(viewGroup);
        int size = this.f2602KQgRr5e_0.size();
        for (int i = 0; i < size; i++) {
            this.f2602KQgRr5e_0.get(i).setSceneRoot(viewGroup);
        }
        return this;
    }
}
