package bj;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.InsetDrawable;
import com.google.android.material.internal.o;
import vi.d;
import vi.l;

/* loaded from: classes3.dex */
public abstract class c {
    public static Rect a(Context context, int i10, int i11) {
        TypedArray h10 = o.h(context, null, l.f39966f3, i10, i11, new int[0]);
        int dimensionPixelSize = h10.getDimensionPixelSize(l.f39996i3, context.getResources().getDimensionPixelSize(d.J));
        int dimensionPixelSize2 = h10.getDimensionPixelSize(l.f40006j3, context.getResources().getDimensionPixelSize(d.K));
        int dimensionPixelSize3 = h10.getDimensionPixelSize(l.f39986h3, context.getResources().getDimensionPixelSize(d.I));
        int dimensionPixelSize4 = h10.getDimensionPixelSize(l.f39976g3, context.getResources().getDimensionPixelSize(d.H));
        h10.recycle();
        if (context.getResources().getConfiguration().getLayoutDirection() == 1) {
            dimensionPixelSize3 = dimensionPixelSize;
            dimensionPixelSize = dimensionPixelSize3;
        }
        return new Rect(dimensionPixelSize, dimensionPixelSize2, dimensionPixelSize3, dimensionPixelSize4);
    }

    public static InsetDrawable b(Drawable drawable, Rect rect) {
        return new InsetDrawable(drawable, rect.left, rect.top, rect.right, rect.bottom);
    }
}
