package p028j;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
import p007c.C0494j;
import p073z.C1865a;

/* renamed from: j.b3 */
/* loaded from: classes.dex */
public class C1073b3 {

    /* renamed from: a */
    public static final ThreadLocal<TypedValue> f2634a = new ThreadLocal<>();

    /* renamed from: b */
    public static final int[] f2635b = {-16842910};

    /* renamed from: c */
    public static final int[] f2636c = {16842908};

    /* renamed from: d */
    public static final int[] f2637d = {16843518};

    /* renamed from: e */
    public static final int[] f2638e = {16842919};

    /* renamed from: f */
    public static final int[] f2639f = {16842912};

    /* renamed from: g */
    public static final int[] f2640g = {16842913};

    /* renamed from: h */
    public static final int[] f2641h = {-16842919, -16842908};

    /* renamed from: i */
    public static final int[] f2642i = new int[0];

    /* renamed from: j */
    public static final int[] f2643j = new int[1];

    /* renamed from: a */
    public static void m2264a(View view, Context context) {
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(C0494j.f1922y0);
        try {
            if (!obtainStyledAttributes.hasValue(C0494j.f1707D0)) {
                Log.e("ThemeUtils", "View " + view.getClass() + " is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).");
            }
        } finally {
            obtainStyledAttributes.recycle();
        }
    }

    /* renamed from: b */
    public static int m2263b(Context context, int i) {
        ColorStateList m2260e = m2260e(context, i);
        if (m2260e == null || !m2260e.isStateful()) {
            TypedValue m2259f = m2259f();
            context.getTheme().resolveAttribute(16842803, m2259f, true);
            return m2261d(context, i, m2259f.getFloat());
        }
        return m2260e.getColorForState(f2635b, m2260e.getDefaultColor());
    }

    /* renamed from: c */
    public static int m2262c(Context context, int i) {
        int[] iArr = f2643j;
        iArr[0] = i;
        C1106g3 m2161t = C1106g3.m2161t(context, null, iArr);
        try {
            return m2161t.m2179b(0, 0);
        } finally {
            m2161t.m2159v();
        }
    }

    /* renamed from: d */
    public static int m2261d(Context context, int i, float f) {
        int m2262c = m2262c(context, i);
        return C1865a.m155f(m2262c, Math.round(Color.alpha(m2262c) * f));
    }

    /* renamed from: e */
    public static ColorStateList m2260e(Context context, int i) {
        int[] iArr = f2643j;
        iArr[0] = i;
        C1106g3 m2161t = C1106g3.m2161t(context, null, iArr);
        try {
            return m2161t.m2178c(0);
        } finally {
            m2161t.m2159v();
        }
    }

    /* renamed from: f */
    public static TypedValue m2259f() {
        ThreadLocal<TypedValue> threadLocal = f2634a;
        TypedValue typedValue = threadLocal.get();
        if (typedValue == null) {
            TypedValue typedValue2 = new TypedValue();
            threadLocal.set(typedValue2);
            return typedValue2;
        }
        return typedValue;
    }
}