package com.scwang.smartrefresh.layout.header.bezierradar;

import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import com.google.android.material.bottomappbar.BottomAppBarTopEdgeTreatment;
import ඓ.㿎.K.ῲ.ؿ.ඓ.C1403;

public class RoundProgressView extends View {

    /* renamed from: ʬ  reason: contains not printable characters */
    public Paint f3316 = new Paint();

    /* renamed from: ඓ  reason: contains not printable characters */
    public int f3317 = 0;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public RectF f3318 = new RectF(0.0f, 0.0f, 0.0f, 0.0f);

    /* renamed from: ῲ  reason: contains not printable characters */
    public Paint f3319 = new Paint();

    /* renamed from: ⁱ  reason: contains not printable characters */
    public int f3320 = 0;

    /* renamed from: 㴹  reason: contains not printable characters */
    public int f3321 = BottomAppBarTopEdgeTreatment.ANGLE_UP;

    /* renamed from: 㸾  reason: contains not printable characters */
    public ValueAnimator f3322;

    /* renamed from: 㿎  reason: contains not printable characters */
    public int f3323 = 0;

    public RoundProgressView(Context context) {
        super(context);
        this.f3319.setAntiAlias(true);
        this.f3316.setAntiAlias(true);
        this.f3319.setColor(-1);
        this.f3316.setColor(1426063360);
        float f = Resources.getSystem().getDisplayMetrics().density;
        this.f3320 = (int) ((20.0f * f) + 0.5f);
        this.f3323 = (int) ((7.0f * f) + 0.5f);
        float f2 = (float) ((int) ((f * 3.0f) + 0.5f));
        this.f3319.setStrokeWidth(f2);
        this.f3316.setStrokeWidth(f2);
        this.f3322 = ValueAnimator.ofInt(0, 360);
        this.f3322.setDuration(720L);
        this.f3322.addUpdateListener(new C1403(this));
        this.f3322.setRepeatCount(-1);
        this.f3322.setInterpolator(new AccelerateDecelerateInterpolator());
    }

    /* renamed from: K  reason: contains not printable characters */
    public static /* synthetic */ void m1896(RoundProgressView roundProgressView, ValueAnimator valueAnimator) {
        roundProgressView.f3317 = ((Integer) valueAnimator.getAnimatedValue()).intValue();
        roundProgressView.postInvalidate();
    }

    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        int width = getWidth();
        int height = getHeight();
        if (isInEditMode()) {
            this.f3321 = 0;
            this.f3317 = BottomAppBarTopEdgeTreatment.ANGLE_UP;
        }
        this.f3319.setStyle(Paint.Style.FILL);
        int i = width / 2;
        float f = (float) i;
        int i2 = height / 2;
        float f2 = (float) i2;
        canvas.drawCircle(f, f2, (float) this.f3320, this.f3319);
        this.f3319.setStyle(Paint.Style.STROKE);
        canvas.drawCircle(f, f2, (float) (this.f3320 + this.f3323), this.f3319);
        this.f3316.setStyle(Paint.Style.FILL);
        RectF rectF = this.f3318;
        int i3 = this.f3320;
        rectF.set((float) (i - i3), (float) (i2 - i3), (float) (i + i3), (float) (i3 + i2));
        canvas.drawArc(this.f3318, (float) this.f3321, (float) this.f3317, true, this.f3316);
        this.f3320 += this.f3323;
        this.f3316.setStyle(Paint.Style.STROKE);
        RectF rectF2 = this.f3318;
        int i4 = this.f3320;
        rectF2.set((float) (i - i4), (float) (i2 - i4), (float) (i + i4), (float) (i2 + i4));
        canvas.drawArc(this.f3318, (float) this.f3321, (float) this.f3317, false, this.f3316);
        this.f3320 -= this.f3323;
    }

    public void onMeasure(int i, int i2) {
        setMeasuredDimension(View.resolveSize(getSuggestedMinimumWidth(), i), View.resolveSize(getSuggestedMinimumHeight(), i2));
    }

    public void setBackColor(int i) {
        this.f3316.setColor((i & 16777215) | 1426063360);
    }

    public void setFrontColor(int i) {
        this.f3319.setColor(i);
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public void m1897() {
        ValueAnimator valueAnimator = this.f3322;
        if (valueAnimator != null && valueAnimator.isRunning()) {
            this.f3322.cancel();
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m1898() {
        ValueAnimator valueAnimator = this.f3322;
        if (valueAnimator != null) {
            valueAnimator.start();
        }
    }
}
