package t0; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; 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; /* loaded from: classes.dex */ public class c extends l { private static final String[] M = {"android:changeBounds:bounds", "android:changeBounds:clip", "android:changeBounds:parent", "android:changeBounds:windowX", "android:changeBounds:windowY"}; private static final Property N = new b(PointF.class, "boundsOrigin"); private static final Property O = new C0231c(PointF.class, "topLeft"); private static final Property P = new d(PointF.class, "bottomRight"); private static final Property Q = new e(PointF.class, "bottomRight"); private static final Property V = new f(PointF.class, "topLeft"); private static final Property W = new g(PointF.class, "position"); private static t0.j X = new t0.j(); private int[] J = new int[2]; private boolean K = false; private boolean L = false; class a extends AnimatorListenerAdapter { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ ViewGroup f14139a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ BitmapDrawable f14140b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ View f14141c; /* renamed from: d, reason: collision with root package name */ final /* synthetic */ float f14142d; a(ViewGroup viewGroup, BitmapDrawable bitmapDrawable, View view, float f10) { this.f14139a = viewGroup; this.f14140b = bitmapDrawable; this.f14141c = view; this.f14142d = f10; } @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener public void onAnimationEnd(Animator animator) { a0.b(this.f14139a).b(this.f14140b); a0.g(this.f14141c, this.f14142d); } } static class b extends Property { /* renamed from: a, reason: collision with root package name */ private Rect f14144a; b(Class cls, String str) { super(cls, str); this.f14144a = new Rect(); } @Override // android.util.Property /* renamed from: a, reason: merged with bridge method [inline-methods] */ public PointF get(Drawable drawable) { drawable.copyBounds(this.f14144a); Rect rect = this.f14144a; return new PointF(rect.left, rect.top); } @Override // android.util.Property /* renamed from: b, reason: merged with bridge method [inline-methods] */ public void set(Drawable drawable, PointF pointF) { drawable.copyBounds(this.f14144a); this.f14144a.offsetTo(Math.round(pointF.x), Math.round(pointF.y)); drawable.setBounds(this.f14144a); } } /* renamed from: t0.c$c, reason: collision with other inner class name */ static class C0231c extends Property { C0231c(Class cls, String str) { super(cls, str); } @Override // android.util.Property /* renamed from: a, reason: merged with bridge method [inline-methods] */ public PointF get(k kVar) { return null; } @Override // android.util.Property /* renamed from: b, reason: merged with bridge method [inline-methods] */ public void set(k kVar, PointF pointF) { kVar.c(pointF); } } static class d extends Property { d(Class cls, String str) { super(cls, str); } @Override // android.util.Property /* renamed from: a, reason: merged with bridge method [inline-methods] */ public PointF get(k kVar) { return null; } @Override // android.util.Property /* renamed from: b, reason: merged with bridge method [inline-methods] */ public void set(k kVar, PointF pointF) { kVar.a(pointF); } } static class e extends Property { e(Class cls, String str) { super(cls, str); } @Override // android.util.Property /* renamed from: a, reason: merged with bridge method [inline-methods] */ public PointF get(View view) { return null; } @Override // android.util.Property /* renamed from: b, reason: merged with bridge method [inline-methods] */ public void set(View view, PointF pointF) { a0.f(view, view.getLeft(), view.getTop(), Math.round(pointF.x), Math.round(pointF.y)); } } static class f extends Property { f(Class cls, String str) { super(cls, str); } @Override // android.util.Property /* renamed from: a, reason: merged with bridge method [inline-methods] */ public PointF get(View view) { return null; } @Override // android.util.Property /* renamed from: b, reason: merged with bridge method [inline-methods] */ public void set(View view, PointF pointF) { a0.f(view, Math.round(pointF.x), Math.round(pointF.y), view.getRight(), view.getBottom()); } } static class g extends Property { g(Class cls, String str) { super(cls, str); } @Override // android.util.Property /* renamed from: a, reason: merged with bridge method [inline-methods] */ public PointF get(View view) { return null; } @Override // android.util.Property /* renamed from: b, reason: merged with bridge method [inline-methods] */ public void set(View view, PointF pointF) { int round = Math.round(pointF.x); int round2 = Math.round(pointF.y); a0.f(view, round, round2, view.getWidth() + round, view.getHeight() + round2); } } class h extends AnimatorListenerAdapter { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ k f14145a; private k mViewBounds; h(k kVar) { this.f14145a = kVar; this.mViewBounds = kVar; } } class i extends AnimatorListenerAdapter { /* renamed from: a, reason: collision with root package name */ private boolean f14147a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ View f14148b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ Rect f14149c; /* renamed from: d, reason: collision with root package name */ final /* synthetic */ int f14150d; /* renamed from: e, reason: collision with root package name */ final /* synthetic */ int f14151e; /* renamed from: f, reason: collision with root package name */ final /* synthetic */ int f14152f; /* renamed from: g, reason: collision with root package name */ final /* synthetic */ int f14153g; i(View view, Rect rect, int i10, int i11, int i12, int i13) { this.f14148b = view; this.f14149c = rect; this.f14150d = i10; this.f14151e = i11; this.f14152f = i12; this.f14153g = i13; } @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener public void onAnimationCancel(Animator animator) { this.f14147a = true; } @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener public void onAnimationEnd(Animator animator) { if (this.f14147a) { return; } androidx.core.view.n0.t0(this.f14148b, this.f14149c); a0.f(this.f14148b, this.f14150d, this.f14151e, this.f14152f, this.f14153g); } } class j extends m { /* renamed from: a, reason: collision with root package name */ boolean f14155a = false; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ ViewGroup f14156b; j(ViewGroup viewGroup) { this.f14156b = viewGroup; } @Override // t0.m, t0.l.f public void a(l lVar) { x.c(this.f14156b, false); } @Override // t0.l.f public void b(l lVar) { if (!this.f14155a) { x.c(this.f14156b, false); } lVar.R(this); } @Override // t0.m, t0.l.f public void c(l lVar) { x.c(this.f14156b, true); } @Override // t0.m, t0.l.f public void d(l lVar) { x.c(this.f14156b, false); this.f14155a = true; } } private static class k { /* renamed from: a, reason: collision with root package name */ private int f14158a; /* renamed from: b, reason: collision with root package name */ private int f14159b; /* renamed from: c, reason: collision with root package name */ private int f14160c; /* renamed from: d, reason: collision with root package name */ private int f14161d; /* renamed from: e, reason: collision with root package name */ private View f14162e; /* renamed from: f, reason: collision with root package name */ private int f14163f; /* renamed from: g, reason: collision with root package name */ private int f14164g; k(View view) { this.f14162e = view; } private void b() { a0.f(this.f14162e, this.f14158a, this.f14159b, this.f14160c, this.f14161d); this.f14163f = 0; this.f14164g = 0; } void a(PointF pointF) { this.f14160c = Math.round(pointF.x); this.f14161d = Math.round(pointF.y); int i10 = this.f14164g + 1; this.f14164g = i10; if (this.f14163f == i10) { b(); } } void c(PointF pointF) { this.f14158a = Math.round(pointF.x); this.f14159b = Math.round(pointF.y); int i10 = this.f14163f + 1; this.f14163f = i10; if (i10 == this.f14164g) { b(); } } } private void e0(s sVar) { View view = sVar.f14260b; if (!androidx.core.view.n0.R(view) && view.getWidth() == 0 && view.getHeight() == 0) { return; } sVar.f14259a.put("android:changeBounds:bounds", new Rect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom())); sVar.f14259a.put("android:changeBounds:parent", sVar.f14260b.getParent()); if (this.L) { sVar.f14260b.getLocationInWindow(this.J); sVar.f14259a.put("android:changeBounds:windowX", Integer.valueOf(this.J[0])); sVar.f14259a.put("android:changeBounds:windowY", Integer.valueOf(this.J[1])); } if (this.K) { sVar.f14259a.put("android:changeBounds:clip", androidx.core.view.n0.t(view)); } } private boolean f0(View view, View view2) { if (!this.L) { return true; } s t10 = t(view, true); if (t10 == null) { if (view == view2) { return true; } } else if (view2 == t10.f14260b) { return true; } return false; } @Override // t0.l public String[] E() { return M; } @Override // t0.l public void g(s sVar) { e0(sVar); } @Override // t0.l public void j(s sVar) { e0(sVar); } @Override // t0.l public Animator n(ViewGroup viewGroup, s sVar, s sVar2) { int i10; View view; int i11; Rect rect; ObjectAnimator objectAnimator; Animator c10; if (sVar == null || sVar2 == null) { return null; } Map map = sVar.f14259a; Map map2 = sVar2.f14259a; 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 = sVar2.f14260b; if (!f0(viewGroup2, viewGroup3)) { int intValue = ((Integer) sVar.f14259a.get("android:changeBounds:windowX")).intValue(); int intValue2 = ((Integer) sVar.f14259a.get("android:changeBounds:windowY")).intValue(); int intValue3 = ((Integer) sVar2.f14259a.get("android:changeBounds:windowX")).intValue(); int intValue4 = ((Integer) sVar2.f14259a.get("android:changeBounds:windowY")).intValue(); if (intValue == intValue3 && intValue2 == intValue4) { return null; } viewGroup.getLocationInWindow(this.J); Bitmap createBitmap = Bitmap.createBitmap(view2.getWidth(), view2.getHeight(), Bitmap.Config.ARGB_8888); view2.draw(new Canvas(createBitmap)); BitmapDrawable bitmapDrawable = new BitmapDrawable(createBitmap); float c11 = a0.c(view2); a0.g(view2, 0.0f); a0.b(viewGroup).a(bitmapDrawable); t0.g v10 = v(); int[] iArr = this.J; int i12 = iArr[0]; int i13 = iArr[1]; ObjectAnimator ofPropertyValuesHolder = ObjectAnimator.ofPropertyValuesHolder(bitmapDrawable, t0.h.a(N, v10.a(intValue - i12, intValue2 - i13, intValue3 - i12, intValue4 - i13))); ofPropertyValuesHolder.addListener(new a(viewGroup, bitmapDrawable, view2, c11)); return ofPropertyValuesHolder; } Rect rect2 = (Rect) sVar.f14259a.get("android:changeBounds:bounds"); Rect rect3 = (Rect) sVar2.f14259a.get("android:changeBounds:bounds"); int i14 = rect2.left; int i15 = rect3.left; int i16 = rect2.top; int i17 = rect3.top; int i18 = rect2.right; int i19 = rect3.right; int i20 = rect2.bottom; int i21 = rect3.bottom; int i22 = i18 - i14; int i23 = i20 - i16; int i24 = i19 - i15; int i25 = i21 - i17; Rect rect4 = (Rect) sVar.f14259a.get("android:changeBounds:clip"); Rect rect5 = (Rect) sVar2.f14259a.get("android:changeBounds:clip"); if ((i22 == 0 || i23 == 0) && (i24 == 0 || i25 == 0)) { i10 = 0; } else { i10 = (i14 == i15 && i16 == i17) ? 0 : 1; if (i18 != i19 || i20 != i21) { i10++; } } if ((rect4 != null && !rect4.equals(rect5)) || (rect4 == null && rect5 != null)) { i10++; } if (i10 <= 0) { return null; } if (this.K) { view = view2; a0.f(view, i14, i16, Math.max(i22, i24) + i14, Math.max(i23, i25) + i16); ObjectAnimator a10 = (i14 == i15 && i16 == i17) ? null : t0.f.a(view, W, v().a(i14, i16, i15, i17)); if (rect4 == null) { i11 = 0; rect = new Rect(0, 0, i22, i23); } else { i11 = 0; rect = rect4; } Rect rect6 = rect5 == null ? new Rect(i11, i11, i24, i25) : rect5; if (rect.equals(rect6)) { objectAnimator = null; } else { androidx.core.view.n0.t0(view, rect); t0.j jVar = X; Object[] objArr = new Object[2]; objArr[i11] = rect; objArr[1] = rect6; ObjectAnimator ofObject = ObjectAnimator.ofObject(view, "clipBounds", jVar, objArr); ofObject.addListener(new i(view, rect5, i15, i17, i19, i21)); objectAnimator = ofObject; } c10 = r.c(a10, objectAnimator); } else { view = view2; a0.f(view, i14, i16, i18, i20); if (i10 != 2) { c10 = (i14 == i15 && i16 == i17) ? t0.f.a(view, Q, v().a(i18, i20, i19, i21)) : t0.f.a(view, V, v().a(i14, i16, i15, i17)); } else if (i22 == i24 && i23 == i25) { c10 = t0.f.a(view, W, v().a(i14, i16, i15, i17)); } else { k kVar = new k(view); ObjectAnimator a11 = t0.f.a(kVar, O, v().a(i14, i16, i15, i17)); ObjectAnimator a12 = t0.f.a(kVar, P, v().a(i18, i20, i19, i21)); AnimatorSet animatorSet = new AnimatorSet(); animatorSet.playTogether(a11, a12); animatorSet.addListener(new h(kVar)); c10 = animatorSet; } } if (view.getParent() instanceof ViewGroup) { ViewGroup viewGroup4 = (ViewGroup) view.getParent(); x.c(viewGroup4, true); a(new j(viewGroup4)); } return c10; } }