package x;

import android.content.Context;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.util.TypedValue;
import android.util.Xml;
import java.util.HashMap;
import n4.u0;
import u.AbstractC1563h;

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

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

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

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

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

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

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

    public a(a aVar, Object obj) {
        aVar.getClass();
        this.f18320a = aVar.f18320a;
        b(obj);
    }

    public static void a(Context context, XmlResourceParser xmlResourceParser, HashMap map) {
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(Xml.asAttributeSet(xmlResourceParser), n.f18489c);
        int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
        String string = null;
        int i = 0;
        Object string2 = null;
        for (int i5 = 0; i5 < indexCount; i5++) {
            int index = typedArrayObtainStyledAttributes.getIndex(i5);
            if (index == 0) {
                string = typedArrayObtainStyledAttributes.getString(index);
                if (string != null && string.length() > 0) {
                    string = Character.toUpperCase(string.charAt(0)) + string.substring(1);
                }
            } else if (index == 1) {
                string2 = Boolean.valueOf(typedArrayObtainStyledAttributes.getBoolean(index, false));
                i = 6;
            } else {
                int i8 = 3;
                if (index == 3) {
                    string2 = Integer.valueOf(typedArrayObtainStyledAttributes.getColor(index, 0));
                } else {
                    i8 = 4;
                    if (index == 2) {
                        string2 = Integer.valueOf(typedArrayObtainStyledAttributes.getColor(index, 0));
                    } else {
                        if (index == 7) {
                            string2 = Float.valueOf(TypedValue.applyDimension(1, typedArrayObtainStyledAttributes.getDimension(index, 0.0f), context.getResources().getDisplayMetrics()));
                        } else if (index == 4) {
                            string2 = Float.valueOf(typedArrayObtainStyledAttributes.getDimension(index, 0.0f));
                        } else {
                            i8 = 5;
                            if (index == 5) {
                                string2 = Float.valueOf(typedArrayObtainStyledAttributes.getFloat(index, Float.NaN));
                                i = 2;
                            } else if (index == 6) {
                                string2 = Integer.valueOf(typedArrayObtainStyledAttributes.getInteger(index, -1));
                                i = 1;
                            } else if (index == 8) {
                                string2 = typedArrayObtainStyledAttributes.getString(index);
                            }
                        }
                        i = 7;
                    }
                }
                i = i8;
            }
        }
        if (string != null && string2 != null) {
            a aVar = new a();
            aVar.f18320a = i;
            aVar.b(string2);
            map.put(string, aVar);
        }
        typedArrayObtainStyledAttributes.recycle();
    }

    public final void b(Object obj) {
        switch (AbstractC1563h.c(this.f18320a)) {
            case u0.f15495q /* 0 */:
                this.f18321b = ((Integer) obj).intValue();
                break;
            case 1:
                this.f18322c = ((Float) obj).floatValue();
                break;
            case 2:
            case 3:
                this.f18325f = ((Integer) obj).intValue();
                break;
            case 4:
                this.f18323d = (String) obj;
                break;
            case 5:
                this.f18324e = ((Boolean) obj).booleanValue();
                break;
            case Z.g.STRING_SET_FIELD_NUMBER /* 6 */:
                this.f18322c = ((Float) obj).floatValue();
                break;
        }
    }
}
