2021-07-24 02:37:17 +00:00
|
|
|
package androidx.constraintlayout.solver.widgets.analyzer;
|
|
|
|
|
|
|
|
import androidx.constraintlayout.solver.widgets.ConstraintAnchor;
|
|
|
|
import androidx.constraintlayout.solver.widgets.ConstraintWidget;
|
|
|
|
import androidx.constraintlayout.solver.widgets.Helper;
|
|
|
|
import androidx.constraintlayout.solver.widgets.analyzer.DependencyNode;
|
|
|
|
import androidx.constraintlayout.solver.widgets.analyzer.WidgetRun;
|
2021-12-17 21:59:34 +00:00
|
|
|
import b.d.b.a.a;
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes.dex */
|
2021-07-24 02:37:17 +00:00
|
|
|
public class VerticalWidgetRun extends WidgetRun {
|
|
|
|
public DependencyNode baseline;
|
|
|
|
public DimensionDependency baselineDimension = null;
|
|
|
|
|
|
|
|
/* renamed from: androidx.constraintlayout.solver.widgets.analyzer.VerticalWidgetRun$1 reason: invalid class name */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes.dex */
|
2021-07-24 02:37:17 +00:00
|
|
|
public static /* synthetic */ class AnonymousClass1 {
|
|
|
|
public static final /* synthetic */ int[] $SwitchMap$androidx$constraintlayout$solver$widgets$analyzer$WidgetRun$RunType;
|
|
|
|
|
|
|
|
static {
|
|
|
|
WidgetRun.RunType.values();
|
|
|
|
int[] iArr = new int[4];
|
|
|
|
$SwitchMap$androidx$constraintlayout$solver$widgets$analyzer$WidgetRun$RunType = iArr;
|
|
|
|
try {
|
|
|
|
iArr[WidgetRun.RunType.START.ordinal()] = 1;
|
|
|
|
} catch (NoSuchFieldError unused) {
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
$SwitchMap$androidx$constraintlayout$solver$widgets$analyzer$WidgetRun$RunType[WidgetRun.RunType.END.ordinal()] = 2;
|
|
|
|
} catch (NoSuchFieldError unused2) {
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
$SwitchMap$androidx$constraintlayout$solver$widgets$analyzer$WidgetRun$RunType[WidgetRun.RunType.CENTER.ordinal()] = 3;
|
|
|
|
} catch (NoSuchFieldError unused3) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public VerticalWidgetRun(ConstraintWidget constraintWidget) {
|
|
|
|
super(constraintWidget);
|
|
|
|
DependencyNode dependencyNode = new DependencyNode(this);
|
|
|
|
this.baseline = dependencyNode;
|
|
|
|
this.start.type = DependencyNode.Type.TOP;
|
|
|
|
this.end.type = DependencyNode.Type.BOTTOM;
|
|
|
|
dependencyNode.type = DependencyNode.Type.BASELINE;
|
|
|
|
this.orientation = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.constraintlayout.solver.widgets.analyzer.WidgetRun
|
|
|
|
public void apply() {
|
|
|
|
ConstraintWidget parent;
|
|
|
|
ConstraintWidget parent2;
|
|
|
|
ConstraintWidget constraintWidget = this.widget;
|
|
|
|
if (constraintWidget.measured) {
|
|
|
|
this.dimension.resolve(constraintWidget.getHeight());
|
|
|
|
}
|
|
|
|
if (!this.dimension.resolved) {
|
|
|
|
this.dimensionBehavior = this.widget.getVerticalDimensionBehaviour();
|
|
|
|
if (this.widget.hasBaseline()) {
|
|
|
|
this.baselineDimension = new BaselineDimensionDependency(this);
|
|
|
|
}
|
|
|
|
ConstraintWidget.DimensionBehaviour dimensionBehaviour = this.dimensionBehavior;
|
|
|
|
if (dimensionBehaviour != ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
|
|
|
|
if (dimensionBehaviour == ConstraintWidget.DimensionBehaviour.MATCH_PARENT && (parent2 = this.widget.getParent()) != null && parent2.getVerticalDimensionBehaviour() == ConstraintWidget.DimensionBehaviour.FIXED) {
|
|
|
|
int height = (parent2.getHeight() - this.widget.mTop.getMargin()) - this.widget.mBottom.getMargin();
|
|
|
|
addTarget(this.start, parent2.verticalRun.start, this.widget.mTop.getMargin());
|
|
|
|
addTarget(this.end, parent2.verticalRun.end, -this.widget.mBottom.getMargin());
|
|
|
|
this.dimension.resolve(height);
|
|
|
|
return;
|
|
|
|
} else if (this.dimensionBehavior == ConstraintWidget.DimensionBehaviour.FIXED) {
|
|
|
|
this.dimension.resolve(this.widget.getHeight());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (this.dimensionBehavior == ConstraintWidget.DimensionBehaviour.MATCH_PARENT && (parent = this.widget.getParent()) != null && parent.getVerticalDimensionBehaviour() == ConstraintWidget.DimensionBehaviour.FIXED) {
|
|
|
|
addTarget(this.start, parent.verticalRun.start, this.widget.mTop.getMargin());
|
|
|
|
addTarget(this.end, parent.verticalRun.end, -this.widget.mBottom.getMargin());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
DimensionDependency dimensionDependency = this.dimension;
|
|
|
|
boolean z2 = dimensionDependency.resolved;
|
|
|
|
if (z2) {
|
|
|
|
ConstraintWidget constraintWidget2 = this.widget;
|
|
|
|
if (constraintWidget2.measured) {
|
|
|
|
ConstraintAnchor[] constraintAnchorArr = constraintWidget2.mListAnchors;
|
|
|
|
if (constraintAnchorArr[2].mTarget != null && constraintAnchorArr[3].mTarget != null) {
|
|
|
|
if (constraintWidget2.isInVerticalChain()) {
|
|
|
|
this.start.margin = this.widget.mListAnchors[2].getMargin();
|
|
|
|
this.end.margin = -this.widget.mListAnchors[3].getMargin();
|
|
|
|
} else {
|
|
|
|
DependencyNode target = getTarget(this.widget.mListAnchors[2]);
|
|
|
|
if (target != null) {
|
|
|
|
addTarget(this.start, target, this.widget.mListAnchors[2].getMargin());
|
|
|
|
}
|
|
|
|
DependencyNode target2 = getTarget(this.widget.mListAnchors[3]);
|
|
|
|
if (target2 != null) {
|
|
|
|
addTarget(this.end, target2, -this.widget.mListAnchors[3].getMargin());
|
|
|
|
}
|
|
|
|
this.start.delegateToWidgetRun = true;
|
|
|
|
this.end.delegateToWidgetRun = true;
|
|
|
|
}
|
|
|
|
if (this.widget.hasBaseline()) {
|
|
|
|
addTarget(this.baseline, this.start, this.widget.getBaselineDistance());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
} else if (constraintAnchorArr[2].mTarget != null) {
|
|
|
|
DependencyNode target3 = getTarget(constraintAnchorArr[2]);
|
|
|
|
if (target3 != null) {
|
|
|
|
addTarget(this.start, target3, this.widget.mListAnchors[2].getMargin());
|
|
|
|
addTarget(this.end, this.start, this.dimension.value);
|
|
|
|
if (this.widget.hasBaseline()) {
|
|
|
|
addTarget(this.baseline, this.start, this.widget.getBaselineDistance());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
} else if (constraintAnchorArr[3].mTarget != null) {
|
|
|
|
DependencyNode target4 = getTarget(constraintAnchorArr[3]);
|
|
|
|
if (target4 != null) {
|
|
|
|
addTarget(this.end, target4, -this.widget.mListAnchors[3].getMargin());
|
|
|
|
addTarget(this.start, this.end, -this.dimension.value);
|
|
|
|
}
|
|
|
|
if (this.widget.hasBaseline()) {
|
|
|
|
addTarget(this.baseline, this.start, this.widget.getBaselineDistance());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
} else if (constraintAnchorArr[4].mTarget != null) {
|
|
|
|
DependencyNode target5 = getTarget(constraintAnchorArr[4]);
|
|
|
|
if (target5 != null) {
|
|
|
|
addTarget(this.baseline, target5, 0);
|
|
|
|
addTarget(this.start, this.baseline, -this.widget.getBaselineDistance());
|
|
|
|
addTarget(this.end, this.start, this.dimension.value);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
} else if (!(constraintWidget2 instanceof Helper) && constraintWidget2.getParent() != null && this.widget.getAnchor(ConstraintAnchor.Type.CENTER).mTarget == null) {
|
|
|
|
addTarget(this.start, this.widget.getParent().verticalRun.start, this.widget.getY());
|
|
|
|
addTarget(this.end, this.start, this.dimension.value);
|
|
|
|
if (this.widget.hasBaseline()) {
|
|
|
|
addTarget(this.baseline, this.start, this.widget.getBaselineDistance());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (z2 || this.dimensionBehavior != ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
|
|
|
|
dimensionDependency.addDependency(this);
|
|
|
|
} else {
|
|
|
|
ConstraintWidget constraintWidget3 = this.widget;
|
|
|
|
int i = constraintWidget3.mMatchConstraintDefaultHeight;
|
|
|
|
if (i == 2) {
|
|
|
|
ConstraintWidget parent3 = constraintWidget3.getParent();
|
|
|
|
if (parent3 != null) {
|
|
|
|
DimensionDependency dimensionDependency2 = parent3.verticalRun.dimension;
|
|
|
|
this.dimension.targets.add(dimensionDependency2);
|
|
|
|
dimensionDependency2.dependencies.add(this.dimension);
|
|
|
|
DimensionDependency dimensionDependency3 = this.dimension;
|
|
|
|
dimensionDependency3.delegateToWidgetRun = true;
|
|
|
|
dimensionDependency3.dependencies.add(this.start);
|
|
|
|
this.dimension.dependencies.add(this.end);
|
|
|
|
}
|
|
|
|
} else if (i == 3 && !constraintWidget3.isInVerticalChain()) {
|
|
|
|
ConstraintWidget constraintWidget4 = this.widget;
|
|
|
|
if (constraintWidget4.mMatchConstraintDefaultWidth != 3) {
|
|
|
|
DimensionDependency dimensionDependency4 = constraintWidget4.horizontalRun.dimension;
|
|
|
|
this.dimension.targets.add(dimensionDependency4);
|
|
|
|
dimensionDependency4.dependencies.add(this.dimension);
|
|
|
|
DimensionDependency dimensionDependency5 = this.dimension;
|
|
|
|
dimensionDependency5.delegateToWidgetRun = true;
|
|
|
|
dimensionDependency5.dependencies.add(this.start);
|
|
|
|
this.dimension.dependencies.add(this.end);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ConstraintWidget constraintWidget5 = this.widget;
|
|
|
|
ConstraintAnchor[] constraintAnchorArr2 = constraintWidget5.mListAnchors;
|
|
|
|
if (constraintAnchorArr2[2].mTarget != null && constraintAnchorArr2[3].mTarget != null) {
|
|
|
|
if (constraintWidget5.isInVerticalChain()) {
|
|
|
|
this.start.margin = this.widget.mListAnchors[2].getMargin();
|
|
|
|
this.end.margin = -this.widget.mListAnchors[3].getMargin();
|
|
|
|
} else {
|
|
|
|
DependencyNode target6 = getTarget(this.widget.mListAnchors[2]);
|
|
|
|
DependencyNode target7 = getTarget(this.widget.mListAnchors[3]);
|
|
|
|
target6.addDependency(this);
|
|
|
|
target7.addDependency(this);
|
|
|
|
this.mRunType = WidgetRun.RunType.CENTER;
|
|
|
|
}
|
|
|
|
if (this.widget.hasBaseline()) {
|
|
|
|
addTarget(this.baseline, this.start, 1, this.baselineDimension);
|
|
|
|
}
|
|
|
|
} else if (constraintAnchorArr2[2].mTarget != null) {
|
|
|
|
DependencyNode target8 = getTarget(constraintAnchorArr2[2]);
|
|
|
|
if (target8 != null) {
|
|
|
|
addTarget(this.start, target8, this.widget.mListAnchors[2].getMargin());
|
|
|
|
addTarget(this.end, this.start, 1, this.dimension);
|
|
|
|
if (this.widget.hasBaseline()) {
|
|
|
|
addTarget(this.baseline, this.start, 1, this.baselineDimension);
|
|
|
|
}
|
|
|
|
ConstraintWidget.DimensionBehaviour dimensionBehaviour2 = this.dimensionBehavior;
|
|
|
|
ConstraintWidget.DimensionBehaviour dimensionBehaviour3 = ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT;
|
|
|
|
if (dimensionBehaviour2 == dimensionBehaviour3 && this.widget.getDimensionRatio() > 0.0f) {
|
|
|
|
HorizontalWidgetRun horizontalWidgetRun = this.widget.horizontalRun;
|
|
|
|
if (horizontalWidgetRun.dimensionBehavior == dimensionBehaviour3) {
|
|
|
|
horizontalWidgetRun.dimension.dependencies.add(this.dimension);
|
|
|
|
this.dimension.targets.add(this.widget.horizontalRun.dimension);
|
|
|
|
this.dimension.updateDelegate = this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (constraintAnchorArr2[3].mTarget != null) {
|
|
|
|
DependencyNode target9 = getTarget(constraintAnchorArr2[3]);
|
|
|
|
if (target9 != null) {
|
|
|
|
addTarget(this.end, target9, -this.widget.mListAnchors[3].getMargin());
|
|
|
|
addTarget(this.start, this.end, -1, this.dimension);
|
|
|
|
if (this.widget.hasBaseline()) {
|
|
|
|
addTarget(this.baseline, this.start, 1, this.baselineDimension);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (constraintAnchorArr2[4].mTarget != null) {
|
|
|
|
DependencyNode target10 = getTarget(constraintAnchorArr2[4]);
|
|
|
|
if (target10 != null) {
|
|
|
|
addTarget(this.baseline, target10, 0);
|
|
|
|
addTarget(this.start, this.baseline, -1, this.baselineDimension);
|
|
|
|
addTarget(this.end, this.start, 1, this.dimension);
|
|
|
|
}
|
|
|
|
} else if (!(constraintWidget5 instanceof Helper) && constraintWidget5.getParent() != null) {
|
|
|
|
addTarget(this.start, this.widget.getParent().verticalRun.start, this.widget.getY());
|
|
|
|
addTarget(this.end, this.start, 1, this.dimension);
|
|
|
|
if (this.widget.hasBaseline()) {
|
|
|
|
addTarget(this.baseline, this.start, 1, this.baselineDimension);
|
|
|
|
}
|
|
|
|
ConstraintWidget.DimensionBehaviour dimensionBehaviour4 = this.dimensionBehavior;
|
|
|
|
ConstraintWidget.DimensionBehaviour dimensionBehaviour5 = ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT;
|
|
|
|
if (dimensionBehaviour4 == dimensionBehaviour5 && this.widget.getDimensionRatio() > 0.0f) {
|
|
|
|
HorizontalWidgetRun horizontalWidgetRun2 = this.widget.horizontalRun;
|
|
|
|
if (horizontalWidgetRun2.dimensionBehavior == dimensionBehaviour5) {
|
|
|
|
horizontalWidgetRun2.dimension.dependencies.add(this.dimension);
|
|
|
|
this.dimension.targets.add(this.widget.horizontalRun.dimension);
|
|
|
|
this.dimension.updateDelegate = this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.dimension.targets.size() == 0) {
|
|
|
|
this.dimension.readyToSolve = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.constraintlayout.solver.widgets.analyzer.WidgetRun
|
|
|
|
public void applyToWidget() {
|
|
|
|
DependencyNode dependencyNode = this.start;
|
|
|
|
if (dependencyNode.resolved) {
|
|
|
|
this.widget.setY(dependencyNode.value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.constraintlayout.solver.widgets.analyzer.WidgetRun
|
|
|
|
public void clear() {
|
|
|
|
this.runGroup = null;
|
|
|
|
this.start.clear();
|
|
|
|
this.end.clear();
|
|
|
|
this.baseline.clear();
|
|
|
|
this.dimension.clear();
|
|
|
|
this.resolved = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.constraintlayout.solver.widgets.analyzer.WidgetRun
|
|
|
|
public void reset() {
|
|
|
|
this.resolved = false;
|
|
|
|
this.start.clear();
|
|
|
|
this.start.resolved = false;
|
|
|
|
this.end.clear();
|
|
|
|
this.end.resolved = false;
|
|
|
|
this.baseline.clear();
|
|
|
|
this.baseline.resolved = false;
|
|
|
|
this.dimension.resolved = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.constraintlayout.solver.widgets.analyzer.WidgetRun
|
|
|
|
public boolean supportsWrapComputation() {
|
|
|
|
return this.dimensionBehavior != ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT || this.widget.mMatchConstraintDefaultHeight == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
2021-11-05 06:48:17 +00:00
|
|
|
StringBuilder R = a.R("VerticalRun ");
|
|
|
|
R.append(this.widget.getDebugName());
|
|
|
|
return R.toString();
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.constraintlayout.solver.widgets.analyzer.WidgetRun, androidx.constraintlayout.solver.widgets.analyzer.Dependency
|
|
|
|
public void update(Dependency dependency) {
|
2022-03-07 09:34:54 +00:00
|
|
|
DimensionDependency dimensionDependency;
|
2021-07-24 02:37:17 +00:00
|
|
|
int i;
|
|
|
|
float f;
|
|
|
|
float f2;
|
2022-03-07 09:34:54 +00:00
|
|
|
ConstraintWidget constraintWidget;
|
2021-07-24 02:37:17 +00:00
|
|
|
int ordinal = this.mRunType.ordinal();
|
|
|
|
if (ordinal == 1) {
|
|
|
|
updateRunStart(dependency);
|
|
|
|
} else if (ordinal == 2) {
|
|
|
|
updateRunEnd(dependency);
|
|
|
|
} else if (ordinal == 3) {
|
2022-03-07 09:34:54 +00:00
|
|
|
ConstraintWidget constraintWidget2 = this.widget;
|
|
|
|
updateRunCenter(dependency, constraintWidget2.mTop, constraintWidget2.mBottom, 1);
|
2021-07-24 02:37:17 +00:00
|
|
|
return;
|
|
|
|
}
|
2022-03-07 09:34:54 +00:00
|
|
|
DimensionDependency dimensionDependency2 = this.dimension;
|
|
|
|
if (dimensionDependency2.readyToSolve && !dimensionDependency2.resolved && this.dimensionBehavior == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
|
|
|
|
ConstraintWidget constraintWidget3 = this.widget;
|
|
|
|
int i2 = constraintWidget3.mMatchConstraintDefaultHeight;
|
2021-07-24 02:37:17 +00:00
|
|
|
if (i2 == 2) {
|
2022-03-07 09:34:54 +00:00
|
|
|
ConstraintWidget parent = constraintWidget3.getParent();
|
2021-07-24 02:37:17 +00:00
|
|
|
if (parent != null) {
|
2022-03-07 09:34:54 +00:00
|
|
|
if (parent.verticalRun.dimension.resolved) {
|
|
|
|
this.dimension.resolve((int) ((dimensionDependency.value * this.widget.mMatchConstraintPercentHeight) + 0.5f));
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|
2022-03-07 09:34:54 +00:00
|
|
|
} else if (i2 == 3 && constraintWidget3.horizontalRun.dimension.resolved) {
|
|
|
|
int dimensionRatioSide = constraintWidget3.getDimensionRatioSide();
|
2021-07-24 02:37:17 +00:00
|
|
|
if (dimensionRatioSide != -1) {
|
|
|
|
if (dimensionRatioSide == 0) {
|
2022-03-07 09:34:54 +00:00
|
|
|
i = (int) ((this.widget.getDimensionRatio() * constraintWidget.horizontalRun.dimension.value) + 0.5f);
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (dimensionRatioSide != 1) {
|
|
|
|
i = 0;
|
|
|
|
} else {
|
|
|
|
ConstraintWidget constraintWidget4 = this.widget;
|
2022-03-07 09:34:54 +00:00
|
|
|
f2 = constraintWidget4.horizontalRun.dimension.value;
|
2021-07-24 02:37:17 +00:00
|
|
|
f = constraintWidget4.getDimensionRatio();
|
|
|
|
}
|
|
|
|
this.dimension.resolve(i);
|
|
|
|
} else {
|
|
|
|
ConstraintWidget constraintWidget5 = this.widget;
|
2022-03-07 09:34:54 +00:00
|
|
|
f2 = constraintWidget5.horizontalRun.dimension.value;
|
2021-07-24 02:37:17 +00:00
|
|
|
f = constraintWidget5.getDimensionRatio();
|
|
|
|
}
|
|
|
|
i = (int) ((f2 / f) + 0.5f);
|
|
|
|
this.dimension.resolve(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DependencyNode dependencyNode = this.start;
|
|
|
|
if (dependencyNode.readyToSolve) {
|
|
|
|
DependencyNode dependencyNode2 = this.end;
|
|
|
|
if (dependencyNode2.readyToSolve) {
|
|
|
|
if (!dependencyNode.resolved || !dependencyNode2.resolved || !this.dimension.resolved) {
|
|
|
|
if (!this.dimension.resolved && this.dimensionBehavior == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
|
|
|
|
ConstraintWidget constraintWidget6 = this.widget;
|
|
|
|
if (constraintWidget6.mMatchConstraintDefaultWidth == 0 && !constraintWidget6.isInVerticalChain()) {
|
|
|
|
int i3 = this.start.targets.get(0).value;
|
|
|
|
DependencyNode dependencyNode3 = this.start;
|
|
|
|
int i4 = i3 + dependencyNode3.margin;
|
|
|
|
int i5 = this.end.targets.get(0).value + this.end.margin;
|
|
|
|
dependencyNode3.resolve(i4);
|
|
|
|
this.end.resolve(i5);
|
|
|
|
this.dimension.resolve(i5 - i4);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!this.dimension.resolved && this.dimensionBehavior == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT && this.matchConstraintsType == 1 && this.start.targets.size() > 0 && this.end.targets.size() > 0) {
|
|
|
|
int i6 = (this.end.targets.get(0).value + this.end.margin) - (this.start.targets.get(0).value + this.start.margin);
|
|
|
|
DimensionDependency dimensionDependency3 = this.dimension;
|
|
|
|
int i7 = dimensionDependency3.wrapValue;
|
|
|
|
if (i6 < i7) {
|
|
|
|
dimensionDependency3.resolve(i6);
|
|
|
|
} else {
|
|
|
|
dimensionDependency3.resolve(i7);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.dimension.resolved && this.start.targets.size() > 0 && this.end.targets.size() > 0) {
|
|
|
|
DependencyNode dependencyNode4 = this.start.targets.get(0);
|
|
|
|
DependencyNode dependencyNode5 = this.end.targets.get(0);
|
|
|
|
int i8 = dependencyNode4.value + this.start.margin;
|
|
|
|
int i9 = dependencyNode5.value + this.end.margin;
|
|
|
|
float verticalBiasPercent = this.widget.getVerticalBiasPercent();
|
|
|
|
if (dependencyNode4 == dependencyNode5) {
|
|
|
|
i8 = dependencyNode4.value;
|
|
|
|
i9 = dependencyNode5.value;
|
|
|
|
verticalBiasPercent = 0.5f;
|
|
|
|
}
|
2022-03-07 09:34:54 +00:00
|
|
|
this.start.resolve((int) ((((i9 - i8) - this.dimension.value) * verticalBiasPercent) + i8 + 0.5f));
|
2021-07-24 02:37:17 +00:00
|
|
|
this.end.resolve(this.start.value + this.dimension.value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|