package defpackage;

import android.os.Looper;
import android.util.AndroidRuntimeException;
import android.view.animation.AnimationUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/* JADX INFO: renamed from: ᵖᵲᵥ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public class C2453 extends AbstractC2842 implements InterfaceC3064 {

    /* JADX INFO: renamed from: ˈⁱᵡ, reason: contains not printable characters */
    public static final ᵱᵻᵧᵷ f9514 = new ᵱᵻᵧᵷ();

    /* JADX INFO: renamed from: ʽᵡᵢᵾ, reason: contains not printable characters */
    public HashMap f9515;

    /* JADX INFO: renamed from: ˑʢ, reason: contains not printable characters */
    public C4687[] f9524;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public boolean f9531;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public long f9528 = -1;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public float f9529 = -1.0f;

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public float f9519 = 0.0f;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public long f9523 = -1;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public boolean f9532 = false;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public boolean f9525 = false;

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public boolean f9516 = false;

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public boolean f9527 = false;

    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    public boolean f9520 = false;

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public long f9518 = 300;

    /* JADX INFO: renamed from: ˀᵭ, reason: contains not printable characters */
    public int f9517 = 0;

    /* JADX INFO: renamed from: ˊᵾʽʼ, reason: contains not printable characters */
    public int f9522 = 1;

    /* JADX INFO: renamed from: ˊᵡᵗʨ, reason: contains not printable characters */
    public boolean f9521 = true;

    /* JADX INFO: renamed from: ᵛˑﹳ, reason: contains not printable characters */
    public boolean f9526 = false;

    /* JADX INFO: renamed from: ᵵᵬᵽ, reason: contains not printable characters */
    public InterfaceC5340 f9530 = f9514;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public static C2453 m6185(float... fArr) {
        C2453 c2453 = new C2453();
        c2453.mo6186(fArr);
        return c2453;
    }

    @Override // defpackage.AbstractC2842
    public final void cancel() {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        if (this.f9520) {
            return;
        }
        if ((this.f9525 || this.f9532) && this.f10886 != null) {
            if (!this.f9532) {
                m6189();
            }
            ArrayList arrayList = (ArrayList) this.f10886.clone();
            int size = arrayList.size();
            int i = 0;
            while (i < size) {
                Object obj = arrayList.get(i);
                i++;
                ((InterfaceC4009) obj).mo8803();
            }
        }
        m6194();
    }

    public String toString() {
        String str = "ValueAnimator@" + Integer.toHexString(hashCode());
        if (this.f9524 != null) {
            for (int i = 0; i < this.f9524.length; i++) {
                str = str + "\n    " + this.f9524[i].toString();
            }
        }
        return str;
    }

    @Override // defpackage.InterfaceC3064
    /* JADX INFO: renamed from: ʽˈˋ */
    public final boolean mo2671(long j) {
        if (this.f9528 < 0) {
            this.f9528 = j;
        }
        boolean z = true;
        boolean z2 = false;
        if (!this.f9532) {
            if (this.f9528 > j && this.f9529 == -1.0f) {
                return false;
            }
            this.f9532 = true;
            m6187();
        }
        if (this.f9523 < 0) {
            float f = this.f9529;
            if (f >= 0.0f) {
                this.f9528 = j - ((long) (((long) (this.f9518 * 1.0f)) * f));
                this.f9529 = -1.0f;
            }
        }
        this.f9523 = j;
        long jMax = Math.max(j, this.f9528);
        if (this.f9532) {
            long j2 = (long) (this.f9518 * 1.0f);
            float f2 = j2 > 0 ? (jMax - this.f9528) / j2 : 1.0f;
            boolean z3 = ((int) f2) > ((int) this.f9519);
            int i = this.f9517;
            boolean z4 = f2 >= ((float) (i + 1)) && i != -1;
            if (j2 != 0) {
                if (z3 && !z4) {
                    ArrayList arrayList = this.f10886;
                    if (arrayList != null) {
                        int size = arrayList.size();
                        for (int i2 = 0; i2 < size; i2++) {
                            ((InterfaceC4009) this.f10886.get(i2)).getClass();
                        }
                    }
                } else if (!z4) {
                }
                z = false;
            }
            float fM6192 = m6192(f2);
            this.f9519 = fM6192;
            mo6191(m6198(fM6192, this.f9531));
            z2 = z;
        }
        if (z2) {
            m6194();
        }
        return z2;
    }

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public void mo6186(float... fArr) {
        if (fArr.length == 0) {
            return;
        }
        C4687[] c4687Arr = this.f9524;
        if (c4687Arr == null || c4687Arr.length == 0) {
            m6196(new C4687("", fArr));
        } else {
            c4687Arr[0].m9816(fArr);
        }
        this.f9527 = false;
    }

    /* JADX INFO: renamed from: ˀᵭ, reason: contains not printable characters */
    public final void m6187() {
        this.f9520 = false;
        mo6199();
        this.f9532 = true;
        float f = this.f9529;
        if (f >= 0.0f) {
            this.f9519 = f;
        } else {
            this.f9519 = 0.0f;
        }
        if (this.f10886 != null) {
            m6189();
        }
    }

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public final void m6188(boolean z) {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        this.f9531 = z;
        this.f9521 = !this.f9526;
        if (z) {
            float f = this.f9529;
            if (f != -1.0f && f != 0.0f) {
                if (this.f9517 == -1) {
                    double d = f;
                    this.f9529 = 1.0f - ((float) (d - Math.floor(d)));
                } else {
                    this.f9529 = (r4 + 1) - f;
                }
            }
        }
        this.f9525 = true;
        this.f9532 = false;
        this.f9520 = false;
        this.f9523 = -1L;
        this.f9528 = -1L;
        m6187();
        float f2 = this.f9529;
        if (f2 == -1.0f) {
            long j = this.f9518;
            m6200(j > 0 ? 0.0f / j : 1.0f);
        } else {
            m6200(f2);
        }
        if (this.f9521) {
            AbstractC2842.m6823(this);
        }
    }

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public final void m6189() {
        ArrayList arrayList = this.f10886;
        if (arrayList != null && !this.f9516) {
            ArrayList arrayList2 = (ArrayList) arrayList.clone();
            int size = arrayList2.size();
            for (int i = 0; i < size; i++) {
                ((InterfaceC4009) arrayList2.get(i)).mo8802(this);
            }
        }
        this.f9516 = true;
    }

    @Override // defpackage.AbstractC2842
    /* JADX INFO: renamed from: ˉᵲ */
    public void mo2676() {
        m6188(false);
    }

    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    public final boolean m6190(int i, boolean z) {
        if (i > 0 && this.f9522 == 2) {
            int i2 = this.f9517;
            if (i < i2 + 1 || i2 == -1) {
                return z ? i % 2 == 0 : i % 2 != 0;
            }
        }
        return z;
    }

    @Override // defpackage.AbstractC2842
    /* JADX INFO: renamed from: ˊᵙᵾᵲ */
    public final void mo2678(boolean z) {
        mo6199();
        mo6191((this.f9517 % 2 == 1 && this.f9522 == 2) ? 0.0f : z ? 0.0f : 1.0f);
    }

    /* JADX INFO: renamed from: ˊᵨᵧ, reason: contains not printable characters */
    public void mo6191(float f) {
        float fFloatValue;
        float interpolation = this.f9530.getInterpolation(f);
        int length = this.f9524.length;
        for (int i = 0; i < length; i++) {
            C4687 c4687 = this.f9524[i];
            C0791 c0791 = c4687.f17809;
            int i2 = c0791.f3548;
            List list = c0791.f3550;
            int i3 = 1;
            if (interpolation <= 0.0f) {
                C5514 c5514 = (C5514) list.get(0);
                C5514 c55142 = (C5514) list.get(1);
                float f2 = c5514.f20827;
                float f3 = c55142.f20827;
                float f4 = c5514.f20825;
                float f5 = (interpolation - f4) / (c55142.f20825 - f4);
                InterfaceC3548 interfaceC3548 = c0791.f3549;
                fFloatValue = interfaceC3548 == null ? ((f3 - f2) * f5) + f2 : ((Float) interfaceC3548.m8065(f5, Float.valueOf(f2), Float.valueOf(f3))).floatValue();
            } else if (interpolation < 1.0f) {
                C5514 c55143 = (C5514) list.get(0);
                while (true) {
                    if (i3 >= i2) {
                        fFloatValue = ((C5514) list.get(i2 - 1)).f20827;
                        break;
                    }
                    C5514 c55144 = (C5514) list.get(i3);
                    float f6 = c55144.f20825;
                    if (interpolation < f6) {
                        float f7 = c55143.f20825;
                        float f8 = (interpolation - f7) / (f6 - f7);
                        float f9 = c55143.f20827;
                        float f10 = c55144.f20827;
                        InterfaceC3548 interfaceC35482 = c0791.f3549;
                        fFloatValue = interfaceC35482 == null ? ((f10 - f9) * f8) + f9 : ((Float) interfaceC35482.m8065(f8, Float.valueOf(f9), Float.valueOf(f10))).floatValue();
                    } else {
                        i3++;
                        c55143 = c55144;
                    }
                }
            } else {
                C5514 c55145 = (C5514) list.get(i2 - 2);
                C5514 c55146 = (C5514) list.get(i2 - 1);
                float f11 = c55145.f20827;
                float f12 = c55146.f20827;
                float f13 = c55145.f20825;
                float f14 = (interpolation - f13) / (c55146.f20825 - f13);
                InterfaceC3548 interfaceC35483 = c0791.f3549;
                fFloatValue = interfaceC35483 == null ? ((f12 - f11) * f14) + f11 : ((Float) interfaceC35483.m8065(f14, Float.valueOf(f11), Float.valueOf(f12))).floatValue();
            }
            c4687.f17803 = fFloatValue;
        }
        ArrayList arrayList = this.f10887;
        if (arrayList != null) {
            int size = arrayList.size();
            for (int i4 = 0; i4 < size; i4++) {
                ((InterfaceC2509) this.f10887.get(i4)).m6229(this);
            }
        }
    }

    @Override // defpackage.AbstractC2842
    /* JADX INFO: renamed from: ˊᵫᵗ */
    public final void mo2680() {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        if (!this.f9532) {
            m6187();
            this.f9525 = true;
        } else if (!this.f9527) {
            mo6199();
        }
        mo6191(m6190(this.f9517, this.f9531) ? 0.0f : 1.0f);
        m6194();
    }

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final float m6192(float f) {
        if (f < 0.0f) {
            return 0.0f;
        }
        return this.f9517 != -1 ? Math.min(f, r2 + 1) : f;
    }

    @Override // defpackage.AbstractC2842
    /* JADX INFO: renamed from: ˏːˆ */
    public final void mo2684(boolean z) {
        this.f9526 = true;
        if (z) {
            mo2687();
        } else {
            mo2676();
        }
        this.f9526 = false;
    }

    @Override // defpackage.AbstractC2842
    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters and merged with bridge method [inline-methods] */
    public C2453 mo2681(long j) {
        if (j >= 0) {
            this.f9518 = j;
            return this;
        }
        ᵕᵩʽᵲ.ᵮᵣᵗˈ(AbstractC0659.m2417(j, "Animators cannot have negative duration: "));
        return null;
    }

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final void m6194() {
        ArrayList arrayList;
        C0872 c0872M3062;
        ArrayList arrayList2;
        int iIndexOf;
        if (this.f9520) {
            return;
        }
        if (this.f9521 && (iIndexOf = (arrayList2 = (c0872M3062 = C0872.m3062()).f3867).indexOf(this)) >= 0) {
            arrayList2.set(iIndexOf, null);
            c0872M3062.f3868 = true;
        }
        this.f9520 = true;
        boolean z = (this.f9525 || this.f9532) && this.f10886 != null;
        if (z && !this.f9532) {
            m6189();
        }
        this.f9532 = false;
        this.f9525 = false;
        this.f9516 = false;
        this.f9523 = -1L;
        this.f9528 = -1L;
        if (z && (arrayList = this.f10886) != null) {
            ArrayList arrayList3 = (ArrayList) arrayList.clone();
            int size = arrayList3.size();
            for (int i = 0; i < size; i++) {
                ((InterfaceC4009) arrayList3.get(i)).mo8804(this, this.f9531);
            }
        }
        this.f9531 = false;
    }

    @Override // defpackage.AbstractC2842
    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters and merged with bridge method [inline-methods] and merged with bridge method [inline-methods] */
    public C2453 mo2692() {
        C2453 c2453 = (C2453) super.mo2692();
        if (this.f10887 != null) {
            c2453.f10887 = new ArrayList(this.f10887);
        }
        c2453.f9529 = -1.0f;
        c2453.f9531 = false;
        c2453.f9527 = false;
        c2453.f9525 = false;
        c2453.f9532 = false;
        c2453.f9516 = false;
        c2453.f9528 = -1L;
        c2453.f9520 = false;
        c2453.f9523 = -1L;
        c2453.f9519 = 0.0f;
        c2453.f9521 = true;
        c2453.f9526 = false;
        C4687[] c4687Arr = this.f9524;
        if (c4687Arr != null) {
            int length = c4687Arr.length;
            c2453.f9524 = new C4687[length];
            c2453.f9515 = new HashMap(length);
            for (int i = 0; i < length; i++) {
                C4687 c4687Clone = c4687Arr[i].clone();
                c2453.f9524[i] = c4687Clone;
                c2453.f9515.put(c4687Clone.f17801, c4687Clone);
            }
        }
        return c2453;
    }

    @Override // defpackage.AbstractC2842
    /* JADX INFO: renamed from: ᵝᵶ */
    public final void mo2687() {
        if (this.f9523 >= 0) {
            long jCurrentAnimationTimeMillis = AnimationUtils.currentAnimationTimeMillis();
            this.f9528 = jCurrentAnimationTimeMillis - (((long) (this.f9518 * 1.0f)) - (jCurrentAnimationTimeMillis - this.f9528));
            this.f9531 = !this.f9531;
            return;
        }
        if (!this.f9525) {
            m6188(true);
        } else {
            this.f9531 = !this.f9531;
            mo2680();
        }
    }

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public final void m6196(C4687... c4687Arr) {
        int length = c4687Arr.length;
        this.f9524 = c4687Arr;
        this.f9515 = new HashMap(length);
        for (C4687 c4687 : c4687Arr) {
            this.f9515.put(c4687.f17801, c4687);
        }
        this.f9527 = false;
    }

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final Float m6197() {
        C4687[] c4687Arr = this.f9524;
        if (c4687Arr == null || c4687Arr.length <= 0) {
            return null;
        }
        return Float.valueOf(c4687Arr[0].f17803);
    }

    @Override // defpackage.AbstractC2842
    /* JADX INFO: renamed from: ᵪᵹᵥᵻ */
    public final void mo2688(InterfaceC5340 interfaceC5340) {
        if (interfaceC5340 != null) {
            this.f9530 = interfaceC5340;
        } else {
            this.f9530 = new ʻﾞ();
        }
    }

    @Override // defpackage.AbstractC2842
    /* JADX INFO: renamed from: ᵮᵣᵗˈ */
    public final boolean mo2689(long j) {
        if (this.f9521) {
            return false;
        }
        return mo2671(j);
    }

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public final float m6198(float f, boolean z) {
        float fM6192 = m6192(f);
        float fM61922 = m6192(fM6192);
        double d = fM61922;
        double dFloor = Math.floor(d);
        if (d == dFloor && fM61922 > 0.0f) {
            dFloor -= 1.0d;
        }
        int i = (int) dFloor;
        float f2 = fM6192 - i;
        return m6190(i, z) ? 1.0f - f2 : f2;
    }

    @Override // defpackage.AbstractC2842
    /* JADX INFO: renamed from: ᵱᵽʡᵚ */
    public boolean mo2691() {
        return this.f9527;
    }

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public void mo6199() {
        if (this.f9527) {
            return;
        }
        int length = this.f9524.length;
        for (int i = 0; i < length; i++) {
            C4687 c4687 = this.f9524[i];
            if (c4687.f17802 == null) {
                Class cls = c4687.f17807;
                c4687.f17802 = cls == Integer.class ? ʻﾞ.ᵨᵼⁱ : cls == Float.class ? ᵱᵻᵧᵷ.ᵨᵼⁱ : null;
            }
            InterfaceC3548 interfaceC3548 = c4687.f17802;
            if (interfaceC3548 != null) {
                c4687.f17808.f3549 = interfaceC3548;
            }
        }
        this.f9527 = true;
    }

    @Override // defpackage.AbstractC2842
    /* JADX INFO: renamed from: ᵶᵥᵝ */
    public final boolean mo2694() {
        return this.f9525;
    }

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public final void m6200(float f) {
        mo6199();
        float fM6192 = m6192(f);
        if (this.f9523 >= 0) {
            this.f9528 = AnimationUtils.currentAnimationTimeMillis() - ((long) (((long) (this.f9518 * 1.0f)) * fM6192));
        } else {
            this.f9529 = fM6192;
        }
        this.f9519 = fM6192;
        mo6191(m6198(fM6192, this.f9531));
    }

    @Override // defpackage.AbstractC2842
    /* JADX INFO: renamed from: ᵻʽᵯ */
    public final long mo2696() {
        int i = this.f9517;
        if (i == -1) {
            return -1L;
        }
        return this.f9518 * ((long) (i + 1));
    }
}
