package ῲ.㑃.K;

import android.os.Looper;
import android.util.AndroidRuntimeException;
import ῲ.㑃.K.AbstractC2212;

/* renamed from: ῲ.㑃.K.ඓ  reason: contains not printable characters */
/* compiled from: SpringAnimation */
public final class C2211 extends AbstractC2212<C2211> {

    /* renamed from: Ԛ  reason: contains not printable characters */
    public boolean f7682 = false;

    /* renamed from: ݜ  reason: contains not printable characters */
    public C2237 f7683 = null;

    /* renamed from: 䀟  reason: contains not printable characters */
    public float f7684 = Float.MAX_VALUE;

    public <K> C2211(K k, AbstractC2209<K> r2) {
        super(k, r2);
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public void m5838(float f) {
        if (m5844()) {
            this.f7684 = f;
            return;
        }
        if (this.f7683 == null) {
            this.f7683 = new C2237(f);
        }
        this.f7683.f7719 = (double) f;
        m5842();
    }

    @Override // ῲ.㑃.K.AbstractC2212
    /* renamed from: ῲ  reason: contains not printable characters */
    public boolean m5839(long j) {
        if (this.f7682) {
            float f = this.f7684;
            if (f != Float.MAX_VALUE) {
                this.f7683.f7719 = (double) f;
                this.f7684 = Float.MAX_VALUE;
            }
            this.f7695 = (float) this.f7683.f7719;
            this.f7697 = 0.0f;
            this.f7682 = false;
            return true;
        }
        if (this.f7684 != Float.MAX_VALUE) {
            C2237 r6 = this.f7683;
            double d = r6.f7719;
            long j2 = j / 2;
            AbstractC2212.C2224 r1 = r6.m5862((double) this.f7695, (double) this.f7697, j2);
            C2237 r13 = this.f7683;
            r13.f7719 = (double) this.f7684;
            this.f7684 = Float.MAX_VALUE;
            AbstractC2212.C2224 r12 = r13.m5862((double) r1.f7704, (double) r1.f7703, j2);
            this.f7695 = r12.f7704;
            this.f7697 = r12.f7703;
        } else {
            AbstractC2212.C2224 r14 = this.f7683.m5862((double) this.f7695, (double) this.f7697, j);
            this.f7695 = r14.f7704;
            this.f7697 = r14.f7703;
        }
        this.f7695 = Math.max(this.f7695, this.f7702);
        this.f7695 = Math.min(this.f7695, this.f7696);
        if (!m5841(this.f7695, this.f7697)) {
            return false;
        }
        this.f7695 = (float) this.f7683.f7719;
        this.f7697 = 0.0f;
        return true;
    }

    /* renamed from: K  reason: contains not printable characters */
    public C2211 m5840(C2237 r1) {
        this.f7683 = r1;
        return this;
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public void m5842() {
        C2237 r0 = this.f7683;
        if (r0 != null) {
            double d = (double) ((float) r0.f7719);
            if (d > ((double) this.f7696)) {
                throw new UnsupportedOperationException("Final position of the spring cannot be greater than the max value.");
            } else if (d >= ((double) this.f7702)) {
                r0.m5864((double) m5845());
                if (Looper.myLooper() == Looper.getMainLooper()) {
                    boolean z = this.f7700;
                    if (!z && !z) {
                        this.f7700 = true;
                        if (!this.f7691) {
                            this.f7695 = this.f7692.getValue(this.f7701);
                        }
                        float f = this.f7695;
                        if (f > this.f7696 || f < this.f7702) {
                            throw new IllegalArgumentException("Starting value need to be in between min value and max value");
                        }
                        C2231 r02 = C2231.m5854();
                        if (r02.f7708.size() == 0) {
                            r02.m5855().m5857();
                        }
                        if (!r02.f7708.contains(this)) {
                            r02.f7708.add(this);
                            return;
                        }
                        return;
                    }
                    return;
                }
                throw new AndroidRuntimeException("Animations may only be started on the main thread");
            } else {
                throw new UnsupportedOperationException("Final position of the spring cannot be less than the min value.");
            }
        } else {
            throw new UnsupportedOperationException("Incomplete SpringAnimation: Either final position or a spring force needs to be set.");
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m5841(float f, float f2) {
        return this.f7683.m5865(f, f2);
    }
}
