package d.r;

import android.animation.AnimatorListenerAdapter;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.Property;
import android.view.View;
import android.view.ViewGroup;
import d.h.j.y;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;

/* JADX INFO: loaded from: classes.dex */
public class b extends d.r.h {
    public static final String[] I = {"android:changeBounds:bounds", "android:changeBounds:clip", "android:changeBounds:parent", "android:changeBounds:windowX", "android:changeBounds:windowY"};
    public static final Property<Drawable, PointF> J = new a(PointF.class, "boundsOrigin");
    public static final Property<i, PointF> K = new C0047b(PointF.class, "topLeft");
    public static final Property<i, PointF> L = new c(PointF.class, "bottomRight");
    public static final Property<View, PointF> M = new d(PointF.class, "bottomRight");
    public static final Property<View, PointF> N = new e(PointF.class, "topLeft");
    public static final Property<View, PointF> O = new f(PointF.class, "position");
    public static d.r.f P = new d.r.f();
    public int[] Q = new int[2];

    public static class a extends Property<Drawable, PointF> {
        public Rect a;

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

        @Override // android.util.Property
        public PointF get(Drawable drawable) {
            drawable.copyBounds(this.a);
            Rect rect = this.a;
            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.a);
            this.a.offsetTo(Math.round(pointF2.x), Math.round(pointF2.y));
            drawable2.setBounds(this.a);
        }
    }

    /* JADX INFO: renamed from: d.r.b$b, reason: collision with other inner class name */
    public static class C0047b extends Property<i, PointF> {
        public C0047b(Class cls, String str) {
            super(cls, str);
        }

        @Override // android.util.Property
        public /* bridge */ /* synthetic */ PointF get(i iVar) {
            return null;
        }

        @Override // android.util.Property
        public void set(i iVar, PointF pointF) {
            i iVar2 = iVar;
            PointF pointF2 = pointF;
            Objects.requireNonNull(iVar2);
            iVar2.a = Math.round(pointF2.x);
            int iRound = Math.round(pointF2.y);
            iVar2.f3372b = iRound;
            int i2 = iVar2.f3376f + 1;
            iVar2.f3376f = i2;
            if (i2 == iVar2.f3377g) {
                s.b(iVar2.f3375e, iVar2.a, iRound, iVar2.f3373c, iVar2.f3374d);
                iVar2.f3376f = 0;
                iVar2.f3377g = 0;
            }
        }
    }

    public static class c extends Property<i, PointF> {
        public c(Class cls, String str) {
            super(cls, str);
        }

        @Override // android.util.Property
        public /* bridge */ /* synthetic */ PointF get(i iVar) {
            return null;
        }

        @Override // android.util.Property
        public void set(i iVar, PointF pointF) {
            i iVar2 = iVar;
            PointF pointF2 = pointF;
            Objects.requireNonNull(iVar2);
            iVar2.f3373c = Math.round(pointF2.x);
            int iRound = Math.round(pointF2.y);
            iVar2.f3374d = iRound;
            int i2 = iVar2.f3377g + 1;
            iVar2.f3377g = i2;
            if (iVar2.f3376f == i2) {
                s.b(iVar2.f3375e, iVar2.a, iVar2.f3372b, iVar2.f3373c, iRound);
                iVar2.f3376f = 0;
                iVar2.f3377g = 0;
            }
        }
    }

    public static class d extends Property<View, PointF> {
        public d(Class cls, String str) {
            super(cls, str);
        }

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

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

    public static class e extends Property<View, PointF> {
        public e(Class cls, String str) {
            super(cls, str);
        }

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

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

    public static class f extends Property<View, PointF> {
        public f(Class cls, String str) {
            super(cls, str);
        }

        @Override // android.util.Property
        public /* bridge */ /* synthetic */ 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);
            s.b(view2, iRound, iRound2, view2.getWidth() + iRound, view2.getHeight() + iRound2);
        }
    }

    public class g extends AnimatorListenerAdapter {
        public final /* synthetic */ i a;
        private i mViewBounds;

        public g(b bVar, i iVar) {
            this.a = iVar;
            this.mViewBounds = iVar;
        }
    }

    public class h extends k {
        public boolean a = false;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public final /* synthetic */ ViewGroup f3371b;

        public h(b bVar, ViewGroup viewGroup) {
            this.f3371b = viewGroup;
        }

        @Override // d.r.k, d.r.h.d
        public void b(d.r.h hVar) {
            r.a(this.f3371b, false);
        }

        @Override // d.r.h.d
        public void c(d.r.h hVar) {
            if (!this.a) {
                r.a(this.f3371b, false);
            }
            hVar.y(this);
        }

        @Override // d.r.k, d.r.h.d
        public void d(d.r.h hVar) {
            r.a(this.f3371b, false);
            this.a = true;
        }

        @Override // d.r.k, d.r.h.d
        public void e(d.r.h hVar) {
            r.a(this.f3371b, true);
        }
    }

    public static class i {
        public int a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public int f3372b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        public int f3373c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        public int f3374d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        public View f3375e;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public int f3376f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        public int f3377g;

        public i(View view) {
            this.f3375e = view;
        }
    }

    public final void K(p pVar) {
        View view = pVar.f3413b;
        AtomicInteger atomicInteger = d.h.j.y.a;
        if (!y.f.c(view) && view.getWidth() == 0 && view.getHeight() == 0) {
            return;
        }
        pVar.a.put("android:changeBounds:bounds", new Rect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom()));
        pVar.a.put("android:changeBounds:parent", pVar.f3413b.getParent());
    }

    @Override // d.r.h
    public void f(p pVar) {
        K(pVar);
    }

    @Override // d.r.h
    public void j(p pVar) {
        K(pVar);
    }

    /* JADX WARN: Removed duplicated region for block: B:47:0x0114  */
    @Override // d.r.h
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public android.animation.Animator n(android.view.ViewGroup r19, d.r.p r20, d.r.p r21) {
        /*
            Method dump skipped, instruction units count: 302
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: d.r.b.n(android.view.ViewGroup, d.r.p, d.r.p):android.animation.Animator");
    }

    @Override // d.r.h
    public String[] s() {
        return I;
    }
}
