package m3; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.util.TypedValue; import androidx.appcompat.widget.i2; /* loaded from: classes2.dex */ public abstract class c { public static ColorStateList a(Context context, TypedArray typedArray, int i10) { int resourceId; ColorStateList c10; return (!typedArray.hasValue(i10) || (resourceId = typedArray.getResourceId(i10, 0)) == 0 || (c10 = e.b.c(context, resourceId)) == null) ? typedArray.getColorStateList(i10) : c10; } public static ColorStateList b(Context context, i2 i2Var, int i10) { int n10; ColorStateList c10; return (!i2Var.s(i10) || (n10 = i2Var.n(i10, 0)) == 0 || (c10 = e.b.c(context, n10)) == null) ? i2Var.c(i10) : c10; } public static int c(Context context, TypedArray typedArray, int i10, int i11) { TypedValue typedValue = new TypedValue(); if (!typedArray.getValue(i10, typedValue) || typedValue.type != 2) { return typedArray.getDimensionPixelSize(i10, i11); } TypedArray obtainStyledAttributes = context.getTheme().obtainStyledAttributes(new int[]{typedValue.data}); int dimensionPixelSize = obtainStyledAttributes.getDimensionPixelSize(0, i11); obtainStyledAttributes.recycle(); return dimensionPixelSize; } public static Drawable d(Context context, TypedArray typedArray, int i10) { int resourceId; Drawable d10; return (!typedArray.hasValue(i10) || (resourceId = typedArray.getResourceId(i10, 0)) == 0 || (d10 = e.b.d(context, resourceId)) == null) ? typedArray.getDrawable(i10) : d10; } static int e(TypedArray typedArray, int i10, int i11) { return typedArray.hasValue(i10) ? i10 : i11; } public static d f(Context context, TypedArray typedArray, int i10) { int resourceId; if (!typedArray.hasValue(i10) || (resourceId = typedArray.getResourceId(i10, 0)) == 0) { return null; } return new d(context, resourceId); } }