package androidx.constraintlayout.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
import android.util.AttributeSet;
import p049q.C1544a;
import p049q.C1550e;
import p061u.C1743h;

/* renamed from: androidx.constraintlayout.widget.a */
/* loaded from: classes.dex */
public class C0187a extends AbstractC0191c {

    /* renamed from: m */
    public int f827m;

    /* renamed from: n */
    public int f828n;

    /* renamed from: o */
    public C1544a f829o;

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

    public boolean getAllowsGoneWidget() {
        return this.f829o.m1086r1();
    }

    public int getMargin() {
        return this.f829o.m1084t1();
    }

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

    @Override // androidx.constraintlayout.widget.AbstractC0191c
    /* renamed from: m */
    public void mo480m(AttributeSet attributeSet) {
        super.mo480m(attributeSet);
        this.f829o = new C1544a();
        if (attributeSet != null) {
            TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, C1743h.f4303n1);
            int indexCount = obtainStyledAttributes.getIndexCount();
            for (int i = 0; i < indexCount; i++) {
                int index = obtainStyledAttributes.getIndex(i);
                if (index == C1743h.f4384w1) {
                    setType(obtainStyledAttributes.getInt(index, 0));
                } else if (index == C1743h.f4375v1) {
                    this.f829o.m1081w1(obtainStyledAttributes.getBoolean(index, true));
                } else if (index == C1743h.f4393x1) {
                    this.f829o.m1079y1(obtainStyledAttributes.getDimensionPixelSize(index, 0));
                }
            }
            obtainStyledAttributes.recycle();
        }
        this.f851g = this.f829o;
        m4541s();
    }

    @Override // androidx.constraintlayout.widget.AbstractC0191c
    /* renamed from: n */
    public void mo4546n(C1550e c1550e, boolean z) {
        m4562t(c1550e, this.f827m, z);
    }

    public void setAllowsGoneWidget(boolean z) {
        this.f829o.m1081w1(z);
    }

    public void setDpMargin(int i) {
        C1544a c1544a = this.f829o;
        c1544a.m1079y1((int) ((i * getResources().getDisplayMetrics().density) + 0.5f));
    }

    public void setMargin(int i) {
        this.f829o.m1079y1(i);
    }

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

    /* JADX WARN: Code restructure failed: missing block: B:13:0x001f, code lost:
        if (r7 == 6) goto L5;
     */
    /* JADX WARN: Code restructure failed: missing block: B:17:0x0025, code lost:
        if (r7 == 6) goto L13;
     */
    /* JADX WARN: Code restructure failed: missing block: B:7:0x0013, code lost:
        if (r7 == 6) goto L13;
     */
    /* renamed from: t */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m4562t(C1550e c1550e, int i, boolean z) {
        this.f828n = i;
        if (Build.VERSION.SDK_INT < 17) {
            int i2 = this.f827m;
            if (i2 != 5) {
            }
            this.f828n = 0;
        } else {
            int i3 = this.f827m;
            if (z) {
                if (i3 != 5) {
                }
                this.f828n = 1;
            } else {
                if (i3 != 5) {
                }
                this.f828n = 0;
            }
        }
        if (c1550e instanceof C1544a) {
            ((C1544a) c1550e).m1080x1(this.f828n);
        }
    }
}