package androidx.constraintlayout.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import d.f.a.j.a;
import d.f.c.b;
import d.f.c.i;

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

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public int f569t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public int f570u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public a f571v;

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

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

    public boolean getAllowsGoneWidget() {
        return this.f571v.t0;
    }

    public int getMargin() {
        return this.f571v.u0;
    }

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

    @Override // d.f.c.b
    public void i(AttributeSet attributeSet) {
        super.i(attributeSet);
        this.f571v = new a();
        if (attributeSet != null) {
            TypedArray typedArrayObtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, i.f2546b);
            int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
            for (int i2 = 0; i2 < indexCount; i2++) {
                int index = typedArrayObtainStyledAttributes.getIndex(i2);
                if (index == 26) {
                    setType(typedArrayObtainStyledAttributes.getInt(index, 0));
                } else if (index == 25) {
                    this.f571v.t0 = typedArrayObtainStyledAttributes.getBoolean(index, true);
                } else if (index == 27) {
                    this.f571v.u0 = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, 0);
                }
            }
            typedArrayObtainStyledAttributes.recycle();
        }
        this.f2442o = this.f571v;
        n();
    }

    /* JADX WARN: Code restructure failed: missing block: B:11:0x0014, code lost:
    
        if (r0 == 6) goto L12;
     */
    /* JADX WARN: Code restructure failed: missing block: B:6:0x000b, code lost:
    
        if (r0 == 6) goto L9;
     */
    @Override // d.f.c.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void j(d.f.a.j.d r4, boolean r5) {
        /*
            r3 = this;
            int r0 = r3.f569t
            r3.f570u = r0
            r1 = 6
            r2 = 5
            if (r5 == 0) goto Le
            if (r0 != r2) goto Lb
            goto L16
        Lb:
            if (r0 != r1) goto L18
            goto L10
        Le:
            if (r0 != r2) goto L14
        L10:
            r5 = 0
        L11:
            r3.f570u = r5
            goto L18
        L14:
            if (r0 != r1) goto L18
        L16:
            r5 = 1
            goto L11
        L18:
            boolean r5 = r4 instanceof d.f.a.j.a
            if (r5 == 0) goto L22
            d.f.a.j.a r4 = (d.f.a.j.a) r4
            int r5 = r3.f570u
            r4.s0 = r5
        L22:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.constraintlayout.widget.Barrier.j(d.f.a.j.d, boolean):void");
    }

    public void setAllowsGoneWidget(boolean z2) {
        this.f571v.t0 = z2;
    }

    public void setDpMargin(int i2) {
        this.f571v.u0 = (int) ((i2 * getResources().getDisplayMetrics().density) + 0.5f);
    }

    public void setMargin(int i2) {
        this.f571v.u0 = i2;
    }

    public void setType(int i2) {
        this.f569t = i2;
    }
}
