package androidx.constraintlayout.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
import android.util.AttributeSet;
import android.util.SparseArray;
import androidx.constraintlayout.solver.widgets.ConstraintWidget;
import androidx.constraintlayout.widget.ConstraintLayout;
import ῲ.ⁱ.ʬ.C2059;
import ῲ.ⁱ.ῲ.㿎.C2082;
import ῲ.ⁱ.ῲ.㿎.C2102;
import ῲ.ⁱ.ῲ.㿎.C2103;

public class Barrier extends ConstraintHelper {

    /* renamed from: ᕣ  reason: contains not printable characters */
    public int f979;

    /* renamed from: 㑃  reason: contains not printable characters */
    public C2103 f980;

    /* renamed from: 㳳  reason: contains not printable characters */
    public int f981;

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

    public int getMargin() {
        return this.f980.f7280;
    }

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

    public void setAllowsGoneWidget(boolean z) {
        this.f980.f7283 = z;
    }

    public void setDpMargin(int i) {
        this.f980.f7280 = (int) ((((float) i) * getResources().getDisplayMetrics().density) + 0.5f);
    }

    public void setMargin(int i) {
        this.f980.f7280 = i;
    }

    public void setType(int i) {
        this.f981 = i;
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m536(ConstraintWidget constraintWidget, int i, boolean z) {
        this.f979 = i;
        int i2 = Build.VERSION.SDK_INT;
        if (z) {
            int i3 = this.f981;
            if (i3 == 5) {
                this.f979 = 1;
            } else if (i3 == 6) {
                this.f979 = 0;
            }
        } else {
            int i4 = this.f981;
            if (i4 == 5) {
                this.f979 = 0;
            } else if (i4 == 6) {
                this.f979 = 1;
            }
        }
        if (constraintWidget instanceof C2103) {
            ((C2103) constraintWidget).f7282 = this.f979;
        }
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public boolean m539() {
        return this.f980.f7283;
    }

    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);
    }

    @Override // androidx.constraintlayout.widget.ConstraintHelper
    /* renamed from: K  reason: contains not printable characters */
    public void m537(ConstraintWidget constraintWidget, boolean z) {
        m536(constraintWidget, this.f981, z);
    }

    @Override // androidx.constraintlayout.widget.ConstraintHelper
    /* renamed from: K  reason: contains not printable characters */
    public void m535(AttributeSet attributeSet) {
        super.m557(attributeSet);
        this.f980 = new C2103();
        if (attributeSet != null) {
            TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, R$styleable.ConstraintLayout_Layout);
            int indexCount = obtainStyledAttributes.getIndexCount();
            for (int i = 0; i < indexCount; i++) {
                int index = obtainStyledAttributes.getIndex(i);
                if (index == R$styleable.ConstraintLayout_Layout_barrierDirection) {
                    setType(obtainStyledAttributes.getInt(index, 0));
                } else if (index == R$styleable.ConstraintLayout_Layout_barrierAllowsGoneWidgets) {
                    this.f980.f7283 = obtainStyledAttributes.getBoolean(index, true);
                } else if (index == R$styleable.ConstraintLayout_Layout_barrierMargin) {
                    this.f980.f7280 = obtainStyledAttributes.getDimensionPixelSize(index, 0);
                }
            }
            obtainStyledAttributes.recycle();
        }
        this.f991 = this.f980;
        m548();
    }

    @Override // androidx.constraintlayout.widget.ConstraintHelper
    /* renamed from: K  reason: contains not printable characters */
    public void m538(C2059.C2063 k, C2102 r2, ConstraintLayout.C0140 k2, SparseArray<ConstraintWidget> sparseArray) {
        super.m561(k, r2, k2, sparseArray);
        if (r2 instanceof C2103) {
            C2103 k3 = (C2103) r2;
            m536(k3, k.f7099.f7055, ((C2082) r2.f867).f7189);
            C2059.C2062 r1 = k.f7099;
            k3.f7283 = r1.f7081;
            k3.f7280 = r1.f7074;
        }
    }
}
