package X6FRs_4.PGPF6hQ_2.IFxWkV_5;

import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
/* compiled from: RoundRectDrawable.java */
/* loaded from: classes.dex */
public class IFxWkV_5 extends Drawable {
    public float KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public ColorStateList f1072KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public PorterDuffColorFilter f1075KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final Rect f1076KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final RectF f1077KQgRr5e_0;
    public float QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public ColorStateList f1079QxJ9d_1;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public boolean f1078KQgRr5e_0 = false;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public boolean f1080QxJ9d_1 = true;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public PorterDuff.Mode f1074KQgRr5e_0 = PorterDuff.Mode.SRC_IN;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final Paint f1073KQgRr5e_0 = new Paint(5);

    public IFxWkV_5(ColorStateList colorStateList, float f) {
        this.KQgRr5e_0 = f;
        KQgRr5e_0(colorStateList);
        this.f1077KQgRr5e_0 = new RectF();
        this.f1076KQgRr5e_0 = new Rect();
    }

    public final void KQgRr5e_0(ColorStateList colorStateList) {
        if (colorStateList == null) {
            colorStateList = ColorStateList.valueOf(0);
        }
        this.f1072KQgRr5e_0 = colorStateList;
        this.f1073KQgRr5e_0.setColor(colorStateList.getColorForState(getState(), this.f1072KQgRr5e_0.getDefaultColor()));
    }

    public float QxJ9d_1() {
        return this.KQgRr5e_0;
    }

    @Override // android.graphics.drawable.Drawable
    public void draw(Canvas canvas) {
        boolean z;
        Paint paint = this.f1073KQgRr5e_0;
        if (this.f1075KQgRr5e_0 == null || paint.getColorFilter() != null) {
            z = false;
        } else {
            paint.setColorFilter(this.f1075KQgRr5e_0);
            z = true;
        }
        RectF rectF = this.f1077KQgRr5e_0;
        float f = this.KQgRr5e_0;
        canvas.drawRoundRect(rectF, f, f, paint);
        if (z) {
            paint.setColorFilter(null);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public int getOpacity() {
        return -3;
    }

    @Override // android.graphics.drawable.Drawable
    public void getOutline(Outline outline) {
        outline.setRoundRect(this.f1076KQgRr5e_0, this.KQgRr5e_0);
    }

    @Override // android.graphics.drawable.Drawable
    public boolean isStateful() {
        ColorStateList colorStateList;
        ColorStateList colorStateList2 = this.f1079QxJ9d_1;
        return (colorStateList2 != null && colorStateList2.isStateful()) || ((colorStateList = this.f1072KQgRr5e_0) != null && colorStateList.isStateful()) || super.isStateful();
    }

    @Override // android.graphics.drawable.Drawable
    public void onBoundsChange(Rect rect) {
        super.onBoundsChange(rect);
        KQgRr5e_0(rect);
    }

    @Override // android.graphics.drawable.Drawable
    public boolean onStateChange(int[] iArr) {
        PorterDuff.Mode mode;
        ColorStateList colorStateList = this.f1072KQgRr5e_0;
        int colorForState = colorStateList.getColorForState(iArr, colorStateList.getDefaultColor());
        boolean z = colorForState != this.f1073KQgRr5e_0.getColor();
        if (z) {
            this.f1073KQgRr5e_0.setColor(colorForState);
        }
        ColorStateList colorStateList2 = this.f1079QxJ9d_1;
        if (colorStateList2 == null || (mode = this.f1074KQgRr5e_0) == null) {
            return z;
        }
        this.f1075KQgRr5e_0 = KQgRr5e_0(colorStateList2, mode);
        return true;
    }

    @Override // android.graphics.drawable.Drawable
    public void setAlpha(int i) {
        this.f1073KQgRr5e_0.setAlpha(i);
    }

    @Override // android.graphics.drawable.Drawable
    public void setColorFilter(ColorFilter colorFilter) {
        this.f1073KQgRr5e_0.setColorFilter(colorFilter);
    }

    @Override // android.graphics.drawable.Drawable
    public void setTintList(ColorStateList colorStateList) {
        this.f1079QxJ9d_1 = colorStateList;
        this.f1075KQgRr5e_0 = KQgRr5e_0(colorStateList, this.f1074KQgRr5e_0);
        invalidateSelf();
    }

    @Override // android.graphics.drawable.Drawable
    public void setTintMode(PorterDuff.Mode mode) {
        this.f1074KQgRr5e_0 = mode;
        this.f1075KQgRr5e_0 = KQgRr5e_0(this.f1079QxJ9d_1, mode);
        invalidateSelf();
    }

    public void QxJ9d_1(ColorStateList colorStateList) {
        KQgRr5e_0(colorStateList);
        invalidateSelf();
    }

    public void KQgRr5e_0(float f, boolean z, boolean z2) {
        if (f == this.QxJ9d_1 && this.f1078KQgRr5e_0 == z && this.f1080QxJ9d_1 == z2) {
            return;
        }
        this.QxJ9d_1 = f;
        this.f1078KQgRr5e_0 = z;
        this.f1080QxJ9d_1 = z2;
        KQgRr5e_0((Rect) null);
        invalidateSelf();
    }

    public float KQgRr5e_0() {
        return this.QxJ9d_1;
    }

    public final void KQgRr5e_0(Rect rect) {
        if (rect == null) {
            rect = getBounds();
        }
        this.f1077KQgRr5e_0.set(rect.left, rect.top, rect.right, rect.bottom);
        this.f1076KQgRr5e_0.set(rect);
        if (this.f1078KQgRr5e_0) {
            float QxJ9d_1 = IMuAHx_6.QxJ9d_1(this.QxJ9d_1, this.KQgRr5e_0, this.f1080QxJ9d_1);
            this.f1076KQgRr5e_0.inset((int) Math.ceil(IMuAHx_6.KQgRr5e_0(this.QxJ9d_1, this.KQgRr5e_0, this.f1080QxJ9d_1)), (int) Math.ceil(QxJ9d_1));
            this.f1077KQgRr5e_0.set(this.f1076KQgRr5e_0);
        }
    }

    public void KQgRr5e_0(float f) {
        if (f == this.KQgRr5e_0) {
            return;
        }
        this.KQgRr5e_0 = f;
        KQgRr5e_0((Rect) null);
        invalidateSelf();
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public ColorStateList m517KQgRr5e_0() {
        return this.f1072KQgRr5e_0;
    }

    public final PorterDuffColorFilter KQgRr5e_0(ColorStateList colorStateList, PorterDuff.Mode mode) {
        if (colorStateList == null || mode == null) {
            return null;
        }
        return new PorterDuffColorFilter(colorStateList.getColorForState(getState(), 0), mode);
    }
}
