package o;

import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.graphics.PointF;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewGroup;
import java.util.HashMap;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.Wg, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C0577Wg extends AbstractC3019yg0 {
    public static final String[] M = {"android:changeBounds:bounds", "android:changeBounds:clip", "android:changeBounds:parent", "android:changeBounds:windowX", "android:changeBounds:windowY"};
    public static final C0473Sg N = new C0473Sg("topLeft", 0, PointF.class);
    public static final C0473Sg O = new C0473Sg("bottomRight", 1, PointF.class);
    public static final C0473Sg P = new C0473Sg("bottomRight", 2, PointF.class);
    public static final C0473Sg Q = new C0473Sg("topLeft", 3, PointF.class);
    public static final C0473Sg R = new C0473Sg("position", 4, PointF.class);

    public static void K(Ng0 ng0) {
        View view = ng0.b;
        HashMap map = ng0.a;
        if (!view.isLaidOut() && view.getWidth() == 0 && view.getHeight() == 0) {
            return;
        }
        map.put("android:changeBounds:bounds", new Rect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom()));
        map.put("android:changeBounds:parent", view.getParent());
    }

    @Override // o.AbstractC3019yg0
    public final void e(Ng0 ng0) {
        K(ng0);
    }

    @Override // o.AbstractC3019yg0
    public final void h(Ng0 ng0) {
        K(ng0);
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // o.AbstractC3019yg0
    public final Animator l(ViewGroup viewGroup, Ng0 ng0, Ng0 ng02) {
        int i;
        C0577Wg c0577Wg;
        ObjectAnimator objectAnimatorA;
        if (ng0 != null) {
            HashMap map = ng0.a;
            if (ng02 != null) {
                HashMap map2 = ng02.a;
                ViewGroup viewGroup2 = (ViewGroup) map.get("android:changeBounds:parent");
                ViewGroup viewGroup3 = (ViewGroup) map2.get("android:changeBounds:parent");
                if (viewGroup2 != null && viewGroup3 != null) {
                    View view = ng02.b;
                    Rect rect = (Rect) map.get("android:changeBounds:bounds");
                    Rect rect2 = (Rect) map2.get("android:changeBounds:bounds");
                    int i2 = rect.left;
                    int i3 = rect2.left;
                    int i4 = rect.top;
                    int i5 = rect2.top;
                    int i6 = rect.right;
                    int i7 = rect2.right;
                    int i8 = rect.bottom;
                    int i9 = rect2.bottom;
                    int i10 = i6 - i2;
                    int i11 = i8 - i4;
                    int i12 = i7 - i3;
                    int i13 = i9 - i5;
                    Rect rect3 = (Rect) map.get("android:changeBounds:clip");
                    Rect rect4 = (Rect) map2.get("android:changeBounds:clip");
                    if ((i10 == 0 || i11 == 0) && (i12 == 0 || i13 == 0)) {
                        i = 0;
                    } else {
                        i = (i2 == i3 && i4 == i5) ? 0 : 1;
                        if (i6 != i7 || i8 != i9) {
                            i++;
                        }
                    }
                    if ((rect3 != null && !rect3.equals(rect4)) || (rect3 == null && rect4 != null)) {
                        i++;
                    }
                    int i14 = i;
                    if (i14 > 0) {
                        AbstractC2362rk0.a(view, i2, i4, i6, i8);
                        if (i14 != 2) {
                            c0577Wg = this;
                            if (i2 == i3 && i4 == i5) {
                                c0577Wg.H.getClass();
                                objectAnimatorA = AbstractC0811bT.a(view, P, C2616uQ.t(i6, i8, i7, i9));
                            } else {
                                c0577Wg.H.getClass();
                                objectAnimatorA = AbstractC0811bT.a(view, Q, C2616uQ.t(i2, i4, i3, i5));
                            }
                        } else if (i10 == i12 && i11 == i13) {
                            c0577Wg = this;
                            c0577Wg.H.getClass();
                            objectAnimatorA = AbstractC0811bT.a(view, R, C2616uQ.t(i2, i4, i3, i5));
                        } else {
                            c0577Wg = this;
                            C0551Vg c0551Vg = new C0551Vg(view);
                            c0577Wg.H.getClass();
                            ObjectAnimator objectAnimatorA2 = AbstractC0811bT.a(c0551Vg, N, C2616uQ.t(i2, i4, i3, i5));
                            c0577Wg.H.getClass();
                            ObjectAnimator objectAnimatorA3 = AbstractC0811bT.a(c0551Vg, O, C2616uQ.t(i6, i8, i7, i9));
                            AnimatorSet animatorSet = new AnimatorSet();
                            animatorSet.playTogether(objectAnimatorA2, objectAnimatorA3);
                            animatorSet.addListener(new C0499Tg(c0551Vg));
                            objectAnimatorA = animatorSet;
                        }
                        if (view.getParent() instanceof ViewGroup) {
                            ViewGroup viewGroup4 = (ViewGroup) view.getParent();
                            AbstractC1155f00.E(viewGroup4, true);
                            c0577Wg.p().a(new C0525Ug(viewGroup4));
                        }
                        return objectAnimatorA;
                    }
                }
            }
        }
        return null;
    }

    @Override // o.AbstractC3019yg0
    public final String[] r() {
        return M;
    }
}
