alexandroid/decompiled/jadx/sources/androidx/constraintlayout/solver/widgets/ConstraintWidget.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

1748 lines
65 KiB
Java

package androidx.constraintlayout.solver.widgets;
import androidx.constraintlayout.solver.Cache;
import androidx.constraintlayout.solver.LinearSystem;
import androidx.constraintlayout.solver.SolverVariable;
import androidx.constraintlayout.solver.widgets.ConstraintAnchor;
import androidx.exifinterface.media.ExifInterface;
import com.amazon.alexa.ra.core.ui.markdown.parser.formatter.MarkdownConstants;
import defpackage.a$$ExternalSyntheticOutline0;
import java.util.ArrayList;
import okio.Buffer$$ExternalSyntheticBUOutline0;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes13.dex */
public class ConstraintWidget {
protected static final int ANCHOR_BASELINE = 4;
protected static final int ANCHOR_BOTTOM = 3;
protected static final int ANCHOR_LEFT = 0;
protected static final int ANCHOR_RIGHT = 1;
protected static final int ANCHOR_TOP = 2;
private static final boolean AUTOTAG_CENTER = false;
public static final int CHAIN_PACKED = 2;
public static final int CHAIN_SPREAD = 0;
public static final int CHAIN_SPREAD_INSIDE = 1;
public static float DEFAULT_BIAS = 0.5f;
static final int DIMENSION_HORIZONTAL = 0;
static final int DIMENSION_VERTICAL = 1;
protected static final int DIRECT = 2;
public static final int GONE = 8;
public static final int HORIZONTAL = 0;
public static final int INVISIBLE = 4;
public static final int MATCH_CONSTRAINT_PERCENT = 2;
public static final int MATCH_CONSTRAINT_RATIO = 3;
public static final int MATCH_CONSTRAINT_RATIO_RESOLVED = 4;
public static final int MATCH_CONSTRAINT_SPREAD = 0;
public static final int MATCH_CONSTRAINT_WRAP = 1;
protected static final int SOLVER = 1;
public static final int UNKNOWN = -1;
public static final int VERTICAL = 1;
public static final int VISIBLE = 0;
private static final int WRAP = -2;
protected ArrayList<ConstraintAnchor> mAnchors;
ConstraintAnchor mBaseline;
int mBaselineDistance;
ConstraintWidgetGroup mBelongingGroup;
ConstraintAnchor mBottom;
boolean mBottomHasCentered;
ConstraintAnchor mCenter;
ConstraintAnchor mCenterX;
ConstraintAnchor mCenterY;
private float mCircleConstraintAngle;
private Object mCompanionWidget;
private int mContainerItemSkip;
private String mDebugName;
protected float mDimensionRatio;
protected int mDimensionRatioSide;
int mDistToBottom;
int mDistToLeft;
int mDistToRight;
int mDistToTop;
private int mDrawHeight;
private int mDrawWidth;
private int mDrawX;
private int mDrawY;
boolean mGroupsToSolver;
int mHeight;
float mHorizontalBiasPercent;
boolean mHorizontalChainFixedPosition;
int mHorizontalChainStyle;
ConstraintWidget mHorizontalNextWidget;
public int mHorizontalResolution;
boolean mHorizontalWrapVisited;
boolean mIsHeightWrapContent;
boolean mIsWidthWrapContent;
ConstraintAnchor mLeft;
boolean mLeftHasCentered;
protected ConstraintAnchor[] mListAnchors;
protected DimensionBehaviour[] mListDimensionBehaviors;
protected ConstraintWidget[] mListNextMatchConstraintsWidget;
int mMatchConstraintDefaultHeight;
int mMatchConstraintDefaultWidth;
int mMatchConstraintMaxHeight;
int mMatchConstraintMaxWidth;
int mMatchConstraintMinHeight;
int mMatchConstraintMinWidth;
float mMatchConstraintPercentHeight;
float mMatchConstraintPercentWidth;
private int[] mMaxDimension;
protected int mMinHeight;
protected int mMinWidth;
protected ConstraintWidget[] mNextChainWidget;
protected int mOffsetX;
protected int mOffsetY;
boolean mOptimizerMeasurable;
boolean mOptimizerMeasured;
ConstraintWidget mParent;
int mRelX;
int mRelY;
ResolutionDimension mResolutionHeight;
ResolutionDimension mResolutionWidth;
float mResolvedDimensionRatio;
int mResolvedDimensionRatioSide;
int[] mResolvedMatchConstraintDefault;
ConstraintAnchor mRight;
boolean mRightHasCentered;
ConstraintAnchor mTop;
boolean mTopHasCentered;
private String mType;
float mVerticalBiasPercent;
boolean mVerticalChainFixedPosition;
int mVerticalChainStyle;
ConstraintWidget mVerticalNextWidget;
public int mVerticalResolution;
boolean mVerticalWrapVisited;
private int mVisibility;
float[] mWeight;
int mWidth;
private int mWrapHeight;
private int mWrapWidth;
protected int mX;
protected int mY;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* renamed from: androidx.constraintlayout.solver.widgets.ConstraintWidget$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintAnchor$Type;
static final /* synthetic */ int[] $SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintWidget$DimensionBehaviour;
static {
int[] iArr = new int[DimensionBehaviour.values().length];
$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintWidget$DimensionBehaviour = iArr;
try {
iArr[DimensionBehaviour.FIXED.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintWidget$DimensionBehaviour[DimensionBehaviour.WRAP_CONTENT.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintWidget$DimensionBehaviour[DimensionBehaviour.MATCH_PARENT.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintWidget$DimensionBehaviour[DimensionBehaviour.MATCH_CONSTRAINT.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
int[] iArr2 = new int[ConstraintAnchor.Type.values().length];
$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintAnchor$Type = iArr2;
try {
iArr2[ConstraintAnchor.Type.LEFT.ordinal()] = 1;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintAnchor$Type[ConstraintAnchor.Type.TOP.ordinal()] = 2;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintAnchor$Type[ConstraintAnchor.Type.RIGHT.ordinal()] = 3;
} catch (NoSuchFieldError unused7) {
}
try {
$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintAnchor$Type[ConstraintAnchor.Type.BOTTOM.ordinal()] = 4;
} catch (NoSuchFieldError unused8) {
}
try {
$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintAnchor$Type[ConstraintAnchor.Type.BASELINE.ordinal()] = 5;
} catch (NoSuchFieldError unused9) {
}
try {
$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintAnchor$Type[ConstraintAnchor.Type.CENTER.ordinal()] = 6;
} catch (NoSuchFieldError unused10) {
}
try {
$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintAnchor$Type[ConstraintAnchor.Type.CENTER_X.ordinal()] = 7;
} catch (NoSuchFieldError unused11) {
}
try {
$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintAnchor$Type[ConstraintAnchor.Type.CENTER_Y.ordinal()] = 8;
} catch (NoSuchFieldError unused12) {
}
try {
$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintAnchor$Type[ConstraintAnchor.Type.NONE.ordinal()] = 9;
} catch (NoSuchFieldError unused13) {
}
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public enum ContentAlignment {
BEGIN,
MIDDLE,
END,
TOP,
VERTICAL_MIDDLE,
BOTTOM,
LEFT,
RIGHT
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public enum DimensionBehaviour {
FIXED,
WRAP_CONTENT,
MATCH_CONSTRAINT,
MATCH_PARENT
}
public ConstraintWidget(int i, int i2, int i3, int i4) {
this.mHorizontalResolution = -1;
this.mVerticalResolution = -1;
this.mMatchConstraintDefaultWidth = 0;
this.mMatchConstraintDefaultHeight = 0;
this.mResolvedMatchConstraintDefault = new int[2];
this.mMatchConstraintMinWidth = 0;
this.mMatchConstraintMaxWidth = 0;
this.mMatchConstraintPercentWidth = 1.0f;
this.mMatchConstraintMinHeight = 0;
this.mMatchConstraintMaxHeight = 0;
this.mMatchConstraintPercentHeight = 1.0f;
this.mResolvedDimensionRatioSide = -1;
this.mResolvedDimensionRatio = 1.0f;
this.mBelongingGroup = null;
this.mMaxDimension = new int[]{Integer.MAX_VALUE, Integer.MAX_VALUE};
this.mCircleConstraintAngle = 0.0f;
this.mLeft = new ConstraintAnchor(this, ConstraintAnchor.Type.LEFT);
this.mTop = new ConstraintAnchor(this, ConstraintAnchor.Type.TOP);
this.mRight = new ConstraintAnchor(this, ConstraintAnchor.Type.RIGHT);
this.mBottom = new ConstraintAnchor(this, ConstraintAnchor.Type.BOTTOM);
this.mBaseline = new ConstraintAnchor(this, ConstraintAnchor.Type.BASELINE);
this.mCenterX = new ConstraintAnchor(this, ConstraintAnchor.Type.CENTER_X);
this.mCenterY = new ConstraintAnchor(this, ConstraintAnchor.Type.CENTER_Y);
ConstraintAnchor constraintAnchor = new ConstraintAnchor(this, ConstraintAnchor.Type.CENTER);
this.mCenter = constraintAnchor;
this.mListAnchors = new ConstraintAnchor[]{this.mLeft, this.mRight, this.mTop, this.mBottom, this.mBaseline, constraintAnchor};
this.mAnchors = new ArrayList<>();
DimensionBehaviour dimensionBehaviour = DimensionBehaviour.FIXED;
this.mListDimensionBehaviors = new DimensionBehaviour[]{dimensionBehaviour, dimensionBehaviour};
this.mParent = null;
this.mDimensionRatio = 0.0f;
this.mDimensionRatioSide = -1;
this.mRelX = 0;
this.mRelY = 0;
this.mDrawX = 0;
this.mDrawY = 0;
this.mDrawWidth = 0;
this.mDrawHeight = 0;
this.mOffsetX = 0;
this.mOffsetY = 0;
this.mBaselineDistance = 0;
float f = DEFAULT_BIAS;
this.mHorizontalBiasPercent = f;
this.mVerticalBiasPercent = f;
this.mContainerItemSkip = 0;
this.mVisibility = 0;
this.mDebugName = null;
this.mType = null;
this.mOptimizerMeasurable = false;
this.mOptimizerMeasured = false;
this.mGroupsToSolver = false;
this.mHorizontalChainStyle = 0;
this.mVerticalChainStyle = 0;
this.mWeight = new float[]{-1.0f, -1.0f};
this.mListNextMatchConstraintsWidget = new ConstraintWidget[]{null, null};
this.mNextChainWidget = new ConstraintWidget[]{null, null};
this.mHorizontalNextWidget = null;
this.mVerticalNextWidget = null;
this.mX = i;
this.mY = i2;
this.mWidth = i3;
this.mHeight = i4;
addAnchors();
forceUpdateDrawPosition();
}
private void addAnchors() {
this.mAnchors.add(this.mLeft);
this.mAnchors.add(this.mTop);
this.mAnchors.add(this.mRight);
this.mAnchors.add(this.mBottom);
this.mAnchors.add(this.mCenterX);
this.mAnchors.add(this.mCenterY);
this.mAnchors.add(this.mCenter);
this.mAnchors.add(this.mBaseline);
}
/* JADX WARN: Removed duplicated region for block: B:102:0x02bf */
/* JADX WARN: Removed duplicated region for block: B:104:0x02c3 A[ADDED_TO_REGION] */
/* JADX WARN: Removed duplicated region for block: B:107:0x02d0 A[ADDED_TO_REGION] */
/* JADX WARN: Removed duplicated region for block: B:110:0x02de */
/* JADX WARN: Removed duplicated region for block: B:117:0x02b2 */
/* JADX WARN: Removed duplicated region for block: B:143:0x0105 */
/* JADX WARN: Removed duplicated region for block: B:161:0x01bd A[ADDED_TO_REGION] */
/* JADX WARN: Removed duplicated region for block: B:49:0x00de */
/* JADX WARN: Removed duplicated region for block: B:97:0x0279 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private void applyConstraints(androidx.constraintlayout.solver.LinearSystem r22, boolean r23, androidx.constraintlayout.solver.SolverVariable r24, androidx.constraintlayout.solver.SolverVariable r25, androidx.constraintlayout.solver.widgets.ConstraintWidget.DimensionBehaviour r26, boolean r27, androidx.constraintlayout.solver.widgets.ConstraintAnchor r28, androidx.constraintlayout.solver.widgets.ConstraintAnchor r29, int r30, int r31, int r32, int r33, float r34, boolean r35, boolean r36, int r37, int r38, int r39, float r40, boolean r41) {
/*
Method dump skipped, instructions count: 756
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.constraintlayout.solver.widgets.ConstraintWidget.applyConstraints(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");
}
private boolean isChainHead(int i) {
ConstraintAnchor constraintAnchor;
ConstraintAnchor constraintAnchor2;
int i2 = i * 2;
ConstraintAnchor[] constraintAnchorArr = this.mListAnchors;
ConstraintAnchor constraintAnchor3 = constraintAnchorArr[i2];
ConstraintAnchor constraintAnchor4 = constraintAnchor3.mTarget;
return (constraintAnchor4 == null || constraintAnchor4.mTarget == constraintAnchor3 || (constraintAnchor2 = (constraintAnchor = constraintAnchorArr[i2 + 1]).mTarget) == null || constraintAnchor2.mTarget != constraintAnchor) ? false : true;
}
/* JADX WARN: Removed duplicated region for block: B:111:0x0297 */
/* JADX WARN: Removed duplicated region for block: B:114:0x02a5 */
/* JADX WARN: Removed duplicated region for block: B:117:0x02dc */
/* JADX WARN: Removed duplicated region for block: B:123:0x030a */
/* JADX WARN: Removed duplicated region for block: B:126:? A[RETURN, SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:128:0x029f */
/* JADX WARN: Removed duplicated region for block: B:132:? A[RETURN, SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:135:0x022c */
/* JADX WARN: Removed duplicated region for block: B:138:0x019f */
/* JADX WARN: Removed duplicated region for block: B:70:0x0196 */
/* JADX WARN: Removed duplicated region for block: B:76:0x01ab */
/* JADX WARN: Removed duplicated region for block: B:81:0x01c5 */
/* JADX WARN: Removed duplicated region for block: B:90:0x0241 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public void addToSolver(androidx.constraintlayout.solver.LinearSystem r40) {
/*
Method dump skipped, instructions count: 809
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.constraintlayout.solver.widgets.ConstraintWidget.addToSolver(androidx.constraintlayout.solver.LinearSystem):void");
}
public boolean allowedInBarrier() {
return this.mVisibility != 8;
}
public void analyze(int i) {
Optimizer.analyze(i, this);
}
public void connect(ConstraintAnchor.Type type, ConstraintWidget constraintWidget, ConstraintAnchor.Type type2, int i, ConstraintAnchor.Strength strength, int i2) {
ConstraintAnchor.Type type3;
ConstraintAnchor.Type type4;
boolean z;
ConstraintWidget constraintWidget2;
int i3;
ConstraintAnchor.Type type5 = ConstraintAnchor.Type.CENTER;
int i4 = 0;
if (type == type5) {
if (type2 != type5) {
ConstraintAnchor.Type type6 = ConstraintAnchor.Type.LEFT;
if (type2 == type6 || type2 == ConstraintAnchor.Type.RIGHT) {
connect(type6, constraintWidget, type2, 0, strength, i2);
connect(ConstraintAnchor.Type.RIGHT, constraintWidget, type2, 0, strength, i2);
getAnchor(type5).connect(constraintWidget.getAnchor(type2), 0, i2);
return;
}
ConstraintAnchor.Type type7 = ConstraintAnchor.Type.TOP;
if (type2 == type7 || type2 == ConstraintAnchor.Type.BOTTOM) {
connect(type7, constraintWidget, type2, 0, strength, i2);
connect(ConstraintAnchor.Type.BOTTOM, constraintWidget, type2, 0, strength, i2);
getAnchor(type5).connect(constraintWidget.getAnchor(type2), 0, i2);
return;
}
return;
}
ConstraintAnchor.Type type8 = ConstraintAnchor.Type.LEFT;
ConstraintAnchor anchor = getAnchor(type8);
ConstraintAnchor.Type type9 = ConstraintAnchor.Type.RIGHT;
ConstraintAnchor anchor2 = getAnchor(type9);
ConstraintAnchor.Type type10 = ConstraintAnchor.Type.TOP;
ConstraintAnchor anchor3 = getAnchor(type10);
ConstraintAnchor.Type type11 = ConstraintAnchor.Type.BOTTOM;
ConstraintAnchor anchor4 = getAnchor(type11);
boolean z2 = true;
if ((anchor == null || !anchor.isConnected()) && (anchor2 == null || !anchor2.isConnected())) {
connect(type8, constraintWidget, type8, 0, strength, i2);
connect(type9, constraintWidget, type9, 0, strength, i2);
z = true;
} else {
z = false;
}
if ((anchor3 == null || !anchor3.isConnected()) && (anchor4 == null || !anchor4.isConnected())) {
constraintWidget2 = constraintWidget;
i3 = i2;
connect(type10, constraintWidget2, type10, 0, strength, i3);
connect(type11, constraintWidget2, type11, 0, strength, i3);
} else {
constraintWidget2 = constraintWidget;
i3 = i2;
z2 = false;
}
if (z && z2) {
getAnchor(type5).connect(constraintWidget2.getAnchor(type5), 0, i3);
return;
}
if (z) {
ConstraintAnchor.Type type12 = ConstraintAnchor.Type.CENTER_X;
getAnchor(type12).connect(constraintWidget2.getAnchor(type12), 0, i3);
return;
} else {
if (z2) {
ConstraintAnchor.Type type13 = ConstraintAnchor.Type.CENTER_Y;
getAnchor(type13).connect(constraintWidget2.getAnchor(type13), 0, i3);
return;
}
return;
}
}
ConstraintAnchor.Type type14 = ConstraintAnchor.Type.CENTER_X;
if (type == type14 && (type2 == (type4 = ConstraintAnchor.Type.LEFT) || type2 == ConstraintAnchor.Type.RIGHT)) {
ConstraintAnchor anchor5 = getAnchor(type4);
ConstraintAnchor anchor6 = constraintWidget.getAnchor(type2);
ConstraintAnchor anchor7 = getAnchor(ConstraintAnchor.Type.RIGHT);
anchor5.connect(anchor6, 0, i2);
anchor7.connect(anchor6, 0, i2);
getAnchor(type14).connect(anchor6, 0, i2);
return;
}
ConstraintAnchor.Type type15 = ConstraintAnchor.Type.CENTER_Y;
if (type == type15 && (type2 == (type3 = ConstraintAnchor.Type.TOP) || type2 == ConstraintAnchor.Type.BOTTOM)) {
ConstraintAnchor anchor8 = constraintWidget.getAnchor(type2);
getAnchor(type3).connect(anchor8, 0, i2);
getAnchor(ConstraintAnchor.Type.BOTTOM).connect(anchor8, 0, i2);
getAnchor(type15).connect(anchor8, 0, i2);
return;
}
if (type == type14 && type2 == type14) {
ConstraintAnchor.Type type16 = ConstraintAnchor.Type.LEFT;
getAnchor(type16).connect(constraintWidget.getAnchor(type16), 0, i2);
ConstraintAnchor.Type type17 = ConstraintAnchor.Type.RIGHT;
getAnchor(type17).connect(constraintWidget.getAnchor(type17), 0, i2);
getAnchor(type14).connect(constraintWidget.getAnchor(type2), 0, i2);
return;
}
if (type == type15 && type2 == type15) {
ConstraintAnchor.Type type18 = ConstraintAnchor.Type.TOP;
getAnchor(type18).connect(constraintWidget.getAnchor(type18), 0, i2);
ConstraintAnchor.Type type19 = ConstraintAnchor.Type.BOTTOM;
getAnchor(type19).connect(constraintWidget.getAnchor(type19), 0, i2);
getAnchor(type15).connect(constraintWidget.getAnchor(type2), 0, i2);
return;
}
ConstraintAnchor anchor9 = getAnchor(type);
ConstraintAnchor anchor10 = constraintWidget.getAnchor(type2);
if (anchor9.isValidConnection(anchor10)) {
ConstraintAnchor.Type type20 = ConstraintAnchor.Type.BASELINE;
if (type == type20) {
ConstraintAnchor anchor11 = getAnchor(ConstraintAnchor.Type.TOP);
ConstraintAnchor anchor12 = getAnchor(ConstraintAnchor.Type.BOTTOM);
if (anchor11 != null) {
anchor11.reset();
}
if (anchor12 != null) {
anchor12.reset();
}
} else {
if (type == ConstraintAnchor.Type.TOP || type == ConstraintAnchor.Type.BOTTOM) {
ConstraintAnchor anchor13 = getAnchor(type20);
if (anchor13 != null) {
anchor13.reset();
}
ConstraintAnchor anchor14 = getAnchor(type5);
if (anchor14.getTarget() != anchor10) {
anchor14.reset();
}
ConstraintAnchor opposite = getAnchor(type).getOpposite();
ConstraintAnchor anchor15 = getAnchor(type15);
if (anchor15.isConnected()) {
opposite.reset();
anchor15.reset();
}
} else if (type == ConstraintAnchor.Type.LEFT || type == ConstraintAnchor.Type.RIGHT) {
ConstraintAnchor anchor16 = getAnchor(type5);
if (anchor16.getTarget() != anchor10) {
anchor16.reset();
}
ConstraintAnchor opposite2 = getAnchor(type).getOpposite();
ConstraintAnchor anchor17 = getAnchor(type14);
if (anchor17.isConnected()) {
opposite2.reset();
anchor17.reset();
}
}
i4 = i;
}
anchor9.connect(anchor10, i4, strength, i2);
anchor10.getOwner().connectedTo(anchor9.getOwner());
}
}
public void connectCircularConstraint(ConstraintWidget constraintWidget, float f, int i) {
ConstraintAnchor.Type type = ConstraintAnchor.Type.CENTER;
immediateConnect(type, constraintWidget, type, i, 0);
this.mCircleConstraintAngle = f;
}
public void createObjectVariables(LinearSystem linearSystem) {
linearSystem.createObjectVariable(this.mLeft);
linearSystem.createObjectVariable(this.mTop);
linearSystem.createObjectVariable(this.mRight);
linearSystem.createObjectVariable(this.mBottom);
if (this.mBaselineDistance > 0) {
linearSystem.createObjectVariable(this.mBaseline);
}
}
public void disconnectUnlockedWidget(ConstraintWidget constraintWidget) {
ArrayList<ConstraintAnchor> anchors = getAnchors();
int size = anchors.size();
for (int i = 0; i < size; i++) {
ConstraintAnchor constraintAnchor = anchors.get(i);
if (constraintAnchor.isConnected() && constraintAnchor.getTarget().getOwner() == constraintWidget && constraintAnchor.getConnectionCreator() == 2) {
constraintAnchor.reset();
}
}
}
public void disconnectWidget(ConstraintWidget constraintWidget) {
ArrayList<ConstraintAnchor> anchors = getAnchors();
int size = anchors.size();
for (int i = 0; i < size; i++) {
ConstraintAnchor constraintAnchor = anchors.get(i);
if (constraintAnchor.isConnected() && constraintAnchor.getTarget().getOwner() == constraintWidget) {
constraintAnchor.reset();
}
}
}
public void forceUpdateDrawPosition() {
int i = this.mX;
int i2 = this.mY;
int i3 = this.mWidth + i;
int i4 = this.mHeight + i2;
this.mDrawX = i;
this.mDrawY = i2;
this.mDrawWidth = i3 - i;
this.mDrawHeight = i4 - i2;
}
public ConstraintAnchor getAnchor(ConstraintAnchor.Type type) {
switch (AnonymousClass1.$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintAnchor$Type[type.ordinal()]) {
case 1:
return this.mLeft;
case 2:
return this.mTop;
case 3:
return this.mRight;
case 4:
return this.mBottom;
case 5:
return this.mBaseline;
case 6:
return this.mCenter;
case 7:
return this.mCenterX;
case 8:
return this.mCenterY;
case 9:
return null;
default:
Buffer$$ExternalSyntheticBUOutline0.m((Object) type.name());
return null;
}
}
public ArrayList<ConstraintAnchor> getAnchors() {
return this.mAnchors;
}
public int getBaselineDistance() {
return this.mBaselineDistance;
}
public float getBiasPercent(int i) {
if (i == 0) {
return this.mHorizontalBiasPercent;
}
if (i == 1) {
return this.mVerticalBiasPercent;
}
return -1.0f;
}
public int getBottom() {
return getY() + this.mHeight;
}
public Object getCompanionWidget() {
return this.mCompanionWidget;
}
public int getContainerItemSkip() {
return this.mContainerItemSkip;
}
public String getDebugName() {
return this.mDebugName;
}
public DimensionBehaviour getDimensionBehaviour(int i) {
if (i == 0) {
return getHorizontalDimensionBehaviour();
}
if (i == 1) {
return getVerticalDimensionBehaviour();
}
return null;
}
public float getDimensionRatio() {
return this.mDimensionRatio;
}
public int getDimensionRatioSide() {
return this.mDimensionRatioSide;
}
public int getDrawBottom() {
return getDrawY() + this.mDrawHeight;
}
public int getDrawHeight() {
return this.mDrawHeight;
}
public int getDrawRight() {
return getDrawX() + this.mDrawWidth;
}
public int getDrawWidth() {
return this.mDrawWidth;
}
public int getDrawX() {
return this.mDrawX + this.mOffsetX;
}
public int getDrawY() {
return this.mDrawY + this.mOffsetY;
}
public int getHeight() {
if (this.mVisibility == 8) {
return 0;
}
return this.mHeight;
}
public float getHorizontalBiasPercent() {
return this.mHorizontalBiasPercent;
}
public ConstraintWidget getHorizontalChainControlWidget() {
if (!isInHorizontalChain()) {
return null;
}
ConstraintWidget constraintWidget = this;
ConstraintWidget constraintWidget2 = null;
while (constraintWidget2 == null && constraintWidget != null) {
ConstraintAnchor anchor = constraintWidget.getAnchor(ConstraintAnchor.Type.LEFT);
ConstraintAnchor target = anchor == null ? null : anchor.getTarget();
ConstraintWidget owner = target == null ? null : target.getOwner();
if (owner == getParent()) {
return constraintWidget;
}
ConstraintAnchor target2 = owner == null ? null : owner.getAnchor(ConstraintAnchor.Type.RIGHT).getTarget();
if (target2 == null || target2.getOwner() == constraintWidget) {
constraintWidget = owner;
} else {
constraintWidget2 = constraintWidget;
}
}
return constraintWidget2;
}
public int getHorizontalChainStyle() {
return this.mHorizontalChainStyle;
}
public DimensionBehaviour getHorizontalDimensionBehaviour() {
return this.mListDimensionBehaviors[0];
}
public int getInternalDrawBottom() {
return this.mDrawY + this.mDrawHeight;
}
public int getInternalDrawRight() {
return this.mDrawX + this.mDrawWidth;
}
public int getInternalDrawX() {
return this.mDrawX;
}
public int getInternalDrawY() {
return this.mDrawY;
}
public int getLeft() {
return getX();
}
public int getLength(int i) {
if (i == 0) {
return getWidth();
}
if (i == 1) {
return getHeight();
}
return 0;
}
public int getMaxHeight() {
return this.mMaxDimension[1];
}
public int getMaxWidth() {
return this.mMaxDimension[0];
}
public int getMinHeight() {
return this.mMinHeight;
}
public int getMinWidth() {
return this.mMinWidth;
}
public int getOptimizerWrapHeight() {
int i = this.mHeight;
if (this.mListDimensionBehaviors[1] != DimensionBehaviour.MATCH_CONSTRAINT) {
return i;
}
int i2 = this.mMatchConstraintDefaultHeight;
int i3 = this.mMatchConstraintMinHeight;
if (i2 == 1) {
i3 = Math.max(i3, i);
} else if (i3 > 0) {
this.mHeight = i3;
} else {
i3 = 0;
}
int i4 = this.mMatchConstraintMaxHeight;
return (i4 <= 0 || i4 >= i3) ? i3 : i4;
}
public int getOptimizerWrapWidth() {
int i = this.mWidth;
int i2 = 0;
if (this.mListDimensionBehaviors[0] != DimensionBehaviour.MATCH_CONSTRAINT) {
return i;
}
int i3 = this.mMatchConstraintDefaultWidth;
int i4 = this.mMatchConstraintMinWidth;
if (i3 == 1) {
i2 = Math.max(i4, i);
} else if (i4 > 0) {
this.mWidth = i4;
i2 = i4;
}
int i5 = this.mMatchConstraintMaxWidth;
return (i5 <= 0 || i5 >= i2) ? i2 : i5;
}
public ConstraintWidget getParent() {
return this.mParent;
}
public int getRelativePositioning(int i) {
if (i == 0) {
return this.mRelX;
}
if (i == 1) {
return this.mRelY;
}
return 0;
}
public ResolutionDimension getResolutionHeight() {
if (this.mResolutionHeight == null) {
this.mResolutionHeight = new ResolutionDimension();
}
return this.mResolutionHeight;
}
public ResolutionDimension getResolutionWidth() {
if (this.mResolutionWidth == null) {
this.mResolutionWidth = new ResolutionDimension();
}
return this.mResolutionWidth;
}
public int getRight() {
return getX() + this.mWidth;
}
public WidgetContainer getRootWidgetContainer() {
while (this.getParent() != null) {
this = this.getParent();
}
if (this instanceof WidgetContainer) {
return (WidgetContainer) this;
}
return null;
}
public int getRootX() {
return this.mX + this.mOffsetX;
}
public int getRootY() {
return this.mY + this.mOffsetY;
}
public int getTop() {
return getY();
}
public String getType() {
return this.mType;
}
public float getVerticalBiasPercent() {
return this.mVerticalBiasPercent;
}
public ConstraintWidget getVerticalChainControlWidget() {
if (!isInVerticalChain()) {
return null;
}
ConstraintWidget constraintWidget = this;
ConstraintWidget constraintWidget2 = null;
while (constraintWidget2 == null && constraintWidget != null) {
ConstraintAnchor anchor = constraintWidget.getAnchor(ConstraintAnchor.Type.TOP);
ConstraintAnchor target = anchor == null ? null : anchor.getTarget();
ConstraintWidget owner = target == null ? null : target.getOwner();
if (owner == getParent()) {
return constraintWidget;
}
ConstraintAnchor target2 = owner == null ? null : owner.getAnchor(ConstraintAnchor.Type.BOTTOM).getTarget();
if (target2 == null || target2.getOwner() == constraintWidget) {
constraintWidget = owner;
} else {
constraintWidget2 = constraintWidget;
}
}
return constraintWidget2;
}
public int getVerticalChainStyle() {
return this.mVerticalChainStyle;
}
public DimensionBehaviour getVerticalDimensionBehaviour() {
return this.mListDimensionBehaviors[1];
}
public int getVisibility() {
return this.mVisibility;
}
public int getWidth() {
if (this.mVisibility == 8) {
return 0;
}
return this.mWidth;
}
public int getWrapHeight() {
return this.mWrapHeight;
}
public int getWrapWidth() {
return this.mWrapWidth;
}
public int getX() {
return this.mX;
}
public int getY() {
return this.mY;
}
public boolean hasAncestor(ConstraintWidget constraintWidget) {
ConstraintWidget parent = getParent();
if (parent == constraintWidget) {
return true;
}
if (parent == constraintWidget.getParent()) {
return false;
}
while (parent != null) {
if (parent == constraintWidget || parent == constraintWidget.getParent()) {
return true;
}
parent = parent.getParent();
}
return false;
}
public boolean hasBaseline() {
return this.mBaselineDistance > 0;
}
public void immediateConnect(ConstraintAnchor.Type type, ConstraintWidget constraintWidget, ConstraintAnchor.Type type2, int i, int i2) {
getAnchor(type).connect(constraintWidget.getAnchor(type2), i, i2, ConstraintAnchor.Strength.STRONG, 0, true);
}
public boolean isFullyResolved() {
return this.mLeft.getResolutionNode().state == 1 && this.mRight.getResolutionNode().state == 1 && this.mTop.getResolutionNode().state == 1 && this.mBottom.getResolutionNode().state == 1;
}
public boolean isHeightWrapContent() {
return this.mIsHeightWrapContent;
}
public boolean isInHorizontalChain() {
ConstraintAnchor constraintAnchor = this.mLeft;
ConstraintAnchor constraintAnchor2 = constraintAnchor.mTarget;
if (constraintAnchor2 != null && constraintAnchor2.mTarget == constraintAnchor) {
return true;
}
ConstraintAnchor constraintAnchor3 = this.mRight;
ConstraintAnchor constraintAnchor4 = constraintAnchor3.mTarget;
return constraintAnchor4 != null && constraintAnchor4.mTarget == constraintAnchor3;
}
public boolean isInVerticalChain() {
ConstraintAnchor constraintAnchor = this.mTop;
ConstraintAnchor constraintAnchor2 = constraintAnchor.mTarget;
if (constraintAnchor2 != null && constraintAnchor2.mTarget == constraintAnchor) {
return true;
}
ConstraintAnchor constraintAnchor3 = this.mBottom;
ConstraintAnchor constraintAnchor4 = constraintAnchor3.mTarget;
return constraintAnchor4 != null && constraintAnchor4.mTarget == constraintAnchor3;
}
public boolean isInsideConstraintLayout() {
ConstraintWidget parent = getParent();
if (parent == null) {
return false;
}
while (parent != null) {
if (parent instanceof ConstraintWidgetContainer) {
return true;
}
parent = parent.getParent();
}
return false;
}
public boolean isRoot() {
return this.mParent == null;
}
public boolean isRootContainer() {
if (!(this instanceof ConstraintWidgetContainer)) {
return false;
}
ConstraintWidget constraintWidget = this.mParent;
return constraintWidget == null || !(constraintWidget instanceof ConstraintWidgetContainer);
}
public boolean isSpreadHeight() {
return this.mMatchConstraintDefaultHeight == 0 && this.mDimensionRatio == 0.0f && this.mMatchConstraintMinHeight == 0 && this.mMatchConstraintMaxHeight == 0 && this.mListDimensionBehaviors[1] == DimensionBehaviour.MATCH_CONSTRAINT;
}
public boolean isSpreadWidth() {
return this.mMatchConstraintDefaultWidth == 0 && this.mDimensionRatio == 0.0f && this.mMatchConstraintMinWidth == 0 && this.mMatchConstraintMaxWidth == 0 && this.mListDimensionBehaviors[0] == DimensionBehaviour.MATCH_CONSTRAINT;
}
public boolean isWidthWrapContent() {
return this.mIsWidthWrapContent;
}
public void reset() {
this.mLeft.reset();
this.mTop.reset();
this.mRight.reset();
this.mBottom.reset();
this.mBaseline.reset();
this.mCenterX.reset();
this.mCenterY.reset();
this.mCenter.reset();
this.mParent = null;
this.mCircleConstraintAngle = 0.0f;
this.mWidth = 0;
this.mHeight = 0;
this.mDimensionRatio = 0.0f;
this.mDimensionRatioSide = -1;
this.mX = 0;
this.mY = 0;
this.mDrawX = 0;
this.mDrawY = 0;
this.mDrawWidth = 0;
this.mDrawHeight = 0;
this.mOffsetX = 0;
this.mOffsetY = 0;
this.mBaselineDistance = 0;
this.mMinWidth = 0;
this.mMinHeight = 0;
this.mWrapWidth = 0;
this.mWrapHeight = 0;
float f = DEFAULT_BIAS;
this.mHorizontalBiasPercent = f;
this.mVerticalBiasPercent = f;
DimensionBehaviour[] dimensionBehaviourArr = this.mListDimensionBehaviors;
DimensionBehaviour dimensionBehaviour = DimensionBehaviour.FIXED;
dimensionBehaviourArr[0] = dimensionBehaviour;
dimensionBehaviourArr[1] = dimensionBehaviour;
this.mCompanionWidget = null;
this.mContainerItemSkip = 0;
this.mVisibility = 0;
this.mType = null;
this.mHorizontalWrapVisited = false;
this.mVerticalWrapVisited = false;
this.mHorizontalChainStyle = 0;
this.mVerticalChainStyle = 0;
this.mHorizontalChainFixedPosition = false;
this.mVerticalChainFixedPosition = false;
float[] fArr = this.mWeight;
fArr[0] = -1.0f;
fArr[1] = -1.0f;
this.mHorizontalResolution = -1;
this.mVerticalResolution = -1;
int[] iArr = this.mMaxDimension;
iArr[0] = Integer.MAX_VALUE;
iArr[1] = Integer.MAX_VALUE;
this.mMatchConstraintDefaultWidth = 0;
this.mMatchConstraintDefaultHeight = 0;
this.mMatchConstraintPercentWidth = 1.0f;
this.mMatchConstraintPercentHeight = 1.0f;
this.mMatchConstraintMaxWidth = Integer.MAX_VALUE;
this.mMatchConstraintMaxHeight = Integer.MAX_VALUE;
this.mMatchConstraintMinWidth = 0;
this.mMatchConstraintMinHeight = 0;
this.mResolvedDimensionRatioSide = -1;
this.mResolvedDimensionRatio = 1.0f;
ResolutionDimension resolutionDimension = this.mResolutionWidth;
if (resolutionDimension != null) {
resolutionDimension.reset();
}
ResolutionDimension resolutionDimension2 = this.mResolutionHeight;
if (resolutionDimension2 != null) {
resolutionDimension2.reset();
}
this.mBelongingGroup = null;
this.mOptimizerMeasurable = false;
this.mOptimizerMeasured = false;
this.mGroupsToSolver = false;
}
public void resetAllConstraints() {
resetAnchors();
setVerticalBiasPercent(DEFAULT_BIAS);
setHorizontalBiasPercent(DEFAULT_BIAS);
if (this instanceof ConstraintWidgetContainer) {
return;
}
DimensionBehaviour horizontalDimensionBehaviour = getHorizontalDimensionBehaviour();
DimensionBehaviour dimensionBehaviour = DimensionBehaviour.MATCH_CONSTRAINT;
if (horizontalDimensionBehaviour == dimensionBehaviour) {
if (getWidth() == getWrapWidth()) {
setHorizontalDimensionBehaviour(DimensionBehaviour.WRAP_CONTENT);
} else if (getWidth() > getMinWidth()) {
setHorizontalDimensionBehaviour(DimensionBehaviour.FIXED);
}
}
if (getVerticalDimensionBehaviour() == dimensionBehaviour) {
if (getHeight() == getWrapHeight()) {
setVerticalDimensionBehaviour(DimensionBehaviour.WRAP_CONTENT);
} else if (getHeight() > getMinHeight()) {
setVerticalDimensionBehaviour(DimensionBehaviour.FIXED);
}
}
}
public void resetAnchor(ConstraintAnchor constraintAnchor) {
if (getParent() != null && (getParent() instanceof ConstraintWidgetContainer) && ((ConstraintWidgetContainer) getParent()).handlesInternalConstraints()) {
return;
}
ConstraintAnchor anchor = getAnchor(ConstraintAnchor.Type.LEFT);
ConstraintAnchor anchor2 = getAnchor(ConstraintAnchor.Type.RIGHT);
ConstraintAnchor anchor3 = getAnchor(ConstraintAnchor.Type.TOP);
ConstraintAnchor anchor4 = getAnchor(ConstraintAnchor.Type.BOTTOM);
ConstraintAnchor anchor5 = getAnchor(ConstraintAnchor.Type.CENTER);
ConstraintAnchor anchor6 = getAnchor(ConstraintAnchor.Type.CENTER_X);
ConstraintAnchor anchor7 = getAnchor(ConstraintAnchor.Type.CENTER_Y);
if (constraintAnchor == anchor5) {
if (anchor.isConnected() && anchor2.isConnected() && anchor.getTarget() == anchor2.getTarget()) {
anchor.reset();
anchor2.reset();
}
if (anchor3.isConnected() && anchor4.isConnected() && anchor3.getTarget() == anchor4.getTarget()) {
anchor3.reset();
anchor4.reset();
}
this.mHorizontalBiasPercent = 0.5f;
this.mVerticalBiasPercent = 0.5f;
} else if (constraintAnchor == anchor6) {
if (anchor.isConnected() && anchor2.isConnected() && anchor.getTarget().getOwner() == anchor2.getTarget().getOwner()) {
anchor.reset();
anchor2.reset();
}
this.mHorizontalBiasPercent = 0.5f;
} else if (constraintAnchor == anchor7) {
if (anchor3.isConnected() && anchor4.isConnected() && anchor3.getTarget().getOwner() == anchor4.getTarget().getOwner()) {
anchor3.reset();
anchor4.reset();
}
this.mVerticalBiasPercent = 0.5f;
} else if (constraintAnchor == anchor || constraintAnchor == anchor2) {
if (anchor.isConnected() && anchor.getTarget() == anchor2.getTarget()) {
anchor5.reset();
}
} else if ((constraintAnchor == anchor3 || constraintAnchor == anchor4) && anchor3.isConnected() && anchor3.getTarget() == anchor4.getTarget()) {
anchor5.reset();
}
constraintAnchor.reset();
}
public void resetAnchors(int i) {
ConstraintWidget parent = getParent();
if (parent != null && (parent instanceof ConstraintWidgetContainer) && ((ConstraintWidgetContainer) getParent()).handlesInternalConstraints()) {
return;
}
int size = this.mAnchors.size();
for (int i2 = 0; i2 < size; i2++) {
ConstraintAnchor constraintAnchor = this.mAnchors.get(i2);
if (i == constraintAnchor.getConnectionCreator()) {
if (constraintAnchor.isVerticalAnchor()) {
setVerticalBiasPercent(DEFAULT_BIAS);
} else {
setHorizontalBiasPercent(DEFAULT_BIAS);
}
constraintAnchor.reset();
}
}
}
public void resetResolutionNodes() {
for (int i = 0; i < 6; i++) {
this.mListAnchors[i].getResolutionNode().reset();
}
}
public void resetSolverVariables(Cache cache) {
this.mLeft.resetSolverVariable(cache);
this.mTop.resetSolverVariable(cache);
this.mRight.resetSolverVariable(cache);
this.mBottom.resetSolverVariable(cache);
this.mBaseline.resetSolverVariable(cache);
this.mCenter.resetSolverVariable(cache);
this.mCenterX.resetSolverVariable(cache);
this.mCenterY.resetSolverVariable(cache);
}
public void setBaselineDistance(int i) {
this.mBaselineDistance = i;
}
public void setCompanionWidget(Object obj) {
this.mCompanionWidget = obj;
}
public void setContainerItemSkip(int i) {
if (i >= 0) {
this.mContainerItemSkip = i;
} else {
this.mContainerItemSkip = 0;
}
}
public void setDebugName(String str) {
this.mDebugName = str;
}
public void setDebugSolverName(LinearSystem linearSystem, String str) {
this.mDebugName = str;
SolverVariable createObjectVariable = linearSystem.createObjectVariable(this.mLeft);
SolverVariable createObjectVariable2 = linearSystem.createObjectVariable(this.mTop);
SolverVariable createObjectVariable3 = linearSystem.createObjectVariable(this.mRight);
SolverVariable createObjectVariable4 = linearSystem.createObjectVariable(this.mBottom);
createObjectVariable.setName(str + ".left");
createObjectVariable2.setName(str + ".top");
createObjectVariable3.setName(str + ".right");
createObjectVariable4.setName(str + ".bottom");
if (this.mBaselineDistance > 0) {
linearSystem.createObjectVariable(this.mBaseline).setName(str + ".baseline");
}
}
public void setDimension(int i, int i2) {
this.mWidth = i;
int i3 = this.mMinWidth;
if (i < i3) {
this.mWidth = i3;
}
this.mHeight = i2;
int i4 = this.mMinHeight;
if (i2 < i4) {
this.mHeight = i4;
}
}
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:38:0x0086 -> B:31:0x0087). Please report as a decompilation issue!!! */
public void setDimensionRatio(String str) {
float f;
int i = 0;
if (str == null || str.length() == 0) {
this.mDimensionRatio = 0.0f;
return;
}
int length = str.length();
int indexOf = str.indexOf(44);
int i2 = -1;
if (indexOf > 0 && indexOf < length - 1) {
String substring = str.substring(0, indexOf);
i2 = substring.equalsIgnoreCase(ExifInterface.LONGITUDE_WEST) ? 0 : substring.equalsIgnoreCase("H") ? 1 : -1;
r3 = indexOf + 1;
}
int indexOf2 = str.indexOf(58);
if (indexOf2 < 0 || indexOf2 >= length - 1) {
String substring2 = str.substring(r3);
if (substring2.length() > 0) {
f = Float.parseFloat(substring2);
}
f = i;
} else {
String substring3 = str.substring(r3, indexOf2);
String substring4 = str.substring(indexOf2 + 1);
if (substring3.length() > 0 && substring4.length() > 0) {
float parseFloat = Float.parseFloat(substring3);
float parseFloat2 = Float.parseFloat(substring4);
if (parseFloat > 0.0f && parseFloat2 > 0.0f) {
f = i2 == 1 ? Math.abs(parseFloat2 / parseFloat) : Math.abs(parseFloat / parseFloat2);
}
}
f = i;
}
i = (f > i ? 1 : (f == i ? 0 : -1));
if (i > 0) {
this.mDimensionRatio = f;
this.mDimensionRatioSide = i2;
}
}
public void setDrawHeight(int i) {
this.mDrawHeight = i;
}
public void setDrawOrigin(int i, int i2) {
int i3 = i - this.mOffsetX;
this.mDrawX = i3;
int i4 = i2 - this.mOffsetY;
this.mDrawY = i4;
this.mX = i3;
this.mY = i4;
}
public void setDrawWidth(int i) {
this.mDrawWidth = i;
}
public void setDrawX(int i) {
int i2 = i - this.mOffsetX;
this.mDrawX = i2;
this.mX = i2;
}
public void setDrawY(int i) {
int i2 = i - this.mOffsetY;
this.mDrawY = i2;
this.mY = i2;
}
public void setFrame(int i, int i2, int i3, int i4) {
int i5;
int i6;
int i7 = i3 - i;
int i8 = i4 - i2;
this.mX = i;
this.mY = i2;
if (this.mVisibility == 8) {
this.mWidth = 0;
this.mHeight = 0;
return;
}
DimensionBehaviour[] dimensionBehaviourArr = this.mListDimensionBehaviors;
DimensionBehaviour dimensionBehaviour = dimensionBehaviourArr[0];
DimensionBehaviour dimensionBehaviour2 = DimensionBehaviour.FIXED;
if (dimensionBehaviour == dimensionBehaviour2 && i7 < (i6 = this.mWidth)) {
i7 = i6;
}
if (dimensionBehaviourArr[1] == dimensionBehaviour2 && i8 < (i5 = this.mHeight)) {
i8 = i5;
}
this.mWidth = i7;
this.mHeight = i8;
int i9 = this.mMinHeight;
if (i8 < i9) {
this.mHeight = i9;
}
int i10 = this.mMinWidth;
if (i7 < i10) {
this.mWidth = i10;
}
this.mOptimizerMeasured = true;
}
public void setGoneMargin(ConstraintAnchor.Type type, int i) {
int i2 = AnonymousClass1.$SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintAnchor$Type[type.ordinal()];
if (i2 == 1) {
this.mLeft.mGoneMargin = i;
return;
}
if (i2 == 2) {
this.mTop.mGoneMargin = i;
} else if (i2 == 3) {
this.mRight.mGoneMargin = i;
} else {
if (i2 != 4) {
return;
}
this.mBottom.mGoneMargin = i;
}
}
public void setHeight(int i) {
this.mHeight = i;
int i2 = this.mMinHeight;
if (i < i2) {
this.mHeight = i2;
}
}
public void setHeightWrapContent(boolean z) {
this.mIsHeightWrapContent = z;
}
public void setHorizontalBiasPercent(float f) {
this.mHorizontalBiasPercent = f;
}
public void setHorizontalChainStyle(int i) {
this.mHorizontalChainStyle = i;
}
public void setHorizontalDimension(int i, int i2) {
this.mX = i;
int i3 = i2 - i;
this.mWidth = i3;
int i4 = this.mMinWidth;
if (i3 < i4) {
this.mWidth = i4;
}
}
public void setHorizontalDimensionBehaviour(DimensionBehaviour dimensionBehaviour) {
this.mListDimensionBehaviors[0] = dimensionBehaviour;
if (dimensionBehaviour == DimensionBehaviour.WRAP_CONTENT) {
setWidth(this.mWrapWidth);
}
}
public void setHorizontalMatchStyle(int i, int i2, int i3, float f) {
this.mMatchConstraintDefaultWidth = i;
this.mMatchConstraintMinWidth = i2;
this.mMatchConstraintMaxWidth = i3;
this.mMatchConstraintPercentWidth = f;
if (f >= 1.0f || i != 0) {
return;
}
this.mMatchConstraintDefaultWidth = 2;
}
public void setHorizontalWeight(float f) {
this.mWeight[0] = f;
}
public void setLength(int i, int i2) {
if (i2 == 0) {
setWidth(i);
} else if (i2 == 1) {
setHeight(i);
}
}
public void setMaxHeight(int i) {
this.mMaxDimension[1] = i;
}
public void setMaxWidth(int i) {
this.mMaxDimension[0] = i;
}
public void setMinHeight(int i) {
if (i < 0) {
this.mMinHeight = 0;
} else {
this.mMinHeight = i;
}
}
public void setMinWidth(int i) {
if (i < 0) {
this.mMinWidth = 0;
} else {
this.mMinWidth = i;
}
}
public void setOffset(int i, int i2) {
this.mOffsetX = i;
this.mOffsetY = i2;
}
public void setOrigin(int i, int i2) {
this.mX = i;
this.mY = i2;
}
public void setParent(ConstraintWidget constraintWidget) {
this.mParent = constraintWidget;
}
public void setRelativePositioning(int i, int i2) {
if (i2 == 0) {
this.mRelX = i;
} else if (i2 == 1) {
this.mRelY = i;
}
}
public void setType(String str) {
this.mType = str;
}
public void setVerticalBiasPercent(float f) {
this.mVerticalBiasPercent = f;
}
public void setVerticalChainStyle(int i) {
this.mVerticalChainStyle = i;
}
public void setVerticalDimension(int i, int i2) {
this.mY = i;
int i3 = i2 - i;
this.mHeight = i3;
int i4 = this.mMinHeight;
if (i3 < i4) {
this.mHeight = i4;
}
}
public void setVerticalDimensionBehaviour(DimensionBehaviour dimensionBehaviour) {
this.mListDimensionBehaviors[1] = dimensionBehaviour;
if (dimensionBehaviour == DimensionBehaviour.WRAP_CONTENT) {
setHeight(this.mWrapHeight);
}
}
public void setVerticalMatchStyle(int i, int i2, int i3, float f) {
this.mMatchConstraintDefaultHeight = i;
this.mMatchConstraintMinHeight = i2;
this.mMatchConstraintMaxHeight = i3;
this.mMatchConstraintPercentHeight = f;
if (f >= 1.0f || i != 0) {
return;
}
this.mMatchConstraintDefaultHeight = 2;
}
public void setVerticalWeight(float f) {
this.mWeight[1] = f;
}
public void setVisibility(int i) {
this.mVisibility = i;
}
public void setWidth(int i) {
this.mWidth = i;
int i2 = this.mMinWidth;
if (i < i2) {
this.mWidth = i2;
}
}
public void setWidthWrapContent(boolean z) {
this.mIsWidthWrapContent = z;
}
public void setWrapHeight(int i) {
this.mWrapHeight = i;
}
public void setWrapWidth(int i) {
this.mWrapWidth = i;
}
public void setX(int i) {
this.mX = i;
}
public void setY(int i) {
this.mY = i;
}
public void setupDimensionRatio(boolean z, boolean z2, boolean z3, boolean z4) {
if (this.mResolvedDimensionRatioSide == -1) {
if (z3 && !z4) {
this.mResolvedDimensionRatioSide = 0;
} else if (!z3 && z4) {
this.mResolvedDimensionRatioSide = 1;
if (this.mDimensionRatioSide == -1) {
this.mResolvedDimensionRatio = 1.0f / this.mResolvedDimensionRatio;
}
}
}
if (this.mResolvedDimensionRatioSide == 0 && (!this.mTop.isConnected() || !this.mBottom.isConnected())) {
this.mResolvedDimensionRatioSide = 1;
} else if (this.mResolvedDimensionRatioSide == 1 && (!this.mLeft.isConnected() || !this.mRight.isConnected())) {
this.mResolvedDimensionRatioSide = 0;
}
if (this.mResolvedDimensionRatioSide == -1 && (!this.mTop.isConnected() || !this.mBottom.isConnected() || !this.mLeft.isConnected() || !this.mRight.isConnected())) {
if (this.mTop.isConnected() && this.mBottom.isConnected()) {
this.mResolvedDimensionRatioSide = 0;
} else if (this.mLeft.isConnected() && this.mRight.isConnected()) {
this.mResolvedDimensionRatio = 1.0f / this.mResolvedDimensionRatio;
this.mResolvedDimensionRatioSide = 1;
}
}
if (this.mResolvedDimensionRatioSide == -1) {
if (z && !z2) {
this.mResolvedDimensionRatioSide = 0;
} else if (!z && z2) {
this.mResolvedDimensionRatio = 1.0f / this.mResolvedDimensionRatio;
this.mResolvedDimensionRatioSide = 1;
}
}
if (this.mResolvedDimensionRatioSide == -1) {
int i = this.mMatchConstraintMinWidth;
if (i > 0 && this.mMatchConstraintMinHeight == 0) {
this.mResolvedDimensionRatioSide = 0;
} else if (i == 0 && this.mMatchConstraintMinHeight > 0) {
this.mResolvedDimensionRatio = 1.0f / this.mResolvedDimensionRatio;
this.mResolvedDimensionRatioSide = 1;
}
}
if (this.mResolvedDimensionRatioSide == -1 && z && z2) {
this.mResolvedDimensionRatio = 1.0f / this.mResolvedDimensionRatio;
this.mResolvedDimensionRatioSide = 1;
}
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(this.mType != null ? a$$ExternalSyntheticOutline0.m(new StringBuilder("type: "), this.mType, " ") : "");
sb.append(this.mDebugName != null ? a$$ExternalSyntheticOutline0.m(new StringBuilder("id: "), this.mDebugName, " ") : "");
sb.append(MarkdownConstants.LEFT_PARENTHESIS);
sb.append(this.mX);
sb.append(", ");
sb.append(this.mY);
sb.append(") - (");
sb.append(this.mWidth);
sb.append(" x ");
sb.append(this.mHeight);
sb.append(") wrap: (");
sb.append(this.mWrapWidth);
sb.append(" x ");
return a$$ExternalSyntheticOutline0.m(sb, this.mWrapHeight, MarkdownConstants.RIGHT_PARENTHESIS);
}
public void updateDrawPosition() {
int i = this.mX;
int i2 = this.mY;
int i3 = this.mWidth + i;
int i4 = this.mHeight + i2;
this.mDrawX = i;
this.mDrawY = i2;
this.mDrawWidth = i3 - i;
this.mDrawHeight = i4 - i2;
}
public void updateFromSolver(LinearSystem linearSystem) {
int objectVariableValue = linearSystem.getObjectVariableValue(this.mLeft);
int objectVariableValue2 = linearSystem.getObjectVariableValue(this.mTop);
int objectVariableValue3 = linearSystem.getObjectVariableValue(this.mRight);
int objectVariableValue4 = linearSystem.getObjectVariableValue(this.mBottom);
int i = objectVariableValue4 - objectVariableValue2;
if (objectVariableValue3 - objectVariableValue < 0 || i < 0 || objectVariableValue == Integer.MIN_VALUE || objectVariableValue == Integer.MAX_VALUE || objectVariableValue2 == Integer.MIN_VALUE || objectVariableValue2 == Integer.MAX_VALUE || objectVariableValue3 == Integer.MIN_VALUE || objectVariableValue3 == Integer.MAX_VALUE || objectVariableValue4 == Integer.MIN_VALUE || objectVariableValue4 == Integer.MAX_VALUE) {
objectVariableValue = 0;
objectVariableValue4 = 0;
objectVariableValue2 = 0;
objectVariableValue3 = 0;
}
setFrame(objectVariableValue, objectVariableValue2, objectVariableValue3, objectVariableValue4);
}
public void updateResolutionNodes() {
for (int i = 0; i < 6; i++) {
this.mListAnchors[i].getResolutionNode().update();
}
}
public void resolve() {
}
public void connectedTo(ConstraintWidget constraintWidget) {
}
public void setFrame(int i, int i2, int i3) {
if (i3 == 0) {
setHorizontalDimension(i, i2);
} else if (i3 == 1) {
setVerticalDimension(i, i2);
}
this.mOptimizerMeasured = true;
}
public void resetAnchors() {
ConstraintWidget parent = getParent();
if (parent != null && (parent instanceof ConstraintWidgetContainer) && ((ConstraintWidgetContainer) getParent()).handlesInternalConstraints()) {
return;
}
int size = this.mAnchors.size();
for (int i = 0; i < size; i++) {
this.mAnchors.get(i).reset();
}
}
public void setDimensionRatio(float f, int i) {
this.mDimensionRatio = f;
this.mDimensionRatioSide = i;
}
public ConstraintWidget() {
this.mHorizontalResolution = -1;
this.mVerticalResolution = -1;
this.mMatchConstraintDefaultWidth = 0;
this.mMatchConstraintDefaultHeight = 0;
this.mResolvedMatchConstraintDefault = new int[2];
this.mMatchConstraintMinWidth = 0;
this.mMatchConstraintMaxWidth = 0;
this.mMatchConstraintPercentWidth = 1.0f;
this.mMatchConstraintMinHeight = 0;
this.mMatchConstraintMaxHeight = 0;
this.mMatchConstraintPercentHeight = 1.0f;
this.mResolvedDimensionRatioSide = -1;
this.mResolvedDimensionRatio = 1.0f;
this.mBelongingGroup = null;
this.mMaxDimension = new int[]{Integer.MAX_VALUE, Integer.MAX_VALUE};
this.mCircleConstraintAngle = 0.0f;
this.mLeft = new ConstraintAnchor(this, ConstraintAnchor.Type.LEFT);
this.mTop = new ConstraintAnchor(this, ConstraintAnchor.Type.TOP);
this.mRight = new ConstraintAnchor(this, ConstraintAnchor.Type.RIGHT);
this.mBottom = new ConstraintAnchor(this, ConstraintAnchor.Type.BOTTOM);
this.mBaseline = new ConstraintAnchor(this, ConstraintAnchor.Type.BASELINE);
this.mCenterX = new ConstraintAnchor(this, ConstraintAnchor.Type.CENTER_X);
this.mCenterY = new ConstraintAnchor(this, ConstraintAnchor.Type.CENTER_Y);
ConstraintAnchor constraintAnchor = new ConstraintAnchor(this, ConstraintAnchor.Type.CENTER);
this.mCenter = constraintAnchor;
this.mListAnchors = new ConstraintAnchor[]{this.mLeft, this.mRight, this.mTop, this.mBottom, this.mBaseline, constraintAnchor};
this.mAnchors = new ArrayList<>();
DimensionBehaviour dimensionBehaviour = DimensionBehaviour.FIXED;
this.mListDimensionBehaviors = new DimensionBehaviour[]{dimensionBehaviour, dimensionBehaviour};
this.mParent = null;
this.mWidth = 0;
this.mHeight = 0;
this.mDimensionRatio = 0.0f;
this.mDimensionRatioSide = -1;
this.mX = 0;
this.mY = 0;
this.mRelX = 0;
this.mRelY = 0;
this.mDrawX = 0;
this.mDrawY = 0;
this.mDrawWidth = 0;
this.mDrawHeight = 0;
this.mOffsetX = 0;
this.mOffsetY = 0;
this.mBaselineDistance = 0;
float f = DEFAULT_BIAS;
this.mHorizontalBiasPercent = f;
this.mVerticalBiasPercent = f;
this.mContainerItemSkip = 0;
this.mVisibility = 0;
this.mDebugName = null;
this.mType = null;
this.mOptimizerMeasurable = false;
this.mOptimizerMeasured = false;
this.mGroupsToSolver = false;
this.mHorizontalChainStyle = 0;
this.mVerticalChainStyle = 0;
this.mWeight = new float[]{-1.0f, -1.0f};
this.mListNextMatchConstraintsWidget = new ConstraintWidget[]{null, null};
this.mNextChainWidget = new ConstraintWidget[]{null, null};
this.mHorizontalNextWidget = null;
this.mVerticalNextWidget = null;
addAnchors();
}
public ConstraintWidget(int i, int i2) {
this(0, 0, i, i2);
}
public void connect(ConstraintAnchor constraintAnchor, ConstraintAnchor constraintAnchor2, int i) {
connect(constraintAnchor, constraintAnchor2, i, ConstraintAnchor.Strength.STRONG, 0);
}
public void connect(ConstraintAnchor constraintAnchor, ConstraintAnchor constraintAnchor2, int i, ConstraintAnchor.Strength strength, int i2) {
if (constraintAnchor.getOwner() == this) {
connect(constraintAnchor.getType(), constraintAnchor2.getOwner(), constraintAnchor2.getType(), i, strength, i2);
}
}
public void connect(ConstraintAnchor.Type type, ConstraintWidget constraintWidget, ConstraintAnchor.Type type2, int i) {
connect(type, constraintWidget, type2, i, ConstraintAnchor.Strength.STRONG);
}
public void connect(ConstraintAnchor.Type type, ConstraintWidget constraintWidget, ConstraintAnchor.Type type2) {
connect(type, constraintWidget, type2, 0, ConstraintAnchor.Strength.STRONG);
}
public void connect(ConstraintAnchor.Type type, ConstraintWidget constraintWidget, ConstraintAnchor.Type type2, int i, ConstraintAnchor.Strength strength) {
connect(type, constraintWidget, type2, i, strength, 0);
}
public void connect(ConstraintAnchor constraintAnchor, ConstraintAnchor constraintAnchor2, int i, int i2) {
connect(constraintAnchor, constraintAnchor2, i, ConstraintAnchor.Strength.STRONG, i2);
}
}