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;
import java.util.ArrayList;

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

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final ArrayList f1361b = new ArrayList();

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

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

    public f(Context context, XmlResourceParser xmlResourceParser) {
        this.f1362c = -1;
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(Xml.asAttributeSet(xmlResourceParser), s.State);
        int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
        for (int i10 = 0; i10 < indexCount; i10++) {
            int index = typedArrayObtainStyledAttributes.getIndex(i10);
            if (index == s.State_android_id) {
                this.f1360a = typedArrayObtainStyledAttributes.getResourceId(index, this.f1360a);
            } else if (index == s.State_constraints) {
                int resourceId = typedArrayObtainStyledAttributes.getResourceId(index, this.f1362c);
                this.f1362c = resourceId;
                String resourceTypeName = context.getResources().getResourceTypeName(resourceId);
                context.getResources().getResourceName(resourceId);
                if ("layout".equals(resourceTypeName)) {
                    o oVar = new o();
                    this.f1363d = oVar;
                    oVar.e((ConstraintLayout) LayoutInflater.from(context).inflate(resourceId, (ViewGroup) null));
                }
            }
        }
        typedArrayObtainStyledAttributes.recycle();
    }
}
