package p037.p118;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.animation.TypeConverter;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.util.Property;
import android.view.View;
import android.view.ViewGroup;
import java.util.Map;
import p037.p041.p042.LayoutInflaterFactory2C1494;
import p037.p065.p078.C1920;

/* JADX INFO: renamed from: މ.ޔ.ؠ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C2459 extends AbstractC2485 {

    /* JADX INFO: renamed from: ࢢ, reason: contains not printable characters */
    public static final String[] f7758 = {"android:changeBounds:bounds", "android:changeBounds:clip", "android:changeBounds:parent", "android:changeBounds:windowX", "android:changeBounds:windowY"};

    /* JADX INFO: renamed from: ࢣ, reason: contains not printable characters */
    public static final Property<Drawable, PointF> f7759 = new C2461(PointF.class, "boundsOrigin");

    /* JADX INFO: renamed from: ࢤ, reason: contains not printable characters */
    public static final Property<C2470, PointF> f7760 = new C2462(PointF.class, "topLeft");

    /* JADX INFO: renamed from: ࢥ, reason: contains not printable characters */
    public static final Property<C2470, PointF> f7761 = new C2463(PointF.class, "bottomRight");

    /* JADX INFO: renamed from: ࢦ, reason: contains not printable characters */
    public static final Property<View, PointF> f7762 = new C2464(PointF.class, "bottomRight");

    /* JADX INFO: renamed from: ࢧ, reason: contains not printable characters */
    public static final Property<View, PointF> f7763 = new C2465(PointF.class, "topLeft");

    /* JADX INFO: renamed from: ࢨ, reason: contains not printable characters */
    public static final Property<View, PointF> f7764 = new C2466(PointF.class, "position");

    /* JADX INFO: renamed from: ࢩ, reason: contains not printable characters */
    public static C2483 f7765 = new C2483();

    /* JADX INFO: renamed from: ޥ, reason: contains not printable characters */
    public int[] f7766 = new int[2];

    /* JADX INFO: renamed from: ޱ, reason: contains not printable characters */
    public boolean f7767 = false;

    /* JADX INFO: renamed from: ࢠ, reason: contains not printable characters */
    public boolean f7768 = false;

    /* JADX INFO: renamed from: މ.ޔ.ؠ$֏, reason: contains not printable characters */
    public class C2460 extends AnimatorListenerAdapter {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final /* synthetic */ ViewGroup f7769;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final /* synthetic */ BitmapDrawable f7770;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final /* synthetic */ View f7771;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public final /* synthetic */ float f7772;

        public C2460(C2459 c2459, ViewGroup viewGroup, BitmapDrawable bitmapDrawable, View view, float f) {
            this.f7769 = viewGroup;
            this.f7770 = bitmapDrawable;
            this.f7771 = view;
            this.f7772 = f;
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationEnd(Animator animator) {
            InterfaceC2505 interfaceC2505M4580 = C2506.m4580(this.f7769);
            ((C2504) interfaceC2505M4580).f7870.remove(this.f7770);
            C2506.f7871.mo4585(this.f7771, this.f7772);
        }
    }

    /* JADX INFO: renamed from: މ.ޔ.ؠ$ؠ, reason: contains not printable characters */
    public static class C2461 extends Property<Drawable, PointF> {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public Rect f7773;

        public C2461(Class cls, String str) {
            super(cls, str);
            this.f7773 = new Rect();
        }

        @Override // android.util.Property
        public PointF get(Drawable drawable) {
            drawable.copyBounds(this.f7773);
            Rect rect = this.f7773;
            return new PointF(rect.left, rect.top);
        }

        @Override // android.util.Property
        public void set(Drawable drawable, PointF pointF) {
            Drawable drawable2 = drawable;
            PointF pointF2 = pointF;
            drawable2.copyBounds(this.f7773);
            this.f7773.offsetTo(Math.round(pointF2.x), Math.round(pointF2.y));
            drawable2.setBounds(this.f7773);
        }
    }

    /* JADX INFO: renamed from: މ.ޔ.ؠ$ހ, reason: contains not printable characters */
    public static class C2462 extends Property<C2470, PointF> {
        public C2462(Class cls, String str) {
            super(cls, str);
        }

        @Override // android.util.Property
        public PointF get(C2470 c2470) {
            return null;
        }

        @Override // android.util.Property
        public void set(C2470 c2470, PointF pointF) {
            C2470 c24702 = c2470;
            PointF pointF2 = pointF;
            if (c24702 == null) {
                throw null;
            }
            c24702.f7784 = Math.round(pointF2.x);
            int iRound = Math.round(pointF2.y);
            c24702.f7785 = iRound;
            int i = c24702.f7789 + 1;
            c24702.f7789 = i;
            if (i == c24702.f7790) {
                C2506.m4581(c24702.f7788, c24702.f7784, iRound, c24702.f7786, c24702.f7787);
                c24702.f7789 = 0;
                c24702.f7790 = 0;
            }
        }
    }

    /* JADX INFO: renamed from: މ.ޔ.ؠ$ށ, reason: contains not printable characters */
    public static class C2463 extends Property<C2470, PointF> {
        public C2463(Class cls, String str) {
            super(cls, str);
        }

        @Override // android.util.Property
        public PointF get(C2470 c2470) {
            return null;
        }

        @Override // android.util.Property
        public void set(C2470 c2470, PointF pointF) {
            C2470 c24702 = c2470;
            PointF pointF2 = pointF;
            if (c24702 == null) {
                throw null;
            }
            c24702.f7786 = Math.round(pointF2.x);
            int iRound = Math.round(pointF2.y);
            c24702.f7787 = iRound;
            int i = c24702.f7790 + 1;
            c24702.f7790 = i;
            if (c24702.f7789 == i) {
                C2506.m4581(c24702.f7788, c24702.f7784, c24702.f7785, c24702.f7786, iRound);
                c24702.f7789 = 0;
                c24702.f7790 = 0;
            }
        }
    }

    /* JADX INFO: renamed from: މ.ޔ.ؠ$ނ, reason: contains not printable characters */
    public static class C2464 extends Property<View, PointF> {
        public C2464(Class cls, String str) {
            super(cls, str);
        }

        @Override // android.util.Property
        public PointF get(View view) {
            return null;
        }

        @Override // android.util.Property
        public void set(View view, PointF pointF) {
            View view2 = view;
            PointF pointF2 = pointF;
            C2506.m4581(view2, view2.getLeft(), view2.getTop(), Math.round(pointF2.x), Math.round(pointF2.y));
        }
    }

    /* JADX INFO: renamed from: މ.ޔ.ؠ$ރ, reason: contains not printable characters */
    public static class C2465 extends Property<View, PointF> {
        public C2465(Class cls, String str) {
            super(cls, str);
        }

        @Override // android.util.Property
        public PointF get(View view) {
            return null;
        }

        @Override // android.util.Property
        public void set(View view, PointF pointF) {
            View view2 = view;
            PointF pointF2 = pointF;
            C2506.m4581(view2, Math.round(pointF2.x), Math.round(pointF2.y), view2.getRight(), view2.getBottom());
        }
    }

    /* JADX INFO: renamed from: މ.ޔ.ؠ$ބ, reason: contains not printable characters */
    public static class C2466 extends Property<View, PointF> {
        public C2466(Class cls, String str) {
            super(cls, str);
        }

        @Override // android.util.Property
        public PointF get(View view) {
            return null;
        }

        @Override // android.util.Property
        public void set(View view, PointF pointF) {
            View view2 = view;
            PointF pointF2 = pointF;
            int iRound = Math.round(pointF2.x);
            int iRound2 = Math.round(pointF2.y);
            C2506.m4581(view2, iRound, iRound2, view2.getWidth() + iRound, view2.getHeight() + iRound2);
        }
    }

    /* JADX INFO: renamed from: މ.ޔ.ؠ$ޅ, reason: contains not printable characters */
    public class C2467 extends AnimatorListenerAdapter {
        public C2470 mViewBounds;

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final /* synthetic */ C2470 f7774;

        public C2467(C2459 c2459, C2470 c2470) {
            this.f7774 = c2470;
            this.mViewBounds = this.f7774;
        }
    }

    /* JADX INFO: renamed from: މ.ޔ.ؠ$ކ, reason: contains not printable characters */
    public class C2468 extends AnimatorListenerAdapter {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public boolean f7775;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final /* synthetic */ View f7776;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final /* synthetic */ Rect f7777;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public final /* synthetic */ int f7778;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public final /* synthetic */ int f7779;

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public final /* synthetic */ int f7780;

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public final /* synthetic */ int f7781;

        public C2468(C2459 c2459, View view, Rect rect, int i, int i2, int i3, int i4) {
            this.f7776 = view;
            this.f7777 = rect;
            this.f7778 = i;
            this.f7779 = i2;
            this.f7780 = i3;
            this.f7781 = i4;
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationCancel(Animator animator) {
            this.f7775 = true;
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationEnd(Animator animator) {
            if (this.f7775) {
                return;
            }
            C1920.m3743(this.f7776, this.f7777);
            C2506.m4581(this.f7776, this.f7778, this.f7779, this.f7780, this.f7781);
        }
    }

    /* JADX INFO: renamed from: މ.ޔ.ؠ$އ, reason: contains not printable characters */
    public class C2469 extends C2492 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public boolean f7782 = false;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final /* synthetic */ ViewGroup f7783;

        public C2469(C2459 c2459, ViewGroup viewGroup) {
            this.f7783 = viewGroup;
        }

        @Override // p037.p118.C2492, p037.p118.AbstractC2485.InterfaceC2489
        /* JADX INFO: renamed from: ؠ */
        public void mo2432(AbstractC2485 abstractC2485) {
            C2503.m4579(this.f7783, false);
            this.f7782 = true;
        }

        @Override // p037.p118.C2492, p037.p118.AbstractC2485.InterfaceC2489
        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public void mo4535(AbstractC2485 abstractC2485) {
            C2503.m4579(this.f7783, false);
        }

        @Override // p037.p118.C2492, p037.p118.AbstractC2485.InterfaceC2489
        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public void mo4536(AbstractC2485 abstractC2485) {
            C2503.m4579(this.f7783, true);
        }

        @Override // p037.p118.AbstractC2485.InterfaceC2489
        /* JADX INFO: renamed from: ނ */
        public void mo1665(AbstractC2485 abstractC2485) {
            if (!this.f7782) {
                C2503.m4579(this.f7783, false);
            }
            abstractC2485.mo4560(this);
        }
    }

    /* JADX INFO: renamed from: މ.ޔ.ؠ$ވ, reason: contains not printable characters */
    public static class C2470 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public int f7784;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public int f7785;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public int f7786;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public int f7787;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public View f7788;

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public int f7789;

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public int f7790;

        public C2470(View view) {
            this.f7788 = view;
        }
    }

    @Override // p037.p118.AbstractC2485
    /* JADX INFO: renamed from: ֏ */
    public Animator mo2514(ViewGroup viewGroup, C2501 c2501, C2501 c25012) {
        int i;
        View view;
        int i2;
        Rect rect;
        ObjectAnimator objectAnimator;
        Animator animatorM4577;
        C2501 c2501M4564;
        if (c2501 == null || c25012 == null) {
            return null;
        }
        Map<String, Object> map = c2501.f7862;
        Map<String, Object> map2 = c25012.f7862;
        ViewGroup viewGroup2 = (ViewGroup) map.get("android:changeBounds:parent");
        ViewGroup viewGroup3 = (ViewGroup) map2.get("android:changeBounds:parent");
        if (viewGroup2 == null || viewGroup3 == null) {
            return null;
        }
        View view2 = c25012.f7863;
        if (!(!this.f7768 || ((c2501M4564 = m4564(viewGroup2, true)) != null ? viewGroup3 == c2501M4564.f7863 : viewGroup2 == viewGroup3))) {
            int iIntValue = ((Integer) c2501.f7862.get("android:changeBounds:windowX")).intValue();
            int iIntValue2 = ((Integer) c2501.f7862.get("android:changeBounds:windowY")).intValue();
            int iIntValue3 = ((Integer) c25012.f7862.get("android:changeBounds:windowX")).intValue();
            int iIntValue4 = ((Integer) c25012.f7862.get("android:changeBounds:windowY")).intValue();
            if (iIntValue == iIntValue3 && iIntValue2 == iIntValue4) {
                return null;
            }
            viewGroup.getLocationInWindow(this.f7766);
            Bitmap bitmapCreateBitmap = Bitmap.createBitmap(view2.getWidth(), view2.getHeight(), Bitmap.Config.ARGB_8888);
            view2.draw(new Canvas(bitmapCreateBitmap));
            BitmapDrawable bitmapDrawable = new BitmapDrawable(bitmapCreateBitmap);
            float fM4582 = C2506.m4582(view2);
            C2506.f7871.mo4585(view2, 0.0f);
            viewGroup.getOverlay().add(bitmapDrawable);
            AbstractC2481 abstractC2481 = this.f7838;
            int[] iArr = this.f7766;
            ObjectAnimator objectAnimatorOfPropertyValuesHolder = ObjectAnimator.ofPropertyValuesHolder(bitmapDrawable, PropertyValuesHolder.ofObject(f7759, (TypeConverter) null, abstractC2481.mo4539(iIntValue - iArr[0], iIntValue2 - iArr[1], iIntValue3 - iArr[0], iIntValue4 - iArr[1])));
            objectAnimatorOfPropertyValuesHolder.addListener(new C2460(this, viewGroup, bitmapDrawable, view2, fM4582));
            return objectAnimatorOfPropertyValuesHolder;
        }
        Rect rect2 = (Rect) c2501.f7862.get("android:changeBounds:bounds");
        Rect rect3 = (Rect) c25012.f7862.get("android:changeBounds:bounds");
        int i3 = rect2.left;
        int i4 = rect3.left;
        int i5 = rect2.top;
        int i6 = rect3.top;
        int i7 = rect2.right;
        int i8 = rect3.right;
        int i9 = rect2.bottom;
        int i10 = rect3.bottom;
        int i11 = i7 - i3;
        int i12 = i9 - i5;
        int i13 = i8 - i4;
        int i14 = i10 - i6;
        Rect rect4 = (Rect) c2501.f7862.get("android:changeBounds:clip");
        Rect rect5 = (Rect) c25012.f7862.get("android:changeBounds:clip");
        if ((i11 == 0 || i12 == 0) && (i13 == 0 || i14 == 0)) {
            i = 0;
        } else {
            i = (i3 == i4 && i5 == i6) ? 0 : 1;
            if (i7 != i8 || i9 != i10) {
                i++;
            }
        }
        if ((rect4 != null && !rect4.equals(rect5)) || (rect4 == null && rect5 != null)) {
            i++;
        }
        if (i <= 0) {
            return null;
        }
        if (this.f7767) {
            view = view2;
            C2506.m4581(view, i3, i5, Math.max(i11, i13) + i3, Math.max(i12, i14) + i5);
            ObjectAnimator objectAnimatorM2887 = (i3 == i4 && i5 == i6) ? null : LayoutInflaterFactory2C1494.C1505.m2887(view, f7764, this.f7838.mo4539(i3, i5, i4, i6));
            if (rect4 == null) {
                i2 = 0;
                rect = new Rect(0, 0, i11, i12);
            } else {
                i2 = 0;
                rect = rect4;
            }
            Rect rect6 = rect5 == null ? new Rect(i2, i2, i13, i14) : rect5;
            if (rect.equals(rect6)) {
                objectAnimator = null;
            } else {
                C1920.m3743(view, rect);
                C2483 c2483 = f7765;
                Object[] objArr = new Object[2];
                objArr[i2] = rect;
                objArr[1] = rect6;
                ObjectAnimator objectAnimatorOfObject = ObjectAnimator.ofObject(view, "clipBounds", c2483, objArr);
                objectAnimatorOfObject.addListener(new C2468(this, view, rect5, i4, i6, i8, i10));
                objectAnimator = objectAnimatorOfObject;
            }
            animatorM4577 = C2500.m4577(objectAnimatorM2887, objectAnimator);
        } else {
            view = view2;
            C2506.m4581(view, i3, i5, i7, i9);
            if (i != 2) {
                animatorM4577 = (i3 == i4 && i5 == i6) ? LayoutInflaterFactory2C1494.C1505.m2887(view, f7762, this.f7838.mo4539(i7, i9, i8, i10)) : LayoutInflaterFactory2C1494.C1505.m2887(view, f7763, this.f7838.mo4539(i3, i5, i4, i6));
            } else if (i11 == i13 && i12 == i14) {
                animatorM4577 = LayoutInflaterFactory2C1494.C1505.m2887(view, f7764, this.f7838.mo4539(i3, i5, i4, i6));
            } else {
                C2470 c2470 = new C2470(view);
                ObjectAnimator objectAnimatorM28872 = LayoutInflaterFactory2C1494.C1505.m2887(c2470, f7760, this.f7838.mo4539(i3, i5, i4, i6));
                ObjectAnimator objectAnimatorM28873 = LayoutInflaterFactory2C1494.C1505.m2887(c2470, f7761, this.f7838.mo4539(i7, i9, i8, i10));
                AnimatorSet animatorSet = new AnimatorSet();
                animatorSet.playTogether(objectAnimatorM28872, objectAnimatorM28873);
                animatorSet.addListener(new C2467(this, c2470));
                animatorM4577 = animatorSet;
            }
        }
        if (view.getParent() instanceof ViewGroup) {
            ViewGroup viewGroup4 = (ViewGroup) view.getParent();
            C2503.m4579(viewGroup4, true);
            mo4548(new C2469(this, viewGroup4));
        }
        return animatorM4577;
    }

    @Override // p037.p118.AbstractC2485
    /* JADX INFO: renamed from: ֏ */
    public void mo2515(C2501 c2501) {
        m4534(c2501);
    }

    @Override // p037.p118.AbstractC2485
    /* JADX INFO: renamed from: ހ */
    public void mo2516(C2501 c2501) {
        m4534(c2501);
    }

    @Override // p037.p118.AbstractC2485
    /* JADX INFO: renamed from: ހ */
    public String[] mo2517() {
        return f7758;
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final void m4534(C2501 c2501) {
        View view = c2501.f7863;
        if (!C1920.m3770(view) && view.getWidth() == 0 && view.getHeight() == 0) {
            return;
        }
        c2501.f7862.put("android:changeBounds:bounds", new Rect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom()));
        c2501.f7862.put("android:changeBounds:parent", c2501.f7863.getParent());
        if (this.f7768) {
            c2501.f7863.getLocationInWindow(this.f7766);
            c2501.f7862.put("android:changeBounds:windowX", Integer.valueOf(this.f7766[0]));
            c2501.f7862.put("android:changeBounds:windowY", Integer.valueOf(this.f7766[1]));
        }
        if (this.f7767) {
            c2501.f7862.put("android:changeBounds:clip", view.getClipBounds());
        }
    }
}
