package X6FRs_4.JZJr_16;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.animation.TimeInterpolator;
import android.view.View;
/* compiled from: TranslationAnimationCreator.java */
/* loaded from: classes.dex */
public class G83uNX_24 {

    /* compiled from: TranslationAnimationCreator.java */
    /* loaded from: classes.dex */
    public static class KQgRr5e_0 extends AnimatorListenerAdapter {
        public float KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final int f560KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final View f561KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public int[] f562KQgRr5e_0;

        /* renamed from: Mqv2r_3  reason: collision with root package name */
        public final float f3128Mqv2r_3;
        public final float PGPF6hQ_2;
        public float QxJ9d_1;

        /* renamed from: QxJ9d_1  reason: collision with other field name */
        public final int f563QxJ9d_1;

        /* renamed from: QxJ9d_1  reason: collision with other field name */
        public final View f564QxJ9d_1;

        public KQgRr5e_0(View view, View view2, int i, int i2, float f, float f2) {
            this.f564QxJ9d_1 = view;
            this.f561KQgRr5e_0 = view2;
            this.f560KQgRr5e_0 = i - Math.round(view.getTranslationX());
            this.f563QxJ9d_1 = i2 - Math.round(this.f564QxJ9d_1.getTranslationY());
            this.PGPF6hQ_2 = f;
            this.f3128Mqv2r_3 = f2;
            int[] iArr = (int[]) this.f561KQgRr5e_0.getTag(WwEq_13.transition_position);
            this.f562KQgRr5e_0 = iArr;
            if (iArr != null) {
                this.f561KQgRr5e_0.setTag(WwEq_13.transition_position, null);
            }
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationCancel(Animator animator) {
            if (this.f562KQgRr5e_0 == null) {
                this.f562KQgRr5e_0 = new int[2];
            }
            this.f562KQgRr5e_0[0] = Math.round(this.f560KQgRr5e_0 + this.f564QxJ9d_1.getTranslationX());
            this.f562KQgRr5e_0[1] = Math.round(this.f563QxJ9d_1 + this.f564QxJ9d_1.getTranslationY());
            this.f561KQgRr5e_0.setTag(WwEq_13.transition_position, this.f562KQgRr5e_0);
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationEnd(Animator animator) {
            this.f564QxJ9d_1.setTranslationX(this.PGPF6hQ_2);
            this.f564QxJ9d_1.setTranslationY(this.f3128Mqv2r_3);
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorPauseListener
        public void onAnimationPause(Animator animator) {
            this.KQgRr5e_0 = this.f564QxJ9d_1.getTranslationX();
            this.QxJ9d_1 = this.f564QxJ9d_1.getTranslationY();
            this.f564QxJ9d_1.setTranslationX(this.PGPF6hQ_2);
            this.f564QxJ9d_1.setTranslationY(this.f3128Mqv2r_3);
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorPauseListener
        public void onAnimationResume(Animator animator) {
            this.f564QxJ9d_1.setTranslationX(this.KQgRr5e_0);
            this.f564QxJ9d_1.setTranslationY(this.QxJ9d_1);
        }
    }

    public static Animator KQgRr5e_0(View view, H5YG8fq_22 h5YG8fq_22, int i, int i2, float f, float f2, float f3, float f4, TimeInterpolator timeInterpolator) {
        float f5;
        float f6;
        float translationX = view.getTranslationX();
        float translationY = view.getTranslationY();
        int[] iArr = (int[]) h5YG8fq_22.KQgRr5e_0.getTag(WwEq_13.transition_position);
        if (iArr != null) {
            f5 = (iArr[0] - i) + translationX;
            f6 = (iArr[1] - i2) + translationY;
        } else {
            f5 = f;
            f6 = f2;
        }
        int round = i + Math.round(f5 - translationX);
        int round2 = i2 + Math.round(f6 - translationY);
        view.setTranslationX(f5);
        view.setTranslationY(f6);
        if (f5 == f3 && f6 == f4) {
            return null;
        }
        ObjectAnimator ofPropertyValuesHolder = ObjectAnimator.ofPropertyValuesHolder(view, PropertyValuesHolder.ofFloat(View.TRANSLATION_X, f5, f3), PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, f6, f4));
        KQgRr5e_0 kQgRr5e_0 = new KQgRr5e_0(view, h5YG8fq_22.KQgRr5e_0, round, round2, translationX, translationY);
        ofPropertyValuesHolder.addListener(kQgRr5e_0);
        X6FRs_4.JZJr_16.KQgRr5e_0.KQgRr5e_0(ofPropertyValuesHolder, kQgRr5e_0);
        ofPropertyValuesHolder.setInterpolator(timeInterpolator);
        return ofPropertyValuesHolder;
    }
}
