1190 lines
53 KiB
Java
1190 lines
53 KiB
Java
package androidx.constraintlayout.solver.widgets;
|
|
|
|
import androidx.constraintlayout.solver.LinearSystem;
|
|
import androidx.constraintlayout.solver.widgets.ConstraintWidget;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.HashMap;
|
|
/* loaded from: classes.dex */
|
|
public class Flow extends VirtualLayout {
|
|
public static final int HORIZONTAL_ALIGN_CENTER = 2;
|
|
public static final int HORIZONTAL_ALIGN_END = 1;
|
|
public static final int HORIZONTAL_ALIGN_START = 0;
|
|
public static final int VERTICAL_ALIGN_BASELINE = 3;
|
|
public static final int VERTICAL_ALIGN_BOTTOM = 1;
|
|
public static final int VERTICAL_ALIGN_CENTER = 2;
|
|
public static final int VERTICAL_ALIGN_TOP = 0;
|
|
public static final int WRAP_ALIGNED = 2;
|
|
public static final int WRAP_CHAIN = 1;
|
|
public static final int WRAP_NONE = 0;
|
|
private ConstraintWidget[] mDisplayedWidgets;
|
|
private int mHorizontalStyle = -1;
|
|
private int mVerticalStyle = -1;
|
|
private int mFirstHorizontalStyle = -1;
|
|
private int mFirstVerticalStyle = -1;
|
|
private int mLastHorizontalStyle = -1;
|
|
private int mLastVerticalStyle = -1;
|
|
private float mHorizontalBias = 0.5f;
|
|
private float mVerticalBias = 0.5f;
|
|
private float mFirstHorizontalBias = 0.5f;
|
|
private float mFirstVerticalBias = 0.5f;
|
|
private float mLastHorizontalBias = 0.5f;
|
|
private float mLastVerticalBias = 0.5f;
|
|
private int mHorizontalGap = 0;
|
|
private int mVerticalGap = 0;
|
|
private int mHorizontalAlign = 2;
|
|
private int mVerticalAlign = 2;
|
|
private int mWrapMode = 0;
|
|
private int mMaxElementsWrap = -1;
|
|
private int mOrientation = 0;
|
|
private ArrayList<WidgetsList> mChainList = new ArrayList<>();
|
|
private ConstraintWidget[] mAlignedBiggestElementsInRows = null;
|
|
private ConstraintWidget[] mAlignedBiggestElementsInCols = null;
|
|
private int[] mAlignedDimensions = null;
|
|
private int mDisplayedWidgetsCount = 0;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class WidgetsList {
|
|
private ConstraintAnchor mBottom;
|
|
private ConstraintAnchor mLeft;
|
|
private int mMax;
|
|
private int mOrientation;
|
|
private int mPaddingBottom;
|
|
private int mPaddingLeft;
|
|
private int mPaddingRight;
|
|
private int mPaddingTop;
|
|
private ConstraintAnchor mRight;
|
|
private ConstraintAnchor mTop;
|
|
private ConstraintWidget biggest = null;
|
|
public int biggestDimension = 0;
|
|
private int mWidth = 0;
|
|
private int mHeight = 0;
|
|
private int mStartIndex = 0;
|
|
private int mCount = 0;
|
|
private int mNbMatchConstraintsWidgets = 0;
|
|
|
|
public WidgetsList(int i, ConstraintAnchor constraintAnchor, ConstraintAnchor constraintAnchor2, ConstraintAnchor constraintAnchor3, ConstraintAnchor constraintAnchor4, int i2) {
|
|
this.mOrientation = 0;
|
|
this.mPaddingLeft = 0;
|
|
this.mPaddingTop = 0;
|
|
this.mPaddingRight = 0;
|
|
this.mPaddingBottom = 0;
|
|
this.mMax = 0;
|
|
this.mOrientation = i;
|
|
this.mLeft = constraintAnchor;
|
|
this.mTop = constraintAnchor2;
|
|
this.mRight = constraintAnchor3;
|
|
this.mBottom = constraintAnchor4;
|
|
this.mPaddingLeft = Flow.this.getPaddingLeft();
|
|
this.mPaddingTop = Flow.this.getPaddingTop();
|
|
this.mPaddingRight = Flow.this.getPaddingRight();
|
|
this.mPaddingBottom = Flow.this.getPaddingBottom();
|
|
this.mMax = i2;
|
|
}
|
|
|
|
public static /* synthetic */ ConstraintWidget access$2000(WidgetsList widgetsList) {
|
|
return widgetsList.biggest;
|
|
}
|
|
|
|
private void recomputeDimensions() {
|
|
this.mWidth = 0;
|
|
this.mHeight = 0;
|
|
this.biggest = null;
|
|
this.biggestDimension = 0;
|
|
int i = this.mCount;
|
|
for (int i2 = 0; i2 < i && this.mStartIndex + i2 < Flow.access$400(Flow.this); i2++) {
|
|
ConstraintWidget constraintWidget = Flow.access$500(Flow.this)[this.mStartIndex + i2];
|
|
if (this.mOrientation == 0) {
|
|
int width = constraintWidget.getWidth();
|
|
int access$000 = Flow.access$000(Flow.this);
|
|
if (constraintWidget.getVisibility() == 8) {
|
|
access$000 = 0;
|
|
}
|
|
this.mWidth = width + access$000 + this.mWidth;
|
|
int access$300 = Flow.access$300(Flow.this, constraintWidget, this.mMax);
|
|
if (this.biggest == null || this.biggestDimension < access$300) {
|
|
this.biggest = constraintWidget;
|
|
this.biggestDimension = access$300;
|
|
this.mHeight = access$300;
|
|
}
|
|
} else {
|
|
int access$200 = Flow.access$200(Flow.this, constraintWidget, this.mMax);
|
|
int access$3002 = Flow.access$300(Flow.this, constraintWidget, this.mMax);
|
|
int access$100 = Flow.access$100(Flow.this);
|
|
if (constraintWidget.getVisibility() == 8) {
|
|
access$100 = 0;
|
|
}
|
|
this.mHeight = access$3002 + access$100 + this.mHeight;
|
|
if (this.biggest == null || this.biggestDimension < access$200) {
|
|
this.biggest = constraintWidget;
|
|
this.biggestDimension = access$200;
|
|
this.mWidth = access$200;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public void add(ConstraintWidget constraintWidget) {
|
|
int i = 0;
|
|
if (this.mOrientation == 0) {
|
|
int access$200 = Flow.access$200(Flow.this, constraintWidget, this.mMax);
|
|
if (constraintWidget.getHorizontalDimensionBehaviour() == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
|
|
this.mNbMatchConstraintsWidgets++;
|
|
access$200 = 0;
|
|
}
|
|
i = Flow.access$000(Flow.this);
|
|
if (constraintWidget.getVisibility() != 8) {
|
|
}
|
|
this.mWidth = access$200 + i + this.mWidth;
|
|
int access$300 = Flow.access$300(Flow.this, constraintWidget, this.mMax);
|
|
if (this.biggest == null || this.biggestDimension < access$300) {
|
|
this.biggest = constraintWidget;
|
|
this.biggestDimension = access$300;
|
|
this.mHeight = access$300;
|
|
}
|
|
} else {
|
|
int access$2002 = Flow.access$200(Flow.this, constraintWidget, this.mMax);
|
|
int access$3002 = Flow.access$300(Flow.this, constraintWidget, this.mMax);
|
|
if (constraintWidget.getVerticalDimensionBehaviour() == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
|
|
this.mNbMatchConstraintsWidgets++;
|
|
access$3002 = 0;
|
|
}
|
|
i = Flow.access$100(Flow.this);
|
|
if (constraintWidget.getVisibility() != 8) {
|
|
}
|
|
this.mHeight = access$3002 + i + this.mHeight;
|
|
if (this.biggest == null || this.biggestDimension < access$2002) {
|
|
this.biggest = constraintWidget;
|
|
this.biggestDimension = access$2002;
|
|
this.mWidth = access$2002;
|
|
}
|
|
}
|
|
this.mCount++;
|
|
}
|
|
|
|
public void clear() {
|
|
this.biggestDimension = 0;
|
|
this.biggest = null;
|
|
this.mWidth = 0;
|
|
this.mHeight = 0;
|
|
this.mStartIndex = 0;
|
|
this.mCount = 0;
|
|
this.mNbMatchConstraintsWidgets = 0;
|
|
}
|
|
|
|
public void createConstraints(boolean z2, int i, boolean z3) {
|
|
ConstraintWidget constraintWidget;
|
|
int i2 = this.mCount;
|
|
for (int i3 = 0; i3 < i2 && this.mStartIndex + i3 < Flow.access$400(Flow.this); i3++) {
|
|
ConstraintWidget constraintWidget2 = Flow.access$500(Flow.this)[this.mStartIndex + i3];
|
|
if (constraintWidget2 != null) {
|
|
constraintWidget2.resetAnchors();
|
|
}
|
|
}
|
|
if (!(i2 == 0 || this.biggest == null)) {
|
|
boolean z4 = z3 && i == 0;
|
|
int i4 = -1;
|
|
int i5 = -1;
|
|
for (int i6 = 0; i6 < i2; i6++) {
|
|
int i7 = z2 ? (i2 - 1) - i6 : i6;
|
|
if (this.mStartIndex + i7 >= Flow.access$400(Flow.this)) {
|
|
break;
|
|
}
|
|
if (Flow.access$500(Flow.this)[this.mStartIndex + i7].getVisibility() == 0) {
|
|
if (i4 == -1) {
|
|
i4 = i6;
|
|
}
|
|
i5 = i6;
|
|
}
|
|
}
|
|
ConstraintWidget constraintWidget3 = null;
|
|
if (this.mOrientation == 0) {
|
|
ConstraintWidget constraintWidget4 = this.biggest;
|
|
constraintWidget4.setVerticalChainStyle(Flow.access$600(Flow.this));
|
|
int i8 = this.mPaddingTop;
|
|
if (i > 0) {
|
|
i8 += Flow.access$100(Flow.this);
|
|
}
|
|
constraintWidget4.mTop.connect(this.mTop, i8);
|
|
if (z3) {
|
|
constraintWidget4.mBottom.connect(this.mBottom, this.mPaddingBottom);
|
|
}
|
|
if (i > 0) {
|
|
this.mTop.mOwner.mBottom.connect(constraintWidget4.mTop, 0);
|
|
}
|
|
if (Flow.access$700(Flow.this) == 3 && !constraintWidget4.hasBaseline()) {
|
|
for (int i9 = 0; i9 < i2; i9++) {
|
|
int i10 = z2 ? (i2 - 1) - i9 : i9;
|
|
if (this.mStartIndex + i10 >= Flow.access$400(Flow.this)) {
|
|
break;
|
|
}
|
|
constraintWidget = Flow.access$500(Flow.this)[this.mStartIndex + i10];
|
|
if (constraintWidget.hasBaseline()) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
constraintWidget = constraintWidget4;
|
|
int i11 = 0;
|
|
while (i11 < i2) {
|
|
int i12 = z2 ? (i2 - 1) - i11 : i11;
|
|
if (this.mStartIndex + i12 < Flow.access$400(Flow.this)) {
|
|
ConstraintWidget constraintWidget5 = Flow.access$500(Flow.this)[this.mStartIndex + i12];
|
|
if (i11 == 0) {
|
|
constraintWidget5.connect(constraintWidget5.mLeft, this.mLeft, this.mPaddingLeft);
|
|
}
|
|
if (i12 == 0) {
|
|
int access$800 = Flow.access$800(Flow.this);
|
|
float access$900 = Flow.access$900(Flow.this);
|
|
if (this.mStartIndex == 0 && Flow.access$1000(Flow.this) != -1) {
|
|
access$800 = Flow.access$1000(Flow.this);
|
|
access$900 = Flow.access$1100(Flow.this);
|
|
} else if (z3 && Flow.access$1200(Flow.this) != -1) {
|
|
access$800 = Flow.access$1200(Flow.this);
|
|
access$900 = Flow.access$1300(Flow.this);
|
|
}
|
|
constraintWidget5.setHorizontalChainStyle(access$800);
|
|
constraintWidget5.setHorizontalBiasPercent(access$900);
|
|
}
|
|
if (i11 == i2 - 1) {
|
|
constraintWidget5.connect(constraintWidget5.mRight, this.mRight, this.mPaddingRight);
|
|
}
|
|
if (constraintWidget3 != null) {
|
|
constraintWidget5.mLeft.connect(constraintWidget3.mRight, Flow.access$000(Flow.this));
|
|
if (i11 == i4) {
|
|
constraintWidget5.mLeft.setGoneMargin(this.mPaddingLeft);
|
|
}
|
|
constraintWidget3.mRight.connect(constraintWidget5.mLeft, 0);
|
|
if (i11 == i5 + 1) {
|
|
constraintWidget3.mRight.setGoneMargin(this.mPaddingRight);
|
|
}
|
|
}
|
|
if (constraintWidget5 != constraintWidget4) {
|
|
if (Flow.access$700(Flow.this) != 3 || !constraintWidget.hasBaseline() || constraintWidget5 == constraintWidget || !constraintWidget5.hasBaseline()) {
|
|
int access$700 = Flow.access$700(Flow.this);
|
|
if (access$700 == 0) {
|
|
constraintWidget5.mTop.connect(constraintWidget4.mTop, 0);
|
|
} else if (access$700 == 1) {
|
|
constraintWidget5.mBottom.connect(constraintWidget4.mBottom, 0);
|
|
} else if (z4) {
|
|
constraintWidget5.mTop.connect(this.mTop, this.mPaddingTop);
|
|
constraintWidget5.mBottom.connect(this.mBottom, this.mPaddingBottom);
|
|
} else {
|
|
constraintWidget5.mTop.connect(constraintWidget4.mTop, 0);
|
|
constraintWidget5.mBottom.connect(constraintWidget4.mBottom, 0);
|
|
}
|
|
} else {
|
|
constraintWidget5.mBaseline.connect(constraintWidget.mBaseline, 0);
|
|
}
|
|
}
|
|
i11++;
|
|
constraintWidget3 = constraintWidget5;
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
ConstraintWidget constraintWidget6 = this.biggest;
|
|
constraintWidget6.setHorizontalChainStyle(Flow.access$800(Flow.this));
|
|
int i13 = this.mPaddingLeft;
|
|
if (i > 0) {
|
|
i13 += Flow.access$000(Flow.this);
|
|
}
|
|
if (z2) {
|
|
constraintWidget6.mRight.connect(this.mRight, i13);
|
|
if (z3) {
|
|
constraintWidget6.mLeft.connect(this.mLeft, this.mPaddingRight);
|
|
}
|
|
if (i > 0) {
|
|
this.mRight.mOwner.mLeft.connect(constraintWidget6.mRight, 0);
|
|
}
|
|
} else {
|
|
constraintWidget6.mLeft.connect(this.mLeft, i13);
|
|
if (z3) {
|
|
constraintWidget6.mRight.connect(this.mRight, this.mPaddingRight);
|
|
}
|
|
if (i > 0) {
|
|
this.mLeft.mOwner.mRight.connect(constraintWidget6.mLeft, 0);
|
|
}
|
|
}
|
|
int i14 = 0;
|
|
while (i14 < i2 && this.mStartIndex + i14 < Flow.access$400(Flow.this)) {
|
|
ConstraintWidget constraintWidget7 = Flow.access$500(Flow.this)[this.mStartIndex + i14];
|
|
if (i14 == 0) {
|
|
constraintWidget7.connect(constraintWidget7.mTop, this.mTop, this.mPaddingTop);
|
|
int access$600 = Flow.access$600(Flow.this);
|
|
float access$1400 = Flow.access$1400(Flow.this);
|
|
if (this.mStartIndex == 0 && Flow.access$1500(Flow.this) != -1) {
|
|
access$600 = Flow.access$1500(Flow.this);
|
|
access$1400 = Flow.access$1600(Flow.this);
|
|
} else if (z3 && Flow.access$1700(Flow.this) != -1) {
|
|
access$600 = Flow.access$1700(Flow.this);
|
|
access$1400 = Flow.access$1800(Flow.this);
|
|
}
|
|
constraintWidget7.setVerticalChainStyle(access$600);
|
|
constraintWidget7.setVerticalBiasPercent(access$1400);
|
|
}
|
|
if (i14 == i2 - 1) {
|
|
constraintWidget7.connect(constraintWidget7.mBottom, this.mBottom, this.mPaddingBottom);
|
|
}
|
|
if (constraintWidget3 != null) {
|
|
constraintWidget7.mTop.connect(constraintWidget3.mBottom, Flow.access$100(Flow.this));
|
|
if (i14 == i4) {
|
|
constraintWidget7.mTop.setGoneMargin(this.mPaddingTop);
|
|
}
|
|
constraintWidget3.mBottom.connect(constraintWidget7.mTop, 0);
|
|
if (i14 == i5 + 1) {
|
|
constraintWidget3.mBottom.setGoneMargin(this.mPaddingBottom);
|
|
}
|
|
}
|
|
if (constraintWidget7 != constraintWidget6) {
|
|
if (z2) {
|
|
int access$1900 = Flow.access$1900(Flow.this);
|
|
if (access$1900 == 0) {
|
|
constraintWidget7.mRight.connect(constraintWidget6.mRight, 0);
|
|
} else if (access$1900 == 1) {
|
|
constraintWidget7.mLeft.connect(constraintWidget6.mLeft, 0);
|
|
} else if (access$1900 == 2) {
|
|
constraintWidget7.mLeft.connect(constraintWidget6.mLeft, 0);
|
|
constraintWidget7.mRight.connect(constraintWidget6.mRight, 0);
|
|
}
|
|
} else {
|
|
int access$19002 = Flow.access$1900(Flow.this);
|
|
if (access$19002 == 0) {
|
|
constraintWidget7.mLeft.connect(constraintWidget6.mLeft, 0);
|
|
} else if (access$19002 == 1) {
|
|
constraintWidget7.mRight.connect(constraintWidget6.mRight, 0);
|
|
} else if (access$19002 == 2) {
|
|
if (z4) {
|
|
constraintWidget7.mLeft.connect(this.mLeft, this.mPaddingLeft);
|
|
constraintWidget7.mRight.connect(this.mRight, this.mPaddingRight);
|
|
} else {
|
|
constraintWidget7.mLeft.connect(constraintWidget6.mLeft, 0);
|
|
constraintWidget7.mRight.connect(constraintWidget6.mRight, 0);
|
|
}
|
|
}
|
|
i14++;
|
|
constraintWidget3 = constraintWidget7;
|
|
}
|
|
}
|
|
i14++;
|
|
constraintWidget3 = constraintWidget7;
|
|
}
|
|
}
|
|
}
|
|
|
|
public int getHeight() {
|
|
return this.mOrientation == 1 ? this.mHeight - Flow.access$100(Flow.this) : this.mHeight;
|
|
}
|
|
|
|
public int getWidth() {
|
|
return this.mOrientation == 0 ? this.mWidth - Flow.access$000(Flow.this) : this.mWidth;
|
|
}
|
|
|
|
public void measureMatchConstraints(int i) {
|
|
int i2 = this.mNbMatchConstraintsWidgets;
|
|
if (i2 != 0) {
|
|
int i3 = this.mCount;
|
|
int i4 = i / i2;
|
|
for (int i5 = 0; i5 < i3 && this.mStartIndex + i5 < Flow.access$400(Flow.this); i5++) {
|
|
ConstraintWidget constraintWidget = Flow.access$500(Flow.this)[this.mStartIndex + i5];
|
|
if (this.mOrientation == 0) {
|
|
if (constraintWidget != null && constraintWidget.getHorizontalDimensionBehaviour() == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT && constraintWidget.mMatchConstraintDefaultWidth == 0) {
|
|
Flow.this.measure(constraintWidget, ConstraintWidget.DimensionBehaviour.FIXED, i4, constraintWidget.getVerticalDimensionBehaviour(), constraintWidget.getHeight());
|
|
}
|
|
} else if (constraintWidget != null && constraintWidget.getVerticalDimensionBehaviour() == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT && constraintWidget.mMatchConstraintDefaultHeight == 0) {
|
|
Flow.this.measure(constraintWidget, constraintWidget.getHorizontalDimensionBehaviour(), constraintWidget.getWidth(), ConstraintWidget.DimensionBehaviour.FIXED, i4);
|
|
}
|
|
}
|
|
recomputeDimensions();
|
|
}
|
|
}
|
|
|
|
public void setStartIndex(int i) {
|
|
this.mStartIndex = i;
|
|
}
|
|
|
|
public void setup(int i, ConstraintAnchor constraintAnchor, ConstraintAnchor constraintAnchor2, ConstraintAnchor constraintAnchor3, ConstraintAnchor constraintAnchor4, int i2, int i3, int i4, int i5, int i6) {
|
|
this.mOrientation = i;
|
|
this.mLeft = constraintAnchor;
|
|
this.mTop = constraintAnchor2;
|
|
this.mRight = constraintAnchor3;
|
|
this.mBottom = constraintAnchor4;
|
|
this.mPaddingLeft = i2;
|
|
this.mPaddingTop = i3;
|
|
this.mPaddingRight = i4;
|
|
this.mPaddingBottom = i5;
|
|
this.mMax = i6;
|
|
}
|
|
}
|
|
|
|
public static /* synthetic */ int access$000(Flow flow) {
|
|
return flow.mHorizontalGap;
|
|
}
|
|
|
|
public static /* synthetic */ int access$100(Flow flow) {
|
|
return flow.mVerticalGap;
|
|
}
|
|
|
|
public static /* synthetic */ int access$1000(Flow flow) {
|
|
return flow.mFirstHorizontalStyle;
|
|
}
|
|
|
|
public static /* synthetic */ float access$1100(Flow flow) {
|
|
return flow.mFirstHorizontalBias;
|
|
}
|
|
|
|
public static /* synthetic */ int access$1200(Flow flow) {
|
|
return flow.mLastHorizontalStyle;
|
|
}
|
|
|
|
public static /* synthetic */ float access$1300(Flow flow) {
|
|
return flow.mLastHorizontalBias;
|
|
}
|
|
|
|
public static /* synthetic */ float access$1400(Flow flow) {
|
|
return flow.mVerticalBias;
|
|
}
|
|
|
|
public static /* synthetic */ int access$1500(Flow flow) {
|
|
return flow.mFirstVerticalStyle;
|
|
}
|
|
|
|
public static /* synthetic */ float access$1600(Flow flow) {
|
|
return flow.mFirstVerticalBias;
|
|
}
|
|
|
|
public static /* synthetic */ int access$1700(Flow flow) {
|
|
return flow.mLastVerticalStyle;
|
|
}
|
|
|
|
public static /* synthetic */ float access$1800(Flow flow) {
|
|
return flow.mLastVerticalBias;
|
|
}
|
|
|
|
public static /* synthetic */ int access$1900(Flow flow) {
|
|
return flow.mHorizontalAlign;
|
|
}
|
|
|
|
public static /* synthetic */ int access$200(Flow flow, ConstraintWidget constraintWidget, int i) {
|
|
return flow.getWidgetWidth(constraintWidget, i);
|
|
}
|
|
|
|
public static /* synthetic */ int access$300(Flow flow, ConstraintWidget constraintWidget, int i) {
|
|
return flow.getWidgetHeight(constraintWidget, i);
|
|
}
|
|
|
|
public static /* synthetic */ int access$400(Flow flow) {
|
|
return flow.mDisplayedWidgetsCount;
|
|
}
|
|
|
|
public static /* synthetic */ ConstraintWidget[] access$500(Flow flow) {
|
|
return flow.mDisplayedWidgets;
|
|
}
|
|
|
|
public static /* synthetic */ int access$600(Flow flow) {
|
|
return flow.mVerticalStyle;
|
|
}
|
|
|
|
public static /* synthetic */ int access$700(Flow flow) {
|
|
return flow.mVerticalAlign;
|
|
}
|
|
|
|
public static /* synthetic */ int access$800(Flow flow) {
|
|
return flow.mHorizontalStyle;
|
|
}
|
|
|
|
public static /* synthetic */ float access$900(Flow flow) {
|
|
return flow.mHorizontalBias;
|
|
}
|
|
|
|
private void createAlignedConstraints(boolean z2) {
|
|
ConstraintWidget constraintWidget;
|
|
if (!(this.mAlignedDimensions == null || this.mAlignedBiggestElementsInCols == null || this.mAlignedBiggestElementsInRows == null)) {
|
|
for (int i = 0; i < this.mDisplayedWidgetsCount; i++) {
|
|
this.mDisplayedWidgets[i].resetAnchors();
|
|
}
|
|
int[] iArr = this.mAlignedDimensions;
|
|
int i2 = iArr[0];
|
|
int i3 = iArr[1];
|
|
ConstraintWidget constraintWidget2 = null;
|
|
for (int i4 = 0; i4 < i2; i4++) {
|
|
ConstraintWidget constraintWidget3 = this.mAlignedBiggestElementsInCols[z2 ? (i2 - i4) - 1 : i4];
|
|
if (!(constraintWidget3 == null || constraintWidget3.getVisibility() == 8)) {
|
|
if (i4 == 0) {
|
|
constraintWidget3.connect(constraintWidget3.mLeft, this.mLeft, getPaddingLeft());
|
|
constraintWidget3.setHorizontalChainStyle(this.mHorizontalStyle);
|
|
constraintWidget3.setHorizontalBiasPercent(this.mHorizontalBias);
|
|
}
|
|
if (i4 == i2 - 1) {
|
|
constraintWidget3.connect(constraintWidget3.mRight, this.mRight, getPaddingRight());
|
|
}
|
|
if (i4 > 0) {
|
|
constraintWidget3.connect(constraintWidget3.mLeft, constraintWidget2.mRight, this.mHorizontalGap);
|
|
constraintWidget2.connect(constraintWidget2.mRight, constraintWidget3.mLeft, 0);
|
|
}
|
|
constraintWidget2 = constraintWidget3;
|
|
}
|
|
}
|
|
for (int i5 = 0; i5 < i3; i5++) {
|
|
ConstraintWidget constraintWidget4 = this.mAlignedBiggestElementsInRows[i5];
|
|
if (!(constraintWidget4 == null || constraintWidget4.getVisibility() == 8)) {
|
|
if (i5 == 0) {
|
|
constraintWidget4.connect(constraintWidget4.mTop, this.mTop, getPaddingTop());
|
|
constraintWidget4.setVerticalChainStyle(this.mVerticalStyle);
|
|
constraintWidget4.setVerticalBiasPercent(this.mVerticalBias);
|
|
}
|
|
if (i5 == i3 - 1) {
|
|
constraintWidget4.connect(constraintWidget4.mBottom, this.mBottom, getPaddingBottom());
|
|
}
|
|
if (i5 > 0) {
|
|
constraintWidget4.connect(constraintWidget4.mTop, constraintWidget2.mBottom, this.mVerticalGap);
|
|
constraintWidget2.connect(constraintWidget2.mBottom, constraintWidget4.mTop, 0);
|
|
}
|
|
constraintWidget2 = constraintWidget4;
|
|
}
|
|
}
|
|
for (int i6 = 0; i6 < i2; i6++) {
|
|
for (int i7 = 0; i7 < i3; i7++) {
|
|
int i8 = (i7 * i2) + i6;
|
|
if (this.mOrientation == 1) {
|
|
i8 = (i6 * i3) + i7;
|
|
}
|
|
ConstraintWidget[] constraintWidgetArr = this.mDisplayedWidgets;
|
|
if (!(i8 >= constraintWidgetArr.length || (constraintWidget = constraintWidgetArr[i8]) == null || constraintWidget.getVisibility() == 8)) {
|
|
ConstraintWidget constraintWidget5 = this.mAlignedBiggestElementsInCols[i6];
|
|
ConstraintWidget constraintWidget6 = this.mAlignedBiggestElementsInRows[i7];
|
|
if (constraintWidget != constraintWidget5) {
|
|
constraintWidget.connect(constraintWidget.mLeft, constraintWidget5.mLeft, 0);
|
|
constraintWidget.connect(constraintWidget.mRight, constraintWidget5.mRight, 0);
|
|
}
|
|
if (constraintWidget != constraintWidget6) {
|
|
constraintWidget.connect(constraintWidget.mTop, constraintWidget6.mTop, 0);
|
|
constraintWidget.connect(constraintWidget.mBottom, constraintWidget6.mBottom, 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private final int getWidgetHeight(ConstraintWidget constraintWidget, int i) {
|
|
if (constraintWidget == null) {
|
|
return 0;
|
|
}
|
|
if (constraintWidget.getVerticalDimensionBehaviour() == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
|
|
int i2 = constraintWidget.mMatchConstraintDefaultHeight;
|
|
if (i2 == 0) {
|
|
return 0;
|
|
}
|
|
if (i2 == 2) {
|
|
int i3 = (int) (constraintWidget.mMatchConstraintPercentHeight * i);
|
|
if (i3 != constraintWidget.getHeight()) {
|
|
constraintWidget.setMeasureRequested(true);
|
|
measure(constraintWidget, constraintWidget.getHorizontalDimensionBehaviour(), constraintWidget.getWidth(), ConstraintWidget.DimensionBehaviour.FIXED, i3);
|
|
}
|
|
return i3;
|
|
} else if (i2 == 1) {
|
|
return constraintWidget.getHeight();
|
|
} else {
|
|
if (i2 == 3) {
|
|
return (int) ((constraintWidget.getWidth() * constraintWidget.mDimensionRatio) + 0.5f);
|
|
}
|
|
}
|
|
}
|
|
return constraintWidget.getHeight();
|
|
}
|
|
|
|
private final int getWidgetWidth(ConstraintWidget constraintWidget, int i) {
|
|
if (constraintWidget == null) {
|
|
return 0;
|
|
}
|
|
if (constraintWidget.getHorizontalDimensionBehaviour() == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
|
|
int i2 = constraintWidget.mMatchConstraintDefaultWidth;
|
|
if (i2 == 0) {
|
|
return 0;
|
|
}
|
|
if (i2 == 2) {
|
|
int i3 = (int) (constraintWidget.mMatchConstraintPercentWidth * i);
|
|
if (i3 != constraintWidget.getWidth()) {
|
|
constraintWidget.setMeasureRequested(true);
|
|
measure(constraintWidget, ConstraintWidget.DimensionBehaviour.FIXED, i3, constraintWidget.getVerticalDimensionBehaviour(), constraintWidget.getHeight());
|
|
}
|
|
return i3;
|
|
} else if (i2 == 1) {
|
|
return constraintWidget.getWidth();
|
|
} else {
|
|
if (i2 == 3) {
|
|
return (int) ((constraintWidget.getHeight() * constraintWidget.mDimensionRatio) + 0.5f);
|
|
}
|
|
}
|
|
}
|
|
return constraintWidget.getWidth();
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:41:0x0068 */
|
|
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:100:0x0123 -> B:38:0x0063). Please submit an issue!!! */
|
|
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:101:0x0125 -> B:38:0x0063). Please submit an issue!!! */
|
|
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:97:0x011b -> B:38:0x0063). Please submit an issue!!! */
|
|
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:98:0x011d -> B:38:0x0063). Please submit an issue!!! */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
private void measureAligned(ConstraintWidget[] constraintWidgetArr, int i, int i2, int i3, int[] iArr) {
|
|
int i4;
|
|
int i5;
|
|
boolean z2;
|
|
ConstraintWidget constraintWidget;
|
|
if (i2 == 0) {
|
|
i4 = this.mMaxElementsWrap;
|
|
if (i4 <= 0) {
|
|
i4 = 0;
|
|
int i6 = 0;
|
|
for (int i7 = 0; i7 < i; i7++) {
|
|
if (i7 > 0) {
|
|
i6 += this.mHorizontalGap;
|
|
}
|
|
ConstraintWidget constraintWidget2 = constraintWidgetArr[i7];
|
|
if (constraintWidget2 != null) {
|
|
i6 += getWidgetWidth(constraintWidget2, i3);
|
|
if (i6 > i3) {
|
|
break;
|
|
}
|
|
i4++;
|
|
}
|
|
}
|
|
}
|
|
i5 = 0;
|
|
} else {
|
|
i5 = this.mMaxElementsWrap;
|
|
if (i5 <= 0) {
|
|
i5 = 0;
|
|
int i8 = 0;
|
|
for (int i9 = 0; i9 < i; i9++) {
|
|
if (i9 > 0) {
|
|
i8 += this.mVerticalGap;
|
|
}
|
|
ConstraintWidget constraintWidget3 = constraintWidgetArr[i9];
|
|
if (constraintWidget3 != null) {
|
|
i8 += getWidgetHeight(constraintWidget3, i3);
|
|
if (i8 > i3) {
|
|
break;
|
|
}
|
|
i5++;
|
|
}
|
|
}
|
|
}
|
|
i4 = 0;
|
|
}
|
|
if (this.mAlignedDimensions == null) {
|
|
this.mAlignedDimensions = new int[2];
|
|
}
|
|
if (!((i5 == 0 && i2 == 1) || (i4 == 0 && i2 == 0))) {
|
|
z2 = false;
|
|
while (!z2) {
|
|
if (i2 == 0) {
|
|
i5 = (int) Math.ceil(i / i4);
|
|
} else {
|
|
i4 = (int) Math.ceil(i / i5);
|
|
}
|
|
ConstraintWidget[] constraintWidgetArr2 = this.mAlignedBiggestElementsInCols;
|
|
if (constraintWidgetArr2 == null || constraintWidgetArr2.length < i4) {
|
|
this.mAlignedBiggestElementsInCols = new ConstraintWidget[i4];
|
|
} else {
|
|
Arrays.fill(constraintWidgetArr2, (Object) null);
|
|
}
|
|
ConstraintWidget[] constraintWidgetArr3 = this.mAlignedBiggestElementsInRows;
|
|
if (constraintWidgetArr3 == null || constraintWidgetArr3.length < i5) {
|
|
this.mAlignedBiggestElementsInRows = new ConstraintWidget[i5];
|
|
} else {
|
|
Arrays.fill(constraintWidgetArr3, (Object) null);
|
|
}
|
|
for (int i10 = 0; i10 < i4; i10++) {
|
|
for (int i11 = 0; i11 < i5; i11++) {
|
|
int i12 = (i11 * i4) + i10;
|
|
if (i2 == 1) {
|
|
i12 = (i10 * i5) + i11;
|
|
}
|
|
if (i12 < constraintWidgetArr.length && (constraintWidget = constraintWidgetArr[i12]) != null) {
|
|
int widgetWidth = getWidgetWidth(constraintWidget, i3);
|
|
ConstraintWidget[] constraintWidgetArr4 = this.mAlignedBiggestElementsInCols;
|
|
if (constraintWidgetArr4[i10] == null || constraintWidgetArr4[i10].getWidth() < widgetWidth) {
|
|
this.mAlignedBiggestElementsInCols[i10] = constraintWidget;
|
|
}
|
|
int widgetHeight = getWidgetHeight(constraintWidget, i3);
|
|
ConstraintWidget[] constraintWidgetArr5 = this.mAlignedBiggestElementsInRows;
|
|
if (constraintWidgetArr5[i11] == null || constraintWidgetArr5[i11].getHeight() < widgetHeight) {
|
|
this.mAlignedBiggestElementsInRows[i11] = constraintWidget;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
int i13 = 0;
|
|
for (int i14 = 0; i14 < i4; i14++) {
|
|
ConstraintWidget constraintWidget4 = this.mAlignedBiggestElementsInCols[i14];
|
|
if (constraintWidget4 != null) {
|
|
if (i14 > 0) {
|
|
i13 += this.mHorizontalGap;
|
|
}
|
|
i13 += getWidgetWidth(constraintWidget4, i3);
|
|
}
|
|
}
|
|
int i15 = 0;
|
|
for (int i16 = 0; i16 < i5; i16++) {
|
|
ConstraintWidget constraintWidget5 = this.mAlignedBiggestElementsInRows[i16];
|
|
if (constraintWidget5 != null) {
|
|
if (i16 > 0) {
|
|
i15 += this.mVerticalGap;
|
|
}
|
|
i15 += getWidgetHeight(constraintWidget5, i3);
|
|
}
|
|
}
|
|
iArr[0] = i13;
|
|
iArr[1] = i15;
|
|
if (i2 != 0) {
|
|
if (i15 > i3 && i5 > 1) {
|
|
i5--;
|
|
}
|
|
} else if (i13 > i3 && i4 > 1) {
|
|
i4--;
|
|
}
|
|
while (!z2) {
|
|
}
|
|
}
|
|
int[] iArr2 = this.mAlignedDimensions;
|
|
iArr2[0] = i4;
|
|
iArr2[1] = i5;
|
|
}
|
|
z2 = true;
|
|
while (!z2) {
|
|
}
|
|
int[] iArr22 = this.mAlignedDimensions;
|
|
iArr22[0] = i4;
|
|
iArr22[1] = i5;
|
|
}
|
|
|
|
private void measureChainWrap(ConstraintWidget[] constraintWidgetArr, int i, int i2, int i3, int[] iArr) {
|
|
int i4;
|
|
int i5;
|
|
int i6;
|
|
int i7;
|
|
ConstraintAnchor constraintAnchor;
|
|
int i8;
|
|
int i9;
|
|
if (i != 0) {
|
|
this.mChainList.clear();
|
|
WidgetsList widgetsList = new WidgetsList(i2, this.mLeft, this.mTop, this.mRight, this.mBottom, i3);
|
|
this.mChainList.add(widgetsList);
|
|
if (i2 == 0) {
|
|
i4 = 0;
|
|
int i10 = 0;
|
|
for (int i11 = 0; i11 < i; i11++) {
|
|
ConstraintWidget constraintWidget = constraintWidgetArr[i11];
|
|
int widgetWidth = getWidgetWidth(constraintWidget, i3);
|
|
if (constraintWidget.getHorizontalDimensionBehaviour() == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
|
|
i4++;
|
|
}
|
|
boolean z2 = (i10 == i3 || (this.mHorizontalGap + i10) + widgetWidth > i3) && WidgetsList.access$2000(widgetsList) != null;
|
|
if (!z2 && i11 > 0 && (i9 = this.mMaxElementsWrap) > 0 && i11 % i9 == 0) {
|
|
z2 = true;
|
|
}
|
|
if (z2) {
|
|
widgetsList = new WidgetsList(i2, this.mLeft, this.mTop, this.mRight, this.mBottom, i3);
|
|
widgetsList.setStartIndex(i11);
|
|
this.mChainList.add(widgetsList);
|
|
} else if (i11 > 0) {
|
|
i10 = this.mHorizontalGap + widgetWidth + i10;
|
|
widgetsList.add(constraintWidget);
|
|
}
|
|
i10 = widgetWidth;
|
|
widgetsList.add(constraintWidget);
|
|
}
|
|
} else {
|
|
i4 = 0;
|
|
int i12 = 0;
|
|
for (int i13 = 0; i13 < i; i13++) {
|
|
ConstraintWidget constraintWidget2 = constraintWidgetArr[i13];
|
|
int widgetHeight = getWidgetHeight(constraintWidget2, i3);
|
|
if (constraintWidget2.getVerticalDimensionBehaviour() == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
|
|
i4++;
|
|
}
|
|
boolean z3 = (i12 == i3 || (this.mVerticalGap + i12) + widgetHeight > i3) && WidgetsList.access$2000(widgetsList) != null;
|
|
if (!z3 && i13 > 0 && (i8 = this.mMaxElementsWrap) > 0 && i13 % i8 == 0) {
|
|
z3 = true;
|
|
}
|
|
if (z3) {
|
|
widgetsList = new WidgetsList(i2, this.mLeft, this.mTop, this.mRight, this.mBottom, i3);
|
|
widgetsList.setStartIndex(i13);
|
|
this.mChainList.add(widgetsList);
|
|
} else if (i13 > 0) {
|
|
i12 = this.mVerticalGap + widgetHeight + i12;
|
|
widgetsList.add(constraintWidget2);
|
|
}
|
|
i12 = widgetHeight;
|
|
widgetsList.add(constraintWidget2);
|
|
}
|
|
}
|
|
int size = this.mChainList.size();
|
|
ConstraintAnchor constraintAnchor2 = this.mLeft;
|
|
ConstraintAnchor constraintAnchor3 = this.mTop;
|
|
ConstraintAnchor constraintAnchor4 = this.mRight;
|
|
ConstraintAnchor constraintAnchor5 = this.mBottom;
|
|
int paddingLeft = getPaddingLeft();
|
|
int paddingTop = getPaddingTop();
|
|
int paddingRight = getPaddingRight();
|
|
int paddingBottom = getPaddingBottom();
|
|
ConstraintWidget.DimensionBehaviour horizontalDimensionBehaviour = getHorizontalDimensionBehaviour();
|
|
ConstraintWidget.DimensionBehaviour dimensionBehaviour = ConstraintWidget.DimensionBehaviour.WRAP_CONTENT;
|
|
boolean z4 = horizontalDimensionBehaviour == dimensionBehaviour || getVerticalDimensionBehaviour() == dimensionBehaviour;
|
|
if (i4 > 0 && z4) {
|
|
for (int i14 = 0; i14 < size; i14++) {
|
|
WidgetsList widgetsList2 = this.mChainList.get(i14);
|
|
if (i2 == 0) {
|
|
widgetsList2.measureMatchConstraints(i3 - widgetsList2.getWidth());
|
|
} else {
|
|
widgetsList2.measureMatchConstraints(i3 - widgetsList2.getHeight());
|
|
}
|
|
}
|
|
}
|
|
int i15 = 0;
|
|
int i16 = 0;
|
|
int i17 = 0;
|
|
while (i17 < size) {
|
|
WidgetsList widgetsList3 = this.mChainList.get(i17);
|
|
if (i2 == 0) {
|
|
if (i17 < size - 1) {
|
|
constraintAnchor = WidgetsList.access$2000(this.mChainList.get(i17 + 1)).mTop;
|
|
i7 = 0;
|
|
} else {
|
|
constraintAnchor = this.mBottom;
|
|
i7 = getPaddingBottom();
|
|
}
|
|
constraintAnchor3 = WidgetsList.access$2000(widgetsList3).mBottom;
|
|
i5 = i17;
|
|
widgetsList3.setup(i2, constraintAnchor2, constraintAnchor3, constraintAnchor4, constraintAnchor, paddingLeft, paddingTop, paddingRight, i7, i3);
|
|
i16 = Math.max(i16, widgetsList3.getWidth());
|
|
i15 = widgetsList3.getHeight() + i15;
|
|
if (i5 > 0) {
|
|
i15 += this.mVerticalGap;
|
|
}
|
|
constraintAnchor2 = constraintAnchor2;
|
|
paddingTop = 0;
|
|
constraintAnchor4 = constraintAnchor4;
|
|
constraintAnchor5 = constraintAnchor;
|
|
paddingBottom = i7;
|
|
} else {
|
|
i5 = i17;
|
|
if (i5 < size - 1) {
|
|
constraintAnchor4 = WidgetsList.access$2000(this.mChainList.get(i5 + 1)).mLeft;
|
|
i6 = 0;
|
|
} else {
|
|
constraintAnchor4 = this.mRight;
|
|
i6 = getPaddingRight();
|
|
}
|
|
constraintAnchor2 = WidgetsList.access$2000(widgetsList3).mRight;
|
|
widgetsList3.setup(i2, constraintAnchor2, constraintAnchor3, constraintAnchor4, constraintAnchor5, paddingLeft, paddingTop, i6, paddingBottom, i3);
|
|
i16 = widgetsList3.getWidth() + i16;
|
|
i15 = Math.max(i15, widgetsList3.getHeight());
|
|
if (i5 > 0) {
|
|
i16 += this.mHorizontalGap;
|
|
}
|
|
paddingRight = i6;
|
|
paddingLeft = 0;
|
|
}
|
|
i17 = i5 + 1;
|
|
}
|
|
iArr[0] = i16;
|
|
iArr[1] = i15;
|
|
}
|
|
}
|
|
|
|
private void measureNoWrap(ConstraintWidget[] constraintWidgetArr, int i, int i2, int i3, int[] iArr) {
|
|
WidgetsList widgetsList;
|
|
if (i != 0) {
|
|
if (this.mChainList.size() == 0) {
|
|
widgetsList = new WidgetsList(i2, this.mLeft, this.mTop, this.mRight, this.mBottom, i3);
|
|
this.mChainList.add(widgetsList);
|
|
} else {
|
|
WidgetsList widgetsList2 = this.mChainList.get(0);
|
|
widgetsList2.clear();
|
|
widgetsList = widgetsList2;
|
|
widgetsList.setup(i2, this.mLeft, this.mTop, this.mRight, this.mBottom, getPaddingLeft(), getPaddingTop(), getPaddingRight(), getPaddingBottom(), i3);
|
|
}
|
|
for (int i4 = 0; i4 < i; i4++) {
|
|
widgetsList.add(constraintWidgetArr[i4]);
|
|
}
|
|
iArr[0] = widgetsList.getWidth();
|
|
iArr[1] = widgetsList.getHeight();
|
|
}
|
|
}
|
|
|
|
@Override // androidx.constraintlayout.solver.widgets.ConstraintWidget
|
|
public void addToSolver(LinearSystem linearSystem, boolean z2) {
|
|
super.addToSolver(linearSystem, z2);
|
|
boolean isRtl = getParent() != null ? ((ConstraintWidgetContainer) getParent()).isRtl() : false;
|
|
int i = this.mWrapMode;
|
|
if (i != 0) {
|
|
if (i == 1) {
|
|
int size = this.mChainList.size();
|
|
int i2 = 0;
|
|
while (i2 < size) {
|
|
this.mChainList.get(i2).createConstraints(isRtl, i2, i2 == size + (-1));
|
|
i2++;
|
|
}
|
|
} else if (i == 2) {
|
|
createAlignedConstraints(isRtl);
|
|
}
|
|
} else if (this.mChainList.size() > 0) {
|
|
this.mChainList.get(0).createConstraints(isRtl, 0, true);
|
|
}
|
|
needsCallbackFromSolver(false);
|
|
}
|
|
|
|
@Override // androidx.constraintlayout.solver.widgets.HelperWidget, androidx.constraintlayout.solver.widgets.ConstraintWidget
|
|
public void copy(ConstraintWidget constraintWidget, HashMap<ConstraintWidget, ConstraintWidget> hashMap) {
|
|
super.copy(constraintWidget, hashMap);
|
|
Flow flow = (Flow) constraintWidget;
|
|
this.mHorizontalStyle = flow.mHorizontalStyle;
|
|
this.mVerticalStyle = flow.mVerticalStyle;
|
|
this.mFirstHorizontalStyle = flow.mFirstHorizontalStyle;
|
|
this.mFirstVerticalStyle = flow.mFirstVerticalStyle;
|
|
this.mLastHorizontalStyle = flow.mLastHorizontalStyle;
|
|
this.mLastVerticalStyle = flow.mLastVerticalStyle;
|
|
this.mHorizontalBias = flow.mHorizontalBias;
|
|
this.mVerticalBias = flow.mVerticalBias;
|
|
this.mFirstHorizontalBias = flow.mFirstHorizontalBias;
|
|
this.mFirstVerticalBias = flow.mFirstVerticalBias;
|
|
this.mLastHorizontalBias = flow.mLastHorizontalBias;
|
|
this.mLastVerticalBias = flow.mLastVerticalBias;
|
|
this.mHorizontalGap = flow.mHorizontalGap;
|
|
this.mVerticalGap = flow.mVerticalGap;
|
|
this.mHorizontalAlign = flow.mHorizontalAlign;
|
|
this.mVerticalAlign = flow.mVerticalAlign;
|
|
this.mWrapMode = flow.mWrapMode;
|
|
this.mMaxElementsWrap = flow.mMaxElementsWrap;
|
|
this.mOrientation = flow.mOrientation;
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:55:0x00da */
|
|
/* JADX WARN: Removed duplicated region for block: B:56:0x00dc */
|
|
/* JADX WARN: Removed duplicated region for block: B:61:0x00e9 */
|
|
/* JADX WARN: Removed duplicated region for block: B:62:0x00eb */
|
|
/* JADX WARN: Removed duplicated region for block: B:68:0x0104 */
|
|
@Override // androidx.constraintlayout.solver.widgets.VirtualLayout
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
public void measure(int i, int i2, int i3, int i4) {
|
|
int i5;
|
|
int i6;
|
|
int[] iArr;
|
|
boolean z2;
|
|
char c;
|
|
if (this.mWidgetsCount <= 0 || measureChildren()) {
|
|
int paddingLeft = getPaddingLeft();
|
|
int paddingRight = getPaddingRight();
|
|
int paddingTop = getPaddingTop();
|
|
int paddingBottom = getPaddingBottom();
|
|
int[] iArr2 = new int[2];
|
|
int i7 = (i2 - paddingLeft) - paddingRight;
|
|
int i8 = this.mOrientation;
|
|
if (i8 == 1) {
|
|
i7 = (i4 - paddingTop) - paddingBottom;
|
|
}
|
|
if (i8 == 0) {
|
|
if (this.mHorizontalStyle == -1) {
|
|
this.mHorizontalStyle = 0;
|
|
}
|
|
if (this.mVerticalStyle == -1) {
|
|
this.mVerticalStyle = 0;
|
|
}
|
|
} else {
|
|
if (this.mHorizontalStyle == -1) {
|
|
this.mHorizontalStyle = 0;
|
|
}
|
|
if (this.mVerticalStyle == -1) {
|
|
this.mVerticalStyle = 0;
|
|
}
|
|
}
|
|
ConstraintWidget[] constraintWidgetArr = this.mWidgets;
|
|
int i9 = 0;
|
|
int i10 = 0;
|
|
while (true) {
|
|
i5 = this.mWidgetsCount;
|
|
if (i9 >= i5) {
|
|
break;
|
|
}
|
|
if (this.mWidgets[i9].getVisibility() == 8) {
|
|
i10++;
|
|
}
|
|
i9++;
|
|
}
|
|
if (i10 > 0) {
|
|
constraintWidgetArr = new ConstraintWidget[i5 - i10];
|
|
int i11 = 0;
|
|
for (int i12 = 0; i12 < this.mWidgetsCount; i12++) {
|
|
ConstraintWidget constraintWidget = this.mWidgets[i12];
|
|
if (constraintWidget.getVisibility() != 8) {
|
|
constraintWidgetArr[i11] = constraintWidget;
|
|
i11++;
|
|
}
|
|
}
|
|
i6 = i11;
|
|
} else {
|
|
i6 = i5;
|
|
}
|
|
this.mDisplayedWidgets = constraintWidgetArr;
|
|
this.mDisplayedWidgetsCount = i6;
|
|
int i13 = this.mWrapMode;
|
|
if (i13 == 0) {
|
|
iArr = iArr2;
|
|
z2 = true;
|
|
measureNoWrap(constraintWidgetArr, i6, this.mOrientation, i7, iArr2);
|
|
} else if (i13 == 1) {
|
|
iArr = iArr2;
|
|
z2 = true;
|
|
measureChainWrap(constraintWidgetArr, i6, this.mOrientation, i7, iArr2);
|
|
} else if (i13 != 2) {
|
|
iArr = iArr2;
|
|
c = 0;
|
|
z2 = true;
|
|
int i14 = iArr[c] + paddingLeft + paddingRight;
|
|
char c2 = z2 ? 1 : 0;
|
|
char c3 = z2 ? 1 : 0;
|
|
char c4 = z2 ? 1 : 0;
|
|
char c5 = z2 ? 1 : 0;
|
|
char c6 = z2 ? 1 : 0;
|
|
char c7 = z2 ? 1 : 0;
|
|
char c8 = z2 ? 1 : 0;
|
|
int i15 = iArr[c2] + paddingTop + paddingBottom;
|
|
if (i != 1073741824) {
|
|
i14 = i2;
|
|
} else if (i == Integer.MIN_VALUE) {
|
|
i14 = Math.min(i14, i2);
|
|
} else if (i != 0) {
|
|
i14 = 0;
|
|
}
|
|
if (i3 != 1073741824) {
|
|
i15 = i4;
|
|
} else if (i3 == Integer.MIN_VALUE) {
|
|
i15 = Math.min(i15, i4);
|
|
} else if (i3 != 0) {
|
|
i15 = 0;
|
|
}
|
|
setMeasure(i14, i15);
|
|
setWidth(i14);
|
|
setHeight(i15);
|
|
if (this.mWidgetsCount <= 0) {
|
|
z2 = false;
|
|
}
|
|
needsCallbackFromSolver(z2);
|
|
return;
|
|
} else {
|
|
z2 = true;
|
|
iArr = iArr2;
|
|
measureAligned(constraintWidgetArr, i6, this.mOrientation, i7, iArr2);
|
|
}
|
|
c = 0;
|
|
int i142 = iArr[c] + paddingLeft + paddingRight;
|
|
char c22 = z2 ? 1 : 0;
|
|
char c32 = z2 ? 1 : 0;
|
|
char c42 = z2 ? 1 : 0;
|
|
char c52 = z2 ? 1 : 0;
|
|
char c62 = z2 ? 1 : 0;
|
|
char c72 = z2 ? 1 : 0;
|
|
char c82 = z2 ? 1 : 0;
|
|
int i152 = iArr[c22] + paddingTop + paddingBottom;
|
|
if (i != 1073741824) {
|
|
}
|
|
if (i3 != 1073741824) {
|
|
}
|
|
setMeasure(i142, i152);
|
|
setWidth(i142);
|
|
setHeight(i152);
|
|
if (this.mWidgetsCount <= 0) {
|
|
}
|
|
needsCallbackFromSolver(z2);
|
|
return;
|
|
}
|
|
setMeasure(0, 0);
|
|
needsCallbackFromSolver(false);
|
|
}
|
|
|
|
public void setFirstHorizontalBias(float f) {
|
|
this.mFirstHorizontalBias = f;
|
|
}
|
|
|
|
public void setFirstHorizontalStyle(int i) {
|
|
this.mFirstHorizontalStyle = i;
|
|
}
|
|
|
|
public void setFirstVerticalBias(float f) {
|
|
this.mFirstVerticalBias = f;
|
|
}
|
|
|
|
public void setFirstVerticalStyle(int i) {
|
|
this.mFirstVerticalStyle = i;
|
|
}
|
|
|
|
public void setHorizontalAlign(int i) {
|
|
this.mHorizontalAlign = i;
|
|
}
|
|
|
|
public void setHorizontalBias(float f) {
|
|
this.mHorizontalBias = f;
|
|
}
|
|
|
|
public void setHorizontalGap(int i) {
|
|
this.mHorizontalGap = i;
|
|
}
|
|
|
|
public void setHorizontalStyle(int i) {
|
|
this.mHorizontalStyle = i;
|
|
}
|
|
|
|
public void setLastHorizontalBias(float f) {
|
|
this.mLastHorizontalBias = f;
|
|
}
|
|
|
|
public void setLastHorizontalStyle(int i) {
|
|
this.mLastHorizontalStyle = i;
|
|
}
|
|
|
|
public void setLastVerticalBias(float f) {
|
|
this.mLastVerticalBias = f;
|
|
}
|
|
|
|
public void setLastVerticalStyle(int i) {
|
|
this.mLastVerticalStyle = i;
|
|
}
|
|
|
|
public void setMaxElementsWrap(int i) {
|
|
this.mMaxElementsWrap = i;
|
|
}
|
|
|
|
public void setOrientation(int i) {
|
|
this.mOrientation = i;
|
|
}
|
|
|
|
public void setVerticalAlign(int i) {
|
|
this.mVerticalAlign = i;
|
|
}
|
|
|
|
public void setVerticalBias(float f) {
|
|
this.mVerticalBias = f;
|
|
}
|
|
|
|
public void setVerticalGap(int i) {
|
|
this.mVerticalGap = i;
|
|
}
|
|
|
|
public void setVerticalStyle(int i) {
|
|
this.mVerticalStyle = i;
|
|
}
|
|
|
|
public void setWrapMode(int i) {
|
|
this.mWrapMode = i;
|
|
}
|
|
}
|