package com.scwang.smartrefresh.layout.footer;

import IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.FSaI4_7.QxJ9d_1;
import IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.IFxWkV_5.PGPF6hQ_2;
import IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.Mqv2r_3;
import IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.X6FRs_4.IFxWkV_5;
import IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.X6FRs_4.XnFJ5_9;
import X6FRs_4.IMuAHx_6.IFxWkV_5.KQgRr5e_0;
import android.animation.TimeInterpolator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.animation.AccelerateDecelerateInterpolator;
/* loaded from: classes.dex */
public class BallPulseFooter extends QxJ9d_1 implements IFxWkV_5 {
    public float KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public int f2908KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public long f2909KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public TimeInterpolator f2910KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Paint f2911KQgRr5e_0;

    /* renamed from: Mqv2r_3  reason: collision with root package name */
    public boolean f3680Mqv2r_3;
    public boolean PGPF6hQ_2;
    public int QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public boolean f2912QxJ9d_1;

    public BallPulseFooter(Context context) {
        this(context, null);
    }

    @Override // IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.FSaI4_7.QxJ9d_1, IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.X6FRs_4.FSaI4_7
    public void KQgRr5e_0(XnFJ5_9 xnFJ5_9, int i, int i2) {
        if (this.f3680Mqv2r_3) {
            return;
        }
        invalidate();
        this.f3680Mqv2r_3 = true;
        this.f2909KQgRr5e_0 = System.currentTimeMillis();
        this.f2911KQgRr5e_0.setColor(this.QxJ9d_1);
    }

    public BallPulseFooter QxJ9d_1(int i) {
        this.f2908KQgRr5e_0 = i;
        this.f2912QxJ9d_1 = true;
        if (!this.f3680Mqv2r_3) {
            this.f2911KQgRr5e_0.setColor(i);
        }
        return this;
    }

    @Override // android.view.ViewGroup, android.view.View
    public void dispatchDraw(Canvas canvas) {
        int width = getWidth();
        int height = getHeight();
        float f = this.KQgRr5e_0;
        float min = (Math.min(width, height) - (f * 2.0f)) / 6.0f;
        float f2 = min * 2.0f;
        float f3 = (width / 2.0f) - (f + f2);
        float f4 = height / 2.0f;
        long currentTimeMillis = System.currentTimeMillis();
        int i = 0;
        while (i < 3) {
            int i2 = i + 1;
            long j = (currentTimeMillis - this.f2909KQgRr5e_0) - (i2 * 120);
            float interpolation = this.f2910KQgRr5e_0.getInterpolation(j > 0 ? ((float) (j % 750)) / 750.0f : 0.0f);
            canvas.save();
            float f5 = i;
            canvas.translate((f2 * f5) + f3 + (this.KQgRr5e_0 * f5), f4);
            if (interpolation < 0.5d) {
                float f6 = 1.0f - ((interpolation * 2.0f) * 0.7f);
                canvas.scale(f6, f6);
            } else {
                float f7 = ((interpolation * 2.0f) * 0.7f) - 0.4f;
                canvas.scale(f7, f7);
            }
            canvas.drawCircle(0.0f, 0.0f, min, this.f2911KQgRr5e_0);
            canvas.restore();
            i = i2;
        }
        super.dispatchDraw(canvas);
        if (this.f3680Mqv2r_3) {
            invalidate();
        }
    }

    @Override // IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.FSaI4_7.QxJ9d_1, IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.X6FRs_4.FSaI4_7
    @Deprecated
    public void setPrimaryColors(int... iArr) {
        if (!this.PGPF6hQ_2 && iArr.length > 1) {
            KQgRr5e_0(iArr[0]);
            this.PGPF6hQ_2 = false;
        }
        if (this.f2912QxJ9d_1) {
            return;
        }
        if (iArr.length > 1) {
            QxJ9d_1(iArr[1]);
        } else if (iArr.length > 0) {
            QxJ9d_1(KQgRr5e_0.QxJ9d_1(-1711276033, iArr[0]));
        }
        this.f2912QxJ9d_1 = false;
    }

    public BallPulseFooter(Context context, AttributeSet attributeSet) {
        super(context, attributeSet, 0);
        this.f2908KQgRr5e_0 = -1118482;
        this.QxJ9d_1 = -1615546;
        this.f2909KQgRr5e_0 = 0L;
        this.f3680Mqv2r_3 = false;
        this.f2910KQgRr5e_0 = new AccelerateDecelerateInterpolator();
        setMinimumHeight(IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.XnFJ5_9.QxJ9d_1.m124KQgRr5e_0(60.0f));
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, Mqv2r_3.BallPulseFooter);
        Paint paint = new Paint();
        this.f2911KQgRr5e_0 = paint;
        paint.setColor(-1);
        this.f2911KQgRr5e_0.setStyle(Paint.Style.FILL);
        this.f2911KQgRr5e_0.setAntiAlias(true);
        PGPF6hQ_2 pGPF6hQ_2 = PGPF6hQ_2.KQgRr5e_0;
        ((QxJ9d_1) this).KQgRr5e_0 = pGPF6hQ_2;
        ((QxJ9d_1) this).KQgRr5e_0 = PGPF6hQ_2.f260KQgRr5e_0[obtainStyledAttributes.getInt(Mqv2r_3.BallPulseFooter_srlClassicsSpinnerStyle, pGPF6hQ_2.f261KQgRr5e_0)];
        if (obtainStyledAttributes.hasValue(Mqv2r_3.BallPulseFooter_srlNormalColor)) {
            QxJ9d_1(obtainStyledAttributes.getColor(Mqv2r_3.BallPulseFooter_srlNormalColor, 0));
        }
        if (obtainStyledAttributes.hasValue(Mqv2r_3.BallPulseFooter_srlAnimatingColor)) {
            KQgRr5e_0(obtainStyledAttributes.getColor(Mqv2r_3.BallPulseFooter_srlAnimatingColor, 0));
        }
        obtainStyledAttributes.recycle();
        this.KQgRr5e_0 = IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.XnFJ5_9.QxJ9d_1.m124KQgRr5e_0(4.0f);
    }

    @Override // IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.FSaI4_7.QxJ9d_1, IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.X6FRs_4.FSaI4_7
    public int KQgRr5e_0(XnFJ5_9 xnFJ5_9, boolean z) {
        this.f3680Mqv2r_3 = false;
        this.f2909KQgRr5e_0 = 0L;
        this.f2911KQgRr5e_0.setColor(this.f2908KQgRr5e_0);
        return 0;
    }

    public BallPulseFooter KQgRr5e_0(int i) {
        this.QxJ9d_1 = i;
        this.PGPF6hQ_2 = true;
        if (this.f3680Mqv2r_3) {
            this.f2911KQgRr5e_0.setColor(i);
        }
        return this;
    }
}
