package ῲ.ඓ.K;

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;

/* renamed from: ῲ.ඓ.K.㸾  reason: contains not printable characters */
/* compiled from: RoundRectDrawable */
public class C1614 extends Drawable {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final RectF f5793;

    /* renamed from: ඓ  reason: contains not printable characters */
    public float f5794;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public PorterDuff.Mode f5795 = PorterDuff.Mode.SRC_IN;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public PorterDuffColorFilter f5796;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final Paint f5797;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public boolean f5798 = true;

    /* renamed from: K  reason: contains not printable characters */
    public float f5799;

    /* renamed from: 㳳  reason: contains not printable characters */
    public ColorStateList f5800;

    /* renamed from: 㴹  reason: contains not printable characters */
    public boolean f5801 = false;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final Rect f5802;

    /* renamed from: 㿎  reason: contains not printable characters */
    public ColorStateList f5803;

    public C1614(ColorStateList colorStateList, float f) {
        this.f5799 = f;
        this.f5797 = new Paint(5);
        m4185(colorStateList);
        this.f5793 = new RectF();
        this.f5802 = new Rect();
    }

    public void draw(Canvas canvas) {
        boolean z;
        Paint paint = this.f5797;
        if (this.f5796 == null || paint.getColorFilter() != null) {
            z = false;
        } else {
            paint.setColorFilter(this.f5796);
            z = true;
        }
        RectF rectF = this.f5793;
        float f = this.f5799;
        canvas.drawRoundRect(rectF, f, f, paint);
        if (z) {
            paint.setColorFilter(null);
        }
    }

    public int getOpacity() {
        return -3;
    }

    public void getOutline(Outline outline) {
        outline.setRoundRect(this.f5802, this.f5799);
    }

    public boolean isStateful() {
        ColorStateList colorStateList;
        ColorStateList colorStateList2 = this.f5800;
        return (colorStateList2 != null && colorStateList2.isStateful()) || ((colorStateList = this.f5803) != null && colorStateList.isStateful()) || super.isStateful();
    }

    public void onBoundsChange(Rect rect) {
        super.onBoundsChange(rect);
        m4186(rect);
    }

    public boolean onStateChange(int[] iArr) {
        PorterDuff.Mode mode;
        ColorStateList colorStateList = this.f5803;
        int colorForState = colorStateList.getColorForState(iArr, colorStateList.getDefaultColor());
        boolean z = colorForState != this.f5797.getColor();
        if (z) {
            this.f5797.setColor(colorForState);
        }
        ColorStateList colorStateList2 = this.f5800;
        if (colorStateList2 == null || (mode = this.f5795) == null) {
            return z;
        }
        this.f5796 = m4184(colorStateList2, mode);
        return true;
    }

    public void setAlpha(int i) {
        this.f5797.setAlpha(i);
    }

    public void setColorFilter(ColorFilter colorFilter) {
        this.f5797.setColorFilter(colorFilter);
    }

    public void setTintList(ColorStateList colorStateList) {
        this.f5800 = colorStateList;
        this.f5796 = m4184(this.f5800, this.f5795);
        invalidateSelf();
    }

    public void setTintMode(PorterDuff.Mode mode) {
        this.f5795 = mode;
        this.f5796 = m4184(this.f5800, this.f5795);
        invalidateSelf();
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m4185(ColorStateList colorStateList) {
        if (colorStateList == null) {
            colorStateList = ColorStateList.valueOf(0);
        }
        this.f5803 = colorStateList;
        this.f5797.setColor(this.f5803.getColorForState(getState(), this.f5803.getDefaultColor()));
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m4186(Rect rect) {
        if (rect == null) {
            rect = getBounds();
        }
        this.f5793.set((float) rect.left, (float) rect.top, (float) rect.right, (float) rect.bottom);
        this.f5802.set(rect);
        if (this.f5801) {
            float r6 = C1611.m4166(this.f5794, this.f5799, this.f5798);
            this.f5802.inset((int) Math.ceil((double) C1611.m4167(this.f5794, this.f5799, this.f5798)), (int) Math.ceil((double) r6));
            this.f5793.set(this.f5802);
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public final PorterDuffColorFilter m4184(ColorStateList colorStateList, PorterDuff.Mode mode) {
        if (colorStateList == null || mode == null) {
            return null;
        }
        return new PorterDuffColorFilter(colorStateList.getColorForState(getState(), 0), mode);
    }
}
