package androidx.constraintlayout.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import p037.p058.p061.p062.C1743;
import p037.p058.p061.p062.C1747;
import p037.p058.p064.AbstractC1775;
import p037.p058.p064.C1790;

/* JADX INFO: loaded from: classes.dex */
public class Barrier extends AbstractC1775 {

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public int f489;

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public int f490;

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public C1743 f491;

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

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

    public int getMargin() {
        return this.f491.f5696;
    }

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

    public void setAllowsGoneWidget(boolean z) {
        this.f491.f5695 = z;
    }

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

    public void setMargin(int i) {
        this.f491.f5696 = i;
    }

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

    @Override // p037.p058.p064.AbstractC1775
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void mo209(AttributeSet attributeSet) {
        super.mo209(attributeSet);
        this.f491 = new C1743();
        if (attributeSet != null) {
            TypedArray typedArrayObtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, C1790.ConstraintLayout_Layout);
            int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
            for (int i = 0; i < indexCount; i++) {
                int index = typedArrayObtainStyledAttributes.getIndex(i);
                if (index == C1790.ConstraintLayout_Layout_barrierDirection) {
                    setType(typedArrayObtainStyledAttributes.getInt(index, 0));
                } else if (index == C1790.ConstraintLayout_Layout_barrierAllowsGoneWidgets) {
                    this.f491.f5695 = typedArrayObtainStyledAttributes.getBoolean(index, true);
                } else if (index == C1790.ConstraintLayout_Layout_barrierMargin) {
                    this.f491.f5696 = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, 0);
                }
            }
        }
        this.f5902 = this.f491;
        m3526();
    }

    @Override // p037.p058.p064.AbstractC1775
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void mo210(C1747 c1747, boolean z) {
        int i = this.f489;
        this.f490 = i;
        if (z) {
            if (i == 5) {
                this.f490 = 1;
            } else if (i == 6) {
                this.f490 = 0;
            }
        } else if (i == 5) {
            this.f490 = 0;
        } else if (i == 6) {
            this.f490 = 1;
        }
        if (c1747 instanceof C1743) {
            ((C1743) c1747).f5694 = this.f490;
        }
    }
}
