package o; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.TypeConverter; import android.content.Context; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.graphics.PointF; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Build; import android.util.AttributeSet; import android.util.Property; import android.view.View; import android.view.ViewGroup; import androidx.core.view.ViewCompat; import java.util.Map; /* renamed from: o.JZy, reason: case insensitive filesystem */ /* loaded from: classes.dex */ public final class C0542JZy extends VKj { private static final Property g; private static final Property k; private static final Property l; private static ZsO m; private static final Property n; /* renamed from: o, reason: collision with root package name */ private static final Property f8227o; private static final String[] t = {"android:changeBounds:bounds", "android:changeBounds:clip", "android:changeBounds:parent", "android:changeBounds:windowX", "android:changeBounds:windowY"}; private int[] p; private boolean q; private boolean r; static { new Property(PointF.class, "boundsOrigin") { // from class: o.JZy.1 private Rect c = new Rect(); @Override // android.util.Property public final /* synthetic */ PointF get(Drawable drawable) { drawable.copyBounds(this.c); return new PointF(this.c.left, this.c.top); } @Override // android.util.Property public final /* synthetic */ void set(Drawable drawable, PointF pointF) { Drawable drawable2 = drawable; PointF pointF2 = pointF; drawable2.copyBounds(this.c); this.c.offsetTo(Math.round(pointF2.x), Math.round(pointF2.y)); drawable2.setBounds(this.c); } }; String str = "topLeft"; n = new Property(PointF.class, str) { // from class: o.JZy.2 @Override // android.util.Property public final /* bridge */ /* synthetic */ PointF get(Sts sts) { return null; } @Override // android.util.Property public final /* synthetic */ void set(Sts sts, PointF pointF) { Sts sts2 = sts; PointF pointF2 = pointF; sts2.a = Math.round(pointF2.x); sts2.e = Math.round(pointF2.y); int i = sts2.j + 1; sts2.j = i; if (i == sts2.b) { sts2.b(); } } }; String str2 = "bottomRight"; l = new Property(PointF.class, str2) { // from class: o.JZy.4 @Override // android.util.Property public final /* bridge */ /* synthetic */ PointF get(Sts sts) { return null; } @Override // android.util.Property public final /* synthetic */ void set(Sts sts, PointF pointF) { Sts sts2 = sts; PointF pointF2 = pointF; sts2.c = Math.round(pointF2.x); sts2.d = Math.round(pointF2.y); int i = sts2.b + 1; sts2.b = i; if (sts2.j == i) { sts2.b(); } } }; g = new Property(PointF.class, str2) { // from class: o.JZy.5 @Override // android.util.Property public final /* bridge */ /* synthetic */ PointF get(View view) { return null; } @Override // android.util.Property public final /* synthetic */ void set(View view, PointF pointF) { View view2 = view; PointF pointF2 = pointF; RHF.e(view2, view2.getLeft(), view2.getTop(), Math.round(pointF2.x), Math.round(pointF2.y)); } }; k = new Property(PointF.class, str) { // from class: o.JZy.3 @Override // android.util.Property public final /* bridge */ /* synthetic */ PointF get(View view) { return null; } @Override // android.util.Property public final /* synthetic */ void set(View view, PointF pointF) { View view2 = view; PointF pointF2 = pointF; RHF.e(view2, Math.round(pointF2.x), Math.round(pointF2.y), view2.getRight(), view2.getBottom()); } }; f8227o = new Property(PointF.class, "position") { // from class: o.JZy.6 @Override // android.util.Property public final /* bridge */ /* synthetic */ PointF get(View view) { return null; } @Override // android.util.Property public final /* synthetic */ void set(View view, PointF pointF) { View view2 = view; PointF pointF2 = pointF; int round = Math.round(pointF2.x); int round2 = Math.round(pointF2.y); RHF.e(view2, round, round2, view2.getWidth() + round, view2.getHeight() + round2); } }; m = new ZsO(); } public C0542JZy() { this.p = new int[2]; this.r = false; this.q = false; } public C0542JZy(Context context, AttributeSet attributeSet) { super(context, attributeSet); this.p = new int[2]; this.r = false; this.q = false; TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, QXV.b); boolean ov_ = C2447ael.ov_(obtainStyledAttributes, (XmlResourceParser) attributeSet, "resizeClip", 0, false); obtainStyledAttributes.recycle(); this.r = ov_; } private void c(PaT paT) { View view = paT.d; if (!ViewCompat.G(view) && view.getWidth() == 0 && view.getHeight() == 0) { return; } paT.a.put("android:changeBounds:bounds", new Rect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom())); paT.a.put("android:changeBounds:parent", paT.d.getParent()); if (this.r) { paT.a.put("android:changeBounds:clip", ViewCompat.sj_(view)); } } @Override // o.VKj public final void b(PaT paT) { c(paT); } @Override // o.VKj public final void d(PaT paT) { c(paT); } /* JADX WARN: Multi-variable type inference failed */ @Override // o.VKj public final Animator Ka_(ViewGroup viewGroup, PaT paT, PaT paT2) { int i; View view; int i2; boolean z; int i3; ObjectAnimator objectAnimator; Animator Bm_; boolean z2; boolean z3; if (paT == null || paT2 == null) { return null; } Map map = paT.a; Map map2 = paT2.a; 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 = paT2.d; Rect rect = (Rect) paT.a.get("android:changeBounds:bounds"); Rect rect2 = (Rect) paT2.a.get("android:changeBounds:bounds"); int i4 = rect.left; int i5 = rect2.left; int i6 = rect.top; int i7 = rect2.top; int i8 = rect.right; int i9 = rect2.right; int i10 = rect.bottom; int i11 = rect2.bottom; int i12 = i8 - i4; int i13 = i10 - i6; int i14 = i9 - i5; int i15 = i11 - i7; Rect rect3 = (Rect) paT.a.get("android:changeBounds:clip"); Rect rect4 = (Rect) paT2.a.get("android:changeBounds:clip"); if ((i12 == 0 || i13 == 0) && (i14 == 0 || i15 == 0)) { i = 0; } else { i = (i4 == i5 && i6 == i7) ? 0 : 1; if (i8 != i9 || i10 != i11) { i++; } } if ((rect3 != null && !rect3.equals(rect4)) || (rect3 == null && rect4 != null)) { i++; } int i16 = i; if (i16 <= 0) { return null; } if (!this.r) { view = view2; RHF.e(view, i4, i6, i8, i10); if (i16 != 2) { z3 = true; if (i4 == i5 && i6 == i7) { Bm_ = ObjectAnimator.ofObject(view, (Property) g, (TypeConverter) null, i().Bg_(i8, i10, i9, i11)); } else { Bm_ = ObjectAnimator.ofObject(view, (Property) k, (TypeConverter) null, i().Bg_(i4, i6, i5, i7)); } } else if (i12 != i14 || i13 != i15) { Sts sts = new Sts(view); ObjectAnimator ofObject = ObjectAnimator.ofObject(sts, (Property) n, (TypeConverter) null, i().Bg_(i4, i6, i5, i7)); ObjectAnimator ofObject2 = ObjectAnimator.ofObject(sts, (Property) l, (TypeConverter) null, i().Bg_(i8, i10, i9, i11)); AnimatorSet animatorSet = new AnimatorSet(); z3 = true; animatorSet.playTogether(ofObject, ofObject2); animatorSet.addListener(new AnimatorListenerAdapter(this, sts) { // from class: o.JZy.7 final Sts b; final C0542JZy e; private Sts mViewBounds; { this.e = this; this.b = sts; this.mViewBounds = sts; } }); Bm_ = animatorSet; } else { Bm_ = ObjectAnimator.ofObject(view, (Property) f8227o, (TypeConverter) null, i().Bg_(i4, i6, i5, i7)); z = true; z2 = 0; } z = z3; z2 = 0; } else { view = view2; RHF.e(view, i4, i6, Math.max(i12, i14) + i4, Math.max(i13, i15) + i6); ObjectAnimator ofObject3 = (i4 == i5 && i6 == i7) ? null : ObjectAnimator.ofObject(view, (Property) f8227o, (TypeConverter) null, i().Bg_(i4, i6, i5, i7)); if (rect3 == null) { i2 = 0; rect3 = new Rect(0, 0, i12, i13); } else { i2 = 0; } Rect rect5 = rect4 == null ? new Rect(i2, i2, i14, i15) : rect4; if (rect3.equals(rect5)) { z = true; i3 = i2; objectAnimator = null; } else { ViewCompat.sq_(view, rect3); ObjectAnimator ofObject4 = ObjectAnimator.ofObject(view, "clipBounds", m, rect3, rect5); i3 = i2; z = true; ofObject4.addListener(new AnimatorListenerAdapter(this, view, rect4, i5, i7, i9, i11) { // from class: o.JZy.10 final int a; final int b; final C0542JZy c; final int d; final int e; private boolean f; final View h; final Rect j; { this.c = this; this.h = view; this.j = rect4; this.b = i5; this.a = i7; this.e = i9; this.d = i11; } @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener public final void onAnimationEnd(Animator animator) { if (this.f) { return; } ViewCompat.sq_(this.h, this.j); RHF.e(this.h, this.b, this.a, this.e, this.d); } @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener public final void onAnimationCancel(Animator animator) { this.f = true; } }); objectAnimator = ofObject4; } Bm_ = YCb.Bm_(ofObject3, objectAnimator); z2 = i3; } if (view.getParent() instanceof ViewGroup) { ViewGroup viewGroup4 = (ViewGroup) view.getParent(); if (Build.VERSION.SDK_INT >= 29) { viewGroup4.suppressLayout(z); } else if (C17523xVc.e) { try { viewGroup4.suppressLayout(z); } catch (NoSuchMethodError unused) { C17523xVc.e = z2; } } a(new C17599yDT(this, viewGroup4) { // from class: o.JZy.8 final ViewGroup b; private boolean c = false; final C0542JZy d; { this.d = this; this.b = viewGroup4; } @Override // o.C17599yDT, o.VKj.Sts public final void b() { ViewGroup viewGroup5 = this.b; if (Build.VERSION.SDK_INT >= 29) { viewGroup5.suppressLayout(false); } else if (C17523xVc.e) { try { viewGroup5.suppressLayout(false); } catch (NoSuchMethodError unused2) { C17523xVc.e = false; } } this.c = true; } @Override // o.C17599yDT, o.VKj.Sts public final void e(VKj vKj) { if (!this.c) { ViewGroup viewGroup5 = this.b; if (Build.VERSION.SDK_INT >= 29) { viewGroup5.suppressLayout(false); } else if (C17523xVc.e) { try { viewGroup5.suppressLayout(false); } catch (NoSuchMethodError unused2) { C17523xVc.e = false; } } } vKj.b(this); } @Override // o.C17599yDT, o.VKj.Sts public final void a() { ViewGroup viewGroup5 = this.b; if (Build.VERSION.SDK_INT >= 29) { viewGroup5.suppressLayout(false); } else if (C17523xVc.e) { try { viewGroup5.suppressLayout(false); } catch (NoSuchMethodError unused2) { C17523xVc.e = false; } } } @Override // o.C17599yDT, o.VKj.Sts public final void c() { ViewGroup viewGroup5 = this.b; if (Build.VERSION.SDK_INT >= 29) { viewGroup5.suppressLayout(true); } else if (C17523xVc.e) { try { viewGroup5.suppressLayout(true); } catch (NoSuchMethodError unused2) { C17523xVc.e = false; } } } }); } return Bm_; } /* renamed from: o.JZy$Sts */ /* loaded from: classes.dex */ static class Sts { int a; int b; int c; int d; int e; private View g; int j; Sts(View view) { this.g = view; } final void b() { RHF.e(this.g, this.a, this.e, this.c, this.d); this.j = 0; this.b = 0; } } @Override // o.VKj public final String[] a() { return t; } }