package androidx.constraintlayout.widget;

import X6FRs_4.X6FRs_4.KQgRr5e_0.XnFJ5_9.QxJ9d_1;
import X6FRs_4.X6FRs_4.QxJ9d_1.PGPF6hQ_2;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
import android.util.AttributeSet;
/* loaded from: classes.dex */
public class Barrier extends ConstraintHelper {
    public QxJ9d_1 KQgRr5e_0;
    public int PGPF6hQ_2;
    public int QxJ9d_1;

    public Barrier(Context context) {
        super(context);
        super.setVisibility(8);
    }

    @Override // androidx.constraintlayout.widget.ConstraintHelper
    public void KQgRr5e_0(AttributeSet attributeSet) {
        super.KQgRr5e_0(attributeSet);
        this.KQgRr5e_0 = new QxJ9d_1();
        if (attributeSet != null) {
            TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, PGPF6hQ_2.ConstraintLayout_Layout);
            int indexCount = obtainStyledAttributes.getIndexCount();
            for (int i = 0; i < indexCount; i++) {
                int index = obtainStyledAttributes.getIndex(i);
                if (index == PGPF6hQ_2.ConstraintLayout_Layout_barrierDirection) {
                    setType(obtainStyledAttributes.getInt(index, 0));
                } else if (index == PGPF6hQ_2.ConstraintLayout_Layout_barrierAllowsGoneWidgets) {
                    this.KQgRr5e_0.PGPF6hQ_2(obtainStyledAttributes.getBoolean(index, true));
                }
            }
        }
        ((ConstraintHelper) this).f2178KQgRr5e_0 = this.KQgRr5e_0;
        KQgRr5e_0();
    }

    public int getType() {
        return this.QxJ9d_1;
    }

    public void setAllowsGoneWidget(boolean z) {
        this.KQgRr5e_0.PGPF6hQ_2(z);
    }

    public void setType(int i) {
        this.QxJ9d_1 = i;
        this.PGPF6hQ_2 = i;
        if (Build.VERSION.SDK_INT >= 17) {
            if (1 == getResources().getConfiguration().getLayoutDirection()) {
                int i2 = this.QxJ9d_1;
                if (i2 == 5) {
                    this.PGPF6hQ_2 = 1;
                } else if (i2 == 6) {
                    this.PGPF6hQ_2 = 0;
                }
            } else {
                int i3 = this.QxJ9d_1;
                if (i3 == 5) {
                    this.PGPF6hQ_2 = 0;
                } else if (i3 == 6) {
                    this.PGPF6hQ_2 = 1;
                }
            }
        } else if (i == 5) {
            this.PGPF6hQ_2 = 0;
        } else if (i == 6) {
            this.PGPF6hQ_2 = 1;
        }
        this.KQgRr5e_0.LGe8pk_15(this.PGPF6hQ_2);
    }

    public Barrier(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        super.setVisibility(8);
    }

    public Barrier(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        super.setVisibility(8);
    }
}
