package ඓ.ᕣ.K.K.㿎;

import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.graphics.PointF;
import android.graphics.RectF;
import android.view.animation.BounceInterpolator;
import android.view.animation.DecelerateInterpolator;
import java.util.Iterator;
import java.util.LinkedList;
import ඓ.ᕣ.K.K.ඓ.AbstractC0740;

/* renamed from: ඓ.ᕣ.K.K.㿎.K  reason: contains not printable characters */
/* compiled from: MusicPathBuilder */
public class C0763 extends AbstractC0740 {

    /* renamed from: Ԕ  reason: contains not printable characters */
    public PathMeasure f3903;

    /* renamed from: ؿ  reason: contains not printable characters */
    public boolean f3904 = false;

    /* renamed from: ᓣ  reason: contains not printable characters */
    public DecelerateInterpolator f3905;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public float f3906;

    /* renamed from: 㑃  reason: contains not printable characters */
    public LinkedList<Path> f3907;

    /* renamed from: 㗗  reason: contains not printable characters */
    public LinkedList<C0764> f3908;

    /* renamed from: 㗽  reason: contains not printable characters */
    public BounceInterpolator f3909;

    /* renamed from: 㳳  reason: contains not printable characters */
    public Paint f3910;

    /* renamed from: 䁗  reason: contains not printable characters */
    public LinkedList<Path> f3911;

    /* renamed from: ඓ.ᕣ.K.K.㿎.K$K  reason: contains not printable characters */
    /* compiled from: MusicPathBuilder */
    public static class C0764 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final PointF f3912;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final PointF f3913;

        /* renamed from: K  reason: contains not printable characters */
        public final RectF f3914;

        /* renamed from: 㸾  reason: contains not printable characters */
        public float f3915 = 0.0f;

        public C0764(RectF rectF, PointF pointF, PointF pointF2) {
            this.f3914 = rectF;
            this.f3913 = pointF;
            this.f3912 = pointF2;
        }
    }

    @Override // ඓ.ᕣ.K.K.ඓ.AbstractC0740
    /* renamed from: ඓ  reason: contains not printable characters */
    public int m2300() {
        return 3;
    }

    @Override // ඓ.ᕣ.K.K.ඓ.AbstractC0740
    /* renamed from: K  reason: contains not printable characters */
    public void m2303(Context context, Paint paint) {
        this.f3910 = paint;
        this.f3910.setStrokeWidth(2.0f);
        this.f3906 = this.f3803;
        this.f3907 = new LinkedList<>();
        float f = this.f3906 * 2.0f;
        float f2 = f / 5.0f;
        float r5 = m2199() - this.f3906;
        float r6 = m2198() + this.f3906;
        for (int i = 0; i < 5; i++) {
            Path path = new Path();
            float f3 = r6 - (((float) i) * f2);
            path.moveTo(r5, f3);
            path.lineTo(r5 + f, f3);
            this.f3907.add(path);
        }
        this.f3911 = new LinkedList<>();
        for (int i2 = 0; i2 < 5; i2++) {
            this.f3911.add(new Path());
        }
        this.f3903 = new PathMeasure();
        float f4 = this.f3906;
        float f5 = 0.2f * f4;
        this.f3908 = new LinkedList<>();
        float f6 = (this.f3906 * 2.0f) / 5.0f;
        float f7 = f5 / 2.0f;
        float r3 = m2199() - f7;
        float r62 = m2199() + f7;
        float r2 = (m2198() + f4) - (1.5f * f6);
        float r7 = (m2198() + f4) - (f6 * 0.5f);
        float f8 = this.f3906 * 0.5f;
        RectF rectF = new RectF(r3 - f8, r2, r62 - f8, r7);
        double d = ((double) f5) * 0.5d;
        float cos = (float) (Math.cos(75.0d) * d);
        this.f3908.add(new C0764(rectF, new PointF(rectF.right + cos, rectF.centerY()), new PointF(rectF.right + cos, rectF.centerY() - f4)));
        float f9 = this.f3906 * 0.5f;
        RectF rectF2 = new RectF(r3 + f9, r2 - f6, f9 + r62, r7 - f6);
        float cos2 = (float) (Math.cos(75.0d) * d);
        this.f3908.add(new C0764(rectF2, new PointF(rectF2.right + cos2, rectF2.centerY()), new PointF(rectF2.right + cos2, rectF2.centerY() - f4)));
        this.f3905 = new DecelerateInterpolator();
        this.f3909 = new BounceInterpolator();
    }

    /* renamed from: 㴹  reason: contains not printable characters */
    public final void m2305() {
        this.f3904 = false;
        Iterator<Path> it2 = this.f3911.iterator();
        while (it2.hasNext()) {
            Path next = it2.next();
            next.reset();
            next.lineTo(0.0f, 0.0f);
        }
        Iterator<C0764> it3 = this.f3908.iterator();
        while (it3.hasNext()) {
            it3.next().f3915 = 0.0f;
        }
    }

    @Override // ඓ.ᕣ.K.K.AbstractC0747
    /* renamed from: 㸾  reason: contains not printable characters */
    public void m2306() {
    }

    @Override // ඓ.ᕣ.K.K.ඓ.AbstractC0740
    /* renamed from: K  reason: contains not printable characters */
    public void m2302(ValueAnimator valueAnimator, float f, int i) {
        int i2 = 5;
        float f2 = 1.0f;
        int i3 = 0;
        if (i == 0) {
            valueAnimator.setInterpolator(this.f3905);
            m2305();
            int i4 = 0;
            while (i4 < i2) {
                this.f3903.setPath(this.f3907.get(i4), false);
                if (i4 % 2 == 0) {
                    float length = this.f3903.getLength() * f;
                    this.f3903.getSegment((float) (((double) length) - ((0.5d - Math.abs(((double) f) - 0.5d)) * 200.0d)), length, this.f3911.get(i4), true);
                } else {
                    float f3 = f2 - f;
                    float length2 = this.f3903.getLength() * f3;
                    this.f3903.getSegment((float) (((double) length2) - ((0.5d - Math.abs(((double) f3) - 0.5d)) * 200.0d)), length2, this.f3911.get(i4), true);
                }
                i4++;
                i2 = 5;
                f2 = 1.0f;
            }
        } else if (i == 1) {
            m2305();
            for (int i5 = 0; i5 < 5; i5++) {
                this.f3903.setPath(this.f3907.get(i5), false);
                if (i5 % 2 == 0) {
                    this.f3903.getSegment(0.0f, this.f3903.getLength() * f, this.f3911.get(i5), true);
                } else {
                    float length3 = this.f3903.getLength();
                    this.f3903.getSegment((1.0f - f) * this.f3903.getLength(), length3, this.f3911.get(i5), true);
                }
            }
        } else if (i == 2) {
            valueAnimator.setInterpolator(this.f3909);
            this.f3904 = true;
            float f4 = (this.f3906 * 2.0f) / 5.0f;
            while (i3 < this.f3908.size()) {
                C0764 k = this.f3908.get(i3);
                if (i3 % 2 == 0) {
                    k.f3915 = f * f4;
                } else {
                    k.f3915 = (1.0f - f) * f4;
                }
                i3++;
            }
        } else if (i == 3) {
            this.f3904 = true;
            float f5 = (this.f3906 * 2.0f) / 5.0f;
            while (i3 < this.f3908.size()) {
                C0764 k2 = this.f3908.get(i3);
                if (i3 % 2 == 0) {
                    k2.f3915 = (1.0f - f) * f5;
                } else {
                    k2.f3915 = f * f5;
                }
                i3++;
            }
        }
    }

    @Override // ඓ.ᕣ.K.K.AbstractC0747
    /* renamed from: K  reason: contains not printable characters */
    public void m2304(Canvas canvas) {
        Iterator<Path> it2 = this.f3911.iterator();
        while (it2.hasNext()) {
            canvas.drawPath(it2.next(), this.f3910);
        }
        if (this.f3904) {
            Iterator<C0764> it3 = this.f3908.iterator();
            while (it3.hasNext()) {
                C0764 next = it3.next();
                this.f3910.setStrokeWidth(4.0f);
                canvas.save();
                RectF rectF = next.f3914;
                RectF rectF2 = new RectF(rectF);
                float f = next.f3915;
                rectF2.set(rectF.left, rectF.top - f, rectF.right, rectF.bottom - f);
                canvas.rotate(75.0f, rectF2.centerX(), rectF2.centerY());
                this.f3910.setStyle(Paint.Style.FILL_AND_STROKE);
                canvas.drawOval(rectF2, this.f3910);
                this.f3910.setStyle(Paint.Style.STROKE);
                canvas.restore();
                PointF pointF = next.f3913;
                PointF pointF2 = next.f3912;
                canvas.drawLine(pointF.x, pointF.y - f, pointF2.x, pointF2.y - f, this.f3910);
                this.f3910.setStrokeWidth(2.0f);
            }
        }
    }

    @Override // ඓ.ᕣ.K.K.AbstractC0747
    /* renamed from: K  reason: contains not printable characters */
    public void m2301(ValueAnimator valueAnimator) {
        valueAnimator.setInterpolator(this.f3905);
    }
}
