package l;

import android.R;
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.TypedValue;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/* JADX INFO: loaded from: classes.dex */
public abstract class l3 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final ThreadLocal f29760a = new ThreadLocal();

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final int[] f29761b = {-16842910};

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final int[] f29762c = {R.attr.state_focused};

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final int[] f29763d = {R.attr.state_pressed};

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static final int[] f29764e = {R.attr.state_checked};

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final int[] f29765f = new int[0];

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public static final int[] f29766g = new int[1];

    public static void a(Context context, View view) {
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(d.j.AppCompatTheme);
        try {
            if (!typedArrayObtainStyledAttributes.hasValue(d.j.AppCompatTheme_windowActionBar)) {
                view.getClass().toString();
            }
        } finally {
            typedArrayObtainStyledAttributes.recycle();
        }
    }

    public static int b(Context context, int i10) {
        ColorStateList themeAttrColorStateList = getThemeAttrColorStateList(context, i10);
        if (themeAttrColorStateList != null && themeAttrColorStateList.isStateful()) {
            return themeAttrColorStateList.getColorForState(f29761b, themeAttrColorStateList.getDefaultColor());
        }
        ThreadLocal threadLocal = f29760a;
        TypedValue typedValue = (TypedValue) threadLocal.get();
        if (typedValue == null) {
            typedValue = new TypedValue();
            threadLocal.set(typedValue);
        }
        context.getTheme().resolveAttribute(R.attr.disabledAlpha, typedValue, true);
        float f10 = typedValue.getFloat();
        return j0.c.e(c(context, i10), Math.round(Color.alpha(r4) * f10));
    }

    public static int c(Context context, int i10) {
        int[] iArr = f29766g;
        iArr[0] = i10;
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes((AttributeSet) null, iArr);
        p3 p3Var = new p3(context, typedArrayObtainStyledAttributes);
        try {
            return typedArrayObtainStyledAttributes.getColor(0, 0);
        } finally {
            p3Var.e();
        }
    }

    @Nullable
    public static ColorStateList getThemeAttrColorStateList(@NonNull Context context, int i10) {
        int[] iArr = f29766g;
        iArr[0] = i10;
        p3 p3Var = new p3(context, context.obtainStyledAttributes((AttributeSet) null, iArr));
        try {
            return p3Var.a(0);
        } finally {
            p3Var.e();
        }
    }
}
