package ඓ.ᕣ.K.K.㸾;

import android.animation.Animator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.BounceInterpolator;
import android.view.animation.DecelerateInterpolator;
import java.util.Iterator;
import java.util.LinkedList;
import ඓ.ᕣ.K.K.AbstractC0747;
import ඓ.ᕣ.K.K.㸾.AbstractC0758;

/* renamed from: ඓ.ᕣ.K.K.㸾.ῲ  reason: contains not printable characters */
/* compiled from: ElasticBallBuilder */
public class C0757 extends AbstractC0758 {

    /* renamed from: Ԕ  reason: contains not printable characters */
    public int f3872 = 0;

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

    /* renamed from: ᓣ  reason: contains not printable characters */
    public int f3874 = 0;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public long f3875 = 333;

    /* renamed from: 㑃  reason: contains not printable characters */
    public float f3876;

    /* renamed from: 㗗  reason: contains not printable characters */
    public float f3877;

    /* renamed from: 㳳  reason: contains not printable characters */
    public final LinkedList<AbstractC0758.C0759> f3878 = new LinkedList<>();

    /* renamed from: 䁗  reason: contains not printable characters */
    public Path f3879;

    @Override // ඓ.ᕣ.K.K.AbstractC0747
    public void onAnimationRepeat(Animator animator) {
        int i = this.f3872 + 1;
        this.f3872 = i;
        if (i > 2) {
            this.f3872 = 0;
            if (this.f3873) {
                this.f3874--;
            } else {
                this.f3874++;
            }
            int i2 = this.f3874;
            if (i2 >= 4) {
                this.f3873 = true;
                this.f3874 = 3;
                for (int i3 = 0; i3 < this.f3878.size(); i3++) {
                    AbstractC0758.C0759 k = this.f3878.get(i3);
                    if (i3 == this.f3878.size() - 1) {
                        k.f3883 = true;
                    } else {
                        k.f3883 = false;
                    }
                }
            } else if (i2 < 0) {
                this.f3873 = false;
                this.f3874 = 0;
                for (int i4 = 0; i4 < this.f3878.size(); i4++) {
                    AbstractC0758.C0759 k2 = this.f3878.get(i4);
                    if (i4 == 0) {
                        k2.f3883 = false;
                    } else {
                        k2.f3883 = true;
                    }
                }
            }
            if (this.f3873) {
                Iterator<AbstractC0758.C0759> it2 = this.f3881.iterator();
                while (it2.hasNext()) {
                    it2.next().f3882 = this.f3877;
                }
                this.f3878.get(this.f3874 + 1).f3883 = true;
                return;
            }
            Iterator<AbstractC0758.C0759> it3 = this.f3881.iterator();
            while (it3.hasNext()) {
                it3.next().f3882 = 0.0f;
            }
            this.f3878.get(this.f3874).f3883 = false;
        }
    }

    @Override // ඓ.ᕣ.K.K.AbstractC0747
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m2269(Context context) {
        this.f3876 = this.f3803 / 5.0f;
        this.f3877 = this.f3802 / 5.0f;
        this.f3879 = new Path();
        m2275(5.0f);
        m2274(this.f3876);
        float r9 = m2199();
        float r0 = m2198();
        AbstractC0758.C0759 k = new AbstractC0758.C0759(r9 - (this.f3877 * 2.0f), r0);
        AbstractC0758.C0759 k2 = new AbstractC0758.C0759(r9 - this.f3877, r0);
        AbstractC0758.C0759 k3 = new AbstractC0758.C0759(r9, r0);
        AbstractC0758.C0759 k4 = new AbstractC0758.C0759(this.f3877 + r9, r0);
        AbstractC0758.C0759 k5 = new AbstractC0758.C0759((this.f3877 * 2.0f) + r9, r0);
        k.f3883 = false;
        this.f3878.add(k);
        this.f3878.add(k2);
        this.f3878.add(k3);
        this.f3878.add(k4);
        this.f3878.add(k5);
    }

    @Override // ඓ.ᕣ.K.K.AbstractC0747
    /* renamed from: K  reason: contains not printable characters */
    public void m2272(Canvas canvas) {
        canvas.save();
        this.f3880.setStyle(Paint.Style.STROKE);
        Iterator<AbstractC0758.C0759> it2 = this.f3878.iterator();
        while (it2.hasNext()) {
            AbstractC0758.C0759 next = it2.next();
            float f = this.f3876;
            Paint paint = this.f3880;
            if (next.f3883) {
                canvas.drawCircle(next.m2280(), next.m2279(), f, paint);
            }
        }
        canvas.restore();
        canvas.save();
        this.f3880.setStyle(Paint.Style.FILL_AND_STROKE);
        float f2 = this.f3877;
        canvas.translate((f2 * ((float) this.f3874)) + (-(((float) (this.f3878.size() / 2)) * f2)), 0.0f);
        super.m2277(canvas, this.f3879, this.f3880);
        canvas.restore();
    }

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

    @Override // ඓ.ᕣ.K.K.AbstractC0747
    /* renamed from: K  reason: contains not printable characters */
    public void m2270(ValueAnimator valueAnimator) {
        this.f3875 = AbstractC0747.m2197((double) (((float) m2201()) * 0.3f));
        valueAnimator.setDuration(this.f3875);
    }

    @Override // ඓ.ᕣ.K.K.AbstractC0747
    /* renamed from: K  reason: contains not printable characters */
    public void m2271(ValueAnimator valueAnimator, float f) {
        float f2 = this.f3877;
        int i = this.f3873 ? this.f3872 + 3 : this.f3872;
        if (i == 0) {
            valueAnimator.setDuration(this.f3875);
            valueAnimator.setInterpolator(new AccelerateInterpolator());
            float f3 = f2 * f;
            this.f3881.get(5).f3882 = f3;
            this.f3881.get(6).f3882 = f3;
            this.f3881.get(7).f3882 = f3;
        } else if (i == 1) {
            valueAnimator.setDuration(this.f3875 + 111);
            valueAnimator.setInterpolator(new DecelerateInterpolator());
            float f4 = f2 * f;
            this.f3881.get(2).f3882 = f4;
            this.f3881.get(3).f3882 = f4;
            this.f3881.get(4).f3882 = f4;
            this.f3881.get(8).f3882 = f4;
            this.f3881.get(9).f3882 = f4;
            this.f3881.get(10).f3882 = f4;
        } else if (i == 2) {
            valueAnimator.setDuration(this.f3875 + 333);
            valueAnimator.setInterpolator(new BounceInterpolator());
            float f5 = f2 * f;
            this.f3881.get(0).f3882 = f5;
            this.f3881.get(1).f3882 = f5;
            this.f3881.get(11).f3882 = f5;
        } else if (i == 3) {
            valueAnimator.setDuration(this.f3875);
            valueAnimator.setInterpolator(new AccelerateInterpolator());
            float f6 = f2 * (1.0f - f);
            this.f3881.get(0).f3882 = f6;
            this.f3881.get(1).f3882 = f6;
            this.f3881.get(11).f3882 = f6;
        } else if (i == 4) {
            valueAnimator.setDuration(this.f3875 + 111);
            valueAnimator.setInterpolator(new DecelerateInterpolator());
            float f7 = f2 * (1.0f - f);
            this.f3881.get(2).f3882 = f7;
            this.f3881.get(3).f3882 = f7;
            this.f3881.get(4).f3882 = f7;
            this.f3881.get(8).f3882 = f7;
            this.f3881.get(9).f3882 = f7;
            this.f3881.get(10).f3882 = f7;
        } else if (i == 5) {
            valueAnimator.setDuration(this.f3875 + 333);
            valueAnimator.setInterpolator(new BounceInterpolator());
            float f8 = f2 * (1.0f - f);
            this.f3881.get(5).f3882 = f8;
            this.f3881.get(6).f3882 = f8;
            this.f3881.get(7).f3882 = f8;
        }
    }
}
