package androidx.constraintlayout.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.util.Xml;

/* JADX INFO: loaded from: classes.dex */
public final class w {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final float f1494a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final float f1495b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final float f1496c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final float f1497d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final int f1498e;

    public w(Context context, XmlResourceParser xmlResourceParser) {
        this.f1494a = Float.NaN;
        this.f1495b = Float.NaN;
        this.f1496c = Float.NaN;
        this.f1497d = Float.NaN;
        this.f1498e = -1;
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(Xml.asAttributeSet(xmlResourceParser), s.Variant);
        int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
        for (int i10 = 0; i10 < indexCount; i10++) {
            int index = typedArrayObtainStyledAttributes.getIndex(i10);
            if (index == s.Variant_constraints) {
                int resourceId = typedArrayObtainStyledAttributes.getResourceId(index, this.f1498e);
                this.f1498e = resourceId;
                String resourceTypeName = context.getResources().getResourceTypeName(resourceId);
                context.getResources().getResourceName(resourceId);
                "layout".equals(resourceTypeName);
            } else if (index == s.Variant_region_heightLessThan) {
                this.f1497d = typedArrayObtainStyledAttributes.getDimension(index, this.f1497d);
            } else if (index == s.Variant_region_heightMoreThan) {
                this.f1495b = typedArrayObtainStyledAttributes.getDimension(index, this.f1495b);
            } else if (index == s.Variant_region_widthLessThan) {
                this.f1496c = typedArrayObtainStyledAttributes.getDimension(index, this.f1496c);
            } else if (index == s.Variant_region_widthMoreThan) {
                this.f1494a = typedArrayObtainStyledAttributes.getDimension(index, this.f1494a);
            }
        }
        typedArrayObtainStyledAttributes.recycle();
    }

    public final boolean a(float f10, float f11) {
        float f12 = this.f1494a;
        if (!Float.isNaN(f12) && f10 < f12) {
            return false;
        }
        float f13 = this.f1495b;
        if (!Float.isNaN(f13) && f11 < f13) {
            return false;
        }
        float f14 = this.f1496c;
        if (!Float.isNaN(f14) && f10 > f14) {
            return false;
        }
        float f15 = this.f1497d;
        return Float.isNaN(f15) || f11 <= f15;
    }
}
