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;

/* renamed from: ᵡᵚ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public class C3205 extends AbstractC1144 implements InterfaceC1739 {

    /* renamed from: ˀᵗᵩ, reason: contains not printable characters */
    public static final ᵼᵫᵧˀ f12107 = new ᵼᵫᵧˀ(10);

    /* renamed from: ˊᵸˊ, reason: contains not printable characters */
    public HashMap f12110;

    /* renamed from: ˑᵝﹳᵜ, reason: contains not printable characters */
    public C3104[] f12112;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public boolean f12118;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public long f12124 = -1;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public float f12119 = -1.0f;

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public float f12108 = 0.0f;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public long f12116 = -1;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public boolean f12113 = false;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public boolean f12111 = false;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public boolean f12121 = false;

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public boolean f12120 = false;

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public boolean f12123 = false;

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public long f12114 = 300;

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public int f12122 = 0;

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public int f12109 = 1;

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public boolean f12125 = true;

    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public boolean f12115 = false;

    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public InterfaceC4625 f12117 = f12107;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public static C3205 m7553(float... fArr) {
        C3205 c3205 = new C3205();
        c3205.mo5272(fArr);
        return c3205;
    }

    @Override // defpackage.AbstractC1144
    public final void cancel() {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        if (this.f12123) {
            return;
        }
        if ((this.f12111 || this.f12113) && this.f4898 != null) {
            if (!this.f12113) {
                m7554();
            }
            ArrayList arrayList = (ArrayList) this.f4898.clone();
            int size = arrayList.size();
            int i = 0;
            while (i < size) {
                Object obj = arrayList.get(i);
                i++;
                ((InterfaceC0793) obj).mo2897();
            }
        }
        m7563();
    }

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

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public final void m7554() {
        ArrayList arrayList = this.f4898;
        if (arrayList != null && !this.f12121) {
            ArrayList arrayList2 = (ArrayList) arrayList.clone();
            int size = arrayList2.size();
            for (int i = 0; i < size; i++) {
                ((InterfaceC0793) arrayList2.get(i)).mo2896(this);
            }
        }
        this.f12121 = true;
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ˌᵜᵹᵩ */
    public final boolean mo3581(long j) {
        if (this.f12125) {
            return false;
        }
        return mo4687(j);
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ˎˑː, reason: merged with bridge method [inline-methods] */
    public C3205 mo3587(long j) {
        if (j >= 0) {
            this.f12114 = j;
            return this;
        }
        ᵹˉᵞ.ˌᵜᵹᵩ(AbstractC4737.m10015(j, "Animators cannot have negative duration: "));
        return null;
    }

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public final void m7555(float f) {
        mo5270();
        float fM7559 = m7559(f);
        if (this.f12116 >= 0) {
            this.f12124 = AnimationUtils.currentAnimationTimeMillis() - ((long) (((long) (this.f12114 * 1.0f)) * fM7559));
        } else {
            this.f12119 = fM7559;
        }
        this.f12108 = fM7559;
        mo5268(m7557(fM7559, this.f12118));
    }

    /* renamed from: ˑᵱ */
    public void mo5268(float f) {
        float fFloatValue;
        float interpolation = this.f12117.getInterpolation(f);
        int length = this.f12112.length;
        for (int i = 0; i < length; i++) {
            C3104 c3104 = this.f12112[i];
            C3369 c3369 = c3104.f11849;
            int i2 = c3369.f12594;
            List list = c3369.f12593;
            int i3 = 1;
            if (interpolation <= 0.0f) {
                C3805 c3805 = (C3805) list.get(0);
                C3805 c38052 = (C3805) list.get(1);
                float f2 = c3805.f14187;
                float f3 = c38052.f14187;
                float f4 = c3805.f14188;
                float f5 = (interpolation - f4) / (c38052.f14188 - f4);
                InterfaceC0599 interfaceC0599 = c3369.f12595;
                fFloatValue = interfaceC0599 == null ? ((f3 - f2) * f5) + f2 : ((Float) interfaceC0599.m2483(f5, Float.valueOf(f2), Float.valueOf(f3))).floatValue();
            } else if (interpolation < 1.0f) {
                C3805 c38053 = (C3805) list.get(0);
                while (true) {
                    if (i3 >= i2) {
                        fFloatValue = ((C3805) list.get(i2 - 1)).f14187;
                        break;
                    }
                    C3805 c38054 = (C3805) list.get(i3);
                    float f6 = c38054.f14188;
                    if (interpolation < f6) {
                        float f7 = c38053.f14188;
                        float f8 = (interpolation - f7) / (f6 - f7);
                        float f9 = c38053.f14187;
                        float f10 = c38054.f14187;
                        InterfaceC0599 interfaceC05992 = c3369.f12595;
                        fFloatValue = interfaceC05992 == null ? ((f10 - f9) * f8) + f9 : ((Float) interfaceC05992.m2483(f8, Float.valueOf(f9), Float.valueOf(f10))).floatValue();
                    } else {
                        i3++;
                        c38053 = c38054;
                    }
                }
            } else {
                C3805 c38055 = (C3805) list.get(i2 - 2);
                C3805 c38056 = (C3805) list.get(i2 - 1);
                float f11 = c38055.f14187;
                float f12 = c38056.f14187;
                float f13 = c38055.f14188;
                float f14 = (interpolation - f13) / (c38056.f14188 - f13);
                InterfaceC0599 interfaceC05993 = c3369.f12595;
                fFloatValue = interfaceC05993 == null ? ((f12 - f11) * f14) + f11 : ((Float) interfaceC05993.m2483(f14, Float.valueOf(f11), Float.valueOf(f12))).floatValue();
            }
            c3104.f11848 = fFloatValue;
        }
        ArrayList arrayList = this.f4899;
        if (arrayList != null) {
            int size = arrayList.size();
            for (int i4 = 0; i4 < size; i4++) {
                ((InterfaceC4008) this.f4899.get(i4)).m8848(this);
            }
        }
    }

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public final void m7556(boolean z) {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        this.f12118 = z;
        this.f12125 = !this.f12115;
        if (z) {
            float f = this.f12119;
            if (f != -1.0f && f != 0.0f) {
                if (this.f12122 == -1) {
                    double d = f;
                    this.f12119 = 1.0f - ((float) (d - Math.floor(d)));
                } else {
                    this.f12119 = (r4 + 1) - f;
                }
            }
        }
        this.f12111 = true;
        this.f12113 = false;
        this.f12123 = false;
        this.f12116 = -1L;
        this.f12124 = -1L;
        m7560();
        float f2 = this.f12119;
        if (f2 == -1.0f) {
            long j = this.f12114;
            m7555(j > 0 ? 0.0f / j : 1.0f);
        } else {
            m7555(f2);
        }
        if (this.f12125) {
            AbstractC1144.m3579(this);
        }
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵝᵵᵺ */
    public final long mo3584() {
        if (this.f12122 == -1) {
            return -1L;
        }
        return this.f12114 * (r0 + 1);
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵡʠ */
    public final void mo3585(boolean z) {
        mo5270();
        mo5268((this.f12122 % 2 == 1 && this.f12109 == 2) ? 0.0f : z ? 0.0f : 1.0f);
    }

    /* renamed from: ᵡⁱᵥ */
    public void mo5270() {
        if (this.f12120) {
            return;
        }
        int length = this.f12112.length;
        for (int i = 0; i < length; i++) {
            C3104 c3104 = this.f12112[i];
            if (c3104.f11850 == null) {
                Class cls = c3104.f11853;
                c3104.f11850 = cls == Integer.class ? ʾᵚᵱ.ᵤᵙᵷ : cls == Float.class ? ᵥᵵ.ᵡⁱᵥ : null;
            }
            InterfaceC0599 interfaceC0599 = c3104.f11850;
            if (interfaceC0599 != null) {
                c3104.f11851.f12595 = interfaceC0599;
            }
        }
        this.f12120 = true;
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵢˇᵭ, reason: merged with bridge method [inline-methods] and merged with bridge method [inline-methods] */
    public C3205 mo3582() {
        C3205 c3205 = (C3205) super.mo3582();
        if (this.f4899 != null) {
            c3205.f4899 = new ArrayList(this.f4899);
        }
        c3205.f12119 = -1.0f;
        c3205.f12118 = false;
        c3205.f12120 = false;
        c3205.f12111 = false;
        c3205.f12113 = false;
        c3205.f12121 = false;
        c3205.f12124 = -1L;
        c3205.f12123 = false;
        c3205.f12116 = -1L;
        c3205.f12108 = 0.0f;
        c3205.f12125 = true;
        c3205.f12115 = false;
        C3104[] c3104Arr = this.f12112;
        if (c3104Arr != null) {
            int length = c3104Arr.length;
            c3205.f12112 = new C3104[length];
            c3205.f12110 = new HashMap(length);
            for (int i = 0; i < length; i++) {
                C3104 c3104Clone = c3104Arr[i].clone();
                c3205.f12112[i] = c3104Clone;
                c3205.f12110.put(c3104Clone.f11854, c3104Clone);
            }
        }
        return c3205;
    }

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final float m7557(float f, boolean z) {
        float fM7559 = m7559(f);
        float fM75592 = m7559(fM7559);
        double d = fM75592;
        double dFloor = Math.floor(d);
        if (d == dFloor && fM75592 > 0.0f) {
            dFloor -= 1.0d;
        }
        int i = (int) dFloor;
        float f2 = fM7559 - i;
        return m7561(i, z) ? 1.0f - f2 : f2;
    }

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public final void m7558(C3104... c3104Arr) {
        int length = c3104Arr.length;
        this.f12112 = c3104Arr;
        this.f12110 = new HashMap(length);
        for (C3104 c3104 : c3104Arr) {
            this.f12110.put(c3104.f11854, c3104);
        }
        this.f12120 = false;
    }

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final float m7559(float f) {
        if (f < 0.0f) {
            return 0.0f;
        }
        return this.f12122 != -1 ? Math.min(f, r2 + 1) : f;
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵨᵳʝ */
    public final void mo3586(boolean z) {
        this.f12115 = true;
        if (z) {
            mo3588();
        } else {
            mo3591();
        }
        this.f12115 = false;
    }

    /* renamed from: ᵮᵠـˌ */
    public void mo5272(float... fArr) {
        if (fArr.length == 0) {
            return;
        }
        C3104[] c3104Arr = this.f12112;
        if (c3104Arr == null || c3104Arr.length == 0) {
            m7558(new C3104("", fArr));
        } else {
            c3104Arr[0].m7438(fArr);
        }
        this.f12120 = false;
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵯٴᵦ */
    public final void mo3588() {
        if (this.f12116 >= 0) {
            long jCurrentAnimationTimeMillis = AnimationUtils.currentAnimationTimeMillis();
            this.f12124 = jCurrentAnimationTimeMillis - (((long) (this.f12114 * 1.0f)) - (jCurrentAnimationTimeMillis - this.f12124));
            this.f12118 = !this.f12118;
            return;
        }
        if (!this.f12111) {
            m7556(true);
        } else {
            this.f12118 = !this.f12118;
            mo3593();
        }
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵳٴᵶ */
    public final void mo3589(InterfaceC4625 interfaceC4625) {
        if (interfaceC4625 != null) {
            this.f12117 = interfaceC4625;
        } else {
            this.f12117 = new ʾᵠᵦ();
        }
    }

    @Override // defpackage.InterfaceC1739
    /* renamed from: ᵴᵳ */
    public final boolean mo4687(long j) {
        if (this.f12124 < 0) {
            this.f12124 = j;
        }
        boolean z = true;
        boolean z2 = false;
        if (!this.f12113) {
            if (this.f12124 > j && this.f12119 == -1.0f) {
                return false;
            }
            this.f12113 = true;
            m7560();
        }
        if (this.f12116 < 0) {
            float f = this.f12119;
            if (f >= 0.0f) {
                this.f12124 = j - ((long) (((long) (this.f12114 * 1.0f)) * f));
                this.f12119 = -1.0f;
            }
        }
        this.f12116 = j;
        long jMax = Math.max(j, this.f12124);
        if (this.f12113) {
            long j2 = (long) (this.f12114 * 1.0f);
            float f2 = j2 > 0 ? (jMax - this.f12124) / j2 : 1.0f;
            boolean z3 = ((int) f2) > ((int) this.f12108);
            int i = this.f12122;
            boolean z4 = f2 >= ((float) (i + 1)) && i != -1;
            if (j2 != 0) {
                if (z3 && !z4) {
                    ArrayList arrayList = this.f4898;
                    if (arrayList != null) {
                        int size = arrayList.size();
                        for (int i2 = 0; i2 < size; i2++) {
                            ((InterfaceC0793) this.f4898.get(i2)).getClass();
                        }
                    }
                } else if (!z4) {
                }
                z = false;
            }
            float fM7559 = m7559(f2);
            this.f12108 = fM7559;
            mo5268(m7557(fM7559, this.f12118));
            z2 = z;
        }
        if (z2) {
            m7563();
        }
        return z2;
    }

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public final void m7560() {
        this.f12123 = false;
        mo5270();
        this.f12113 = true;
        float f = this.f12119;
        if (f >= 0.0f) {
            this.f12108 = f;
        } else {
            this.f12108 = 0.0f;
        }
        if (this.f4898 != null) {
            m7554();
        }
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵶᵷᵕ */
    public boolean mo3590() {
        return this.f12120;
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵸʓᵠ */
    public void mo3591() {
        m7556(false);
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵸˑ */
    public final boolean mo3592() {
        return this.f12111;
    }

    @Override // defpackage.AbstractC1144
    /* renamed from: ᵹᵝᵶ */
    public final void mo3593() {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        if (!this.f12113) {
            m7560();
            this.f12111 = true;
        } else if (!this.f12120) {
            mo5270();
        }
        mo5268(m7561(this.f12122, this.f12118) ? 0.0f : 1.0f);
        m7563();
    }

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public final boolean m7561(int i, boolean z) {
        if (i > 0 && this.f12109 == 2) {
            int i2 = this.f12122;
            if (i < i2 + 1 || i2 == -1) {
                return z ? i % 2 == 0 : i % 2 != 0;
            }
        }
        return z;
    }

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final Float m7562() {
        C3104[] c3104Arr = this.f12112;
        if (c3104Arr == null || c3104Arr.length <= 0) {
            return null;
        }
        return Float.valueOf(c3104Arr[0].f11848);
    }

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final void m7563() {
        ArrayList arrayList;
        C3539 c3539M8077;
        ArrayList arrayList2;
        int iIndexOf;
        if (this.f12123) {
            return;
        }
        if (this.f12125 && (iIndexOf = (arrayList2 = (c3539M8077 = C3539.m8077()).f13273).indexOf(this)) >= 0) {
            arrayList2.set(iIndexOf, null);
            c3539M8077.f13271 = true;
        }
        this.f12123 = true;
        boolean z = (this.f12111 || this.f12113) && this.f4898 != null;
        if (z && !this.f12113) {
            m7554();
        }
        this.f12113 = false;
        this.f12111 = false;
        this.f12121 = false;
        this.f12116 = -1L;
        this.f12124 = -1L;
        if (z && (arrayList = this.f4898) != null) {
            ArrayList arrayList3 = (ArrayList) arrayList.clone();
            int size = arrayList3.size();
            for (int i = 0; i < size; i++) {
                ((InterfaceC0793) arrayList3.get(i)).mo2899(this, this.f12118);
            }
        }
        this.f12118 = false;
    }
}
