package IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.FSaI4_7;

import android.animation.ValueAnimator;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.drawable.Animatable;
/* compiled from: ProgressDrawable.java */
/* loaded from: classes.dex */
public class Mqv2r_3 extends PGPF6hQ_2 implements Animatable, ValueAnimator.AnimatorUpdateListener {

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public ValueAnimator f253KQgRr5e_0;
    public int KQgRr5e_0 = 0;
    public int QxJ9d_1 = 0;
    public int PGPF6hQ_2 = 0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Path f254KQgRr5e_0 = new Path();

    public Mqv2r_3() {
        ValueAnimator ofInt = ValueAnimator.ofInt(30, 3600);
        this.f253KQgRr5e_0 = ofInt;
        ofInt.setDuration(10000L);
        this.f253KQgRr5e_0.setInterpolator(null);
        this.f253KQgRr5e_0.setRepeatCount(-1);
        this.f253KQgRr5e_0.setRepeatMode(1);
    }

    @Override // android.graphics.drawable.Drawable
    public void draw(Canvas canvas) {
        Rect bounds = getBounds();
        int width = bounds.width();
        int height = bounds.height();
        float f = width;
        float max = Math.max(1.0f, f / 22.0f);
        if (this.KQgRr5e_0 != width || this.QxJ9d_1 != height) {
            this.f254KQgRr5e_0.reset();
            float f2 = f - max;
            float f3 = height / 2.0f;
            this.f254KQgRr5e_0.addCircle(f2, f3, max, Path.Direction.CW);
            float f4 = f - (5.0f * max);
            this.f254KQgRr5e_0.addRect(f4, f3 - max, f2, f3 + max, Path.Direction.CW);
            this.f254KQgRr5e_0.addCircle(f4, f3, max, Path.Direction.CW);
            this.KQgRr5e_0 = width;
            this.QxJ9d_1 = height;
        }
        canvas.save();
        float f5 = f / 2.0f;
        float f6 = height / 2.0f;
        canvas.rotate(this.PGPF6hQ_2, f5, f6);
        for (int i = 0; i < 12; i++) {
            ((PGPF6hQ_2) this).KQgRr5e_0.setAlpha((i + 5) * 17);
            canvas.rotate(30.0f, f5, f6);
            canvas.drawPath(this.f254KQgRr5e_0, ((PGPF6hQ_2) this).KQgRr5e_0);
        }
        canvas.restore();
    }

    @Override // android.graphics.drawable.Animatable
    public boolean isRunning() {
        return this.f253KQgRr5e_0.isRunning();
    }

    @Override // android.animation.ValueAnimator.AnimatorUpdateListener
    public void onAnimationUpdate(ValueAnimator valueAnimator) {
        this.PGPF6hQ_2 = (((Integer) valueAnimator.getAnimatedValue()).intValue() / 30) * 30;
        invalidateSelf();
    }

    @Override // android.graphics.drawable.Animatable
    public void start() {
        if (this.f253KQgRr5e_0.isRunning()) {
            return;
        }
        this.f253KQgRr5e_0.addUpdateListener(this);
        this.f253KQgRr5e_0.start();
    }

    @Override // android.graphics.drawable.Animatable
    public void stop() {
        if (this.f253KQgRr5e_0.isRunning()) {
            this.f253KQgRr5e_0.removeAllListeners();
            this.f253KQgRr5e_0.removeAllUpdateListeners();
            this.f253KQgRr5e_0.cancel();
        }
    }
}
