package com.vinfast.companion.main.widget;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes3.dex */
@kotlin.Metadata(d1 = {"\u0000N\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\b\b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\f\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\u0018\u00002\u00020\u0001B7\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\u0006\u0010\u0004\u001a\u00020\u0002\u0012\u0006\u0010\u0005\u001a\u00020\u0002\u0012\u0006\u0010\u0006\u001a\u00020\u0002\u0012\u0006\u0010\u0007\u001a\u00020\u0002\u0012\u0006\u0010\b\u001a\u00020\u0002¢\u0006\u0004\b\t\u0010\nJ\u0019\u0010\u000e\u001a\u00020\r2\b\b\u0001\u0010\f\u001a\u00020\u000bH\u0014¢\u0006\u0004\b\u000e\u0010\u000fJ\u0019\u0010\u0012\u001a\u00020\r2\b\b\u0001\u0010\u0011\u001a\u00020\u0010H\u0016¢\u0006\u0004\b\u0012\u0010\u0013J\u0017\u0010\u0015\u001a\u00020\r2\u0006\u0010\u0014\u001a\u00020\u0002H\u0016¢\u0006\u0004\b\u0015\u0010\u0016J\u001b\u0010\u0019\u001a\u00020\r2\n\b\u0001\u0010\u0018\u001a\u0004\u0018\u00010\u0017H\u0016¢\u0006\u0004\b\u0019\u0010\u001aJ\u000f\u0010\u001b\u001a\u00020\u0002H\u0016¢\u0006\u0004\b\u001b\u0010\u001cR\u0014\u0010 \u001a\u00020\u001d8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u001e\u0010\u001fR\u0014\u0010\u0003\u001a\u00020\u00028\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b!\u0010\"R\u0014\u0010\u0004\u001a\u00020\u00028\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b#\u0010\"R\u0014\u0010\u0005\u001a\u00020\u00028\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b$\u0010\"R\u0014\u0010\u0006\u001a\u00020\u00028\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b%\u0010\"R\u0014\u0010'\u001a\u00020\u00028\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b&\u0010\"R\u0014\u0010)\u001a\u00020\u00028\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b(\u0010\"R\u0014\u0010-\u001a\u00020*8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b+\u0010,R\u0014\u00101\u001a\u00020.8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b/\u00100R\u0018\u00105\u001a\u0004\u0018\u0001028\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b3\u00104R\u0018\u00107\u001a\u0004\u0018\u0001028\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b6\u00104¨\u00068"}, d2 = {"Lcom/vinfast/companion/main/widget/GradientDrawable;", "Landroid/graphics/drawable/Drawable;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "solidStartColor", "solidEndColor", "borderStartColor", "borderEndColor", "borderWidth", "borderRadius", "<init>", "(IIIIII)V", "Landroid/graphics/Rect;", "bounds", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "onBoundsChange", "(Landroid/graphics/Rect;)V", "Landroid/graphics/Canvas;", "canvas", "draw", "(Landroid/graphics/Canvas;)V", "alpha", "setAlpha", "(I)V", "Landroid/graphics/ColorFilter;", "colorFilter", "setColorFilter", "(Landroid/graphics/ColorFilter;)V", "getOpacity", "()I", "Landroid/graphics/Paint;", "a", "Landroid/graphics/Paint;", "mPaint", "b", "I", "c", "d", "e", "f", "mBorderWidth", "g", "mBorderRadius", "Landroid/graphics/RectF;", "h", "Landroid/graphics/RectF;", "mRect", "Landroid/graphics/Path;", "i", "Landroid/graphics/Path;", "mPath", "Landroid/graphics/Shader;", "j", "Landroid/graphics/Shader;", "mShader", "k", "mBorderShader", "main_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
public final class GradientDrawable extends android.graphics.drawable.Drawable {

    /* JADX INFO: renamed from: b, reason: from kotlin metadata */
    private final int solidStartColor;

    /* JADX INFO: renamed from: c, reason: from kotlin metadata */
    private final int solidEndColor;

    /* JADX INFO: renamed from: d, reason: from kotlin metadata */
    private final int borderStartColor;

    /* JADX INFO: renamed from: e, reason: from kotlin metadata */
    private final int borderEndColor;

    /* JADX INFO: renamed from: f, reason: from kotlin metadata */
    private final int mBorderWidth;

    /* JADX INFO: renamed from: g, reason: from kotlin metadata */
    private final int mBorderRadius;

    /* JADX INFO: renamed from: j, reason: from kotlin metadata */
    private android.graphics.Shader mShader;

    /* JADX INFO: renamed from: k, reason: from kotlin metadata */
    private android.graphics.Shader mBorderShader;

    /* JADX INFO: renamed from: a, reason: from kotlin metadata */
    private final android.graphics.Paint mPaint = new android.graphics.Paint(1);

    /* JADX INFO: renamed from: h, reason: from kotlin metadata */
    private final android.graphics.RectF mRect = new android.graphics.RectF();

    /* JADX INFO: renamed from: i, reason: from kotlin metadata */
    private final android.graphics.Path mPath = new android.graphics.Path();

    public GradientDrawable(int i, int i2, int i5, int i6, int i7, int i8) {
        this.borderStartColor = i5;
        this.borderEndColor = i6;
        this.solidStartColor = i;
        this.solidEndColor = i2;
        this.mBorderWidth = i7 >> 1;
        this.mBorderRadius = i8;
    }

    @Override // android.graphics.drawable.Drawable
    public void draw(android.graphics.Canvas canvas) {
        kotlin.jvm.internal.Intrinsics.l(canvas, "canvas");
        this.mPaint.setStyle(android.graphics.Paint.Style.FILL);
        this.mPaint.setShader(this.mShader);
        android.graphics.RectF rectF = this.mRect;
        int i = this.mBorderRadius;
        canvas.drawRoundRect(rectF, i, i, this.mPaint);
        this.mPaint.setStyle(android.graphics.Paint.Style.STROKE);
        this.mPaint.setShader(this.mBorderShader);
        canvas.drawPath(this.mPath, this.mPaint);
    }

    @Override // android.graphics.drawable.Drawable
    public int getOpacity() {
        return -3;
    }

    @Override // android.graphics.drawable.Drawable
    protected void onBoundsChange(android.graphics.Rect bounds) {
        kotlin.jvm.internal.Intrinsics.l(bounds, "bounds");
        super.onBoundsChange(bounds);
        this.mPath.reset();
        this.mRect.set(bounds);
        android.graphics.RectF rectF = this.mRect;
        int i = this.mBorderWidth;
        rectF.inset(i, i);
        android.graphics.Path path = this.mPath;
        android.graphics.RectF rectF2 = this.mRect;
        int i2 = this.mBorderRadius;
        path.addRoundRect(rectF2, i2, i2, android.graphics.Path.Direction.CW);
        android.graphics.RectF rectF3 = this.mRect;
        int i5 = this.mBorderWidth;
        rectF3.inset(-i5, -i5);
        float fHeight = bounds.height();
        float fWidth = bounds.width();
        int i6 = this.solidStartColor;
        int i7 = this.solidEndColor;
        android.graphics.Shader.TileMode tileMode = android.graphics.Shader.TileMode.CLAMP;
        this.mShader = new android.graphics.LinearGradient(0.0f, fHeight, fWidth, 0.0f, i6, i7, tileMode);
        this.mBorderShader = new android.graphics.LinearGradient(0.0f, bounds.height(), bounds.width(), 0.0f, this.borderStartColor, this.borderEndColor, tileMode);
    }

    @Override // android.graphics.drawable.Drawable
    public void setAlpha(int alpha) {
        this.mPaint.setAlpha(alpha);
    }

    @Override // android.graphics.drawable.Drawable
    public void setColorFilter(android.graphics.ColorFilter colorFilter) {
        this.mPaint.setColorFilter(colorFilter);
    }
}
