package com.seewo.libvui;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;

/* JADX INFO: loaded from: classes.dex */
public class LoadingAnimatorView extends View {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public Paint f2037b;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f2038e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public int f2039f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public int f2040g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public float[] f2041h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public int f2042i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public int f2043j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public int f2044k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public float[] f2045l;

    public LoadingAnimatorView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        this.f2038e = 5;
        this.f2039f = 14;
        this.f2040g = 8;
        this.f2042i = 48;
        this.f2043j = 68;
        this.f2044k = 0;
        this.f2045l = new float[]{0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.4f, -1.8f, -4.0f, -7.0f, -10.8f, -15.2f, -20.1f, -25.3f, -30.5f, -35.2f, -38.7f, -40.0f, -38.6f, -34.7f, -28.7f, -21.5f, -14.1f, -7.2f, -1.2f, 3.7f, 7.5f, 10.0f, 11.5f, 12.0f, 12.9f, 12.5f, 10.5f, 8.4f, 6.5f, 4.8f, 3.4f, 2.2f, 1.2f, 0.5f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
        setLayerType(1, null);
        Paint paint = new Paint();
        this.f2037b = paint;
        paint.setColor(-1);
        this.f2037b.setStyle(Paint.Style.FILL);
        this.f2037b.setAntiAlias(true);
        this.f2041h = new float[this.f2038e];
        int i2 = this.f2040g * 2;
        for (int i3 = 0; i3 < this.f2038e; i3++) {
            this.f2041h[i3] = (float) (((((double) i3) + 0.5d) * ((double) i2)) + ((double) (this.f2039f * i3)));
        }
    }

    public int getFrame() {
        return this.f2044k;
    }

    @Override // android.view.View
    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        for (int i2 = 0; i2 < this.f2038e; i2++) {
            float f2 = this.f2041h[i2];
            float f3 = this.f2042i;
            float[] fArr = this.f2045l;
            int length = fArr.length;
            canvas.drawCircle(f2, f3 + fArr[((this.f2044k + length) - (i2 * 5)) % length], this.f2040g, this.f2037b);
        }
    }

    @Override // android.view.View
    public void onMeasure(int i2, int i3) {
        super.onMeasure(i2, i3);
        setMeasuredDimension(((int) this.f2041h[this.f2038e - 1]) + this.f2040g, this.f2043j);
    }

    public void setColor(int i2) {
        this.f2037b.setColor(i2);
    }

    public void setFrame(int i2) {
        this.f2044k = i2;
        invalidate();
    }
}
