package ඓ.㴹.ʬ.K;

import android.graphics.Camera;
import android.graphics.Matrix;
import android.graphics.RectF;
import android.os.Build;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Transformation;
import java.lang.ref.WeakReference;
import java.util.WeakHashMap;

/* renamed from: ඓ.㴹.ʬ.K.K  reason: contains not printable characters */
/* compiled from: AnimatorProxy */
public final class C1316 extends Animation {

    /* renamed from: ݜ  reason: contains not printable characters */
    public static final WeakHashMap<View, C1316> f5099 = new WeakHashMap<>();

    /* renamed from: 㗽  reason: contains not printable characters */
    public static final boolean f5100 = (Integer.valueOf(Build.VERSION.SDK).intValue() < 11);

    /* renamed from: ʬ  reason: contains not printable characters */
    public final Camera f5101 = new Camera();

    /* renamed from: Ԕ  reason: contains not printable characters */
    public float f5102;

    /* renamed from: ؿ  reason: contains not printable characters */
    public final RectF f5103 = new RectF();

    /* renamed from: ඓ  reason: contains not printable characters */
    public float f5104 = 1.0f;

    /* renamed from: ᓣ  reason: contains not printable characters */
    public final Matrix f5105 = new Matrix();

    /* renamed from: ᕣ  reason: contains not printable characters */
    public float f5106 = 1.0f;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public float f5107;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final WeakReference<View> f5108;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public float f5109;

    /* renamed from: 㑃  reason: contains not printable characters */
    public float f5110 = 1.0f;

    /* renamed from: 㗗  reason: contains not printable characters */
    public final RectF f5111 = new RectF();

    /* renamed from: 㳳  reason: contains not printable characters */
    public float f5112;

    /* renamed from: 㴹  reason: contains not printable characters */
    public float f5113;

    /* renamed from: 㸾  reason: contains not printable characters */
    public boolean f5114;

    /* renamed from: 㿎  reason: contains not printable characters */
    public float f5115;

    /* renamed from: 䁗  reason: contains not printable characters */
    public float f5116;

    public C1316(View view) {
        setDuration(0);
        setFillAfter(true);
        view.setAnimation(this);
        this.f5108 = new WeakReference<>(view);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static C1316 m3441(View view) {
        C1316 k = f5099.get(view);
        if (k != null && k == view.getAnimation()) {
            return k;
        }
        C1316 k2 = new C1316(view);
        f5099.put(view, k2);
        return k2;
    }

    public void applyTransformation(float f, Transformation transformation) {
        View view = this.f5108.get();
        if (view != null) {
            transformation.setAlpha(this.f5104);
            m3446(transformation.getMatrix(), view);
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public void m3443(float f) {
        if (this.f5102 != f) {
            m3442();
            this.f5102 = f;
            m3444();
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public final void m3442() {
        View view = this.f5108.get();
        if (view != null) {
            m3447(this.f5111, view);
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m3445(float f) {
        if (this.f5116 != f) {
            m3442();
            this.f5116 = f;
            m3444();
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m3444() {
        View view = this.f5108.get();
        if (view != null && view.getParent() != null) {
            RectF rectF = this.f5103;
            m3447(rectF, view);
            rectF.union(this.f5111);
            ((View) view.getParent()).invalidate((int) Math.floor((double) rectF.left), (int) Math.floor((double) rectF.top), (int) Math.ceil((double) rectF.right), (int) Math.ceil((double) rectF.bottom));
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m3447(RectF rectF, View view) {
        rectF.set(0.0f, 0.0f, (float) view.getWidth(), (float) view.getHeight());
        Matrix matrix = this.f5105;
        matrix.reset();
        m3446(matrix, view);
        this.f5105.mapRect(rectF);
        rectF.offset((float) view.getLeft(), (float) view.getTop());
        float f = rectF.right;
        float f2 = rectF.left;
        if (f < f2) {
            rectF.right = f2;
            rectF.left = f;
        }
        float f3 = rectF.bottom;
        float f4 = rectF.top;
        if (f3 < f4) {
            rectF.top = f3;
            rectF.bottom = f4;
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m3446(Matrix matrix, View view) {
        float width = (float) view.getWidth();
        float height = (float) view.getHeight();
        boolean z = this.f5114;
        float f = z ? this.f5113 : width / 2.0f;
        float f2 = z ? this.f5109 : height / 2.0f;
        float f3 = this.f5115;
        float f4 = this.f5107;
        float f5 = this.f5112;
        if (!(f3 == 0.0f && f4 == 0.0f && f5 == 0.0f)) {
            Camera camera = this.f5101;
            camera.save();
            camera.rotateX(f3);
            camera.rotateY(f4);
            camera.rotateZ(-f5);
            camera.getMatrix(matrix);
            camera.restore();
            matrix.preTranslate(-f, -f2);
            matrix.postTranslate(f, f2);
        }
        float f6 = this.f5106;
        float f7 = this.f5110;
        if (!(f6 == 1.0f && f7 == 1.0f)) {
            matrix.postScale(f6, f7);
            matrix.postTranslate(((f6 * width) - width) * (-(f / width)), ((f7 * height) - height) * (-(f2 / height)));
        }
        matrix.postTranslate(this.f5116, this.f5102);
    }
}
