package androidx.constraintlayout.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.util.Xml;
import android.view.LayoutInflater;
import android.view.ViewGroup;

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

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

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

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

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

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final o f1369f;

    public g(Context context, XmlResourceParser xmlResourceParser) {
        this.f1364a = Float.NaN;
        this.f1365b = Float.NaN;
        this.f1366c = Float.NaN;
        this.f1367d = Float.NaN;
        this.f1368e = -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.f1368e);
                this.f1368e = resourceId;
                String resourceTypeName = context.getResources().getResourceTypeName(resourceId);
                context.getResources().getResourceName(resourceId);
                if ("layout".equals(resourceTypeName)) {
                    o oVar = new o();
                    this.f1369f = oVar;
                    oVar.e((ConstraintLayout) LayoutInflater.from(context).inflate(resourceId, (ViewGroup) null));
                }
            } else if (index == s.Variant_region_heightLessThan) {
                this.f1367d = typedArrayObtainStyledAttributes.getDimension(index, this.f1367d);
            } else if (index == s.Variant_region_heightMoreThan) {
                this.f1365b = typedArrayObtainStyledAttributes.getDimension(index, this.f1365b);
            } else if (index == s.Variant_region_widthLessThan) {
                this.f1366c = typedArrayObtainStyledAttributes.getDimension(index, this.f1366c);
            } else if (index == s.Variant_region_widthMoreThan) {
                this.f1364a = typedArrayObtainStyledAttributes.getDimension(index, this.f1364a);
            }
        }
        typedArrayObtainStyledAttributes.recycle();
    }

    public final boolean a(float f10, float f11) {
        float f12 = this.f1364a;
        if (!Float.isNaN(f12) && f10 < f12) {
            return false;
        }
        float f13 = this.f1365b;
        if (!Float.isNaN(f13) && f11 < f13) {
            return false;
        }
        float f14 = this.f1366c;
        if (!Float.isNaN(f14) && f10 > f14) {
            return false;
        }
        float f15 = this.f1367d;
        return Float.isNaN(f15) || f11 <= f15;
    }
}
