package o; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import o.Bgk; import o.C1230Yni; import o.C17026tNn; import o.KMk; /* loaded from: classes.dex */ public final class UhD extends Bgk { FgJ a; public KMk b; public UhD(C17026tNn c17026tNn) { super(c17026tNn); this.b = new KMk(this); this.a = null; this.f8108o.h = KMk.LWm.TOP; this.c.h = KMk.LWm.BOTTOM; this.b.h = KMk.LWm.BASELINE; this.f = 1; } public final String toString() { StringBuilder sb = new StringBuilder("VerticalRun "); sb.append(this.l.r); return sb.toString(); } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.Bgk public final void e() { this.h = null; this.f8108o.e(); this.c.e(); this.b.e(); this.e.e(); this.j = false; } public final void j() { this.j = false; this.f8108o.e(); this.f8108o.j = false; this.c.e(); this.c.j = false; this.b.e(); this.b.j = false; this.e.j = false; } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.Bgk public final boolean d() { return this.d != C17026tNn.LWm.MATCH_CONSTRAINT || this.l.I == 0; } /* renamed from: o.UhD$2, reason: invalid class name */ /* loaded from: classes.dex */ static /* synthetic */ class AnonymousClass2 { static final int[] e; static { int[] iArr = new int[Bgk.RVV.values().length]; e = iArr; try { iArr[Bgk.RVV.START.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { e[Bgk.RVV.END.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { e[Bgk.RVV.CENTER.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } } } @Override // o.Bgk, o.rZk public final void g() { float f; float f2; float f3; int i; int i2 = AnonymousClass2.e[this.g.ordinal()]; if (i2 != 1 && i2 != 2 && i2 == 3) { a(this.l.V, this.l.n, 1); return; } if (this.e.f && !this.e.j && this.d == C17026tNn.LWm.MATCH_CONSTRAINT) { int i3 = this.l.I; if (i3 != 2) { if (i3 == 3 && this.l.h.e.j) { int i4 = this.l.q; if (i4 == -1) { f = this.l.h.e.l; f2 = this.l.s; } else if (i4 == 0) { f3 = this.l.h.e.l * this.l.s; i = (int) (f3 + 0.5f); this.e.d(i); } else if (i4 == 1) { f = this.l.h.e.l; f2 = this.l.s; } else { i = 0; this.e.d(i); } f3 = f / f2; i = (int) (f3 + 0.5f); this.e.d(i); } } else { C17026tNn c17026tNn = this.l.S; if (c17026tNn != null && c17026tNn.ak.e.j) { this.e.d((int) ((c17026tNn.ak.e.l * this.l.K) + 0.5f)); } } } if (this.f8108o.f && this.c.f) { if (this.f8108o.j && this.c.j && this.e.j) { return; } if (!this.e.j && this.d == C17026tNn.LWm.MATCH_CONSTRAINT && this.l.H == 0 && !this.l.k()) { KMk kMk = this.f8108o.i.get(0); KMk kMk2 = this.c.i.get(0); int i5 = kMk.l + this.f8108o.c; int i6 = kMk2.l + this.c.c; this.f8108o.d(i5); this.c.d(i6); this.e.d(i6 - i5); return; } if (!this.e.j && this.d == C17026tNn.LWm.MATCH_CONSTRAINT && this.i == 1 && this.f8108o.i.size() > 0 && this.c.i.size() > 0) { int i7 = (this.c.i.get(0).l + this.c.c) - (this.f8108o.i.get(0).l + this.f8108o.c); if (i7 < this.e.k) { this.e.d(i7); } else { this.e.d(this.e.k); } } if (this.e.j && this.f8108o.i.size() > 0 && this.c.i.size() > 0) { KMk kMk3 = this.f8108o.i.get(0); KMk kMk4 = this.c.i.get(0); int i8 = kMk3.l + this.f8108o.c; int i9 = kMk4.l + this.c.c; float f4 = this.l.T; if (kMk3 == kMk4) { i8 = kMk3.l; i9 = kMk4.l; f4 = 0.5f; } this.f8108o.d((int) (i8 + 0.5f + (((i9 - i8) - this.e.l) * f4))); this.c.d(this.f8108o.l + this.e.l); } } } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.Bgk public final void a() { C17026tNn c17026tNn; C17026tNn c17026tNn2; if (this.l.ae) { FgJ fgJ = this.e; C17026tNn c17026tNn3 = this.l; fgJ.d(c17026tNn3.Z == 8 ? 0 : c17026tNn3.p); } if (!this.e.j) { this.d = this.l.B[1]; if (this.l.d) { this.a = new C10768eOO(this); } if (this.d != C17026tNn.LWm.MATCH_CONSTRAINT) { if (this.d != C17026tNn.LWm.MATCH_PARENT || (c17026tNn2 = this.l.S) == null || c17026tNn2.B[1] != C17026tNn.LWm.FIXED) { if (this.d == C17026tNn.LWm.FIXED) { FgJ fgJ2 = this.e; C17026tNn c17026tNn4 = this.l; fgJ2.d(c17026tNn4.Z == 8 ? 0 : c17026tNn4.p); } } else { int i = c17026tNn2.Z != 8 ? c17026tNn2.p : 0; int e = this.l.V.e(); int e2 = this.l.n.e(); KMk kMk = this.f8108o; KMk kMk2 = c17026tNn2.ak.f8108o; int e3 = this.l.V.e(); kMk.i.add(kMk2); kMk.c = e3; kMk2.d.add(kMk); KMk kMk3 = this.c; KMk kMk4 = c17026tNn2.ak.c; int i2 = -this.l.n.e(); kMk3.i.add(kMk4); kMk3.c = i2; kMk4.d.add(kMk3); this.e.d((i - e) - e2); return; } } } else if (this.d == C17026tNn.LWm.MATCH_PARENT && (c17026tNn = this.l.S) != null && c17026tNn.B[1] == C17026tNn.LWm.FIXED) { KMk kMk5 = this.f8108o; KMk kMk6 = c17026tNn.ak.f8108o; int e4 = this.l.V.e(); kMk5.i.add(kMk6); kMk5.c = e4; kMk6.d.add(kMk5); KMk kMk7 = this.c; KMk kMk8 = c17026tNn.ak.c; int i3 = -this.l.n.e(); kMk7.i.add(kMk8); kMk7.c = i3; kMk8.d.add(kMk7); return; } if (this.e.j && this.l.ae) { if (this.l.C[2].f != null && this.l.C[3].f != null) { if (this.l.k()) { this.f8108o.c = this.l.C[2].e(); this.c.c = -this.l.C[3].e(); } else { KMk c = c(this.l.C[2]); if (c != null) { KMk kMk9 = this.f8108o; int e5 = this.l.C[2].e(); kMk9.i.add(c); kMk9.c = e5; c.d.add(kMk9); } KMk c2 = c(this.l.C[3]); if (c2 != null) { KMk kMk10 = this.c; int i4 = -this.l.C[3].e(); kMk10.i.add(c2); kMk10.c = i4; c2.d.add(kMk10); } this.f8108o.a = true; this.c.a = true; } if (this.l.d) { KMk kMk11 = this.b; KMk kMk12 = this.f8108o; int i5 = this.l.k; kMk11.i.add(kMk12); kMk11.c = i5; kMk12.d.add(kMk11); return; } return; } if (this.l.C[2].f != null) { KMk c3 = c(this.l.C[2]); if (c3 != null) { KMk kMk13 = this.f8108o; int e6 = this.l.C[2].e(); kMk13.i.add(c3); kMk13.c = e6; c3.d.add(kMk13); KMk kMk14 = this.c; KMk kMk15 = this.f8108o; int i6 = this.e.l; kMk14.i.add(kMk15); kMk14.c = i6; kMk15.d.add(kMk14); if (this.l.d) { KMk kMk16 = this.b; KMk kMk17 = this.f8108o; int i7 = this.l.k; kMk16.i.add(kMk17); kMk16.c = i7; kMk17.d.add(kMk16); return; } return; } return; } if (this.l.C[3].f != null) { KMk c4 = c(this.l.C[3]); if (c4 != null) { KMk kMk18 = this.c; int i8 = -this.l.C[3].e(); kMk18.i.add(c4); kMk18.c = i8; c4.d.add(kMk18); KMk kMk19 = this.f8108o; KMk kMk20 = this.c; int i9 = -this.e.l; kMk19.i.add(kMk20); kMk19.c = i9; kMk20.d.add(kMk19); } if (this.l.d) { KMk kMk21 = this.b; KMk kMk22 = this.f8108o; int i10 = this.l.k; kMk21.i.add(kMk22); kMk21.c = i10; kMk22.d.add(kMk21); return; } return; } if (this.l.C[4].f != null) { KMk c5 = c(this.l.C[4]); if (c5 != null) { KMk kMk23 = this.b; kMk23.i.add(c5); kMk23.c = 0; c5.d.add(kMk23); KMk kMk24 = this.f8108o; KMk kMk25 = this.b; int i11 = -this.l.k; kMk24.i.add(kMk25); kMk24.c = i11; kMk25.d.add(kMk24); KMk kMk26 = this.c; KMk kMk27 = this.f8108o; int i12 = this.e.l; kMk26.i.add(kMk27); kMk26.c = i12; kMk27.d.add(kMk26); return; } return; } if ((this.l instanceof InterfaceC15462grE) || this.l.S == null || this.l.e(C1230Yni.HBt.CENTER).f != null) { return; } KMk kMk28 = this.l.S.ak.f8108o; KMk kMk29 = this.f8108o; int l = this.l.l(); kMk29.i.add(kMk28); kMk29.c = l; kMk28.d.add(kMk29); KMk kMk30 = this.c; KMk kMk31 = this.f8108o; int i13 = this.e.l; kMk30.i.add(kMk31); kMk30.c = i13; kMk31.d.add(kMk30); if (this.l.d) { KMk kMk32 = this.b; KMk kMk33 = this.f8108o; int i14 = this.l.k; kMk32.i.add(kMk33); kMk32.c = i14; kMk33.d.add(kMk32); return; } return; } if (!this.e.j && this.d == C17026tNn.LWm.MATCH_CONSTRAINT) { int i15 = this.l.I; if (i15 != 2) { if (i15 == 3 && !this.l.k() && this.l.H != 3) { FgJ fgJ3 = this.l.h.e; this.e.i.add(fgJ3); fgJ3.d.add(this.e); this.e.a = true; this.e.d.add(this.f8108o); this.e.d.add(this.c); } } else { C17026tNn c17026tNn5 = this.l.S; if (c17026tNn5 != null) { FgJ fgJ4 = c17026tNn5.ak.e; this.e.i.add(fgJ4); fgJ4.d.add(this.e); this.e.a = true; this.e.d.add(this.f8108o); this.e.d.add(this.c); } } } else { FgJ fgJ5 = this.e; fgJ5.d.add(this); if (fgJ5.j) { g(); } } if (this.l.C[2].f != null && this.l.C[3].f != null) { if (this.l.k()) { this.f8108o.c = this.l.C[2].e(); this.c.c = -this.l.C[3].e(); } else { KMk c6 = c(this.l.C[2]); KMk c7 = c(this.l.C[3]); if (c6 != null) { c6.d.add(this); if (c6.j) { g(); } } if (c7 != null) { c7.d.add(this); if (c7.j) { g(); } } this.g = Bgk.RVV.CENTER; } if (this.l.d) { d(this.b, this.f8108o, 1, this.a); } } else if (this.l.C[2].f != null) { KMk c8 = c(this.l.C[2]); if (c8 != null) { KMk kMk34 = this.f8108o; int e7 = this.l.C[2].e(); kMk34.i.add(c8); kMk34.c = e7; c8.d.add(kMk34); d(this.c, this.f8108o, 1, this.e); if (this.l.d) { d(this.b, this.f8108o, 1, this.a); } if (this.d == C17026tNn.LWm.MATCH_CONSTRAINT && this.l.s > BitmapDescriptorFactory.HUE_RED && this.l.h.d == C17026tNn.LWm.MATCH_CONSTRAINT) { this.l.h.e.d.add(this.e); this.e.i.add(this.l.h.e); this.e.n = this; } } } else if (this.l.C[3].f != null) { KMk c9 = c(this.l.C[3]); if (c9 != null) { KMk kMk35 = this.c; int i16 = -this.l.C[3].e(); kMk35.i.add(c9); kMk35.c = i16; c9.d.add(kMk35); d(this.f8108o, this.c, -1, this.e); if (this.l.d) { d(this.b, this.f8108o, 1, this.a); } } } else if (this.l.C[4].f != null) { KMk c10 = c(this.l.C[4]); if (c10 != null) { KMk kMk36 = this.b; kMk36.i.add(c10); kMk36.c = 0; c10.d.add(kMk36); d(this.f8108o, this.b, -1, this.a); d(this.c, this.f8108o, 1, this.e); } } else if (!(this.l instanceof InterfaceC15462grE) && this.l.S != null) { KMk kMk37 = this.l.S.ak.f8108o; KMk kMk38 = this.f8108o; int l2 = this.l.l(); kMk38.i.add(kMk37); kMk38.c = l2; kMk37.d.add(kMk38); d(this.c, this.f8108o, 1, this.e); if (this.l.d) { d(this.b, this.f8108o, 1, this.a); } if (this.d == C17026tNn.LWm.MATCH_CONSTRAINT && this.l.s > BitmapDescriptorFactory.HUE_RED && this.l.h.d == C17026tNn.LWm.MATCH_CONSTRAINT) { this.l.h.e.d.add(this.e); this.e.i.add(this.l.h.e); this.e.n = this; } } if (this.e.i.size() == 0) { this.e.f = true; } } @Override // o.Bgk public final void c() { if (this.f8108o.j) { this.l.h(this.f8108o.l); } } }