package IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5;

import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import com.google.android.material.shadow.ShadowDrawableWrapper;
/* compiled from: WaterDropView.java */
/* loaded from: classes.dex */
public class QxJ9d_1 extends View {
    public static int PGPF6hQ_2 = 2;
    public int KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 f191KQgRr5e_0;

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

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Path f193KQgRr5e_0;
    public int QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 f194QxJ9d_1;

    /* compiled from: WaterDropView.java */
    /* loaded from: classes.dex */
    public class KQgRr5e_0 implements ValueAnimator.AnimatorUpdateListener {
        public KQgRr5e_0() {
        }

        @Override // android.animation.ValueAnimator.AnimatorUpdateListener
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            QxJ9d_1.this.KQgRr5e_0(((Float) valueAnimator.getAnimatedValue()).floatValue());
            QxJ9d_1.this.postInvalidate();
        }
    }

    public QxJ9d_1(Context context) {
        super(context);
        this.f191KQgRr5e_0 = new IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0();
        this.f194QxJ9d_1 = new IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0();
        this.f193KQgRr5e_0 = new Path();
        Paint paint = new Paint();
        this.f192KQgRr5e_0 = paint;
        paint.setColor(-7829368);
        this.f192KQgRr5e_0.setAntiAlias(true);
        this.f192KQgRr5e_0.setStyle(Paint.Style.FILL_AND_STROKE);
        Paint paint2 = this.f192KQgRr5e_0;
        int m124KQgRr5e_0 = IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.XnFJ5_9.QxJ9d_1.m124KQgRr5e_0(1.0f);
        PGPF6hQ_2 = m124KQgRr5e_0;
        paint2.setStrokeWidth(m124KQgRr5e_0);
        Paint paint3 = this.f192KQgRr5e_0;
        int i = PGPF6hQ_2;
        paint3.setShadowLayer(i, i / 2.0f, i, -1728053248);
        setLayerType(1, null);
        int i2 = PGPF6hQ_2 * 4;
        setPadding(i2, i2, i2, i2);
        this.f192KQgRr5e_0.setColor(-7829368);
        int m124KQgRr5e_02 = IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.XnFJ5_9.QxJ9d_1.m124KQgRr5e_0(20.0f);
        this.KQgRr5e_0 = m124KQgRr5e_02;
        this.QxJ9d_1 = m124KQgRr5e_02 / 5;
        IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_0 = this.f191KQgRr5e_0;
        kQgRr5e_0.PGPF6hQ_2 = m124KQgRr5e_02;
        IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_02 = this.f194QxJ9d_1;
        kQgRr5e_02.PGPF6hQ_2 = m124KQgRr5e_02;
        int i3 = PGPF6hQ_2;
        kQgRr5e_0.KQgRr5e_0 = i3 + m124KQgRr5e_02;
        kQgRr5e_0.QxJ9d_1 = i3 + m124KQgRr5e_02;
        kQgRr5e_02.KQgRr5e_0 = i3 + m124KQgRr5e_02;
        kQgRr5e_02.QxJ9d_1 = i3 + m124KQgRr5e_02;
    }

    private double getAngle() {
        IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_0 = this.f194QxJ9d_1;
        float f = kQgRr5e_0.PGPF6hQ_2;
        IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_02 = this.f191KQgRr5e_0;
        float f2 = kQgRr5e_02.PGPF6hQ_2;
        return f > f2 ? ShadowDrawableWrapper.COS_45 : Math.asin((f2 - f) / (kQgRr5e_0.QxJ9d_1 - kQgRr5e_02.QxJ9d_1));
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public final void m114KQgRr5e_0() {
        this.f193KQgRr5e_0.reset();
        Path path = this.f193KQgRr5e_0;
        IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_0 = this.f191KQgRr5e_0;
        path.addCircle(kQgRr5e_0.KQgRr5e_0, kQgRr5e_0.QxJ9d_1, kQgRr5e_0.PGPF6hQ_2, Path.Direction.CCW);
        if (this.f194QxJ9d_1.QxJ9d_1 > this.f191KQgRr5e_0.QxJ9d_1 + IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.XnFJ5_9.QxJ9d_1.m124KQgRr5e_0(1.0f)) {
            Path path2 = this.f193KQgRr5e_0;
            IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_02 = this.f194QxJ9d_1;
            path2.addCircle(kQgRr5e_02.KQgRr5e_0, kQgRr5e_02.QxJ9d_1, kQgRr5e_02.PGPF6hQ_2, Path.Direction.CCW);
            double angle = getAngle();
            IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_03 = this.f191KQgRr5e_0;
            double d = kQgRr5e_03.KQgRr5e_0;
            double d2 = kQgRr5e_03.PGPF6hQ_2;
            double cos = Math.cos(angle);
            Double.isNaN(d2);
            Double.isNaN(d);
            float f = (float) (d - (d2 * cos));
            IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_04 = this.f191KQgRr5e_0;
            double d3 = kQgRr5e_04.QxJ9d_1;
            double d4 = kQgRr5e_04.PGPF6hQ_2;
            double sin = Math.sin(angle);
            Double.isNaN(d4);
            Double.isNaN(d3);
            float f2 = (float) (d3 + (d4 * sin));
            IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_05 = this.f191KQgRr5e_0;
            double d5 = kQgRr5e_05.KQgRr5e_0;
            double d6 = kQgRr5e_05.PGPF6hQ_2;
            double cos2 = Math.cos(angle);
            Double.isNaN(d6);
            Double.isNaN(d5);
            float f3 = (float) (d5 + (d6 * cos2));
            IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_06 = this.f194QxJ9d_1;
            double d7 = kQgRr5e_06.KQgRr5e_0;
            double d8 = kQgRr5e_06.PGPF6hQ_2;
            double cos3 = Math.cos(angle);
            Double.isNaN(d8);
            Double.isNaN(d7);
            float f4 = (float) (d7 - (d8 * cos3));
            IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_07 = this.f194QxJ9d_1;
            double d9 = kQgRr5e_07.QxJ9d_1;
            double d10 = kQgRr5e_07.PGPF6hQ_2;
            double sin2 = Math.sin(angle);
            Double.isNaN(d10);
            Double.isNaN(d9);
            float f5 = (float) (d9 + (d10 * sin2));
            IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_08 = this.f194QxJ9d_1;
            double d11 = kQgRr5e_08.KQgRr5e_0;
            double d12 = kQgRr5e_08.PGPF6hQ_2;
            double cos4 = Math.cos(angle);
            Double.isNaN(d12);
            Double.isNaN(d11);
            Path path3 = this.f193KQgRr5e_0;
            IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_09 = this.f191KQgRr5e_0;
            path3.moveTo(kQgRr5e_09.KQgRr5e_0, kQgRr5e_09.QxJ9d_1);
            this.f193KQgRr5e_0.lineTo(f, f2);
            Path path4 = this.f193KQgRr5e_0;
            IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_010 = this.f194QxJ9d_1;
            path4.quadTo(kQgRr5e_010.KQgRr5e_0 - kQgRr5e_010.PGPF6hQ_2, (kQgRr5e_010.QxJ9d_1 + this.f191KQgRr5e_0.QxJ9d_1) / 2.0f, f4, f5);
            this.f193KQgRr5e_0.lineTo((float) (d11 + (d12 * cos4)), f5);
            Path path5 = this.f193KQgRr5e_0;
            IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_011 = this.f194QxJ9d_1;
            path5.quadTo(kQgRr5e_011.KQgRr5e_0 + kQgRr5e_011.PGPF6hQ_2, (kQgRr5e_011.QxJ9d_1 + f2) / 2.0f, f3, f2);
        }
        this.f193KQgRr5e_0.close();
    }

    public void KQgRr5e_0(int i, int i2) {
    }

    public IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 getBottomCircle() {
        return this.f194QxJ9d_1;
    }

    public int getIndicatorColor() {
        return this.f192KQgRr5e_0.getColor();
    }

    public int getMaxCircleRadius() {
        return this.KQgRr5e_0;
    }

    public IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 getTopCircle() {
        return this.f191KQgRr5e_0;
    }

    @Override // android.view.View
    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        int paddingTop = getPaddingTop();
        int paddingLeft = getPaddingLeft();
        int paddingBottom = getPaddingBottom();
        int height = getHeight();
        canvas.save();
        float f = height;
        float f2 = this.f191KQgRr5e_0.PGPF6hQ_2;
        float f3 = paddingTop;
        float f4 = paddingBottom;
        if (f <= (f2 * 2.0f) + f3 + f4) {
            canvas.translate(paddingLeft, (f - (f2 * 2.0f)) - f4);
            IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_0 = this.f191KQgRr5e_0;
            canvas.drawCircle(kQgRr5e_0.KQgRr5e_0, kQgRr5e_0.QxJ9d_1, kQgRr5e_0.PGPF6hQ_2, this.f192KQgRr5e_0);
        } else {
            canvas.translate(paddingLeft, f3);
            m114KQgRr5e_0();
            canvas.drawPath(this.f193KQgRr5e_0, this.f192KQgRr5e_0);
        }
        canvas.restore();
    }

    @Override // android.view.View
    public void onLayout(boolean z, int i, int i2, int i3, int i4) {
        super.onLayout(z, i, i2, i3, i4);
        KQgRr5e_0(getHeight());
    }

    @Override // android.view.View
    public void onMeasure(int i, int i2) {
        int i3 = this.KQgRr5e_0;
        int i4 = PGPF6hQ_2;
        IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_0 = this.f194QxJ9d_1;
        super.setMeasuredDimension(((i3 + i4) * 2) + getPaddingLeft() + getPaddingRight(), View.resolveSize(((int) Math.ceil(kQgRr5e_0.QxJ9d_1 + kQgRr5e_0.PGPF6hQ_2 + (i4 * 2))) + getPaddingTop() + getPaddingBottom(), i2));
    }

    public void setIndicatorColor(int i) {
        this.f192KQgRr5e_0.setColor(i);
    }

    public ValueAnimator KQgRr5e_0() {
        ValueAnimator duration = ValueAnimator.ofFloat(1.0f, 0.001f).setDuration(180L);
        duration.setInterpolator(new DecelerateInterpolator());
        duration.addUpdateListener(new KQgRr5e_0());
        return duration;
    }

    public void KQgRr5e_0(float f) {
        int i = this.KQgRr5e_0;
        double d = i;
        double d2 = f;
        Double.isNaN(d2);
        double d3 = i;
        Double.isNaN(d3);
        Double.isNaN(d);
        float f2 = f * 4.0f * i;
        IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_0 = this.f191KQgRr5e_0;
        kQgRr5e_0.PGPF6hQ_2 = (float) (d - ((d2 * 0.25d) * d3));
        IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_02 = this.f194QxJ9d_1;
        kQgRr5e_02.PGPF6hQ_2 = ((this.QxJ9d_1 - i) * f) + i;
        kQgRr5e_02.QxJ9d_1 = kQgRr5e_0.QxJ9d_1 + f2;
    }

    public void KQgRr5e_0(int i) {
        int paddingTop = getPaddingTop();
        int paddingBottom = getPaddingBottom();
        int i2 = this.KQgRr5e_0;
        float f = (i2 * 2) + paddingTop + paddingBottom;
        float f2 = i;
        if (f2 < f) {
            IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_0 = this.f191KQgRr5e_0;
            kQgRr5e_0.PGPF6hQ_2 = i2;
            IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_02 = this.f194QxJ9d_1;
            kQgRr5e_02.PGPF6hQ_2 = i2;
            kQgRr5e_02.QxJ9d_1 = kQgRr5e_0.QxJ9d_1;
            return;
        }
        float max = Math.max(0.0f, f2 - f);
        Double.isNaN(r4);
        float pow = (float) (r4 * (1.0d - Math.pow(100.0d, (-max) / IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.XnFJ5_9.QxJ9d_1.m124KQgRr5e_0(200.0f))));
        IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_03 = this.f191KQgRr5e_0;
        int i3 = this.KQgRr5e_0;
        kQgRr5e_03.PGPF6hQ_2 = i3 - (pow / 4.0f);
        IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.IFxWkV_5.KQgRr5e_0 kQgRr5e_04 = this.f194QxJ9d_1;
        float f3 = i3 - pow;
        kQgRr5e_04.PGPF6hQ_2 = f3;
        kQgRr5e_04.QxJ9d_1 = ((i - paddingTop) - paddingBottom) - f3;
    }
}
