package p037.p065.p066;

import android.annotation.SuppressLint;
import android.os.Looper;
import android.util.AndroidRuntimeException;
import android.view.animation.AnimationUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import p037.p065.p066.AbstractC1802;
import p037.p065.p066.C1796;
import p037.p065.p074.C1882;
import p138.p139.p143.p144.C2803;

/* JADX INFO: renamed from: މ.ރ.ށ.ސ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C1829 extends AbstractC1802 implements C1796.InterfaceC1798 {

    /* JADX INFO: renamed from: ޞ, reason: contains not printable characters */
    public static float f6122 = 1.0f;

    /* JADX INFO: renamed from: ޟ, reason: contains not printable characters */
    public static final InterfaceC1818 f6123 = new C1795();

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public long f6126;

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public boolean f6128;

    /* JADX INFO: renamed from: ޚ, reason: contains not printable characters */
    public C1826[] f6143;

    /* JADX INFO: renamed from: ޛ, reason: contains not printable characters */
    public HashMap<String, C1826> f6144;

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public long f6124 = -1;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public float f6125 = -1.0f;

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public boolean f6127 = false;

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public float f6129 = 0.0f;

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public long f6130 = -1;

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public boolean f6131 = false;

    /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
    public boolean f6132 = false;

    /* JADX INFO: renamed from: ސ, reason: contains not printable characters */
    public boolean f6133 = false;

    /* JADX INFO: renamed from: ޑ, reason: contains not printable characters */
    public boolean f6134 = false;

    /* JADX INFO: renamed from: ޒ, reason: contains not printable characters */
    public boolean f6135 = false;

    /* JADX INFO: renamed from: ޓ, reason: contains not printable characters */
    public long f6136 = 300;

    /* JADX INFO: renamed from: ޔ, reason: contains not printable characters */
    public long f6137 = 0;

    /* JADX INFO: renamed from: ޕ, reason: contains not printable characters */
    public int f6138 = 0;

    /* JADX INFO: renamed from: ޖ, reason: contains not printable characters */
    public int f6139 = 1;

    /* JADX INFO: renamed from: ޗ, reason: contains not printable characters */
    public boolean f6140 = true;

    /* JADX INFO: renamed from: ޘ, reason: contains not printable characters */
    public boolean f6141 = false;

    /* JADX INFO: renamed from: ޙ, reason: contains not printable characters */
    public InterfaceC1818 f6142 = f6123;

    /* JADX INFO: renamed from: ޜ, reason: contains not printable characters */
    public float f6145 = -1.0f;

    /* JADX INFO: renamed from: ޝ, reason: contains not printable characters */
    public String f6146 = null;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public static C1829 m3618(float... fArr) {
        C1829 c1829 = new C1829();
        c1829.mo3602(fArr);
        return c1829;
    }

    @Override // p037.p065.p066.AbstractC1802
    public void cancel() {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        if (this.f6135) {
            return;
        }
        if ((this.f6132 || this.f6131) && this.f6045 != null) {
            if (!this.f6131) {
                m3628();
            }
            Iterator it = ((ArrayList) this.f6045.clone()).iterator();
            while (it.hasNext()) {
                ((AbstractC1802.InterfaceC1803) it.next()).mo1261(this);
            }
        }
        m3625();
    }

    @Override // p037.p065.p066.AbstractC1802
    @SuppressLint({"NoClone"})
    public C1829 clone() {
        C1829 c1829 = (C1829) super.clone();
        if (this.f6047 != null) {
            c1829.f6047 = new ArrayList<>(this.f6047);
        }
        c1829.f6125 = -1.0f;
        c1829.f6128 = false;
        c1829.f6134 = false;
        c1829.f6132 = false;
        c1829.f6131 = false;
        c1829.f6048 = false;
        c1829.f6127 = false;
        c1829.f6133 = false;
        c1829.f6124 = -1L;
        c1829.f6135 = false;
        c1829.f6126 = -1L;
        c1829.f6130 = -1L;
        c1829.f6129 = 0.0f;
        c1829.f6140 = true;
        c1829.f6141 = false;
        C1826[] c1826Arr = this.f6143;
        if (c1826Arr != null) {
            int length = c1826Arr.length;
            c1829.f6143 = new C1826[length];
            c1829.f6144 = new HashMap<>(length);
            for (int i = 0; i < length; i++) {
                C1826 c1826Clone = c1826Arr[i].clone();
                c1829.f6143[i] = c1826Clone;
                c1829.f6144.put(c1826Clone.f6110, c1826Clone);
            }
        }
        return c1829;
    }

    public String toString() {
        StringBuilder sbM4889 = C2803.m4889("ValueAnimator@");
        sbM4889.append(Integer.toHexString(hashCode()));
        String string = sbM4889.toString();
        if (this.f6143 != null) {
            for (int i = 0; i < this.f6143.length; i++) {
                StringBuilder sbM4897 = C2803.m4897(string, "\n    ");
                sbM4897.append(this.f6143[i].toString());
                string = sbM4897.toString();
            }
        }
        return string;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final float m3619(float f, boolean z) {
        float fM3623 = m3623(f);
        float fM36232 = m3623(fM3623);
        double d = fM36232;
        double dFloor = Math.floor(d);
        if (d == dFloor && fM36232 > 0.0f) {
            dFloor -= 1.0d;
        }
        int i = (int) dFloor;
        float f2 = fM3623 - i;
        return m3621(i, z) ? 1.0f - f2 : f2;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ֏ */
    public void mo3555(InterfaceC1818 interfaceC1818) {
        if (interfaceC1818 != null) {
            this.f6142 = interfaceC1818;
        } else {
            this.f6142 = new C1824();
        }
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ֏ */
    public void mo3556(boolean z) {
        mo3605();
        mo3603((this.f6138 % 2 == 1 && this.f6139 == 2) ? 0.0f : z ? 0.0f : 1.0f);
    }

    /* JADX INFO: renamed from: ֏ */
    public void mo3602(float... fArr) {
        if (fArr == null || fArr.length == 0) {
            return;
        }
        C1826[] c1826Arr = this.f6143;
        if (c1826Arr == null || c1826Arr.length == 0) {
            m3620(C1826.m3609("", fArr));
        } else {
            c1826Arr[0].mo3614(fArr);
        }
        this.f6134 = false;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m3620(C1826... c1826Arr) {
        int length = c1826Arr.length;
        this.f6143 = c1826Arr;
        this.f6144 = new HashMap<>(length);
        for (C1826 c1826 : c1826Arr) {
            this.f6144.put(c1826.f6110, c1826);
        }
        this.f6134 = false;
    }

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

    /* JADX WARN: Removed duplicated region for block: B:64:0x00d4  */
    @Override // p037.p065.p066.C1796.InterfaceC1798
    /* JADX INFO: renamed from: ֏ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean mo3547(long j) {
        long j2;
        if (this.f6124 < 0) {
            if (this.f6128) {
                j2 = j;
            } else {
                float f = this.f6137;
                float f2 = this.f6145;
                if (f2 < 0.0f) {
                    f2 = f6122;
                }
                j2 = ((long) (f * f2)) + j;
            }
            this.f6124 = j2;
        }
        boolean z = false;
        if (this.f6048) {
            this.f6126 = j;
            if (this.f6140) {
                C1796.m3541().m3544(this);
            }
            return false;
        }
        if (this.f6127) {
            this.f6127 = false;
            long j3 = this.f6126;
            if (j3 > 0) {
                this.f6124 = (j - j3) + this.f6124;
            }
        }
        if (!this.f6131) {
            if (this.f6124 > j && this.f6125 == -1.0f) {
                return false;
            }
            this.f6131 = true;
            m3629();
        }
        if (this.f6130 < 0 && this.f6125 >= 0.0f) {
            this.f6124 = j - ((long) (m3627() * this.f6125));
            this.f6125 = -1.0f;
        }
        this.f6130 = j;
        long jMax = Math.max(j, this.f6124);
        if (this.f6131) {
            long jM3627 = m3627();
            float f3 = jM3627 > 0 ? (jMax - this.f6124) / jM3627 : 1.0f;
            boolean z2 = ((int) f3) > ((int) this.f6129);
            int i = this.f6138;
            boolean z3 = f3 >= ((float) (i + 1)) && i != -1;
            if (jM3627 != 0) {
                if (z2 && !z3) {
                    ArrayList<AbstractC1802.InterfaceC1803> arrayList = this.f6045;
                    if (arrayList != null) {
                        int size = arrayList.size();
                        for (int i2 = 0; i2 < size; i2++) {
                            this.f6045.get(i2).mo1551(this);
                        }
                    }
                } else if (z3) {
                    z = true;
                }
                float fM3623 = m3623(f3);
                this.f6129 = fM3623;
                mo3603(m3619(fM3623, this.f6128));
            }
        }
        if (z) {
            m3625();
        }
        return z;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ؠ */
    public void mo3557() {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        if (!this.f6131) {
            m3629();
            this.f6132 = true;
        } else if (!this.f6134) {
            mo3605();
        }
        mo3603(m3621(this.f6138, this.f6128) ? 0.0f : 1.0f);
        m3625();
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ؠ */
    public void mo3559(boolean z) {
        this.f6141 = true;
        if (z) {
            mo3568();
        } else {
            mo3569();
        }
        this.f6141 = false;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ؠ */
    public boolean mo3560(long j) {
        if (this.f6140) {
            return false;
        }
        return mo3547(j);
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ހ */
    public long mo3561() {
        return this.f6136;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ހ */
    public C1829 mo3562(long j) {
        if (j < 0) {
            throw new IllegalArgumentException(C2803.m4874("Animators cannot have negative duration: ", j));
        }
        this.f6136 = j;
        return this;
    }

    /* JADX INFO: renamed from: ހ */
    public void mo3603(float f) {
        float interpolation = this.f6142.getInterpolation(f);
        int length = this.f6143.length;
        for (int i = 0; i < length; i++) {
            this.f6143[i].mo3616(interpolation);
        }
        ArrayList<AbstractC1802.InterfaceC1804> arrayList = this.f6047;
        if (arrayList != null) {
            int size = arrayList.size();
            for (int i2 = 0; i2 < size; i2++) {
                this.f6047.get(i2).mo1547(this);
            }
        }
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final void m3622(boolean z) {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        this.f6128 = z;
        this.f6140 = !this.f6141;
        if (z) {
            float f = this.f6125;
            if (f != -1.0f && f != 0.0f) {
                if (this.f6138 == -1) {
                    this.f6125 = 1.0f - ((float) (((double) f) - Math.floor(f)));
                } else {
                    this.f6125 = (r4 + 1) - f;
                }
            }
        }
        this.f6132 = true;
        this.f6048 = false;
        this.f6131 = false;
        this.f6135 = false;
        this.f6130 = -1L;
        this.f6124 = -1L;
        if (this.f6137 == 0 || this.f6125 >= 0.0f || this.f6128) {
            m3629();
            float f2 = this.f6125;
            if (f2 == -1.0f) {
                long j = this.f6136;
                m3624(j > 0 ? 0 / j : 1.0f);
            } else {
                m3624(f2);
            }
        }
        if (this.f6140) {
            AbstractC1802.m3552(this);
        }
    }

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

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ށ */
    public long mo3563() {
        return this.f6137;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ނ */
    public long mo3564() {
        int i = this.f6138;
        if (i == -1) {
            return -1L;
        }
        return (this.f6136 * ((long) (i + 1))) + this.f6137;
    }

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public void m3624(float f) {
        mo3605();
        float fM3623 = m3623(f);
        if (this.f6130 >= 0) {
            this.f6124 = AnimationUtils.currentAnimationTimeMillis() - ((long) (m3627() * fM3623));
        } else {
            this.f6125 = fM3623;
        }
        this.f6129 = fM3623;
        mo3603(m3619(fM3623, this.f6128));
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ކ */
    public boolean mo3565() {
        return this.f6134;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: އ */
    public boolean mo3566() {
        return this.f6131;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ވ */
    public boolean mo3567() {
        return this.f6132;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: މ */
    public void mo3568() {
        if (this.f6130 >= 0) {
            long jCurrentAnimationTimeMillis = AnimationUtils.currentAnimationTimeMillis();
            this.f6124 = jCurrentAnimationTimeMillis - (m3627() - (jCurrentAnimationTimeMillis - this.f6124));
            this.f6128 = !this.f6128;
        } else if (!this.f6132) {
            m3622(true);
        } else {
            this.f6128 = !this.f6128;
            mo3557();
        }
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ފ */
    public void mo3569() {
        m3622(false);
    }

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public final void m3625() {
        ArrayList<AbstractC1802.InterfaceC1803> arrayList;
        if (this.f6135) {
            return;
        }
        if (this.f6140) {
            C1796.m3541().m3544(this);
        }
        this.f6135 = true;
        this.f6048 = false;
        boolean z = (this.f6132 || this.f6131) && this.f6045 != null;
        if (z && !this.f6131) {
            m3628();
        }
        this.f6131 = false;
        this.f6132 = false;
        this.f6133 = false;
        this.f6130 = -1L;
        this.f6124 = -1L;
        if (z && (arrayList = this.f6045) != null) {
            ArrayList arrayList2 = (ArrayList) arrayList.clone();
            int size = arrayList2.size();
            for (int i = 0; i < size; i++) {
                ((AbstractC1802.InterfaceC1803) arrayList2.get(i)).mo1548(this, this.f6128);
            }
        }
        this.f6128 = false;
        C1882.m3702();
    }

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public Object m3626() {
        C1826[] c1826Arr = this.f6143;
        if (c1826Arr == null || c1826Arr.length <= 0) {
            return null;
        }
        return c1826Arr[0].mo3615();
    }

    /* JADX INFO: renamed from: ލ */
    public String mo3604() {
        String str = this.f6146;
        return str == null ? "animator" : str;
    }

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public final long m3627() {
        float f = this.f6136;
        float f2 = this.f6145;
        if (f2 < 0.0f) {
            f2 = f6122;
        }
        return (long) (f * f2);
    }

    /* JADX INFO: renamed from: ޏ */
    public void mo3605() {
        if (this.f6134) {
            return;
        }
        int length = this.f6143.length;
        for (int i = 0; i < length; i++) {
            C1826 c1826 = this.f6143[i];
            if (c1826.f6117 == null) {
                Class<?> cls = c1826.f6114;
                c1826.f6117 = cls == Integer.class ? C1817.f6091 : cls == Float.class ? C1814.f6090 : null;
            }
            InterfaceC1828 interfaceC1828 = c1826.f6117;
            if (interfaceC1828 != null) {
                c1826.f6115.mo3599(interfaceC1828);
            }
        }
        this.f6134 = true;
    }

    /* JADX INFO: renamed from: ޑ, reason: contains not printable characters */
    public final void m3628() {
        ArrayList<AbstractC1802.InterfaceC1803> arrayList = this.f6045;
        if (arrayList != null && !this.f6133) {
            ArrayList arrayList2 = (ArrayList) arrayList.clone();
            int size = arrayList2.size();
            for (int i = 0; i < size; i++) {
                ((AbstractC1802.InterfaceC1803) arrayList2.get(i)).mo1550(this, this.f6128);
            }
        }
        this.f6133 = true;
    }

    /* JADX INFO: renamed from: ޒ, reason: contains not printable characters */
    public final void m3629() {
        C1882.m3703(mo3604());
        this.f6135 = false;
        mo3605();
        this.f6131 = true;
        float f = this.f6125;
        if (f >= 0.0f) {
            this.f6129 = f;
        } else {
            this.f6129 = 0.0f;
        }
        if (this.f6045 != null) {
            m3628();
        }
    }
}
