package ῲ.ᓆ;

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.Path;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.Property;
import android.view.View;
import android.view.ViewGroup;
import java.util.Map;
import ῲ.ᨨ.ᨨ.C1729;
import ῲ.ᨨ.㳳.C1841;

/* renamed from: ῲ.ᓆ.ʬ  reason: contains not printable characters */
/* compiled from: ChangeBounds */
public class C1618 extends AbstractC1647 {

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

    /* renamed from: ᕣ  reason: contains not printable characters */
    public static final Property<View, PointF> f5816 = new C1624(PointF.class, "position");

    /* renamed from: ᨨ  reason: contains not printable characters */
    public static final Property<View, PointF> f5817 = new C1620(PointF.class, "bottomRight");

    /* renamed from: ⁱ  reason: contains not printable characters */
    public static final Property<C1621, PointF> f5818 = new C1619(PointF.class, "topLeft");

    /* renamed from: 㑃  reason: contains not printable characters */
    public static C1677 f5819 = new C1677();

    /* renamed from: 㳳  reason: contains not printable characters */
    public static final Property<View, PointF> f5820 = new C1627(PointF.class, "topLeft");

    /* renamed from: 㴹  reason: contains not printable characters */
    public static final Property<Drawable, PointF> f5821 = new C1623(PointF.class, "boundsOrigin");

    /* renamed from: 㿎  reason: contains not printable characters */
    public static final Property<C1621, PointF> f5822 = new C1628(PointF.class, "bottomRight");

    /* renamed from: ʬ  reason: contains not printable characters */
    public boolean f5823 = false;

    /* renamed from: ῲ  reason: contains not printable characters */
    public int[] f5824 = new int[2];

    /* renamed from: 㸾  reason: contains not printable characters */
    public boolean f5825 = false;

    /* renamed from: ῲ.ᓆ.ʬ$ʬ  reason: contains not printable characters */
    /* compiled from: ChangeBounds */
    public static class C1619 extends Property<C1621, PointF> {
        public C1619(Class cls, String str) {
            super(cls, str);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // android.util.Property
        public PointF get(C1621 r1) {
            return null;
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // android.util.Property
        public void set(C1621 r1, PointF pointF) {
            r1.m4208(pointF);
        }
    }

    /* renamed from: ῲ.ᓆ.ʬ$ඓ  reason: contains not printable characters */
    /* compiled from: ChangeBounds */
    public static class C1620 extends Property<View, PointF> {
        public C1620(Class cls, String str) {
            super(cls, str);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // android.util.Property
        public PointF get(View view) {
            return null;
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // android.util.Property
        public void set(View view, PointF pointF) {
            View view2 = view;
            PointF pointF2 = pointF;
            C1669.m4260(view2, view2.getLeft(), view2.getTop(), Math.round(pointF2.x), Math.round(pointF2.y));
        }
    }

    /* renamed from: ῲ.ᓆ.ʬ$ᕣ  reason: contains not printable characters */
    /* compiled from: ChangeBounds */
    public static class C1621 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public int f5826;

        /* renamed from: ඓ  reason: contains not printable characters */
        public View f5827;

        /* renamed from: ῲ  reason: contains not printable characters */
        public int f5828;

        /* renamed from: ⁱ  reason: contains not printable characters */
        public int f5829;

        /* renamed from: K  reason: contains not printable characters */
        public int f5830;

        /* renamed from: 㴹  reason: contains not printable characters */
        public int f5831;

        /* renamed from: 㸾  reason: contains not printable characters */
        public int f5832;

        public C1621(View view) {
            this.f5827 = view;
        }

        /* renamed from: ῲ  reason: contains not printable characters */
        public void m4208(PointF pointF) {
            this.f5830 = Math.round(pointF.x);
            this.f5828 = Math.round(pointF.y);
            this.f5831++;
            if (this.f5831 == this.f5829) {
                C1669.m4260(this.f5827, this.f5830, this.f5828, this.f5826, this.f5832);
                this.f5831 = 0;
                this.f5829 = 0;
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public void m4209(PointF pointF) {
            this.f5826 = Math.round(pointF.x);
            this.f5832 = Math.round(pointF.y);
            this.f5829++;
            if (this.f5831 == this.f5829) {
                C1669.m4260(this.f5827, this.f5830, this.f5828, this.f5826, this.f5832);
                this.f5831 = 0;
                this.f5829 = 0;
            }
        }
    }

    /* renamed from: ῲ.ᓆ.ʬ$ᨨ  reason: contains not printable characters */
    /* compiled from: ChangeBounds */
    public class C1622 extends AnimatorListenerAdapter {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final /* synthetic */ Rect f5833;

        /* renamed from: ඓ  reason: contains not printable characters */
        public final /* synthetic */ int f5834;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final /* synthetic */ View f5835;

        /* renamed from: ⁱ  reason: contains not printable characters */
        public final /* synthetic */ int f5836;

        /* renamed from: K  reason: contains not printable characters */
        public boolean f5837;

        /* renamed from: 㴹  reason: contains not printable characters */
        public final /* synthetic */ int f5838;

        /* renamed from: 㸾  reason: contains not printable characters */
        public final /* synthetic */ int f5839;

        public C1622(C1618 r1, View view, Rect rect, int i, int i2, int i3, int i4) {
            this.f5835 = view;
            this.f5833 = rect;
            this.f5839 = i;
            this.f5834 = i2;
            this.f5838 = i3;
            this.f5836 = i4;
        }

        public void onAnimationCancel(Animator animator) {
            this.f5837 = true;
        }

        public void onAnimationEnd(Animator animator) {
            if (!this.f5837) {
                C1729.m4477(this.f5835, this.f5833);
                C1669.m4260(this.f5835, this.f5839, this.f5834, this.f5838, this.f5836);
            }
        }
    }

    /* renamed from: ῲ.ᓆ.ʬ$ῲ  reason: contains not printable characters */
    /* compiled from: ChangeBounds */
    public static class C1623 extends Property<Drawable, PointF> {

        /* renamed from: K  reason: contains not printable characters */
        public Rect f5840 = new Rect();

        public C1623(Class cls, String str) {
            super(cls, str);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // android.util.Property
        public PointF get(Drawable drawable) {
            drawable.copyBounds(this.f5840);
            Rect rect = this.f5840;
            return new PointF((float) rect.left, (float) rect.top);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // android.util.Property
        public void set(Drawable drawable, PointF pointF) {
            Drawable drawable2 = drawable;
            PointF pointF2 = pointF;
            drawable2.copyBounds(this.f5840);
            this.f5840.offsetTo(Math.round(pointF2.x), Math.round(pointF2.y));
            drawable2.setBounds(this.f5840);
        }
    }

    /* renamed from: ῲ.ᓆ.ʬ$ⁱ  reason: contains not printable characters */
    /* compiled from: ChangeBounds */
    public static class C1624 extends Property<View, PointF> {
        public C1624(Class cls, String str) {
            super(cls, str);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // android.util.Property
        public PointF get(View view) {
            return null;
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // android.util.Property
        public void set(View view, PointF pointF) {
            View view2 = view;
            PointF pointF2 = pointF;
            int round = Math.round(pointF2.x);
            int round2 = Math.round(pointF2.y);
            C1669.m4260(view2, round, round2, view2.getWidth() + round, view2.getHeight() + round2);
        }
    }

    /* renamed from: ῲ.ᓆ.ʬ$K  reason: contains not printable characters */
    /* compiled from: ChangeBounds */
    public class C1625 extends AnimatorListenerAdapter {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final /* synthetic */ View f5841;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final /* synthetic */ BitmapDrawable f5842;

        /* renamed from: K  reason: contains not printable characters */
        public final /* synthetic */ ViewGroup f5843;

        /* renamed from: 㸾  reason: contains not printable characters */
        public final /* synthetic */ float f5844;

        public C1625(C1618 r1, ViewGroup viewGroup, BitmapDrawable bitmapDrawable, View view, float f) {
            this.f5843 = viewGroup;
            this.f5842 = bitmapDrawable;
            this.f5841 = view;
            this.f5844 = f;
        }

        public void onAnimationEnd(Animator animator) {
            C1669.m4259(this.f5843).remove(this.f5842);
            C1669.f5917.m4244(this.f5841, this.f5844);
        }
    }

    /* renamed from: ῲ.ᓆ.ʬ$㳳  reason: contains not printable characters */
    /* compiled from: ChangeBounds */
    public class C1626 extends C1662 {

        /* renamed from: ῲ  reason: contains not printable characters */
        public final /* synthetic */ ViewGroup f5845;

        /* renamed from: K  reason: contains not printable characters */
        public boolean f5846 = false;

        public C1626(C1618 r1, ViewGroup viewGroup) {
            this.f5845 = viewGroup;
        }

        @Override // ῲ.ᓆ.C1662, ῲ.ᓆ.AbstractC1647.AbstractC1652
        public void onTransitionCancel(AbstractC1647 r2) {
            C1631.m4211(this.f5845, false);
            this.f5846 = true;
        }

        @Override // ῲ.ᓆ.AbstractC1647.AbstractC1652
        public void onTransitionEnd(AbstractC1647 r3) {
            if (!this.f5846) {
                C1631.m4211(this.f5845, false);
            }
            r3.removeListener(this);
        }

        @Override // ῲ.ᓆ.C1662, ῲ.ᓆ.AbstractC1647.AbstractC1652
        public void onTransitionPause(AbstractC1647 r2) {
            C1631.m4211(this.f5845, false);
        }

        @Override // ῲ.ᓆ.C1662, ῲ.ᓆ.AbstractC1647.AbstractC1652
        public void onTransitionResume(AbstractC1647 r2) {
            C1631.m4211(this.f5845, true);
        }
    }

    /* renamed from: ῲ.ᓆ.ʬ$㴹  reason: contains not printable characters */
    /* compiled from: ChangeBounds */
    public static class C1627 extends Property<View, PointF> {
        public C1627(Class cls, String str) {
            super(cls, str);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // android.util.Property
        public PointF get(View view) {
            return null;
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // android.util.Property
        public void set(View view, PointF pointF) {
            View view2 = view;
            PointF pointF2 = pointF;
            C1669.m4260(view2, Math.round(pointF2.x), Math.round(pointF2.y), view2.getRight(), view2.getBottom());
        }
    }

    /* renamed from: ῲ.ᓆ.ʬ$㸾  reason: contains not printable characters */
    /* compiled from: ChangeBounds */
    public static class C1628 extends Property<C1621, PointF> {
        public C1628(Class cls, String str) {
            super(cls, str);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // android.util.Property
        public PointF get(C1621 r1) {
            return null;
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // android.util.Property
        public void set(C1621 r1, PointF pointF) {
            r1.m4209(pointF);
        }
    }

    /* renamed from: ῲ.ᓆ.ʬ$㿎  reason: contains not printable characters */
    /* compiled from: ChangeBounds */
    public class C1629 extends AnimatorListenerAdapter {
        public C1621 mViewBounds = this.f5847;

        /* renamed from: K  reason: contains not printable characters */
        public final /* synthetic */ C1621 f5847;

        public C1629(C1618 r1, C1621 r2) {
            this.f5847 = r2;
        }
    }

    @Override // ῲ.ᓆ.AbstractC1647
    public void captureEndValues(C1646 r1) {
        captureValues(r1);
    }

    @Override // ῲ.ᓆ.AbstractC1647
    public void captureStartValues(C1646 r1) {
        captureValues(r1);
    }

    public final void captureValues(C1646 r8) {
        View view = r8.f5882;
        if (C1729.m4512(view) || view.getWidth() != 0 || view.getHeight() != 0) {
            r8.f5883.put("android:changeBounds:bounds", new Rect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom()));
            r8.f5883.put("android:changeBounds:parent", r8.f5882.getParent());
            if (this.f5825) {
                r8.f5882.getLocationInWindow(this.f5824);
                r8.f5883.put("android:changeBounds:windowX", Integer.valueOf(this.f5824[0]));
                r8.f5883.put("android:changeBounds:windowY", Integer.valueOf(this.f5824[1]));
            }
            if (this.f5823) {
                r8.f5883.put("android:changeBounds:clip", C1729.m4465(view));
            }
        }
    }

    @Override // ῲ.ᓆ.AbstractC1647
    public Animator createAnimator(ViewGroup viewGroup, C1646 r20, C1646 r21) {
        int i;
        View view;
        Animator animator;
        ObjectAnimator objectAnimator;
        int i2;
        Rect rect;
        ObjectAnimator objectAnimator2;
        C1646 matchedTransitionValues;
        if (r20 == null || r21 == null) {
            return null;
        }
        Map<String, Object> map = r20.f5883;
        Map<String, Object> map2 = r21.f5883;
        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 = r21.f5882;
        if (!this.f5825 || ((matchedTransitionValues = getMatchedTransitionValues(viewGroup2, true)) != null ? viewGroup3 == matchedTransitionValues.f5882 : viewGroup2 == viewGroup3)) {
            Rect rect2 = (Rect) r20.f5883.get("android:changeBounds:bounds");
            Rect rect3 = (Rect) r21.f5883.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) r20.f5883.get("android:changeBounds:clip");
            Rect rect5 = (Rect) r21.f5883.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.f5823) {
                view = view2;
                C1669.m4260(view, i3, i5, i7, i9);
                if (i == 2) {
                    if (i11 == i13 && i12 == i14) {
                        animator = C1841.m4775(view, f5816, getPathMotion().getPath((float) i3, (float) i5, (float) i4, (float) i6));
                    } else {
                        C1621 r1 = new C1621(view);
                        ObjectAnimator r2 = C1841.m4775(r1, f5818, getPathMotion().getPath((float) i3, (float) i5, (float) i4, (float) i6));
                        ObjectAnimator r3 = C1841.m4775(r1, f5822, getPathMotion().getPath((float) i7, (float) i9, (float) i8, (float) i10));
                        AnimatorSet animatorSet = new AnimatorSet();
                        animatorSet.playTogether(r2, r3);
                        animatorSet.addListener(new C1629(this, r1));
                        animator = animatorSet;
                    }
                } else if (i3 == i4 && i5 == i6) {
                    animator = C1841.m4775(view, f5817, getPathMotion().getPath((float) i7, (float) i9, (float) i8, (float) i10));
                } else {
                    animator = C1841.m4775(view, f5820, getPathMotion().getPath((float) i3, (float) i5, (float) i4, (float) i6));
                }
            } else {
                view = view2;
                C1669.m4260(view, i3, i5, Math.max(i11, i13) + i3, Math.max(i12, i14) + i5);
                if (i3 == i4 && i5 == i6) {
                    objectAnimator = null;
                } else {
                    objectAnimator = C1841.m4775(view, f5816, getPathMotion().getPath((float) i3, (float) i5, (float) i4, (float) 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)) {
                    C1729.m4477(view, rect);
                    C1677 r4 = f5819;
                    Object[] objArr = new Object[2];
                    objArr[i2] = rect;
                    objArr[1] = rect6;
                    objectAnimator2 = ObjectAnimator.ofObject(view, "clipBounds", r4, objArr);
                    objectAnimator2.addListener(new C1622(this, view, rect5, i4, i6, i8, i10));
                } else {
                    objectAnimator2 = null;
                }
                animator = C1632.m4212(objectAnimator, objectAnimator2);
            }
            if (view.getParent() instanceof ViewGroup) {
                ViewGroup viewGroup4 = (ViewGroup) view.getParent();
                C1631.m4211(viewGroup4, true);
                addListener(new C1626(this, viewGroup4));
            }
            return animator;
        }
        int intValue = ((Integer) r20.f5883.get("android:changeBounds:windowX")).intValue();
        int intValue2 = ((Integer) r20.f5883.get("android:changeBounds:windowY")).intValue();
        int intValue3 = ((Integer) r21.f5883.get("android:changeBounds:windowX")).intValue();
        int intValue4 = ((Integer) r21.f5883.get("android:changeBounds:windowY")).intValue();
        if (intValue == intValue3 && intValue2 == intValue4) {
            return null;
        }
        viewGroup.getLocationInWindow(this.f5824);
        Bitmap createBitmap = Bitmap.createBitmap(view2.getWidth(), view2.getHeight(), Bitmap.Config.ARGB_8888);
        view2.draw(new Canvas(createBitmap));
        BitmapDrawable bitmapDrawable = new BitmapDrawable(createBitmap);
        float r7 = C1669.m4258(view2);
        C1669.f5917.m4244(view2, 0.0f);
        C1669.m4259(viewGroup).add(bitmapDrawable);
        AbstractC1672 pathMotion = getPathMotion();
        int[] iArr = this.f5824;
        Path path = pathMotion.getPath((float) (intValue - iArr[0]), (float) (intValue2 - iArr[1]), (float) (intValue3 - iArr[0]), (float) (intValue4 - iArr[1]));
        Property<Drawable, PointF> property = f5821;
        int i15 = Build.VERSION.SDK_INT;
        ObjectAnimator ofPropertyValuesHolder = ObjectAnimator.ofPropertyValuesHolder(bitmapDrawable, PropertyValuesHolder.ofObject(property, (TypeConverter) null, path));
        ofPropertyValuesHolder.addListener(new C1625(this, viewGroup, bitmapDrawable, view2, r7));
        return ofPropertyValuesHolder;
    }

    @Override // ῲ.ᓆ.AbstractC1647
    public String[] getTransitionProperties() {
        return f5815;
    }
}
