package v2;

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

/* JADX INFO: renamed from: v2.e, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C3106e extends AbstractC3118q {

    /* JADX INFO: renamed from: C, reason: collision with root package name */
    public static final String[] f25322C = {"android:changeBounds:bounds", "android:changeBounds:clip", "android:changeBounds:parent", "android:changeBounds:windowX", "android:changeBounds:windowY"};

    /* JADX INFO: renamed from: D, reason: collision with root package name */
    public static final androidx.leanback.widget.z f25323D = new androidx.leanback.widget.z("topLeft", 4, PointF.class);

    /* JADX INFO: renamed from: E, reason: collision with root package name */
    public static final androidx.leanback.widget.z f25324E = new androidx.leanback.widget.z("bottomRight", 5, PointF.class);

    /* JADX INFO: renamed from: F, reason: collision with root package name */
    public static final androidx.leanback.widget.z f25325F = new androidx.leanback.widget.z("bottomRight", 6, PointF.class);

    /* JADX INFO: renamed from: G, reason: collision with root package name */
    public static final androidx.leanback.widget.z f25326G = new androidx.leanback.widget.z("topLeft", 7, PointF.class);

    /* JADX INFO: renamed from: H, reason: collision with root package name */
    public static final androidx.leanback.widget.z f25327H = new androidx.leanback.widget.z("position", 8, PointF.class);

    public static void J(C3126y c3126y) {
        View view = c3126y.f25392b;
        if (!view.isLaidOut() && view.getWidth() == 0 && view.getHeight() == 0) {
            return;
        }
        HashMap map = c3126y.f25391a;
        map.put("android:changeBounds:bounds", new Rect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom()));
        map.put("android:changeBounds:parent", c3126y.f25392b.getParent());
    }

    @Override // v2.AbstractC3118q
    public final void d(C3126y c3126y) {
        J(c3126y);
    }

    @Override // v2.AbstractC3118q
    public final void h(C3126y c3126y) {
        J(c3126y);
    }

    @Override // v2.AbstractC3118q
    public final Animator l(ViewGroup viewGroup, C3126y c3126y, C3126y c3126y2) {
        int i6;
        C3106e c3106e;
        Animator animatorOfObject;
        if (c3126y != null && c3126y2 != null) {
            HashMap map = c3126y.f25391a;
            HashMap map2 = c3126y2.f25391a;
            ViewGroup viewGroup2 = (ViewGroup) map.get("android:changeBounds:parent");
            ViewGroup viewGroup3 = (ViewGroup) map2.get("android:changeBounds:parent");
            if (viewGroup2 != null && viewGroup3 != null) {
                Rect rect = (Rect) map.get("android:changeBounds:bounds");
                Rect rect2 = (Rect) map2.get("android:changeBounds:bounds");
                int i7 = rect.left;
                int i8 = rect2.left;
                int i9 = rect.top;
                int i10 = rect2.top;
                int i11 = rect.right;
                int i12 = rect2.right;
                int i13 = rect.bottom;
                int i14 = rect2.bottom;
                int i15 = i11 - i7;
                int i16 = i13 - i9;
                int i17 = i12 - i8;
                int i18 = i14 - i10;
                Rect rect3 = (Rect) map.get("android:changeBounds:clip");
                Rect rect4 = (Rect) map2.get("android:changeBounds:clip");
                if ((i15 == 0 || i16 == 0) && (i17 == 0 || i18 == 0)) {
                    i6 = 0;
                } else {
                    i6 = (i7 == i8 && i9 == i10) ? 0 : 1;
                    if (i11 != i12 || i13 != i14) {
                        i6++;
                    }
                }
                if ((rect3 != null && !rect3.equals(rect4)) || (rect3 == null && rect4 != null)) {
                    i6++;
                }
                if (i6 > 0) {
                    View view = c3126y2.f25392b;
                    AbstractC3127z.a(view, i7, i9, i11, i13);
                    if (i6 != 2) {
                        c3106e = this;
                        if (i7 == i8 && i9 == i10) {
                            c3106e.f25375x.getClass();
                            animatorOfObject = ObjectAnimator.ofObject(view, f25325F, (TypeConverter) null, C1134i.r(i11, i13, i12, i14));
                        } else {
                            c3106e.f25375x.getClass();
                            animatorOfObject = ObjectAnimator.ofObject(view, f25326G, (TypeConverter) null, C1134i.r(i7, i9, i8, i10));
                        }
                    } else if (i15 == i17 && i16 == i18) {
                        c3106e = this;
                        c3106e.f25375x.getClass();
                        animatorOfObject = ObjectAnimator.ofObject(view, f25327H, (TypeConverter) null, C1134i.r(i7, i9, i8, i10));
                    } else {
                        c3106e = this;
                        C3105d c3105d = new C3105d(view);
                        c3106e.f25375x.getClass();
                        ObjectAnimator objectAnimatorOfObject = ObjectAnimator.ofObject(c3105d, f25323D, (TypeConverter) null, C1134i.r(i7, i9, i8, i10));
                        c3106e.f25375x.getClass();
                        ObjectAnimator objectAnimatorOfObject2 = ObjectAnimator.ofObject(c3105d, f25324E, (TypeConverter) null, C1134i.r(i11, i13, i12, i14));
                        AnimatorSet animatorSet = new AnimatorSet();
                        animatorSet.playTogether(objectAnimatorOfObject, objectAnimatorOfObject2);
                        animatorSet.addListener(new C3103b(c3105d));
                        animatorOfObject = animatorSet;
                    }
                    if (view.getParent() instanceof ViewGroup) {
                        ViewGroup viewGroup4 = (ViewGroup) view.getParent();
                        m1.g.p(viewGroup4, true);
                        c3106e.p().a(new C3104c(viewGroup4));
                    }
                    return animatorOfObject;
                }
            }
        }
        return null;
    }

    @Override // v2.AbstractC3118q
    public final String[] r() {
        return f25322C;
    }
}
