package androidx.constraintlayout.solver.widgets; import androidx.constraintlayout.solver.Cache; import androidx.constraintlayout.solver.LinearSystem; import androidx.constraintlayout.solver.widgets.ConstraintAnchor; import java.util.ArrayList; /* loaded from: classes.dex */ public class ConstraintWidget { public static float j0 = 0.5f; protected DimensionBehaviour[] C; ConstraintWidget D; int E; int F; protected float G; protected int H; protected int I; protected int J; int K; int L; private int M; private int N; protected int O; protected int P; int Q; protected int R; protected int S; private int T; private int U; float V; float W; private Object X; private int Y; private String Z; private String a0; boolean b0; ResolutionDimension c; boolean c0; ResolutionDimension d; boolean d0; int e0; int f0; float[] g0; protected ConstraintWidget[] h0; protected ConstraintWidget[] i0; public int a = -1; public int b = -1; int e = 0; int f = 0; int[] g = new int[2]; int h = 0; int i = 0; float j = 1.0f; int k = 0; int l = 0; float m = 1.0f; int n = -1; float o = 1.0f; ConstraintWidgetGroup p = null; private int[] q = {Integer.MAX_VALUE, Integer.MAX_VALUE}; private float r = 0.0f; ConstraintAnchor s = new ConstraintAnchor(this, ConstraintAnchor.Type.LEFT); ConstraintAnchor t = new ConstraintAnchor(this, ConstraintAnchor.Type.TOP); ConstraintAnchor u = new ConstraintAnchor(this, ConstraintAnchor.Type.RIGHT); ConstraintAnchor v = new ConstraintAnchor(this, ConstraintAnchor.Type.BOTTOM); ConstraintAnchor w = new ConstraintAnchor(this, ConstraintAnchor.Type.BASELINE); ConstraintAnchor x = new ConstraintAnchor(this, ConstraintAnchor.Type.CENTER_X); ConstraintAnchor y = new ConstraintAnchor(this, ConstraintAnchor.Type.CENTER_Y); ConstraintAnchor z = new ConstraintAnchor(this, ConstraintAnchor.Type.CENTER); protected ConstraintAnchor[] A = {this.s, this.u, this.t, this.v, this.w, this.z}; protected ArrayList B = new ArrayList<>(); /* renamed from: androidx.constraintlayout.solver.widgets.ConstraintWidget$1, reason: invalid class name */ static /* synthetic */ class AnonymousClass1 { static final /* synthetic */ int[] a; static final /* synthetic */ int[] b = new int[DimensionBehaviour.values().length]; static { try { b[DimensionBehaviour.FIXED.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { b[DimensionBehaviour.WRAP_CONTENT.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { b[DimensionBehaviour.MATCH_PARENT.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } try { b[DimensionBehaviour.MATCH_CONSTRAINT.ordinal()] = 4; } catch (NoSuchFieldError unused4) { } a = new int[ConstraintAnchor.Type.values().length]; try { a[ConstraintAnchor.Type.LEFT.ordinal()] = 1; } catch (NoSuchFieldError unused5) { } try { a[ConstraintAnchor.Type.TOP.ordinal()] = 2; } catch (NoSuchFieldError unused6) { } try { a[ConstraintAnchor.Type.RIGHT.ordinal()] = 3; } catch (NoSuchFieldError unused7) { } try { a[ConstraintAnchor.Type.BOTTOM.ordinal()] = 4; } catch (NoSuchFieldError unused8) { } try { a[ConstraintAnchor.Type.BASELINE.ordinal()] = 5; } catch (NoSuchFieldError unused9) { } try { a[ConstraintAnchor.Type.CENTER.ordinal()] = 6; } catch (NoSuchFieldError unused10) { } try { a[ConstraintAnchor.Type.CENTER_X.ordinal()] = 7; } catch (NoSuchFieldError unused11) { } try { a[ConstraintAnchor.Type.CENTER_Y.ordinal()] = 8; } catch (NoSuchFieldError unused12) { } try { a[ConstraintAnchor.Type.NONE.ordinal()] = 9; } catch (NoSuchFieldError unused13) { } } } public enum ContentAlignment { BEGIN, MIDDLE, END, TOP, VERTICAL_MIDDLE, BOTTOM, LEFT, RIGHT } public enum DimensionBehaviour { FIXED, WRAP_CONTENT, MATCH_CONSTRAINT, MATCH_PARENT } public ConstraintWidget() { DimensionBehaviour dimensionBehaviour = DimensionBehaviour.FIXED; this.C = new DimensionBehaviour[]{dimensionBehaviour, dimensionBehaviour}; this.D = null; this.E = 0; this.F = 0; this.G = 0.0f; this.H = -1; this.I = 0; this.J = 0; this.K = 0; this.L = 0; this.M = 0; this.N = 0; this.O = 0; this.P = 0; this.Q = 0; float f = j0; this.V = f; this.W = f; this.Y = 0; this.Z = null; this.a0 = null; this.b0 = false; this.c0 = false; this.d0 = false; this.e0 = 0; this.f0 = 0; this.g0 = new float[]{-1.0f, -1.0f}; this.h0 = new ConstraintWidget[]{null, null}; this.i0 = new ConstraintWidget[]{null, null}; J(); } private void J() { this.B.add(this.s); this.B.add(this.t); this.B.add(this.u); this.B.add(this.v); this.B.add(this.x); this.B.add(this.y); this.B.add(this.z); this.B.add(this.w); } public boolean A() { ConstraintAnchor constraintAnchor = this.t; ConstraintAnchor constraintAnchor2 = constraintAnchor.d; if (constraintAnchor2 != null && constraintAnchor2.d == constraintAnchor) { return true; } ConstraintAnchor constraintAnchor3 = this.v; ConstraintAnchor constraintAnchor4 = constraintAnchor3.d; return constraintAnchor4 != null && constraintAnchor4.d == constraintAnchor3; } public boolean B() { return this.f == 0 && this.G == 0.0f && this.k == 0 && this.l == 0 && this.C[1] == DimensionBehaviour.MATCH_CONSTRAINT; } public boolean C() { return this.e == 0 && this.G == 0.0f && this.h == 0 && this.i == 0 && this.C[0] == DimensionBehaviour.MATCH_CONSTRAINT; } public void D() { this.s.j(); this.t.j(); this.u.j(); this.v.j(); this.w.j(); this.x.j(); this.y.j(); this.z.j(); this.D = null; this.r = 0.0f; this.E = 0; this.F = 0; this.G = 0.0f; this.H = -1; this.I = 0; this.J = 0; this.M = 0; this.N = 0; this.O = 0; this.P = 0; this.Q = 0; this.R = 0; this.S = 0; this.T = 0; this.U = 0; float f = j0; this.V = f; this.W = f; DimensionBehaviour[] dimensionBehaviourArr = this.C; DimensionBehaviour dimensionBehaviour = DimensionBehaviour.FIXED; dimensionBehaviourArr[0] = dimensionBehaviour; dimensionBehaviourArr[1] = dimensionBehaviour; this.X = null; this.Y = 0; this.a0 = null; this.e0 = 0; this.f0 = 0; float[] fArr = this.g0; fArr[0] = -1.0f; fArr[1] = -1.0f; this.a = -1; this.b = -1; int[] iArr = this.q; iArr[0] = Integer.MAX_VALUE; iArr[1] = Integer.MAX_VALUE; this.e = 0; this.f = 0; this.j = 1.0f; this.m = 1.0f; this.i = Integer.MAX_VALUE; this.l = Integer.MAX_VALUE; this.h = 0; this.k = 0; this.n = -1; this.o = 1.0f; ResolutionDimension resolutionDimension = this.c; if (resolutionDimension != null) { resolutionDimension.d(); } ResolutionDimension resolutionDimension2 = this.d; if (resolutionDimension2 != null) { resolutionDimension2.d(); } this.p = null; this.b0 = false; this.c0 = false; this.d0 = false; } public void E() { ConstraintWidget k = k(); if (k != null && (k instanceof ConstraintWidgetContainer) && ((ConstraintWidgetContainer) k()).N()) { return; } int size = this.B.size(); for (int i = 0; i < size; i++) { this.B.get(i).j(); } } public void F() { for (int i = 0; i < 6; i++) { this.A[i].d().d(); } } public void G() { } public void H() { int i = this.I; int i2 = this.J; this.M = i; this.N = i2; } public void I() { for (int i = 0; i < 6; i++) { this.A[i].d().g(); } } public void a(int i) { Optimizer.a(i, this); } public void a(boolean z) { } public void b(LinearSystem linearSystem) { linearSystem.a(this.s); linearSystem.a(this.t); linearSystem.a(this.u); linearSystem.a(this.v); if (this.Q > 0) { linearSystem.a(this.w); } } public void b(boolean z) { } public int c() { return this.Q; } public int d(int i) { if (i == 0) { return s(); } if (i == 1) { return i(); } return 0; } public Object e() { return this.X; } public String f() { return this.Z; } public int g() { return this.M + this.O; } public int h() { return this.N + this.P; } public void i(int i) { this.q[1] = i; } public void j(int i) { this.q[0] = i; } public ConstraintWidget k() { return this.D; } public ResolutionDimension l() { if (this.d == null) { this.d = new ResolutionDimension(); } return this.d; } public ResolutionDimension m() { if (this.c == null) { this.c = new ResolutionDimension(); } return this.c; } public void n(int i) { this.Y = i; } protected int o() { return this.I + this.O; } protected int p() { return this.J + this.P; } public void q(int i) { this.T = i; } public int r() { return this.Y; } public int s() { if (this.Y == 8) { return 0; } return this.E; } public int t() { return this.U; } public String toString() { String str; StringBuilder sb = new StringBuilder(); String str2 = ""; if (this.a0 != null) { str = "type: " + this.a0 + " "; } else { str = ""; } sb.append(str); if (this.Z != null) { str2 = "id: " + this.Z + " "; } sb.append(str2); sb.append("("); sb.append(this.I); sb.append(", "); sb.append(this.J); sb.append(") - ("); sb.append(this.E); sb.append(" x "); sb.append(this.F); sb.append(") wrap: ("); sb.append(this.T); sb.append(" x "); sb.append(this.U); sb.append(")"); return sb.toString(); } public int u() { return this.T; } public int v() { return this.I; } public int w() { return this.J; } public boolean x() { return this.Q > 0; } public boolean y() { return this.s.d().b == 1 && this.u.d().b == 1 && this.t.d().b == 1 && this.v.d().b == 1; } public boolean z() { ConstraintAnchor constraintAnchor = this.s; ConstraintAnchor constraintAnchor2 = constraintAnchor.d; if (constraintAnchor2 != null && constraintAnchor2.d == constraintAnchor) { return true; } ConstraintAnchor constraintAnchor3 = this.u; ConstraintAnchor constraintAnchor4 = constraintAnchor3.d; return constraintAnchor4 != null && constraintAnchor4.d == constraintAnchor3; } private boolean t(int i) { int i2 = i * 2; ConstraintAnchor[] constraintAnchorArr = this.A; if (constraintAnchorArr[i2].d != null && constraintAnchorArr[i2].d.d != constraintAnchorArr[i2]) { int i3 = i2 + 1; if (constraintAnchorArr[i3].d != null && constraintAnchorArr[i3].d.d == constraintAnchorArr[i3]) { return true; } } return false; } public void a(Cache cache) { this.s.a(cache); this.t.a(cache); this.u.a(cache); this.v.a(cache); this.w.a(cache); this.z.a(cache); this.x.a(cache); this.y.a(cache); } public void c(int i, int i2) { this.I = i; this.J = i2; } public void e(int i, int i2) { this.J = i; this.F = i2 - i; int i3 = this.F; int i4 = this.S; if (i3 < i4) { this.F = i4; } } public void f(int i) { this.Q = i; } public void g(int i) { this.F = i; int i2 = this.F; int i3 = this.S; if (i2 < i3) { this.F = i3; } } public void h(int i) { this.e0 = i; } public int i() { if (this.Y == 8) { return 0; } return this.F; } public DimensionBehaviour j() { return this.C[0]; } public void k(int i) { if (i < 0) { this.S = 0; } else { this.S = i; } } public int n() { return v() + this.E; } public void o(int i) { this.E = i; int i2 = this.E; int i3 = this.R; if (i2 < i3) { this.E = i3; } } public void p(int i) { this.U = i; } public DimensionBehaviour q() { return this.C[1]; } public void r(int i) { this.I = i; } public int d() { return w() + this.F; } public void s(int i) { this.J = i; } public void c(float f) { this.W = f; } void d(int i, int i2) { if (i2 == 0) { this.K = i; } else if (i2 == 1) { this.L = i; } } public void l(int i) { if (i < 0) { this.R = 0; } else { this.R = i; } } public void m(int i) { this.f0 = i; } public DimensionBehaviour c(int i) { if (i == 0) { return j(); } if (i == 1) { return q(); } return null; } public void d(float f) { this.g0[1] = f; } int e(int i) { if (i == 0) { return this.K; } if (i == 1) { return this.L; } return 0; } public float b(int i) { if (i == 0) { return this.V; } if (i == 1) { return this.W; } return -1.0f; } public void c(LinearSystem linearSystem) { int b = linearSystem.b(this.s); int b2 = linearSystem.b(this.t); int b3 = linearSystem.b(this.u); int b4 = linearSystem.b(this.v); int i = b4 - b2; if (b3 - b < 0 || i < 0 || b == Integer.MIN_VALUE || b == Integer.MAX_VALUE || b2 == Integer.MIN_VALUE || b2 == Integer.MAX_VALUE || b3 == Integer.MIN_VALUE || b3 == Integer.MAX_VALUE || b4 == Integer.MIN_VALUE || b4 == Integer.MAX_VALUE) { b4 = 0; b = 0; b2 = 0; b3 = 0; } a(b, b2, b3, b4); } public ArrayList b() { return this.B; } public void a(ConstraintWidget constraintWidget) { this.D = constraintWidget; } public void b(int i, int i2) { this.O = i; this.P = i2; } public void a(ConstraintWidget constraintWidget, float f, int i) { ConstraintAnchor.Type type = ConstraintAnchor.Type.CENTER; a(type, constraintWidget, type, i, 0); this.r = f; } public void b(int i, int i2, int i3, float f) { this.f = i; this.k = i2; this.l = i3; this.m = f; if (f >= 1.0f || this.f != 0) { return; } this.f = 2; } public void a(String str) { this.Z = str; } public void a(int i, int i2, int i3, float f) { this.e = i; this.h = i2; this.i = i3; this.j = f; if (f >= 1.0f || this.e != 0) { return; } this.e = 2; } /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:38:0x0084 -> B:31:0x0085). Please report as a decompilation issue!!! */ public void b(String str) { float f; int i = 0; if (str != null && str.length() != 0) { int i2 = -1; int length = str.length(); int indexOf = str.indexOf(44); int i3 = 0; if (indexOf > 0 && indexOf < length - 1) { String substring = str.substring(0, indexOf); if (substring.equalsIgnoreCase("W")) { i2 = 0; } else if (substring.equalsIgnoreCase("H")) { i2 = 1; } i3 = indexOf + 1; } int indexOf2 = str.indexOf(58); if (indexOf2 >= 0 && indexOf2 < length - 1) { String substring2 = str.substring(i3, indexOf2); String substring3 = str.substring(indexOf2 + 1); if (substring2.length() > 0 && substring3.length() > 0) { float parseFloat = Float.parseFloat(substring2); float parseFloat2 = Float.parseFloat(substring3); if (parseFloat > 0.0f && parseFloat2 > 0.0f) { if (i2 == 1) { f = Math.abs(parseFloat2 / parseFloat); } else { f = Math.abs(parseFloat / parseFloat2); } } } f = 0.0f; } else { String substring4 = str.substring(i3); if (substring4.length() > 0) { f = Float.parseFloat(substring4); } f = 0.0f; } i = (f > i ? 1 : (f == i ? 0 : -1)); if (i > 0) { this.G = f; this.H = i2; return; } return; } this.G = 0.0f; } public void a(float f) { this.V = f; } public void a(int i, int i2, int i3, int i4) { int i5; int i6; int i7 = i3 - i; int i8 = i4 - i2; this.I = i; this.J = i2; if (this.Y == 8) { this.E = 0; this.F = 0; return; } if (this.C[0] != DimensionBehaviour.FIXED || i7 >= (i5 = this.E)) { i5 = i7; } if (this.C[1] != DimensionBehaviour.FIXED || i8 >= (i6 = this.F)) { i6 = i8; } this.E = i5; this.F = i6; int i9 = this.F; int i10 = this.S; if (i9 < i10) { this.F = i10; } int i11 = this.E; int i12 = this.R; if (i11 < i12) { this.E = i12; } this.c0 = true; } public void a(int i, int i2, int i3) { if (i3 == 0) { a(i, i2); } else if (i3 == 1) { e(i, i2); } this.c0 = true; } public void a(int i, int i2) { this.I = i; this.E = i2 - i; int i3 = this.E; int i4 = this.R; if (i3 < i4) { this.E = i4; } } public void b(float f) { this.g0[0] = f; } public void b(DimensionBehaviour dimensionBehaviour) { this.C[1] = dimensionBehaviour; if (dimensionBehaviour == DimensionBehaviour.WRAP_CONTENT) { g(this.U); } } public void a(Object obj) { this.X = obj; } public boolean a() { return this.Y != 8; } public void a(ConstraintAnchor.Type type, ConstraintWidget constraintWidget, ConstraintAnchor.Type type2, int i, int i2) { a(type).a(constraintWidget.a(type2), i, i2, ConstraintAnchor.Strength.STRONG, 0, true); } public ConstraintAnchor a(ConstraintAnchor.Type type) { switch (AnonymousClass1.a[type.ordinal()]) { case 1: return this.s; case 2: return this.t; case 3: return this.u; case 4: return this.v; case 5: return this.w; case 6: return this.z; case 7: return this.x; case 8: return this.y; case 9: return null; default: throw new AssertionError(type.name()); } } public void a(DimensionBehaviour dimensionBehaviour) { this.C[0] = dimensionBehaviour; if (dimensionBehaviour == DimensionBehaviour.WRAP_CONTENT) { o(this.T); } } /* JADX WARN: Removed duplicated region for block: B:116:0x02aa */ /* JADX WARN: Removed duplicated region for block: B:119:0x02b9 */ /* JADX WARN: Removed duplicated region for block: B:122:0x02f8 */ /* JADX WARN: Removed duplicated region for block: B:127:0x032b */ /* JADX WARN: Removed duplicated region for block: B:129:? A[RETURN, SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:131:0x0321 */ /* JADX WARN: Removed duplicated region for block: B:132:0x02c1 */ /* JADX WARN: Removed duplicated region for block: B:133:0x02b3 */ /* JADX WARN: Removed duplicated region for block: B:142:0x0237 */ /* JADX WARN: Removed duplicated region for block: B:145:0x01ab A[ADDED_TO_REGION] */ /* JADX WARN: Removed duplicated region for block: B:74:0x01a1 */ /* JADX WARN: Removed duplicated region for block: B:80:0x01b7 */ /* JADX WARN: Removed duplicated region for block: B:85:0x01d0 */ /* JADX WARN: Removed duplicated region for block: B:94:0x0248 A[RETURN] */ /* JADX WARN: Removed duplicated region for block: B:96:0x0249 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public void a(androidx.constraintlayout.solver.LinearSystem r39) { /* Method dump skipped, instructions count: 844 To view this dump change 'Code comments level' option to 'DEBUG' */ throw new UnsupportedOperationException("Method not decompiled: androidx.constraintlayout.solver.widgets.ConstraintWidget.a(androidx.constraintlayout.solver.LinearSystem):void"); } public void a(boolean z, boolean z2, boolean z3, boolean z4) { if (this.n == -1) { if (z3 && !z4) { this.n = 0; } else if (!z3 && z4) { this.n = 1; if (this.H == -1) { this.o = 1.0f / this.o; } } } if (this.n == 0 && (!this.t.i() || !this.v.i())) { this.n = 1; } else if (this.n == 1 && (!this.s.i() || !this.u.i())) { this.n = 0; } if (this.n == -1 && (!this.t.i() || !this.v.i() || !this.s.i() || !this.u.i())) { if (this.t.i() && this.v.i()) { this.n = 0; } else if (this.s.i() && this.u.i()) { this.o = 1.0f / this.o; this.n = 1; } } if (this.n == -1) { if (z && !z2) { this.n = 0; } else if (!z && z2) { this.o = 1.0f / this.o; this.n = 1; } } if (this.n == -1) { if (this.h > 0 && this.k == 0) { this.n = 0; } else if (this.h == 0 && this.k > 0) { this.o = 1.0f / this.o; this.n = 1; } } if (this.n == -1 && z && z2) { this.o = 1.0f / this.o; this.n = 1; } } /* JADX WARN: Removed duplicated region for block: B:102:0x02a2 */ /* JADX WARN: Removed duplicated region for block: B:107:0x02f4 */ /* JADX WARN: Removed duplicated region for block: B:109:0x02f8 A[ADDED_TO_REGION] */ /* JADX WARN: Removed duplicated region for block: B:112:0x0305 A[ADDED_TO_REGION] */ /* JADX WARN: Removed duplicated region for block: B:115:0x0313 */ /* JADX WARN: Removed duplicated region for block: B:116:0x031c */ /* JADX WARN: Removed duplicated region for block: B:124:0x02e5 */ /* JADX WARN: Removed duplicated region for block: B:151:0x0107 */ /* JADX WARN: Removed duplicated region for block: B:168:0x01d8 A[ADDED_TO_REGION] */ /* JADX WARN: Removed duplicated region for block: B:51:0x00dd */ /* JADX WARN: Removed duplicated region for block: B:71:0x0323 */ /* JADX WARN: Removed duplicated region for block: B:73:? A[RETURN, SYNTHETIC] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ private void a(androidx.constraintlayout.solver.LinearSystem r26, boolean r27, androidx.constraintlayout.solver.SolverVariable r28, androidx.constraintlayout.solver.SolverVariable r29, androidx.constraintlayout.solver.widgets.ConstraintWidget.DimensionBehaviour r30, boolean r31, androidx.constraintlayout.solver.widgets.ConstraintAnchor r32, androidx.constraintlayout.solver.widgets.ConstraintAnchor r33, int r34, int r35, int r36, int r37, float r38, boolean r39, boolean r40, int r41, int r42, int r43, float r44, boolean r45) { /* Method dump skipped, instructions count: 827 To view this dump change 'Code comments level' option to 'DEBUG' */ throw new UnsupportedOperationException("Method not decompiled: androidx.constraintlayout.solver.widgets.ConstraintWidget.a(androidx.constraintlayout.solver.LinearSystem, boolean, androidx.constraintlayout.solver.SolverVariable, androidx.constraintlayout.solver.SolverVariable, androidx.constraintlayout.solver.widgets.ConstraintWidget$DimensionBehaviour, boolean, androidx.constraintlayout.solver.widgets.ConstraintAnchor, androidx.constraintlayout.solver.widgets.ConstraintAnchor, int, int, int, int, float, boolean, boolean, int, int, int, float, boolean):void"); } }