package ῲ.ῲ.㴹;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
import androidx.appcompat.R$styleable;
import ῲ.ᨨ.ʬ.C1718;
import ῲ.ῲ.ῲ.K.C1940;

/* renamed from: ῲ.ῲ.㴹.䃖  reason: contains not printable characters */
/* compiled from: ThemeUtils */
public class C2056 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public static final int[] f6996 = {16842908};

    /* renamed from: ඓ  reason: contains not printable characters */
    public static final int[] f6997 = {16842912};

    /* renamed from: ῲ  reason: contains not printable characters */
    public static final int[] f6998 = {-16842910};

    /* renamed from: ⁱ  reason: contains not printable characters */
    public static final int[] f6999 = new int[1];

    /* renamed from: K  reason: contains not printable characters */
    public static final ThreadLocal<TypedValue> f7000 = new ThreadLocal<>();

    /* renamed from: 㴹  reason: contains not printable characters */
    public static final int[] f7001 = new int[0];

    /* renamed from: 㸾  reason: contains not printable characters */
    public static final int[] f7002 = {16842919};

    static {
        new int[1][0] = 16843518;
        new int[1][0] = 16842913;
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public static ColorStateList m5359(Context context, int i) {
        ColorStateList colorStateList;
        int resourceId;
        int[] iArr = f6999;
        iArr[0] = i;
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes((AttributeSet) null, iArr);
        try {
            if (!obtainStyledAttributes.hasValue(0) || (resourceId = obtainStyledAttributes.getResourceId(0, 0)) == 0 || (colorStateList = C1940.m5018(context, resourceId)) == null) {
                colorStateList = obtainStyledAttributes.getColorStateList(0);
            }
            return colorStateList;
        } finally {
            obtainStyledAttributes.recycle();
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static int m5360(Context context, int i) {
        int[] iArr = f6999;
        iArr[0] = i;
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes((AttributeSet) null, iArr);
        try {
            return obtainStyledAttributes.getColor(0, 0);
        } finally {
            obtainStyledAttributes.recycle();
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m5361(Context context, int i) {
        ColorStateList r0 = m5359(context, i);
        if (r0 != null && r0.isStateful()) {
            return r0.getColorForState(f6998, r0.getDefaultColor());
        }
        TypedValue typedValue = f7000.get();
        if (typedValue == null) {
            typedValue = new TypedValue();
            f7000.set(typedValue);
        }
        context.getTheme().resolveAttribute(16842803, typedValue, true);
        float f = typedValue.getFloat();
        int r4 = m5360(context, i);
        return C1718.m4410(r4, Math.round(((float) Color.alpha(r4)) * f));
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m5362(View view, Context context) {
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(R$styleable.AppCompatTheme);
        try {
            if (!obtainStyledAttributes.hasValue(R$styleable.AppCompatTheme_windowActionBar)) {
                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();
        }
    }
}
