package androidx.constraintlayout.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.View;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashSet;

/* JADX INFO: loaded from: classes.dex */
public class ReactiveGuide extends View implements t {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public boolean f1295b;

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public boolean f1297d;

    public ReactiveGuide(Context context) {
        super(context);
        this.f1294a = -1;
        this.f1295b = false;
        this.f1296c = 0;
        this.f1297d = true;
        super.setVisibility(8);
        a(null);
    }

    public final void a(AttributeSet attributeSet) {
        if (attributeSet != null) {
            TypedArray typedArrayObtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, s.ConstraintLayout_ReactiveGuide);
            int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
            for (int i10 = 0; i10 < indexCount; i10++) {
                int index = typedArrayObtainStyledAttributes.getIndex(i10);
                if (index == s.ConstraintLayout_ReactiveGuide_reactiveGuide_valueId) {
                    this.f1294a = typedArrayObtainStyledAttributes.getResourceId(index, this.f1294a);
                } else if (index == s.ConstraintLayout_ReactiveGuide_reactiveGuide_animateChange) {
                    this.f1295b = typedArrayObtainStyledAttributes.getBoolean(index, this.f1295b);
                } else if (index == s.ConstraintLayout_ReactiveGuide_reactiveGuide_applyToConstraintSet) {
                    this.f1296c = typedArrayObtainStyledAttributes.getResourceId(index, this.f1296c);
                } else if (index == s.ConstraintLayout_ReactiveGuide_reactiveGuide_applyToAllConstraintSets) {
                    this.f1297d = typedArrayObtainStyledAttributes.getBoolean(index, this.f1297d);
                }
            }
            typedArrayObtainStyledAttributes.recycle();
        }
        if (this.f1294a != -1) {
            ConstraintLayout.getSharedValues().a(this.f1294a, this);
        }
    }

    @Override // android.view.View
    public final void draw(Canvas canvas) {
    }

    public int getApplyToConstraintSetId() {
        return this.f1296c;
    }

    public int getAttributeId() {
        return this.f1294a;
    }

    @Override // android.view.View
    public final void onMeasure(int i10, int i11) {
        setMeasuredDimension(0, 0);
    }

    public void setAnimateChange(boolean z10) {
        this.f1295b = z10;
    }

    public void setApplyToConstraintSetId(int i10) {
        this.f1296c = i10;
    }

    public void setAttributeId(int i10) {
        HashSet<WeakReference> hashSet;
        u sharedValues = ConstraintLayout.getSharedValues();
        int i11 = this.f1294a;
        if (i11 != -1 && (hashSet = (HashSet) sharedValues.f1490a.get(Integer.valueOf(i11))) != null) {
            ArrayList arrayList = new ArrayList();
            for (WeakReference weakReference : hashSet) {
                t tVar = (t) weakReference.get();
                if (tVar == null || tVar == this) {
                    arrayList.add(weakReference);
                }
            }
            hashSet.removeAll(arrayList);
        }
        this.f1294a = i10;
        if (i10 != -1) {
            sharedValues.a(i10, this);
        }
    }

    public void setGuidelineBegin(int i10) {
        c cVar = (c) getLayoutParams();
        cVar.f1309a = i10;
        setLayoutParams(cVar);
    }

    public void setGuidelineEnd(int i10) {
        c cVar = (c) getLayoutParams();
        cVar.f1311b = i10;
        setLayoutParams(cVar);
    }

    public void setGuidelinePercent(float f10) {
        c cVar = (c) getLayoutParams();
        cVar.f1313c = f10;
        setLayoutParams(cVar);
    }

    @Override // android.view.View
    public void setVisibility(int i10) {
    }

    public ReactiveGuide(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        this.f1294a = -1;
        this.f1295b = false;
        this.f1296c = 0;
        this.f1297d = true;
        super.setVisibility(8);
        a(attributeSet);
    }

    public ReactiveGuide(Context context, AttributeSet attributeSet, int i10) {
        super(context, attributeSet, i10);
        this.f1294a = -1;
        this.f1295b = false;
        this.f1296c = 0;
        this.f1297d = true;
        super.setVisibility(8);
        a(attributeSet);
    }
}
