2021-07-24 02:37:17 +00:00
|
|
|
package androidx.constraintlayout.solver.widgets;
|
|
|
|
|
|
|
|
import androidx.constraintlayout.solver.Cache;
|
|
|
|
import androidx.constraintlayout.solver.LinearSystem;
|
|
|
|
import androidx.constraintlayout.solver.Metrics;
|
|
|
|
import androidx.constraintlayout.solver.SolverVariable;
|
|
|
|
import androidx.constraintlayout.solver.widgets.ConstraintAnchor;
|
|
|
|
import androidx.constraintlayout.solver.widgets.analyzer.ChainRun;
|
|
|
|
import androidx.constraintlayout.solver.widgets.analyzer.DependencyNode;
|
|
|
|
import androidx.constraintlayout.solver.widgets.analyzer.HorizontalWidgetRun;
|
|
|
|
import androidx.constraintlayout.solver.widgets.analyzer.VerticalWidgetRun;
|
|
|
|
import androidx.constraintlayout.solver.widgets.analyzer.WidgetRun;
|
2021-08-09 22:51:56 +00:00
|
|
|
import androidx.exifinterface.media.ExifInterface;
|
2021-07-24 02:37:17 +00:00
|
|
|
import c.d.b.a.a;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.Iterator;
|
|
|
|
public class ConstraintWidget {
|
|
|
|
public static final int ANCHOR_BASELINE = 4;
|
|
|
|
public static final int ANCHOR_BOTTOM = 3;
|
|
|
|
public static final int ANCHOR_LEFT = 0;
|
|
|
|
public static final int ANCHOR_RIGHT = 1;
|
|
|
|
public static final int ANCHOR_TOP = 2;
|
|
|
|
private static final boolean AUTOTAG_CENTER = false;
|
|
|
|
public static final int BOTH = 2;
|
|
|
|
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;
|
|
|
|
public static final int DIMENSION_HORIZONTAL = 0;
|
|
|
|
public static final int DIMENSION_VERTICAL = 1;
|
|
|
|
public 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;
|
|
|
|
public static final int SOLVER = 1;
|
|
|
|
public static final int UNKNOWN = -1;
|
|
|
|
private static final boolean USE_WRAP_DIMENSION_FOR_SPREAD = false;
|
|
|
|
public static final int VERTICAL = 1;
|
|
|
|
public static final int VISIBLE = 0;
|
|
|
|
private static final int WRAP = -2;
|
|
|
|
private boolean OPTIMIZE_WRAP;
|
|
|
|
private boolean OPTIMIZE_WRAP_ON_RESOLVED;
|
|
|
|
private boolean hasBaseline;
|
|
|
|
public ChainRun horizontalChainRun;
|
|
|
|
public int horizontalGroup;
|
|
|
|
public HorizontalWidgetRun horizontalRun;
|
|
|
|
private boolean inPlaceholder;
|
|
|
|
public boolean[] isTerminalWidget;
|
|
|
|
public ArrayList<ConstraintAnchor> mAnchors;
|
|
|
|
public ConstraintAnchor mBaseline;
|
|
|
|
public int mBaselineDistance;
|
|
|
|
public ConstraintAnchor mBottom;
|
|
|
|
public boolean mBottomHasCentered;
|
|
|
|
public ConstraintAnchor mCenter;
|
|
|
|
public ConstraintAnchor mCenterX;
|
|
|
|
public ConstraintAnchor mCenterY;
|
|
|
|
private float mCircleConstraintAngle;
|
|
|
|
private Object mCompanionWidget;
|
|
|
|
private int mContainerItemSkip;
|
|
|
|
private String mDebugName;
|
|
|
|
public float mDimensionRatio;
|
|
|
|
public int mDimensionRatioSide;
|
|
|
|
public int mDistToBottom;
|
|
|
|
public int mDistToLeft;
|
|
|
|
public int mDistToRight;
|
|
|
|
public int mDistToTop;
|
|
|
|
public boolean mGroupsToSolver;
|
|
|
|
public int mHeight;
|
|
|
|
public float mHorizontalBiasPercent;
|
|
|
|
public boolean mHorizontalChainFixedPosition;
|
|
|
|
public int mHorizontalChainStyle;
|
|
|
|
public ConstraintWidget mHorizontalNextWidget;
|
|
|
|
public int mHorizontalResolution;
|
|
|
|
public boolean mHorizontalWrapVisited;
|
|
|
|
private boolean mInVirtuaLayout;
|
|
|
|
public boolean mIsHeightWrapContent;
|
|
|
|
private boolean[] mIsInBarrier;
|
|
|
|
public boolean mIsWidthWrapContent;
|
|
|
|
private int mLastHorizontalMeasureSpec;
|
|
|
|
private int mLastVerticalMeasureSpec;
|
|
|
|
public ConstraintAnchor mLeft;
|
|
|
|
public boolean mLeftHasCentered;
|
|
|
|
public ConstraintAnchor[] mListAnchors;
|
|
|
|
public DimensionBehaviour[] mListDimensionBehaviors;
|
|
|
|
public ConstraintWidget[] mListNextMatchConstraintsWidget;
|
|
|
|
public int mMatchConstraintDefaultHeight;
|
|
|
|
public int mMatchConstraintDefaultWidth;
|
|
|
|
public int mMatchConstraintMaxHeight;
|
|
|
|
public int mMatchConstraintMaxWidth;
|
|
|
|
public int mMatchConstraintMinHeight;
|
|
|
|
public int mMatchConstraintMinWidth;
|
|
|
|
public float mMatchConstraintPercentHeight;
|
|
|
|
public float mMatchConstraintPercentWidth;
|
|
|
|
private int[] mMaxDimension;
|
|
|
|
private boolean mMeasureRequested;
|
|
|
|
public int mMinHeight;
|
|
|
|
public int mMinWidth;
|
|
|
|
public ConstraintWidget[] mNextChainWidget;
|
|
|
|
public int mOffsetX;
|
|
|
|
public int mOffsetY;
|
|
|
|
public ConstraintWidget mParent;
|
|
|
|
public int mRelX;
|
|
|
|
public int mRelY;
|
|
|
|
public float mResolvedDimensionRatio;
|
|
|
|
public int mResolvedDimensionRatioSide;
|
|
|
|
public boolean mResolvedHasRatio;
|
|
|
|
public int[] mResolvedMatchConstraintDefault;
|
|
|
|
public ConstraintAnchor mRight;
|
|
|
|
public boolean mRightHasCentered;
|
|
|
|
public ConstraintAnchor mTop;
|
|
|
|
public boolean mTopHasCentered;
|
|
|
|
private String mType;
|
|
|
|
public float mVerticalBiasPercent;
|
|
|
|
public boolean mVerticalChainFixedPosition;
|
|
|
|
public int mVerticalChainStyle;
|
|
|
|
public ConstraintWidget mVerticalNextWidget;
|
|
|
|
public int mVerticalResolution;
|
|
|
|
public boolean mVerticalWrapVisited;
|
|
|
|
private int mVisibility;
|
|
|
|
public float[] mWeight;
|
|
|
|
public int mWidth;
|
|
|
|
public int mX;
|
|
|
|
public int mY;
|
|
|
|
public boolean measured;
|
|
|
|
private boolean resolvedHorizontal;
|
|
|
|
private boolean resolvedVertical;
|
|
|
|
public WidgetRun[] run;
|
|
|
|
public ChainRun verticalChainRun;
|
|
|
|
public int verticalGroup;
|
|
|
|
public VerticalWidgetRun verticalRun;
|
|
|
|
|
|
|
|
/* renamed from: androidx.constraintlayout.solver.widgets.ConstraintWidget$1 reason: invalid class name */
|
|
|
|
public static /* synthetic */ class AnonymousClass1 {
|
|
|
|
public static final /* synthetic */ int[] $SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintAnchor$Type;
|
|
|
|
public static final /* synthetic */ int[] $SwitchMap$androidx$constraintlayout$solver$widgets$ConstraintWidget$DimensionBehaviour;
|
|
|
|
|
|
|
|
static {
|
|
|
|
DimensionBehaviour.values();
|
|
|
|
int[] iArr = new int[4];
|
|
|
|
$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) {
|
|
|
|
}
|
|
|
|
ConstraintAnchor.Type.values();
|
|
|
|
int[] iArr2 = new int[9];
|
|
|
|
$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) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public enum DimensionBehaviour {
|
|
|
|
FIXED,
|
|
|
|
WRAP_CONTENT,
|
|
|
|
MATCH_CONSTRAINT,
|
|
|
|
MATCH_PARENT
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConstraintWidget() {
|
|
|
|
this.measured = false;
|
|
|
|
this.run = new WidgetRun[2];
|
|
|
|
this.horizontalRun = null;
|
|
|
|
this.verticalRun = null;
|
|
|
|
this.isTerminalWidget = new boolean[]{true, true};
|
|
|
|
this.mResolvedHasRatio = false;
|
|
|
|
this.mMeasureRequested = true;
|
|
|
|
this.OPTIMIZE_WRAP = false;
|
|
|
|
this.OPTIMIZE_WRAP_ON_RESOLVED = true;
|
|
|
|
this.resolvedHorizontal = false;
|
|
|
|
this.resolvedVertical = false;
|
|
|
|
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.mMaxDimension = new int[]{Integer.MAX_VALUE, Integer.MAX_VALUE};
|
|
|
|
this.mCircleConstraintAngle = 0.0f;
|
|
|
|
this.hasBaseline = false;
|
|
|
|
this.mInVirtuaLayout = false;
|
|
|
|
this.mLastHorizontalMeasureSpec = 0;
|
|
|
|
this.mLastVerticalMeasureSpec = 0;
|
|
|
|
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<>();
|
|
|
|
this.mIsInBarrier = new boolean[2];
|
|
|
|
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.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.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.horizontalGroup = -1;
|
|
|
|
this.verticalGroup = -1;
|
|
|
|
addAnchors();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConstraintWidget(int i, int i2) {
|
|
|
|
this(0, 0, i, i2);
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConstraintWidget(int i, int i2, int i3, int i4) {
|
|
|
|
this.measured = false;
|
|
|
|
this.run = new WidgetRun[2];
|
|
|
|
this.horizontalRun = null;
|
|
|
|
this.verticalRun = null;
|
|
|
|
this.isTerminalWidget = new boolean[]{true, true};
|
|
|
|
this.mResolvedHasRatio = false;
|
|
|
|
this.mMeasureRequested = true;
|
|
|
|
this.OPTIMIZE_WRAP = false;
|
|
|
|
this.OPTIMIZE_WRAP_ON_RESOLVED = true;
|
|
|
|
this.resolvedHorizontal = false;
|
|
|
|
this.resolvedVertical = false;
|
|
|
|
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.mMaxDimension = new int[]{Integer.MAX_VALUE, Integer.MAX_VALUE};
|
|
|
|
this.mCircleConstraintAngle = 0.0f;
|
|
|
|
this.hasBaseline = false;
|
|
|
|
this.mInVirtuaLayout = false;
|
|
|
|
this.mLastHorizontalMeasureSpec = 0;
|
|
|
|
this.mLastVerticalMeasureSpec = 0;
|
|
|
|
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<>();
|
|
|
|
this.mIsInBarrier = new boolean[2];
|
|
|
|
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.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.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.horizontalGroup = -1;
|
|
|
|
this.verticalGroup = -1;
|
|
|
|
this.mX = i;
|
|
|
|
this.mY = i2;
|
|
|
|
this.mWidth = i3;
|
|
|
|
this.mHeight = i4;
|
|
|
|
addAnchors();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConstraintWidget(String str) {
|
|
|
|
this.measured = false;
|
|
|
|
this.run = new WidgetRun[2];
|
|
|
|
this.horizontalRun = null;
|
|
|
|
this.verticalRun = null;
|
|
|
|
this.isTerminalWidget = new boolean[]{true, true};
|
|
|
|
this.mResolvedHasRatio = false;
|
|
|
|
this.mMeasureRequested = true;
|
|
|
|
this.OPTIMIZE_WRAP = false;
|
|
|
|
this.OPTIMIZE_WRAP_ON_RESOLVED = true;
|
|
|
|
this.resolvedHorizontal = false;
|
|
|
|
this.resolvedVertical = false;
|
|
|
|
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.mMaxDimension = new int[]{Integer.MAX_VALUE, Integer.MAX_VALUE};
|
|
|
|
this.mCircleConstraintAngle = 0.0f;
|
|
|
|
this.hasBaseline = false;
|
|
|
|
this.mInVirtuaLayout = false;
|
|
|
|
this.mLastHorizontalMeasureSpec = 0;
|
|
|
|
this.mLastVerticalMeasureSpec = 0;
|
|
|
|
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<>();
|
|
|
|
this.mIsInBarrier = new boolean[2];
|
|
|
|
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.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.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.horizontalGroup = -1;
|
|
|
|
this.verticalGroup = -1;
|
|
|
|
addAnchors();
|
|
|
|
setDebugName(str);
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConstraintWidget(String str, int i, int i2) {
|
|
|
|
this(i, i2);
|
|
|
|
setDebugName(str);
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConstraintWidget(String str, int i, int i2, int i3, int i4) {
|
|
|
|
this(i, i2, i3, i4);
|
|
|
|
setDebugName(str);
|
|
|
|
}
|
|
|
|
|
|
|
|
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 WARNING: Removed duplicated region for block: B:100:0x01de A[ADDED_TO_REGION] */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:206:0x0382 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:214:0x03c4 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:222:0x03e3 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:241:0x041d */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:25:0x007e */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:26:0x0082 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:273:0x046f */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:28:0x0086 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:293:0x04a5 A[ADDED_TO_REGION] */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:312:0x04e0 A[ADDED_TO_REGION] */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:341:? A[ADDED_TO_REGION, RETURN, SYNTHETIC] */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:345:? A[ADDED_TO_REGION, RETURN, SYNTHETIC] */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:37:0x00a8 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:47:0x00d4 */
|
|
|
|
private void applyConstraints(LinearSystem linearSystem, boolean z2, boolean z3, boolean z4, boolean z5, SolverVariable solverVariable, SolverVariable solverVariable2, DimensionBehaviour dimensionBehaviour, boolean z6, ConstraintAnchor constraintAnchor, ConstraintAnchor constraintAnchor2, int i, int i2, int i3, int i4, float f, boolean z7, boolean z8, boolean z9, boolean z10, boolean z11, int i5, int i6, int i7, int i8, float f2, boolean z12) {
|
|
|
|
boolean z13;
|
|
|
|
int i9;
|
|
|
|
int i10;
|
|
|
|
SolverVariable solverVariable3;
|
|
|
|
boolean z14;
|
|
|
|
int i11;
|
|
|
|
boolean z15;
|
|
|
|
SolverVariable solverVariable4;
|
|
|
|
SolverVariable solverVariable5;
|
|
|
|
SolverVariable solverVariable6;
|
|
|
|
int i12;
|
|
|
|
boolean z16;
|
|
|
|
ConstraintAnchor constraintAnchor3;
|
|
|
|
DimensionBehaviour[] dimensionBehaviourArr;
|
|
|
|
DimensionBehaviour dimensionBehaviour2;
|
|
|
|
boolean z17;
|
|
|
|
int i13;
|
|
|
|
SolverVariable solverVariable7;
|
|
|
|
SolverVariable solverVariable8;
|
|
|
|
ConstraintWidget constraintWidget;
|
|
|
|
int i14;
|
|
|
|
int i15;
|
|
|
|
boolean z18;
|
|
|
|
boolean z19;
|
|
|
|
SolverVariable solverVariable9;
|
|
|
|
int i16;
|
|
|
|
boolean z20;
|
|
|
|
boolean z21;
|
|
|
|
int i17;
|
|
|
|
SolverVariable solverVariable10;
|
|
|
|
int i18;
|
|
|
|
ConstraintWidget constraintWidget2;
|
|
|
|
ConstraintWidget constraintWidget3;
|
|
|
|
SolverVariable solverVariable11;
|
|
|
|
int i19;
|
|
|
|
int i20;
|
|
|
|
ConstraintWidget constraintWidget4;
|
|
|
|
int i21;
|
|
|
|
boolean z22;
|
|
|
|
int i22;
|
|
|
|
SolverVariable solverVariable12;
|
|
|
|
int i23;
|
|
|
|
int i24;
|
|
|
|
int i25;
|
|
|
|
int i26;
|
|
|
|
boolean z23;
|
|
|
|
ConstraintWidget constraintWidget5;
|
|
|
|
int i27;
|
|
|
|
SolverVariable solverVariable13;
|
|
|
|
SolverVariable solverVariable14;
|
|
|
|
int i28 = i8;
|
|
|
|
SolverVariable createObjectVariable = linearSystem.createObjectVariable(constraintAnchor);
|
|
|
|
SolverVariable createObjectVariable2 = linearSystem.createObjectVariable(constraintAnchor2);
|
|
|
|
SolverVariable createObjectVariable3 = linearSystem.createObjectVariable(constraintAnchor.getTarget());
|
|
|
|
SolverVariable createObjectVariable4 = linearSystem.createObjectVariable(constraintAnchor2.getTarget());
|
|
|
|
if (LinearSystem.getMetrics() != null) {
|
|
|
|
LinearSystem.getMetrics().nonresolvedWidgets++;
|
|
|
|
}
|
|
|
|
boolean isConnected = constraintAnchor.isConnected();
|
|
|
|
boolean isConnected2 = constraintAnchor2.isConnected();
|
|
|
|
boolean isConnected3 = this.mCenter.isConnected();
|
|
|
|
int i29 = isConnected2 ? (isConnected ? 1 : 0) + 1 : isConnected ? 1 : 0;
|
|
|
|
if (isConnected3) {
|
|
|
|
i29++;
|
|
|
|
}
|
|
|
|
int i30 = z7 ? 3 : i5;
|
|
|
|
int ordinal = dimensionBehaviour.ordinal();
|
|
|
|
if (!(ordinal == 0 || ordinal == 1)) {
|
|
|
|
if (ordinal == 2) {
|
|
|
|
i9 = i30;
|
|
|
|
if (i9 != 4) {
|
|
|
|
z13 = true;
|
|
|
|
if (this.mVisibility == 8) {
|
|
|
|
i10 = 0;
|
|
|
|
z13 = false;
|
|
|
|
} else {
|
|
|
|
i10 = i2;
|
|
|
|
}
|
|
|
|
if (z12) {
|
|
|
|
if (!isConnected && !isConnected2 && !isConnected3) {
|
|
|
|
linearSystem.addEquality(createObjectVariable, i);
|
|
|
|
} else if (isConnected && !isConnected2) {
|
|
|
|
solverVariable3 = createObjectVariable4;
|
|
|
|
linearSystem.addEquality(createObjectVariable, createObjectVariable3, constraintAnchor.getMargin(), 8);
|
|
|
|
if (z13) {
|
|
|
|
if (z6) {
|
|
|
|
linearSystem.addEquality(createObjectVariable2, createObjectVariable, 0, 3);
|
|
|
|
if (i3 > 0) {
|
|
|
|
linearSystem.addGreaterThan(createObjectVariable2, createObjectVariable, i3, 8);
|
|
|
|
}
|
|
|
|
if (i4 < Integer.MAX_VALUE) {
|
|
|
|
linearSystem.addLowerThan(createObjectVariable2, createObjectVariable, i4, 8);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
linearSystem.addEquality(createObjectVariable2, createObjectVariable, i10, 8);
|
|
|
|
}
|
|
|
|
i12 = i29;
|
|
|
|
solverVariable6 = createObjectVariable3;
|
|
|
|
solverVariable4 = createObjectVariable2;
|
|
|
|
z14 = z13;
|
|
|
|
solverVariable5 = solverVariable3;
|
|
|
|
z15 = z5;
|
|
|
|
} else if (i29 == 2 || z7 || !(i9 == 1 || i9 == 0)) {
|
|
|
|
int i31 = i7 == -2 ? i10 : i7;
|
|
|
|
int i32 = i28 == -2 ? i10 : i28;
|
|
|
|
if (i10 > 0 && i9 != 1) {
|
|
|
|
i10 = 0;
|
|
|
|
}
|
|
|
|
if (i31 > 0) {
|
|
|
|
linearSystem.addGreaterThan(createObjectVariable2, createObjectVariable, i31, 8);
|
|
|
|
i10 = Math.max(i10, i31);
|
|
|
|
}
|
|
|
|
if (i32 > 0) {
|
|
|
|
if (!z3 || i9 != 1) {
|
|
|
|
i27 = 8;
|
|
|
|
linearSystem.addLowerThan(createObjectVariable2, createObjectVariable, i32, 8);
|
|
|
|
} else {
|
|
|
|
i27 = 8;
|
|
|
|
}
|
|
|
|
i10 = Math.min(i10, i32);
|
|
|
|
} else {
|
|
|
|
i27 = 8;
|
|
|
|
}
|
|
|
|
if (i9 == 1) {
|
|
|
|
if (z3) {
|
|
|
|
linearSystem.addEquality(createObjectVariable2, createObjectVariable, i10, i27);
|
|
|
|
} else if (z9) {
|
|
|
|
linearSystem.addEquality(createObjectVariable2, createObjectVariable, i10, 5);
|
|
|
|
linearSystem.addLowerThan(createObjectVariable2, createObjectVariable, i10, i27);
|
|
|
|
} else {
|
|
|
|
linearSystem.addEquality(createObjectVariable2, createObjectVariable, i10, 5);
|
|
|
|
linearSystem.addLowerThan(createObjectVariable2, createObjectVariable, i10, i27);
|
|
|
|
}
|
|
|
|
i28 = i32;
|
|
|
|
i12 = i29;
|
|
|
|
solverVariable6 = createObjectVariable3;
|
|
|
|
solverVariable4 = createObjectVariable2;
|
|
|
|
z14 = z13;
|
|
|
|
z15 = z5;
|
|
|
|
i11 = i31;
|
|
|
|
solverVariable5 = solverVariable3;
|
|
|
|
} else if (i9 == 2) {
|
|
|
|
ConstraintAnchor.Type type = constraintAnchor.getType();
|
|
|
|
ConstraintAnchor.Type type2 = ConstraintAnchor.Type.TOP;
|
|
|
|
if (type == type2 || constraintAnchor.getType() == ConstraintAnchor.Type.BOTTOM) {
|
|
|
|
solverVariable14 = linearSystem.createObjectVariable(this.mParent.getAnchor(type2));
|
|
|
|
solverVariable13 = linearSystem.createObjectVariable(this.mParent.getAnchor(ConstraintAnchor.Type.BOTTOM));
|
|
|
|
} else {
|
|
|
|
solverVariable14 = linearSystem.createObjectVariable(this.mParent.getAnchor(ConstraintAnchor.Type.LEFT));
|
|
|
|
solverVariable13 = linearSystem.createObjectVariable(this.mParent.getAnchor(ConstraintAnchor.Type.RIGHT));
|
|
|
|
}
|
|
|
|
i12 = i29;
|
|
|
|
solverVariable5 = solverVariable3;
|
|
|
|
solverVariable6 = createObjectVariable3;
|
|
|
|
solverVariable4 = createObjectVariable2;
|
|
|
|
linearSystem.addConstraint(linearSystem.createRow().createRowDimensionRatio(createObjectVariable2, createObjectVariable, solverVariable13, solverVariable14, f2));
|
|
|
|
z15 = z5;
|
|
|
|
i28 = i32;
|
|
|
|
i11 = i31;
|
|
|
|
z14 = false;
|
|
|
|
} else {
|
|
|
|
i12 = i29;
|
|
|
|
solverVariable6 = createObjectVariable3;
|
|
|
|
solverVariable4 = createObjectVariable2;
|
|
|
|
solverVariable5 = solverVariable3;
|
|
|
|
i28 = i32;
|
|
|
|
i11 = i31;
|
|
|
|
z14 = z13;
|
|
|
|
z15 = true;
|
|
|
|
}
|
|
|
|
if (!z12 && !z9) {
|
|
|
|
if ((isConnected || isConnected2 || isConnected3) && (!isConnected || isConnected2)) {
|
|
|
|
if (!isConnected && isConnected2) {
|
|
|
|
linearSystem.addEquality(solverVariable4, solverVariable5, -constraintAnchor2.getMargin(), 8);
|
|
|
|
if (z3) {
|
|
|
|
if (!this.OPTIMIZE_WRAP || !createObjectVariable.isFinalValue || (constraintWidget5 = this.mParent) == null) {
|
|
|
|
linearSystem.addGreaterThan(createObjectVariable, solverVariable, 0, 5);
|
|
|
|
} else {
|
|
|
|
ConstraintWidgetContainer constraintWidgetContainer = (ConstraintWidgetContainer) constraintWidget5;
|
|
|
|
if (z2) {
|
|
|
|
constraintWidgetContainer.addHorizontalWrapMinVariable(constraintAnchor);
|
|
|
|
} else {
|
|
|
|
constraintWidgetContainer.addVerticalWrapMinVariable(constraintAnchor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (isConnected && isConnected2) {
|
|
|
|
ConstraintWidget constraintWidget6 = constraintAnchor.mTarget.mOwner;
|
|
|
|
ConstraintWidget constraintWidget7 = constraintAnchor2.mTarget.mOwner;
|
|
|
|
ConstraintWidget parent = getParent();
|
|
|
|
int i33 = 6;
|
|
|
|
if (z14) {
|
|
|
|
if (i9 == 0) {
|
|
|
|
if (i28 != 0 || i11 != 0) {
|
|
|
|
z20 = true;
|
|
|
|
z23 = false;
|
|
|
|
z19 = true;
|
|
|
|
i26 = 5;
|
|
|
|
i15 = 5;
|
|
|
|
} else if (!solverVariable6.isFinalValue || !solverVariable5.isFinalValue) {
|
|
|
|
z20 = false;
|
|
|
|
z23 = true;
|
|
|
|
z19 = false;
|
|
|
|
i26 = 8;
|
|
|
|
i15 = 8;
|
|
|
|
} else {
|
|
|
|
linearSystem.addEquality(createObjectVariable, solverVariable6, constraintAnchor.getMargin(), 8);
|
|
|
|
linearSystem.addEquality(solverVariable4, solverVariable5, -constraintAnchor2.getMargin(), 8);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ((constraintWidget6 instanceof Barrier) || (constraintWidget7 instanceof Barrier)) {
|
|
|
|
solverVariable9 = solverVariable2;
|
|
|
|
i14 = i26;
|
|
|
|
i15 = 4;
|
|
|
|
} else {
|
|
|
|
solverVariable9 = solverVariable2;
|
|
|
|
i14 = i26;
|
|
|
|
}
|
|
|
|
z18 = z23;
|
|
|
|
i16 = 6;
|
|
|
|
} else {
|
|
|
|
if (i9 == 1) {
|
|
|
|
solverVariable9 = solverVariable2;
|
|
|
|
z20 = true;
|
|
|
|
i16 = 6;
|
|
|
|
z19 = true;
|
|
|
|
z18 = false;
|
|
|
|
i15 = 4;
|
|
|
|
} else if (i9 != 3) {
|
|
|
|
solverVariable9 = solverVariable2;
|
|
|
|
z20 = false;
|
|
|
|
i16 = 6;
|
|
|
|
z19 = false;
|
|
|
|
} else if (this.mResolvedDimensionRatioSide == -1) {
|
|
|
|
if (z10) {
|
|
|
|
solverVariable9 = solverVariable2;
|
|
|
|
z20 = true;
|
|
|
|
i16 = z3 ? 5 : 4;
|
|
|
|
} else {
|
|
|
|
solverVariable9 = solverVariable2;
|
|
|
|
z20 = true;
|
|
|
|
i16 = 8;
|
|
|
|
}
|
|
|
|
z19 = true;
|
|
|
|
z18 = true;
|
|
|
|
i15 = 5;
|
|
|
|
} else if (z7) {
|
|
|
|
if (!(i6 == 2 || i6 == 1)) {
|
|
|
|
i25 = 8;
|
|
|
|
i24 = 5;
|
|
|
|
} else {
|
|
|
|
i25 = 5;
|
|
|
|
i24 = 4;
|
|
|
|
}
|
|
|
|
solverVariable9 = solverVariable2;
|
|
|
|
i14 = i25;
|
|
|
|
i15 = i24;
|
|
|
|
z20 = true;
|
|
|
|
i16 = 6;
|
|
|
|
z19 = true;
|
|
|
|
z18 = true;
|
|
|
|
} else {
|
|
|
|
if (i28 > 0) {
|
|
|
|
solverVariable9 = solverVariable2;
|
|
|
|
z20 = true;
|
|
|
|
i16 = 6;
|
|
|
|
z19 = true;
|
|
|
|
z18 = true;
|
|
|
|
i15 = 5;
|
|
|
|
} else if (i28 != 0 || i11 != 0) {
|
|
|
|
solverVariable9 = solverVariable2;
|
|
|
|
z20 = true;
|
|
|
|
i16 = 6;
|
|
|
|
z19 = true;
|
|
|
|
z18 = true;
|
|
|
|
i15 = 4;
|
|
|
|
} else if (!z10) {
|
|
|
|
solverVariable9 = solverVariable2;
|
|
|
|
z20 = true;
|
|
|
|
i16 = 6;
|
|
|
|
z19 = true;
|
|
|
|
z18 = true;
|
|
|
|
i15 = 8;
|
|
|
|
} else {
|
|
|
|
solverVariable9 = solverVariable2;
|
|
|
|
i14 = (constraintWidget6 == parent || constraintWidget7 == parent) ? 5 : 4;
|
|
|
|
z20 = true;
|
|
|
|
i16 = 6;
|
|
|
|
z19 = true;
|
|
|
|
z18 = true;
|
|
|
|
i15 = 4;
|
|
|
|
}
|
|
|
|
i14 = 5;
|
|
|
|
}
|
|
|
|
i14 = 8;
|
|
|
|
}
|
|
|
|
if (z19 || solverVariable6 != solverVariable5 || constraintWidget6 == parent) {
|
|
|
|
z21 = true;
|
|
|
|
} else {
|
|
|
|
z19 = false;
|
|
|
|
z21 = false;
|
|
|
|
}
|
|
|
|
if (!z20) {
|
|
|
|
if (z14 || z8 || z10 || solverVariable6 != solverVariable || solverVariable5 != solverVariable9) {
|
|
|
|
i18 = i14;
|
|
|
|
z22 = z21;
|
|
|
|
z17 = z3;
|
|
|
|
i22 = i16;
|
|
|
|
} else {
|
|
|
|
z17 = false;
|
|
|
|
i22 = 8;
|
|
|
|
z22 = false;
|
|
|
|
i18 = 8;
|
|
|
|
}
|
|
|
|
solverVariable10 = solverVariable6;
|
|
|
|
i17 = i9;
|
|
|
|
constraintWidget3 = constraintWidget7;
|
|
|
|
constraintWidget2 = parent;
|
|
|
|
solverVariable11 = createObjectVariable;
|
|
|
|
linearSystem.addCentering(createObjectVariable, solverVariable10, constraintAnchor.getMargin(), f, solverVariable5, solverVariable4, constraintAnchor2.getMargin(), i22);
|
|
|
|
z21 = z22;
|
|
|
|
} else {
|
|
|
|
constraintWidget2 = parent;
|
|
|
|
solverVariable10 = solverVariable6;
|
|
|
|
solverVariable11 = createObjectVariable;
|
|
|
|
i17 = i9;
|
|
|
|
constraintWidget3 = constraintWidget7;
|
|
|
|
i18 = i14;
|
|
|
|
z17 = z3;
|
|
|
|
}
|
|
|
|
if (this.mVisibility == 8 || constraintAnchor2.hasDependents()) {
|
|
|
|
if (z19) {
|
|
|
|
int i34 = (!z17 || solverVariable10 == solverVariable5 || z14 || (!(constraintWidget6 instanceof Barrier) && !(constraintWidget3 instanceof Barrier))) ? i18 : 6;
|
|
|
|
linearSystem.addGreaterThan(solverVariable11, solverVariable10, constraintAnchor.getMargin(), i34);
|
|
|
|
linearSystem.addLowerThan(solverVariable4, solverVariable5, -constraintAnchor2.getMargin(), i34);
|
|
|
|
i18 = i34;
|
|
|
|
}
|
|
|
|
if (z17 || !z11 || (constraintWidget6 instanceof Barrier) || (constraintWidget3 instanceof Barrier)) {
|
|
|
|
i20 = i15;
|
|
|
|
i19 = i18;
|
|
|
|
} else {
|
|
|
|
i20 = 6;
|
|
|
|
i19 = 6;
|
|
|
|
z21 = true;
|
|
|
|
}
|
|
|
|
if (z21) {
|
|
|
|
if (!z18 || (z10 && !z4)) {
|
|
|
|
constraintWidget4 = constraintWidget2;
|
|
|
|
} else {
|
|
|
|
constraintWidget4 = constraintWidget2;
|
|
|
|
if (!(constraintWidget6 == constraintWidget4 || constraintWidget3 == constraintWidget4)) {
|
|
|
|
i33 = i20;
|
|
|
|
}
|
|
|
|
if ((constraintWidget6 instanceof Guideline) || (constraintWidget3 instanceof Guideline)) {
|
|
|
|
i33 = 5;
|
|
|
|
}
|
|
|
|
if ((constraintWidget6 instanceof Barrier) || (constraintWidget3 instanceof Barrier)) {
|
|
|
|
i33 = 5;
|
|
|
|
}
|
|
|
|
i20 = Math.max(z10 ? 5 : i33, i20);
|
|
|
|
}
|
|
|
|
if (z17) {
|
|
|
|
i20 = Math.min(i19, i20);
|
|
|
|
if (z7 && !z10 && (constraintWidget6 == constraintWidget4 || constraintWidget3 == constraintWidget4)) {
|
|
|
|
i21 = 4;
|
|
|
|
linearSystem.addEquality(solverVariable11, solverVariable10, constraintAnchor.getMargin(), i21);
|
|
|
|
linearSystem.addEquality(solverVariable4, solverVariable5, -constraintAnchor2.getMargin(), i21);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
i21 = i20;
|
|
|
|
linearSystem.addEquality(solverVariable11, solverVariable10, constraintAnchor.getMargin(), i21);
|
|
|
|
linearSystem.addEquality(solverVariable4, solverVariable5, -constraintAnchor2.getMargin(), i21);
|
|
|
|
}
|
|
|
|
if (z17) {
|
|
|
|
int margin = solverVariable == solverVariable10 ? constraintAnchor.getMargin() : 0;
|
|
|
|
if (solverVariable10 != solverVariable) {
|
|
|
|
linearSystem.addGreaterThan(solverVariable11, solverVariable, margin, 5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (z17 || !z14) {
|
|
|
|
solverVariable7 = solverVariable4;
|
|
|
|
} else {
|
|
|
|
solverVariable7 = solverVariable4;
|
|
|
|
if (i3 == 0 && i11 == 0) {
|
|
|
|
if (!z14 || i17 != 3) {
|
|
|
|
i13 = 0;
|
|
|
|
linearSystem.addGreaterThan(solverVariable7, solverVariable11, 0, 5);
|
|
|
|
} else {
|
|
|
|
i13 = 0;
|
|
|
|
linearSystem.addGreaterThan(solverVariable7, solverVariable11, 0, 8);
|
|
|
|
}
|
|
|
|
if (z17 && z15) {
|
|
|
|
if (constraintAnchor2.mTarget != null) {
|
|
|
|
solverVariable8 = solverVariable2;
|
|
|
|
i13 = constraintAnchor2.getMargin();
|
|
|
|
} else {
|
|
|
|
solverVariable8 = solverVariable2;
|
|
|
|
}
|
|
|
|
if (solverVariable5 == solverVariable8) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!this.OPTIMIZE_WRAP || !solverVariable7.isFinalValue || (constraintWidget = this.mParent) == null) {
|
|
|
|
linearSystem.addGreaterThan(solverVariable8, solverVariable7, i13, 5);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
ConstraintWidgetContainer constraintWidgetContainer2 = (ConstraintWidgetContainer) constraintWidget;
|
|
|
|
if (z2) {
|
|
|
|
constraintWidgetContainer2.addHorizontalWrapMaxVariable(constraintAnchor2);
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
constraintWidgetContainer2.addVerticalWrapMaxVariable(constraintAnchor2);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
i13 = 0;
|
|
|
|
if (z17) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
} else if (!solverVariable6.isFinalValue || !solverVariable5.isFinalValue) {
|
|
|
|
solverVariable9 = solverVariable2;
|
|
|
|
z20 = true;
|
|
|
|
i16 = 6;
|
|
|
|
z19 = true;
|
|
|
|
} else {
|
|
|
|
linearSystem.addCentering(createObjectVariable, solverVariable6, constraintAnchor.getMargin(), f, solverVariable5, solverVariable4, constraintAnchor2.getMargin(), 8);
|
|
|
|
if (z3 && z15) {
|
|
|
|
if (constraintAnchor2.mTarget != null) {
|
|
|
|
i23 = constraintAnchor2.getMargin();
|
|
|
|
solverVariable12 = solverVariable2;
|
|
|
|
} else {
|
|
|
|
solverVariable12 = solverVariable2;
|
|
|
|
i23 = 0;
|
|
|
|
}
|
|
|
|
if (solverVariable5 != solverVariable12) {
|
|
|
|
linearSystem.addGreaterThan(solverVariable12, solverVariable4, i23, 5);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
z18 = false;
|
|
|
|
i15 = 4;
|
|
|
|
i14 = 5;
|
|
|
|
if (z19) {
|
|
|
|
}
|
|
|
|
z21 = true;
|
|
|
|
if (!z20) {
|
|
|
|
}
|
|
|
|
if (this.mVisibility == 8) {
|
|
|
|
}
|
|
|
|
if (z19) {
|
|
|
|
}
|
|
|
|
if (z17) {
|
|
|
|
}
|
|
|
|
i20 = i15;
|
|
|
|
i19 = i18;
|
|
|
|
if (z21) {
|
|
|
|
}
|
|
|
|
if (z17) {
|
|
|
|
}
|
|
|
|
if (z17) {
|
|
|
|
}
|
|
|
|
solverVariable7 = solverVariable4;
|
|
|
|
i13 = 0;
|
|
|
|
if (z17) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
solverVariable7 = solverVariable4;
|
|
|
|
i13 = 0;
|
|
|
|
z17 = z3;
|
|
|
|
if (z17) {
|
|
|
|
}
|
|
|
|
} else if (i12 >= 2 && z3 && z15) {
|
|
|
|
linearSystem.addGreaterThan(createObjectVariable, solverVariable, 0, 8);
|
|
|
|
boolean z24 = z2 || this.mBaseline.mTarget == null;
|
|
|
|
if (z2 || (constraintAnchor3 = this.mBaseline.mTarget) == null) {
|
|
|
|
z16 = z24;
|
|
|
|
} else {
|
|
|
|
ConstraintWidget constraintWidget8 = constraintAnchor3.mOwner;
|
|
|
|
z16 = constraintWidget8.mDimensionRatio != 0.0f && (dimensionBehaviourArr = constraintWidget8.mListDimensionBehaviors)[0] == (dimensionBehaviour2 = DimensionBehaviour.MATCH_CONSTRAINT) && dimensionBehaviourArr[1] == dimensionBehaviour2;
|
|
|
|
}
|
|
|
|
if (z16) {
|
|
|
|
linearSystem.addGreaterThan(solverVariable2, solverVariable4, 0, 8);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
int max = Math.max(i7, i10);
|
|
|
|
if (i28 > 0) {
|
|
|
|
max = Math.min(i28, max);
|
|
|
|
}
|
|
|
|
linearSystem.addEquality(createObjectVariable2, createObjectVariable, max, 8);
|
|
|
|
z15 = z5;
|
|
|
|
i12 = i29;
|
|
|
|
solverVariable6 = createObjectVariable3;
|
|
|
|
solverVariable4 = createObjectVariable2;
|
|
|
|
solverVariable5 = solverVariable3;
|
|
|
|
z14 = false;
|
|
|
|
}
|
|
|
|
i11 = i7;
|
|
|
|
if (!z12) {
|
|
|
|
}
|
|
|
|
if (i12 >= 2) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
solverVariable3 = createObjectVariable4;
|
|
|
|
if (z13) {
|
|
|
|
}
|
|
|
|
i11 = i7;
|
|
|
|
if (!z12) {
|
|
|
|
}
|
|
|
|
if (i12 >= 2) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
z13 = false;
|
|
|
|
if (this.mVisibility == 8) {
|
|
|
|
}
|
|
|
|
if (z12) {
|
|
|
|
}
|
|
|
|
solverVariable3 = createObjectVariable4;
|
|
|
|
if (z13) {
|
|
|
|
}
|
|
|
|
i11 = i7;
|
|
|
|
if (!z12) {
|
|
|
|
}
|
|
|
|
if (i12 >= 2) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
i9 = i30;
|
|
|
|
z13 = false;
|
|
|
|
if (this.mVisibility == 8) {
|
|
|
|
}
|
|
|
|
if (z12) {
|
|
|
|
}
|
|
|
|
solverVariable3 = createObjectVariable4;
|
|
|
|
if (z13) {
|
|
|
|
}
|
|
|
|
i11 = i7;
|
|
|
|
if (!z12) {
|
|
|
|
}
|
|
|
|
if (i12 >= 2) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private boolean isChainHead(int i) {
|
|
|
|
int i2 = i * 2;
|
|
|
|
ConstraintAnchor[] constraintAnchorArr = this.mListAnchors;
|
|
|
|
if (!(constraintAnchorArr[i2].mTarget == null || constraintAnchorArr[i2].mTarget.mTarget == constraintAnchorArr[i2])) {
|
|
|
|
int i3 = i2 + 1;
|
|
|
|
if (constraintAnchorArr[i3].mTarget != null && constraintAnchorArr[i3].mTarget.mTarget == constraintAnchorArr[i3]) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void addChildrenToSolverByDependency(ConstraintWidgetContainer constraintWidgetContainer, LinearSystem linearSystem, HashSet<ConstraintWidget> hashSet, int i, boolean z2) {
|
|
|
|
if (z2) {
|
|
|
|
if (hashSet.contains(this)) {
|
|
|
|
Optimizer.checkMatchParent(constraintWidgetContainer, linearSystem, this);
|
|
|
|
hashSet.remove(this);
|
|
|
|
addToSolver(linearSystem, constraintWidgetContainer.optimizeFor(64));
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (i == 0) {
|
|
|
|
HashSet<ConstraintAnchor> dependents = this.mLeft.getDependents();
|
|
|
|
if (dependents != null) {
|
|
|
|
Iterator<ConstraintAnchor> it = dependents.iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
it.next().mOwner.addChildrenToSolverByDependency(constraintWidgetContainer, linearSystem, hashSet, i, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
HashSet<ConstraintAnchor> dependents2 = this.mRight.getDependents();
|
|
|
|
if (dependents2 != null) {
|
|
|
|
Iterator<ConstraintAnchor> it2 = dependents2.iterator();
|
|
|
|
while (it2.hasNext()) {
|
|
|
|
it2.next().mOwner.addChildrenToSolverByDependency(constraintWidgetContainer, linearSystem, hashSet, i, true);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
HashSet<ConstraintAnchor> dependents3 = this.mTop.getDependents();
|
|
|
|
if (dependents3 != null) {
|
|
|
|
Iterator<ConstraintAnchor> it3 = dependents3.iterator();
|
|
|
|
while (it3.hasNext()) {
|
|
|
|
it3.next().mOwner.addChildrenToSolverByDependency(constraintWidgetContainer, linearSystem, hashSet, i, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
HashSet<ConstraintAnchor> dependents4 = this.mBottom.getDependents();
|
|
|
|
if (dependents4 != null) {
|
|
|
|
Iterator<ConstraintAnchor> it4 = dependents4.iterator();
|
|
|
|
while (it4.hasNext()) {
|
|
|
|
it4.next().mOwner.addChildrenToSolverByDependency(constraintWidgetContainer, linearSystem, hashSet, i, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
HashSet<ConstraintAnchor> dependents5 = this.mBaseline.getDependents();
|
|
|
|
if (dependents5 != null) {
|
|
|
|
Iterator<ConstraintAnchor> it5 = dependents5.iterator();
|
|
|
|
while (it5.hasNext()) {
|
|
|
|
it5.next().mOwner.addChildrenToSolverByDependency(constraintWidgetContainer, linearSystem, hashSet, i, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean addFirst() {
|
|
|
|
return (this instanceof VirtualLayout) || (this instanceof Guideline);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:182:0x02f2 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:186:0x02fc */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:189:0x0301 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:196:0x0316 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:201:0x031f */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:202:0x0322 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:215:0x0354 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:224:0x039e */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:240:0x045a */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:257:0x04be */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:261:0x04d2 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:262:0x04d4 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:264:0x04d7 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:299:0x0568 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:300:0x056b */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:304:0x05b1 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:308:0x05dc */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:311:0x05e6 */
|
|
|
|
public void addToSolver(LinearSystem linearSystem, boolean z2) {
|
|
|
|
boolean z3;
|
|
|
|
boolean z4;
|
|
|
|
boolean z5;
|
|
|
|
boolean z6;
|
|
|
|
int i;
|
|
|
|
int i2;
|
|
|
|
int i3;
|
|
|
|
SolverVariable solverVariable;
|
|
|
|
char c2;
|
|
|
|
boolean z7;
|
|
|
|
int i4;
|
|
|
|
boolean z8;
|
|
|
|
int i5;
|
|
|
|
DimensionBehaviour dimensionBehaviour;
|
|
|
|
SolverVariable solverVariable2;
|
|
|
|
SolverVariable solverVariable3;
|
|
|
|
SolverVariable solverVariable4;
|
|
|
|
DimensionBehaviour dimensionBehaviour2;
|
|
|
|
boolean z9;
|
|
|
|
boolean z10;
|
|
|
|
SolverVariable solverVariable5;
|
|
|
|
boolean z11;
|
|
|
|
ConstraintWidget constraintWidget;
|
|
|
|
LinearSystem linearSystem2;
|
|
|
|
SolverVariable solverVariable6;
|
|
|
|
SolverVariable solverVariable7;
|
|
|
|
char c3;
|
|
|
|
int i6;
|
|
|
|
boolean z12;
|
|
|
|
int i7;
|
|
|
|
SolverVariable solverVariable8;
|
|
|
|
SolverVariable solverVariable9;
|
|
|
|
SolverVariable solverVariable10;
|
|
|
|
ConstraintWidget constraintWidget2;
|
|
|
|
boolean z13;
|
|
|
|
HorizontalWidgetRun horizontalWidgetRun;
|
|
|
|
int i8;
|
|
|
|
int i9;
|
|
|
|
boolean z14;
|
|
|
|
boolean z15;
|
|
|
|
HorizontalWidgetRun horizontalWidgetRun2;
|
|
|
|
VerticalWidgetRun verticalWidgetRun;
|
|
|
|
boolean z16;
|
|
|
|
ConstraintWidget constraintWidget3;
|
|
|
|
ConstraintWidget constraintWidget4;
|
|
|
|
SolverVariable createObjectVariable = linearSystem.createObjectVariable(this.mLeft);
|
|
|
|
SolverVariable createObjectVariable2 = linearSystem.createObjectVariable(this.mRight);
|
|
|
|
SolverVariable createObjectVariable3 = linearSystem.createObjectVariable(this.mTop);
|
|
|
|
SolverVariable createObjectVariable4 = linearSystem.createObjectVariable(this.mBottom);
|
|
|
|
SolverVariable createObjectVariable5 = linearSystem.createObjectVariable(this.mBaseline);
|
|
|
|
ConstraintWidget constraintWidget5 = this.mParent;
|
|
|
|
if (constraintWidget5 != null) {
|
|
|
|
boolean z17 = constraintWidget5 != null && constraintWidget5.mListDimensionBehaviors[0] == DimensionBehaviour.WRAP_CONTENT;
|
|
|
|
z3 = constraintWidget5 != null && constraintWidget5.mListDimensionBehaviors[1] == DimensionBehaviour.WRAP_CONTENT;
|
|
|
|
z4 = z17;
|
|
|
|
} else {
|
|
|
|
z4 = false;
|
|
|
|
z3 = false;
|
|
|
|
}
|
|
|
|
if (this.mVisibility == 8 && !hasDependencies()) {
|
|
|
|
boolean[] zArr = this.mIsInBarrier;
|
|
|
|
if (!zArr[0] && !zArr[1]) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
boolean z18 = this.resolvedHorizontal;
|
|
|
|
if (z18 || this.resolvedVertical) {
|
|
|
|
if (z18) {
|
|
|
|
linearSystem.addEquality(createObjectVariable, this.mX);
|
|
|
|
linearSystem.addEquality(createObjectVariable2, this.mX + this.mWidth);
|
|
|
|
if (z4 && (constraintWidget4 = this.mParent) != null) {
|
|
|
|
if (this.OPTIMIZE_WRAP_ON_RESOLVED) {
|
|
|
|
ConstraintWidgetContainer constraintWidgetContainer = (ConstraintWidgetContainer) constraintWidget4;
|
|
|
|
constraintWidgetContainer.addVerticalWrapMinVariable(this.mLeft);
|
|
|
|
constraintWidgetContainer.addHorizontalWrapMaxVariable(this.mRight);
|
|
|
|
} else {
|
|
|
|
linearSystem.addGreaterThan(linearSystem.createObjectVariable(constraintWidget4.mRight), createObjectVariable2, 0, 5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.resolvedVertical) {
|
|
|
|
linearSystem.addEquality(createObjectVariable3, this.mY);
|
|
|
|
linearSystem.addEquality(createObjectVariable4, this.mY + this.mHeight);
|
|
|
|
if (this.mBaseline.hasDependents()) {
|
|
|
|
linearSystem.addEquality(createObjectVariable5, this.mY + this.mBaselineDistance);
|
|
|
|
}
|
|
|
|
if (z3 && (constraintWidget3 = this.mParent) != null) {
|
|
|
|
if (this.OPTIMIZE_WRAP_ON_RESOLVED) {
|
|
|
|
ConstraintWidgetContainer constraintWidgetContainer2 = (ConstraintWidgetContainer) constraintWidget3;
|
|
|
|
constraintWidgetContainer2.addVerticalWrapMinVariable(this.mTop);
|
|
|
|
constraintWidgetContainer2.addVerticalWrapMaxVariable(this.mBottom);
|
|
|
|
} else {
|
|
|
|
linearSystem.addGreaterThan(linearSystem.createObjectVariable(constraintWidget3.mBottom), createObjectVariable4, 0, 5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.resolvedHorizontal && this.resolvedVertical) {
|
|
|
|
this.resolvedHorizontal = false;
|
|
|
|
this.resolvedVertical = false;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Metrics metrics = LinearSystem.sMetrics;
|
|
|
|
if (metrics != null) {
|
|
|
|
metrics.widgets++;
|
|
|
|
}
|
|
|
|
if (!(!z2 || (horizontalWidgetRun2 = this.horizontalRun) == null || (verticalWidgetRun = this.verticalRun) == null)) {
|
|
|
|
DependencyNode dependencyNode = horizontalWidgetRun2.start;
|
|
|
|
if (dependencyNode.resolved && horizontalWidgetRun2.end.resolved && verticalWidgetRun.start.resolved && verticalWidgetRun.end.resolved) {
|
|
|
|
if (metrics != null) {
|
|
|
|
metrics.graphSolved++;
|
|
|
|
}
|
|
|
|
linearSystem.addEquality(createObjectVariable, dependencyNode.value);
|
|
|
|
linearSystem.addEquality(createObjectVariable2, this.horizontalRun.end.value);
|
|
|
|
linearSystem.addEquality(createObjectVariable3, this.verticalRun.start.value);
|
|
|
|
linearSystem.addEquality(createObjectVariable4, this.verticalRun.end.value);
|
|
|
|
linearSystem.addEquality(createObjectVariable5, this.verticalRun.baseline.value);
|
|
|
|
if (this.mParent != null) {
|
|
|
|
if (z4 && this.isTerminalWidget[0] && !isInHorizontalChain()) {
|
|
|
|
linearSystem.addGreaterThan(linearSystem.createObjectVariable(this.mParent.mRight), createObjectVariable2, 0, 8);
|
|
|
|
}
|
|
|
|
if (z3 && this.isTerminalWidget[1] && !isInVerticalChain()) {
|
|
|
|
z16 = false;
|
|
|
|
linearSystem.addGreaterThan(linearSystem.createObjectVariable(this.mParent.mBottom), createObjectVariable4, 0, 8);
|
|
|
|
this.resolvedHorizontal = z16;
|
|
|
|
this.resolvedVertical = z16;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
z16 = false;
|
|
|
|
this.resolvedHorizontal = z16;
|
|
|
|
this.resolvedVertical = z16;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (metrics != null) {
|
|
|
|
metrics.linearSolved++;
|
|
|
|
}
|
|
|
|
if (this.mParent != null) {
|
|
|
|
if (isChainHead(0)) {
|
|
|
|
((ConstraintWidgetContainer) this.mParent).addChain(this, 0);
|
|
|
|
z14 = true;
|
|
|
|
} else {
|
|
|
|
z14 = isInHorizontalChain();
|
|
|
|
}
|
|
|
|
if (isChainHead(1)) {
|
|
|
|
((ConstraintWidgetContainer) this.mParent).addChain(this, 1);
|
|
|
|
z15 = true;
|
|
|
|
} else {
|
|
|
|
z15 = isInVerticalChain();
|
|
|
|
}
|
|
|
|
if (!z14 && z4 && this.mVisibility != 8 && this.mLeft.mTarget == null && this.mRight.mTarget == null) {
|
|
|
|
linearSystem.addGreaterThan(linearSystem.createObjectVariable(this.mParent.mRight), createObjectVariable2, 0, 1);
|
|
|
|
}
|
|
|
|
if (!z15 && z3 && this.mVisibility != 8 && this.mTop.mTarget == null && this.mBottom.mTarget == null && this.mBaseline == null) {
|
|
|
|
linearSystem.addGreaterThan(linearSystem.createObjectVariable(this.mParent.mBottom), createObjectVariable4, 0, 1);
|
|
|
|
}
|
|
|
|
z5 = z14;
|
|
|
|
z6 = z15;
|
|
|
|
} else {
|
|
|
|
z6 = false;
|
|
|
|
z5 = false;
|
|
|
|
}
|
|
|
|
int i10 = this.mWidth;
|
|
|
|
int i11 = this.mMinWidth;
|
|
|
|
if (i10 >= i11) {
|
|
|
|
i11 = i10;
|
|
|
|
}
|
|
|
|
int i12 = this.mHeight;
|
|
|
|
int i13 = this.mMinHeight;
|
|
|
|
if (i12 >= i13) {
|
|
|
|
i13 = i12;
|
|
|
|
}
|
|
|
|
DimensionBehaviour[] dimensionBehaviourArr = this.mListDimensionBehaviors;
|
|
|
|
DimensionBehaviour dimensionBehaviour3 = dimensionBehaviourArr[0];
|
|
|
|
DimensionBehaviour dimensionBehaviour4 = DimensionBehaviour.MATCH_CONSTRAINT;
|
|
|
|
boolean z19 = dimensionBehaviour3 != dimensionBehaviour4;
|
|
|
|
boolean z20 = dimensionBehaviourArr[1] != dimensionBehaviour4;
|
|
|
|
int i14 = this.mDimensionRatioSide;
|
|
|
|
this.mResolvedDimensionRatioSide = i14;
|
|
|
|
float f = this.mDimensionRatio;
|
|
|
|
this.mResolvedDimensionRatio = f;
|
|
|
|
int i15 = this.mMatchConstraintDefaultWidth;
|
|
|
|
int i16 = this.mMatchConstraintDefaultHeight;
|
|
|
|
SolverVariable solverVariable11 = createObjectVariable2;
|
|
|
|
if (f > 0.0f) {
|
|
|
|
solverVariable = createObjectVariable;
|
|
|
|
if (this.mVisibility != 8) {
|
|
|
|
if (dimensionBehaviourArr[0] == dimensionBehaviour4 && i15 == 0) {
|
|
|
|
i15 = 3;
|
|
|
|
}
|
|
|
|
if (dimensionBehaviourArr[1] == dimensionBehaviour4 && i16 == 0) {
|
|
|
|
i16 = 3;
|
|
|
|
}
|
|
|
|
if (dimensionBehaviourArr[0] == dimensionBehaviour4 && dimensionBehaviourArr[1] == dimensionBehaviour4) {
|
|
|
|
i9 = 3;
|
|
|
|
if (i15 == 3 && i16 == 3) {
|
|
|
|
setupDimensionRatio(z4, z3, z19, z20);
|
|
|
|
c2 = 0;
|
|
|
|
i = i15;
|
|
|
|
i2 = i16;
|
|
|
|
i4 = i11;
|
|
|
|
i3 = i13;
|
|
|
|
z7 = true;
|
|
|
|
int[] iArr = this.mResolvedMatchConstraintDefault;
|
|
|
|
iArr[c2] = i;
|
|
|
|
iArr[1] = i2;
|
|
|
|
this.mResolvedHasRatio = z7;
|
|
|
|
if (!z7) {
|
|
|
|
int i17 = this.mResolvedDimensionRatioSide;
|
|
|
|
i5 = -1;
|
|
|
|
if (i17 == 0 || i17 == -1) {
|
|
|
|
z8 = true;
|
|
|
|
boolean z21 = !z7 && ((i8 = this.mResolvedDimensionRatioSide) == 1 || i8 == i5);
|
|
|
|
DimensionBehaviour dimensionBehaviour5 = this.mListDimensionBehaviors[0];
|
|
|
|
DimensionBehaviour dimensionBehaviour6 = DimensionBehaviour.WRAP_CONTENT;
|
|
|
|
boolean z22 = dimensionBehaviour5 != dimensionBehaviour6 && (this instanceof ConstraintWidgetContainer);
|
|
|
|
int i18 = z22 ? 0 : i4;
|
|
|
|
boolean z23 = !this.mCenter.isConnected();
|
|
|
|
boolean[] zArr2 = this.mIsInBarrier;
|
|
|
|
boolean z24 = zArr2[0];
|
|
|
|
boolean z25 = zArr2[1];
|
|
|
|
if (this.mHorizontalResolution != 2 && !this.resolvedHorizontal) {
|
|
|
|
if (z2 && (horizontalWidgetRun = this.horizontalRun) != null) {
|
|
|
|
DependencyNode dependencyNode2 = horizontalWidgetRun.start;
|
|
|
|
if (dependencyNode2.resolved && horizontalWidgetRun.end.resolved) {
|
|
|
|
if (z2) {
|
|
|
|
linearSystem.addEquality(solverVariable, dependencyNode2.value);
|
|
|
|
linearSystem.addEquality(solverVariable11, this.horizontalRun.end.value);
|
|
|
|
if (this.mParent != null && z4 && this.isTerminalWidget[0] && !isInHorizontalChain()) {
|
|
|
|
linearSystem.addGreaterThan(linearSystem.createObjectVariable(this.mParent.mRight), solverVariable11, 0, 8);
|
|
|
|
}
|
|
|
|
z9 = z4;
|
|
|
|
z11 = z3;
|
|
|
|
dimensionBehaviour2 = dimensionBehaviour4;
|
|
|
|
solverVariable11 = solverVariable11;
|
|
|
|
solverVariable5 = solverVariable;
|
|
|
|
dimensionBehaviour = dimensionBehaviour6;
|
|
|
|
z10 = z7;
|
|
|
|
solverVariable4 = createObjectVariable5;
|
|
|
|
solverVariable3 = createObjectVariable4;
|
|
|
|
solverVariable2 = createObjectVariable3;
|
|
|
|
if (z2) {
|
|
|
|
constraintWidget = this;
|
|
|
|
VerticalWidgetRun verticalWidgetRun2 = constraintWidget.verticalRun;
|
|
|
|
if (verticalWidgetRun2 != null) {
|
|
|
|
DependencyNode dependencyNode3 = verticalWidgetRun2.start;
|
|
|
|
if (dependencyNode3.resolved && verticalWidgetRun2.end.resolved) {
|
|
|
|
linearSystem2 = linearSystem;
|
|
|
|
solverVariable6 = solverVariable2;
|
|
|
|
linearSystem2.addEquality(solverVariable6, dependencyNode3.value);
|
|
|
|
solverVariable7 = solverVariable3;
|
|
|
|
linearSystem2.addEquality(solverVariable7, constraintWidget.verticalRun.end.value);
|
|
|
|
solverVariable8 = solverVariable4;
|
|
|
|
linearSystem2.addEquality(solverVariable8, constraintWidget.verticalRun.baseline.value);
|
|
|
|
ConstraintWidget constraintWidget6 = constraintWidget.mParent;
|
|
|
|
if (constraintWidget6 == null || z6 || !z11) {
|
|
|
|
i7 = 8;
|
|
|
|
i6 = 0;
|
|
|
|
c3 = 1;
|
|
|
|
} else {
|
|
|
|
c3 = 1;
|
|
|
|
if (constraintWidget.isTerminalWidget[1]) {
|
|
|
|
i7 = 8;
|
|
|
|
i6 = 0;
|
|
|
|
linearSystem2.addGreaterThan(linearSystem2.createObjectVariable(constraintWidget6.mBottom), solverVariable7, 0, 8);
|
|
|
|
} else {
|
|
|
|
i7 = 8;
|
|
|
|
i6 = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
z12 = false;
|
|
|
|
if ((constraintWidget.mVerticalResolution != 2 ? false : z12) || constraintWidget.resolvedVertical) {
|
|
|
|
solverVariable10 = solverVariable7;
|
|
|
|
solverVariable9 = solverVariable6;
|
|
|
|
} else {
|
|
|
|
boolean z26 = constraintWidget.mListDimensionBehaviors[c3] == dimensionBehaviour && (constraintWidget instanceof ConstraintWidgetContainer);
|
|
|
|
if (z26) {
|
|
|
|
i3 = 0;
|
|
|
|
}
|
|
|
|
ConstraintWidget constraintWidget7 = constraintWidget.mParent;
|
|
|
|
SolverVariable createObjectVariable6 = constraintWidget7 != null ? linearSystem2.createObjectVariable(constraintWidget7.mBottom) : null;
|
|
|
|
ConstraintWidget constraintWidget8 = constraintWidget.mParent;
|
|
|
|
SolverVariable createObjectVariable7 = constraintWidget8 != null ? linearSystem2.createObjectVariable(constraintWidget8.mTop) : null;
|
|
|
|
if (constraintWidget.mBaselineDistance > 0 || constraintWidget.mVisibility == i7) {
|
|
|
|
if (constraintWidget.mBaseline.mTarget != null) {
|
|
|
|
linearSystem2.addEquality(solverVariable8, solverVariable6, getBaselineDistance(), i7);
|
|
|
|
linearSystem2.addEquality(solverVariable8, linearSystem2.createObjectVariable(constraintWidget.mBaseline.mTarget), i6, i7);
|
|
|
|
if (z11) {
|
|
|
|
linearSystem2.addGreaterThan(createObjectVariable6, linearSystem2.createObjectVariable(constraintWidget.mBottom), i6, 5);
|
|
|
|
}
|
|
|
|
z13 = false;
|
|
|
|
boolean z27 = constraintWidget.isTerminalWidget[c3];
|
|
|
|
DimensionBehaviour[] dimensionBehaviourArr2 = constraintWidget.mListDimensionBehaviors;
|
|
|
|
solverVariable10 = solverVariable7;
|
|
|
|
solverVariable9 = solverVariable6;
|
|
|
|
applyConstraints(linearSystem, false, z11, z9, z27, createObjectVariable7, createObjectVariable6, dimensionBehaviourArr2[c3], z26, constraintWidget.mTop, constraintWidget.mBottom, constraintWidget.mY, i3, constraintWidget.mMinHeight, constraintWidget.mMaxDimension[c3], constraintWidget.mVerticalBiasPercent, z21, dimensionBehaviourArr2[0] != dimensionBehaviour2, z6, z5, z25, i2, i, constraintWidget.mMatchConstraintMinHeight, constraintWidget.mMatchConstraintMaxHeight, constraintWidget.mMatchConstraintPercentHeight, z13);
|
|
|
|
} else if (constraintWidget.mVisibility == i7) {
|
|
|
|
linearSystem2.addEquality(solverVariable8, solverVariable6, i6, i7);
|
|
|
|
} else {
|
|
|
|
linearSystem2.addEquality(solverVariable8, solverVariable6, getBaselineDistance(), i7);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
z13 = z23;
|
|
|
|
boolean z27 = constraintWidget.isTerminalWidget[c3];
|
|
|
|
DimensionBehaviour[] dimensionBehaviourArr2 = constraintWidget.mListDimensionBehaviors;
|
|
|
|
solverVariable10 = solverVariable7;
|
|
|
|
solverVariable9 = solverVariable6;
|
|
|
|
applyConstraints(linearSystem, false, z11, z9, z27, createObjectVariable7, createObjectVariable6, dimensionBehaviourArr2[c3], z26, constraintWidget.mTop, constraintWidget.mBottom, constraintWidget.mY, i3, constraintWidget.mMinHeight, constraintWidget.mMaxDimension[c3], constraintWidget.mVerticalBiasPercent, z21, dimensionBehaviourArr2[0] != dimensionBehaviour2, z6, z5, z25, i2, i, constraintWidget.mMatchConstraintMinHeight, constraintWidget.mMatchConstraintMaxHeight, constraintWidget.mMatchConstraintPercentHeight, z13);
|
|
|
|
}
|
|
|
|
if (!z10) {
|
|
|
|
constraintWidget2 = this;
|
|
|
|
if (constraintWidget2.mResolvedDimensionRatioSide == 1) {
|
|
|
|
linearSystem.addRatio(solverVariable10, solverVariable9, solverVariable11, solverVariable5, constraintWidget2.mResolvedDimensionRatio, 8);
|
|
|
|
} else {
|
|
|
|
linearSystem.addRatio(solverVariable11, solverVariable5, solverVariable10, solverVariable9, constraintWidget2.mResolvedDimensionRatio, 8);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
constraintWidget2 = this;
|
|
|
|
}
|
|
|
|
if (constraintWidget2.mCenter.isConnected()) {
|
|
|
|
linearSystem.addCenterPoint(constraintWidget2, constraintWidget2.mCenter.getTarget().getOwner(), (float) Math.toRadians((double) (constraintWidget2.mCircleConstraintAngle + 90.0f)), constraintWidget2.mCenter.getMargin());
|
|
|
|
}
|
|
|
|
constraintWidget2.resolvedHorizontal = false;
|
|
|
|
constraintWidget2.resolvedVertical = false;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
linearSystem2 = linearSystem;
|
|
|
|
solverVariable8 = solverVariable4;
|
|
|
|
solverVariable7 = solverVariable3;
|
|
|
|
solverVariable6 = solverVariable2;
|
|
|
|
i7 = 8;
|
|
|
|
i6 = 0;
|
|
|
|
c3 = 1;
|
|
|
|
} else {
|
|
|
|
i7 = 8;
|
|
|
|
i6 = 0;
|
|
|
|
c3 = 1;
|
|
|
|
constraintWidget = this;
|
|
|
|
linearSystem2 = linearSystem;
|
|
|
|
solverVariable8 = solverVariable4;
|
|
|
|
solverVariable7 = solverVariable3;
|
|
|
|
solverVariable6 = solverVariable2;
|
|
|
|
}
|
|
|
|
z12 = true;
|
|
|
|
if (constraintWidget.mVerticalResolution != 2 ? false : z12) {
|
|
|
|
}
|
|
|
|
solverVariable10 = solverVariable7;
|
|
|
|
solverVariable9 = solverVariable6;
|
|
|
|
if (!z10) {
|
|
|
|
}
|
|
|
|
if (constraintWidget2.mCenter.isConnected()) {
|
|
|
|
}
|
|
|
|
constraintWidget2.resolvedHorizontal = false;
|
|
|
|
constraintWidget2.resolvedVertical = false;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ConstraintWidget constraintWidget9 = this.mParent;
|
|
|
|
SolverVariable createObjectVariable8 = constraintWidget9 != null ? linearSystem.createObjectVariable(constraintWidget9.mRight) : null;
|
|
|
|
ConstraintWidget constraintWidget10 = this.mParent;
|
|
|
|
SolverVariable createObjectVariable9 = constraintWidget10 != null ? linearSystem.createObjectVariable(constraintWidget10.mLeft) : null;
|
|
|
|
boolean z28 = this.isTerminalWidget[0];
|
|
|
|
DimensionBehaviour[] dimensionBehaviourArr3 = this.mListDimensionBehaviors;
|
|
|
|
z9 = z4;
|
|
|
|
z11 = z3;
|
|
|
|
dimensionBehaviour2 = dimensionBehaviour4;
|
|
|
|
solverVariable4 = createObjectVariable5;
|
|
|
|
solverVariable3 = createObjectVariable4;
|
|
|
|
solverVariable2 = createObjectVariable3;
|
|
|
|
solverVariable11 = solverVariable11;
|
|
|
|
dimensionBehaviour = dimensionBehaviour6;
|
|
|
|
solverVariable5 = solverVariable;
|
|
|
|
z10 = z7;
|
|
|
|
applyConstraints(linearSystem, true, z4, z3, z28, createObjectVariable9, createObjectVariable8, dimensionBehaviourArr3[0], z22, this.mLeft, this.mRight, this.mX, i18, this.mMinWidth, this.mMaxDimension[0], this.mHorizontalBiasPercent, z8, dimensionBehaviourArr3[1] == dimensionBehaviour4, z5, z6, z24, i, i2, this.mMatchConstraintMinWidth, this.mMatchConstraintMaxWidth, this.mMatchConstraintPercentWidth, z23);
|
|
|
|
if (z2) {
|
|
|
|
}
|
|
|
|
z12 = true;
|
|
|
|
if (constraintWidget.mVerticalResolution != 2 ? false : z12) {
|
|
|
|
}
|
|
|
|
solverVariable10 = solverVariable7;
|
|
|
|
solverVariable9 = solverVariable6;
|
|
|
|
if (!z10) {
|
|
|
|
}
|
|
|
|
if (constraintWidget2.mCenter.isConnected()) {
|
|
|
|
}
|
|
|
|
constraintWidget2.resolvedHorizontal = false;
|
|
|
|
constraintWidget2.resolvedVertical = false;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
z9 = z4;
|
|
|
|
dimensionBehaviour2 = dimensionBehaviour4;
|
|
|
|
dimensionBehaviour = dimensionBehaviour6;
|
|
|
|
z10 = z7;
|
|
|
|
solverVariable4 = createObjectVariable5;
|
|
|
|
solverVariable3 = createObjectVariable4;
|
|
|
|
solverVariable2 = createObjectVariable3;
|
|
|
|
solverVariable5 = solverVariable;
|
|
|
|
z11 = z3;
|
|
|
|
if (z2) {
|
|
|
|
}
|
|
|
|
z12 = true;
|
|
|
|
if (constraintWidget.mVerticalResolution != 2 ? false : z12) {
|
|
|
|
}
|
|
|
|
solverVariable10 = solverVariable7;
|
|
|
|
solverVariable9 = solverVariable6;
|
|
|
|
if (!z10) {
|
|
|
|
}
|
|
|
|
if (constraintWidget2.mCenter.isConnected()) {
|
|
|
|
}
|
|
|
|
constraintWidget2.resolvedHorizontal = false;
|
|
|
|
constraintWidget2.resolvedVertical = false;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
i5 = -1;
|
|
|
|
}
|
|
|
|
z8 = false;
|
|
|
|
if (!z7) {
|
|
|
|
}
|
|
|
|
DimensionBehaviour dimensionBehaviour5 = this.mListDimensionBehaviors[0];
|
|
|
|
DimensionBehaviour dimensionBehaviour6 = DimensionBehaviour.WRAP_CONTENT;
|
|
|
|
if (dimensionBehaviour5 != dimensionBehaviour6) {
|
|
|
|
}
|
|
|
|
if (z22) {
|
|
|
|
}
|
|
|
|
boolean z23 = !this.mCenter.isConnected();
|
|
|
|
boolean[] zArr2 = this.mIsInBarrier;
|
|
|
|
boolean z24 = zArr2[0];
|
|
|
|
boolean z25 = zArr2[1];
|
|
|
|
DependencyNode dependencyNode2 = horizontalWidgetRun.start;
|
|
|
|
if (z2) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
i9 = 3;
|
|
|
|
}
|
|
|
|
if (dimensionBehaviourArr[0] == dimensionBehaviour4 && i15 == i9) {
|
|
|
|
this.mResolvedDimensionRatioSide = 0;
|
|
|
|
i4 = (int) (f * ((float) i12));
|
|
|
|
if (dimensionBehaviourArr[1] != dimensionBehaviour4) {
|
|
|
|
i2 = i16;
|
|
|
|
i3 = i13;
|
|
|
|
z7 = false;
|
|
|
|
c2 = 0;
|
|
|
|
i = 4;
|
|
|
|
} else {
|
|
|
|
i = i15;
|
|
|
|
i2 = i16;
|
|
|
|
i3 = i13;
|
|
|
|
z7 = true;
|
|
|
|
c2 = 0;
|
|
|
|
}
|
|
|
|
int[] iArr = this.mResolvedMatchConstraintDefault;
|
|
|
|
iArr[c2] = i;
|
|
|
|
iArr[1] = i2;
|
|
|
|
this.mResolvedHasRatio = z7;
|
|
|
|
if (!z7) {
|
|
|
|
}
|
|
|
|
z8 = false;
|
|
|
|
if (!z7) {
|
|
|
|
}
|
|
|
|
DimensionBehaviour dimensionBehaviour5 = this.mListDimensionBehaviors[0];
|
|
|
|
DimensionBehaviour dimensionBehaviour6 = DimensionBehaviour.WRAP_CONTENT;
|
|
|
|
if (dimensionBehaviour5 != dimensionBehaviour6) {
|
|
|
|
}
|
|
|
|
if (z22) {
|
|
|
|
}
|
|
|
|
boolean z23 = !this.mCenter.isConnected();
|
|
|
|
boolean[] zArr2 = this.mIsInBarrier;
|
|
|
|
boolean z24 = zArr2[0];
|
|
|
|
boolean z25 = zArr2[1];
|
|
|
|
DependencyNode dependencyNode2 = horizontalWidgetRun.start;
|
|
|
|
if (z2) {
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (dimensionBehaviourArr[1] == dimensionBehaviour4 && i16 == 3) {
|
|
|
|
this.mResolvedDimensionRatioSide = 1;
|
|
|
|
if (i14 == -1) {
|
|
|
|
this.mResolvedDimensionRatio = 1.0f / f;
|
|
|
|
}
|
|
|
|
c2 = 0;
|
|
|
|
DimensionBehaviour dimensionBehaviour7 = dimensionBehaviourArr[0];
|
|
|
|
i3 = (int) (this.mResolvedDimensionRatio * ((float) i10));
|
|
|
|
i = i15;
|
|
|
|
if (dimensionBehaviour7 != dimensionBehaviour4) {
|
|
|
|
i4 = i11;
|
|
|
|
z7 = false;
|
|
|
|
i2 = 4;
|
|
|
|
int[] iArr = this.mResolvedMatchConstraintDefault;
|
|
|
|
iArr[c2] = i;
|
|
|
|
iArr[1] = i2;
|
|
|
|
this.mResolvedHasRatio = z7;
|
|
|
|
if (!z7) {
|
|
|
|
}
|
|
|
|
z8 = false;
|
|
|
|
if (!z7) {
|
|
|
|
}
|
|
|
|
DimensionBehaviour dimensionBehaviour5 = this.mListDimensionBehaviors[0];
|
|
|
|
DimensionBehaviour dimensionBehaviour6 = DimensionBehaviour.WRAP_CONTENT;
|
|
|
|
if (dimensionBehaviour5 != dimensionBehaviour6) {
|
|
|
|
}
|
|
|
|
if (z22) {
|
|
|
|
}
|
|
|
|
boolean z23 = !this.mCenter.isConnected();
|
|
|
|
boolean[] zArr2 = this.mIsInBarrier;
|
|
|
|
boolean z24 = zArr2[0];
|
|
|
|
boolean z25 = zArr2[1];
|
|
|
|
DependencyNode dependencyNode2 = horizontalWidgetRun.start;
|
|
|
|
if (z2) {
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
i2 = i16;
|
|
|
|
i4 = i11;
|
|
|
|
z7 = true;
|
|
|
|
int[] iArr = this.mResolvedMatchConstraintDefault;
|
|
|
|
iArr[c2] = i;
|
|
|
|
iArr[1] = i2;
|
|
|
|
this.mResolvedHasRatio = z7;
|
|
|
|
if (!z7) {
|
|
|
|
}
|
|
|
|
z8 = false;
|
|
|
|
if (!z7) {
|
|
|
|
}
|
|
|
|
DimensionBehaviour dimensionBehaviour5 = this.mListDimensionBehaviors[0];
|
|
|
|
DimensionBehaviour dimensionBehaviour6 = DimensionBehaviour.WRAP_CONTENT;
|
|
|
|
if (dimensionBehaviour5 != dimensionBehaviour6) {
|
|
|
|
}
|
|
|
|
if (z22) {
|
|
|
|
}
|
|
|
|
boolean z23 = !this.mCenter.isConnected();
|
|
|
|
boolean[] zArr2 = this.mIsInBarrier;
|
|
|
|
boolean z24 = zArr2[0];
|
|
|
|
boolean z25 = zArr2[1];
|
|
|
|
DependencyNode dependencyNode2 = horizontalWidgetRun.start;
|
|
|
|
if (z2) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
c2 = 0;
|
|
|
|
i = i15;
|
|
|
|
i2 = i16;
|
|
|
|
i4 = i11;
|
|
|
|
i3 = i13;
|
|
|
|
z7 = true;
|
|
|
|
int[] iArr = this.mResolvedMatchConstraintDefault;
|
|
|
|
iArr[c2] = i;
|
|
|
|
iArr[1] = i2;
|
|
|
|
this.mResolvedHasRatio = z7;
|
|
|
|
if (!z7) {
|
|
|
|
}
|
|
|
|
z8 = false;
|
|
|
|
if (!z7) {
|
|
|
|
}
|
|
|
|
DimensionBehaviour dimensionBehaviour5 = this.mListDimensionBehaviors[0];
|
|
|
|
DimensionBehaviour dimensionBehaviour6 = DimensionBehaviour.WRAP_CONTENT;
|
|
|
|
if (dimensionBehaviour5 != dimensionBehaviour6) {
|
|
|
|
}
|
|
|
|
if (z22) {
|
|
|
|
}
|
|
|
|
boolean z23 = !this.mCenter.isConnected();
|
|
|
|
boolean[] zArr2 = this.mIsInBarrier;
|
|
|
|
boolean z24 = zArr2[0];
|
|
|
|
boolean z25 = zArr2[1];
|
|
|
|
DependencyNode dependencyNode2 = horizontalWidgetRun.start;
|
|
|
|
if (z2) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
solverVariable = createObjectVariable;
|
|
|
|
}
|
|
|
|
c2 = 0;
|
|
|
|
i = i15;
|
|
|
|
i2 = i16;
|
|
|
|
i4 = i11;
|
|
|
|
i3 = i13;
|
|
|
|
z7 = false;
|
|
|
|
int[] iArr = this.mResolvedMatchConstraintDefault;
|
|
|
|
iArr[c2] = i;
|
|
|
|
iArr[1] = i2;
|
|
|
|
this.mResolvedHasRatio = z7;
|
|
|
|
if (!z7) {
|
|
|
|
}
|
|
|
|
z8 = false;
|
|
|
|
if (!z7) {
|
|
|
|
}
|
|
|
|
DimensionBehaviour dimensionBehaviour5 = this.mListDimensionBehaviors[0];
|
|
|
|
DimensionBehaviour dimensionBehaviour6 = DimensionBehaviour.WRAP_CONTENT;
|
|
|
|
if (dimensionBehaviour5 != dimensionBehaviour6) {
|
|
|
|
}
|
|
|
|
if (z22) {
|
|
|
|
}
|
|
|
|
boolean z23 = !this.mCenter.isConnected();
|
|
|
|
boolean[] zArr2 = this.mIsInBarrier;
|
|
|
|
boolean z24 = zArr2[0];
|
|
|
|
boolean z25 = zArr2[1];
|
|
|
|
DependencyNode dependencyNode2 = horizontalWidgetRun.start;
|
|
|
|
if (z2) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean allowedInBarrier() {
|
|
|
|
return this.mVisibility != 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void connect(ConstraintAnchor.Type type, ConstraintWidget constraintWidget, ConstraintAnchor.Type type2) {
|
|
|
|
connect(type, constraintWidget, type2, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void connect(ConstraintAnchor.Type type, ConstraintWidget constraintWidget, ConstraintAnchor.Type type2, int i) {
|
|
|
|
ConstraintAnchor.Type type3;
|
|
|
|
ConstraintAnchor.Type type4;
|
|
|
|
boolean z2;
|
|
|
|
ConstraintAnchor.Type type5 = ConstraintAnchor.Type.CENTER;
|
|
|
|
if (type != type5) {
|
|
|
|
ConstraintAnchor.Type type6 = ConstraintAnchor.Type.CENTER_X;
|
|
|
|
if (type == type6 && (type2 == (type4 = ConstraintAnchor.Type.LEFT) || type2 == ConstraintAnchor.Type.RIGHT)) {
|
|
|
|
ConstraintAnchor anchor = getAnchor(type4);
|
|
|
|
ConstraintAnchor anchor2 = constraintWidget.getAnchor(type2);
|
|
|
|
ConstraintAnchor anchor3 = getAnchor(ConstraintAnchor.Type.RIGHT);
|
|
|
|
anchor.connect(anchor2, 0);
|
|
|
|
anchor3.connect(anchor2, 0);
|
|
|
|
getAnchor(type6).connect(anchor2, 0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
ConstraintAnchor.Type type7 = ConstraintAnchor.Type.CENTER_Y;
|
|
|
|
if (type == type7 && (type2 == (type3 = ConstraintAnchor.Type.TOP) || type2 == ConstraintAnchor.Type.BOTTOM)) {
|
|
|
|
ConstraintAnchor anchor4 = constraintWidget.getAnchor(type2);
|
|
|
|
getAnchor(type3).connect(anchor4, 0);
|
|
|
|
getAnchor(ConstraintAnchor.Type.BOTTOM).connect(anchor4, 0);
|
|
|
|
getAnchor(type7).connect(anchor4, 0);
|
|
|
|
} else if (type == type6 && type2 == type6) {
|
|
|
|
ConstraintAnchor.Type type8 = ConstraintAnchor.Type.LEFT;
|
|
|
|
getAnchor(type8).connect(constraintWidget.getAnchor(type8), 0);
|
|
|
|
ConstraintAnchor.Type type9 = ConstraintAnchor.Type.RIGHT;
|
|
|
|
getAnchor(type9).connect(constraintWidget.getAnchor(type9), 0);
|
|
|
|
getAnchor(type6).connect(constraintWidget.getAnchor(type2), 0);
|
|
|
|
} else if (type == type7 && type2 == type7) {
|
|
|
|
ConstraintAnchor.Type type10 = ConstraintAnchor.Type.TOP;
|
|
|
|
getAnchor(type10).connect(constraintWidget.getAnchor(type10), 0);
|
|
|
|
ConstraintAnchor.Type type11 = ConstraintAnchor.Type.BOTTOM;
|
|
|
|
getAnchor(type11).connect(constraintWidget.getAnchor(type11), 0);
|
|
|
|
getAnchor(type7).connect(constraintWidget.getAnchor(type2), 0);
|
|
|
|
} else {
|
|
|
|
ConstraintAnchor anchor5 = getAnchor(type);
|
|
|
|
ConstraintAnchor anchor6 = constraintWidget.getAnchor(type2);
|
|
|
|
if (anchor5.isValidConnection(anchor6)) {
|
|
|
|
ConstraintAnchor.Type type12 = ConstraintAnchor.Type.BASELINE;
|
|
|
|
if (type == type12) {
|
|
|
|
ConstraintAnchor anchor7 = getAnchor(ConstraintAnchor.Type.TOP);
|
|
|
|
ConstraintAnchor anchor8 = getAnchor(ConstraintAnchor.Type.BOTTOM);
|
|
|
|
if (anchor7 != null) {
|
|
|
|
anchor7.reset();
|
|
|
|
}
|
|
|
|
if (anchor8 != null) {
|
|
|
|
anchor8.reset();
|
|
|
|
}
|
|
|
|
i = 0;
|
|
|
|
} else if (type == ConstraintAnchor.Type.TOP || type == ConstraintAnchor.Type.BOTTOM) {
|
|
|
|
ConstraintAnchor anchor9 = getAnchor(type12);
|
|
|
|
if (anchor9 != null) {
|
|
|
|
anchor9.reset();
|
|
|
|
}
|
|
|
|
ConstraintAnchor anchor10 = getAnchor(type5);
|
|
|
|
if (anchor10.getTarget() != anchor6) {
|
|
|
|
anchor10.reset();
|
|
|
|
}
|
|
|
|
ConstraintAnchor opposite = getAnchor(type).getOpposite();
|
|
|
|
ConstraintAnchor anchor11 = getAnchor(type7);
|
|
|
|
if (anchor11.isConnected()) {
|
|
|
|
opposite.reset();
|
|
|
|
anchor11.reset();
|
|
|
|
}
|
|
|
|
} else if (type == ConstraintAnchor.Type.LEFT || type == ConstraintAnchor.Type.RIGHT) {
|
|
|
|
ConstraintAnchor anchor12 = getAnchor(type5);
|
|
|
|
if (anchor12.getTarget() != anchor6) {
|
|
|
|
anchor12.reset();
|
|
|
|
}
|
|
|
|
ConstraintAnchor opposite2 = getAnchor(type).getOpposite();
|
|
|
|
ConstraintAnchor anchor13 = getAnchor(type6);
|
|
|
|
if (anchor13.isConnected()) {
|
|
|
|
opposite2.reset();
|
|
|
|
anchor13.reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
anchor5.connect(anchor6, i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (type2 == type5) {
|
|
|
|
ConstraintAnchor.Type type13 = ConstraintAnchor.Type.LEFT;
|
|
|
|
ConstraintAnchor anchor14 = getAnchor(type13);
|
|
|
|
ConstraintAnchor.Type type14 = ConstraintAnchor.Type.RIGHT;
|
|
|
|
ConstraintAnchor anchor15 = getAnchor(type14);
|
|
|
|
ConstraintAnchor.Type type15 = ConstraintAnchor.Type.TOP;
|
|
|
|
ConstraintAnchor anchor16 = getAnchor(type15);
|
|
|
|
ConstraintAnchor.Type type16 = ConstraintAnchor.Type.BOTTOM;
|
|
|
|
ConstraintAnchor anchor17 = getAnchor(type16);
|
|
|
|
boolean z3 = true;
|
|
|
|
if ((anchor14 == null || !anchor14.isConnected()) && (anchor15 == null || !anchor15.isConnected())) {
|
|
|
|
connect(type13, constraintWidget, type13, 0);
|
|
|
|
connect(type14, constraintWidget, type14, 0);
|
|
|
|
z2 = true;
|
|
|
|
} else {
|
|
|
|
z2 = false;
|
|
|
|
}
|
|
|
|
if ((anchor16 == null || !anchor16.isConnected()) && (anchor17 == null || !anchor17.isConnected())) {
|
|
|
|
connect(type15, constraintWidget, type15, 0);
|
|
|
|
connect(type16, constraintWidget, type16, 0);
|
|
|
|
} else {
|
|
|
|
z3 = false;
|
|
|
|
}
|
|
|
|
if (z2 && z3) {
|
|
|
|
getAnchor(type5).connect(constraintWidget.getAnchor(type5), 0);
|
|
|
|
} else if (z2) {
|
|
|
|
ConstraintAnchor.Type type17 = ConstraintAnchor.Type.CENTER_X;
|
|
|
|
getAnchor(type17).connect(constraintWidget.getAnchor(type17), 0);
|
|
|
|
} else if (z3) {
|
|
|
|
ConstraintAnchor.Type type18 = ConstraintAnchor.Type.CENTER_Y;
|
|
|
|
getAnchor(type18).connect(constraintWidget.getAnchor(type18), 0);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
ConstraintAnchor.Type type19 = ConstraintAnchor.Type.LEFT;
|
|
|
|
if (type2 == type19 || type2 == ConstraintAnchor.Type.RIGHT) {
|
|
|
|
connect(type19, constraintWidget, type2, 0);
|
|
|
|
connect(ConstraintAnchor.Type.RIGHT, constraintWidget, type2, 0);
|
|
|
|
getAnchor(type5).connect(constraintWidget.getAnchor(type2), 0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
ConstraintAnchor.Type type20 = ConstraintAnchor.Type.TOP;
|
|
|
|
if (type2 == type20 || type2 == ConstraintAnchor.Type.BOTTOM) {
|
|
|
|
connect(type20, constraintWidget, type2, 0);
|
|
|
|
connect(ConstraintAnchor.Type.BOTTOM, constraintWidget, type2, 0);
|
|
|
|
getAnchor(type5).connect(constraintWidget.getAnchor(type2), 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void connect(ConstraintAnchor constraintAnchor, ConstraintAnchor constraintAnchor2, int i) {
|
|
|
|
if (constraintAnchor.getOwner() == this) {
|
|
|
|
connect(constraintAnchor.getType(), constraintAnchor2.getOwner(), constraintAnchor2.getType(), i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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 copy(ConstraintWidget constraintWidget, HashMap<ConstraintWidget, ConstraintWidget> hashMap) {
|
|
|
|
this.mHorizontalResolution = constraintWidget.mHorizontalResolution;
|
|
|
|
this.mVerticalResolution = constraintWidget.mVerticalResolution;
|
|
|
|
this.mMatchConstraintDefaultWidth = constraintWidget.mMatchConstraintDefaultWidth;
|
|
|
|
this.mMatchConstraintDefaultHeight = constraintWidget.mMatchConstraintDefaultHeight;
|
|
|
|
int[] iArr = this.mResolvedMatchConstraintDefault;
|
|
|
|
int[] iArr2 = constraintWidget.mResolvedMatchConstraintDefault;
|
|
|
|
iArr[0] = iArr2[0];
|
|
|
|
iArr[1] = iArr2[1];
|
|
|
|
this.mMatchConstraintMinWidth = constraintWidget.mMatchConstraintMinWidth;
|
|
|
|
this.mMatchConstraintMaxWidth = constraintWidget.mMatchConstraintMaxWidth;
|
|
|
|
this.mMatchConstraintMinHeight = constraintWidget.mMatchConstraintMinHeight;
|
|
|
|
this.mMatchConstraintMaxHeight = constraintWidget.mMatchConstraintMaxHeight;
|
|
|
|
this.mMatchConstraintPercentHeight = constraintWidget.mMatchConstraintPercentHeight;
|
|
|
|
this.mIsWidthWrapContent = constraintWidget.mIsWidthWrapContent;
|
|
|
|
this.mIsHeightWrapContent = constraintWidget.mIsHeightWrapContent;
|
|
|
|
this.mResolvedDimensionRatioSide = constraintWidget.mResolvedDimensionRatioSide;
|
|
|
|
this.mResolvedDimensionRatio = constraintWidget.mResolvedDimensionRatio;
|
|
|
|
int[] iArr3 = constraintWidget.mMaxDimension;
|
|
|
|
this.mMaxDimension = Arrays.copyOf(iArr3, iArr3.length);
|
|
|
|
this.mCircleConstraintAngle = constraintWidget.mCircleConstraintAngle;
|
|
|
|
this.hasBaseline = constraintWidget.hasBaseline;
|
|
|
|
this.inPlaceholder = constraintWidget.inPlaceholder;
|
|
|
|
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.mListDimensionBehaviors = (DimensionBehaviour[]) Arrays.copyOf(this.mListDimensionBehaviors, 2);
|
|
|
|
ConstraintWidget constraintWidget2 = null;
|
|
|
|
this.mParent = this.mParent == null ? null : hashMap.get(constraintWidget.mParent);
|
|
|
|
this.mWidth = constraintWidget.mWidth;
|
|
|
|
this.mHeight = constraintWidget.mHeight;
|
|
|
|
this.mDimensionRatio = constraintWidget.mDimensionRatio;
|
|
|
|
this.mDimensionRatioSide = constraintWidget.mDimensionRatioSide;
|
|
|
|
this.mX = constraintWidget.mX;
|
|
|
|
this.mY = constraintWidget.mY;
|
|
|
|
this.mRelX = constraintWidget.mRelX;
|
|
|
|
this.mRelY = constraintWidget.mRelY;
|
|
|
|
this.mOffsetX = constraintWidget.mOffsetX;
|
|
|
|
this.mOffsetY = constraintWidget.mOffsetY;
|
|
|
|
this.mBaselineDistance = constraintWidget.mBaselineDistance;
|
|
|
|
this.mMinWidth = constraintWidget.mMinWidth;
|
|
|
|
this.mMinHeight = constraintWidget.mMinHeight;
|
|
|
|
this.mHorizontalBiasPercent = constraintWidget.mHorizontalBiasPercent;
|
|
|
|
this.mVerticalBiasPercent = constraintWidget.mVerticalBiasPercent;
|
|
|
|
this.mCompanionWidget = constraintWidget.mCompanionWidget;
|
|
|
|
this.mContainerItemSkip = constraintWidget.mContainerItemSkip;
|
|
|
|
this.mVisibility = constraintWidget.mVisibility;
|
|
|
|
this.mDebugName = constraintWidget.mDebugName;
|
|
|
|
this.mType = constraintWidget.mType;
|
|
|
|
this.mDistToTop = constraintWidget.mDistToTop;
|
|
|
|
this.mDistToLeft = constraintWidget.mDistToLeft;
|
|
|
|
this.mDistToRight = constraintWidget.mDistToRight;
|
|
|
|
this.mDistToBottom = constraintWidget.mDistToBottom;
|
|
|
|
this.mLeftHasCentered = constraintWidget.mLeftHasCentered;
|
|
|
|
this.mRightHasCentered = constraintWidget.mRightHasCentered;
|
|
|
|
this.mTopHasCentered = constraintWidget.mTopHasCentered;
|
|
|
|
this.mBottomHasCentered = constraintWidget.mBottomHasCentered;
|
|
|
|
this.mHorizontalWrapVisited = constraintWidget.mHorizontalWrapVisited;
|
|
|
|
this.mVerticalWrapVisited = constraintWidget.mVerticalWrapVisited;
|
|
|
|
this.mHorizontalChainStyle = constraintWidget.mHorizontalChainStyle;
|
|
|
|
this.mVerticalChainStyle = constraintWidget.mVerticalChainStyle;
|
|
|
|
this.mHorizontalChainFixedPosition = constraintWidget.mHorizontalChainFixedPosition;
|
|
|
|
this.mVerticalChainFixedPosition = constraintWidget.mVerticalChainFixedPosition;
|
|
|
|
float[] fArr = this.mWeight;
|
|
|
|
float[] fArr2 = constraintWidget.mWeight;
|
|
|
|
fArr[0] = fArr2[0];
|
|
|
|
fArr[1] = fArr2[1];
|
|
|
|
ConstraintWidget[] constraintWidgetArr = this.mListNextMatchConstraintsWidget;
|
|
|
|
ConstraintWidget[] constraintWidgetArr2 = constraintWidget.mListNextMatchConstraintsWidget;
|
|
|
|
constraintWidgetArr[0] = constraintWidgetArr2[0];
|
|
|
|
constraintWidgetArr[1] = constraintWidgetArr2[1];
|
|
|
|
ConstraintWidget[] constraintWidgetArr3 = this.mNextChainWidget;
|
|
|
|
ConstraintWidget[] constraintWidgetArr4 = constraintWidget.mNextChainWidget;
|
|
|
|
constraintWidgetArr3[0] = constraintWidgetArr4[0];
|
|
|
|
constraintWidgetArr3[1] = constraintWidgetArr4[1];
|
|
|
|
ConstraintWidget constraintWidget3 = constraintWidget.mHorizontalNextWidget;
|
|
|
|
this.mHorizontalNextWidget = constraintWidget3 == null ? null : hashMap.get(constraintWidget3);
|
|
|
|
ConstraintWidget constraintWidget4 = constraintWidget.mVerticalNextWidget;
|
|
|
|
if (constraintWidget4 != null) {
|
|
|
|
constraintWidget2 = hashMap.get(constraintWidget4);
|
|
|
|
}
|
|
|
|
this.mVerticalNextWidget = constraintWidget2;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 ensureMeasureRequested() {
|
|
|
|
this.mMeasureRequested = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void ensureWidgetRuns() {
|
|
|
|
if (this.horizontalRun == null) {
|
|
|
|
this.horizontalRun = new HorizontalWidgetRun(this);
|
|
|
|
}
|
|
|
|
if (this.verticalRun == null) {
|
|
|
|
this.verticalRun = new VerticalWidgetRun(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConstraintAnchor getAnchor(ConstraintAnchor.Type type) {
|
|
|
|
switch (type.ordinal()) {
|
|
|
|
case 0:
|
|
|
|
return null;
|
|
|
|
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;
|
|
|
|
default:
|
|
|
|
throw new AssertionError(type.name());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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 boolean getHasBaseline() {
|
|
|
|
return this.hasBaseline;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 getHorizontalMargin() {
|
|
|
|
ConstraintAnchor constraintAnchor = this.mLeft;
|
|
|
|
int i = 0;
|
|
|
|
if (constraintAnchor != null) {
|
|
|
|
i = 0 + constraintAnchor.mMargin;
|
|
|
|
}
|
|
|
|
ConstraintAnchor constraintAnchor2 = this.mRight;
|
|
|
|
return constraintAnchor2 != null ? i + constraintAnchor2.mMargin : i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getLastHorizontalMeasureSpec() {
|
|
|
|
return this.mLastHorizontalMeasureSpec;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getLastVerticalMeasureSpec() {
|
|
|
|
return this.mLastVerticalMeasureSpec;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 ConstraintWidget getNextChainMember(int i) {
|
|
|
|
ConstraintAnchor constraintAnchor;
|
|
|
|
ConstraintAnchor constraintAnchor2;
|
|
|
|
if (i == 0) {
|
|
|
|
ConstraintAnchor constraintAnchor3 = this.mRight;
|
|
|
|
ConstraintAnchor constraintAnchor4 = constraintAnchor3.mTarget;
|
|
|
|
if (constraintAnchor4 == null || constraintAnchor4.mTarget != constraintAnchor3) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return constraintAnchor4.mOwner;
|
|
|
|
} else if (i == 1 && (constraintAnchor2 = (constraintAnchor = this.mBottom).mTarget) != null && constraintAnchor2.mTarget == constraintAnchor) {
|
|
|
|
return constraintAnchor2.mOwner;
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getOptimizerWrapHeight() {
|
|
|
|
int i;
|
|
|
|
int i2 = this.mHeight;
|
|
|
|
if (this.mListDimensionBehaviors[1] != DimensionBehaviour.MATCH_CONSTRAINT) {
|
|
|
|
return i2;
|
|
|
|
}
|
|
|
|
if (this.mMatchConstraintDefaultHeight == 1) {
|
|
|
|
i = Math.max(this.mMatchConstraintMinHeight, i2);
|
|
|
|
} else {
|
|
|
|
i = this.mMatchConstraintMinHeight;
|
|
|
|
if (i > 0) {
|
|
|
|
this.mHeight = i;
|
|
|
|
} else {
|
|
|
|
i = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int i3 = this.mMatchConstraintMaxHeight;
|
|
|
|
return (i3 <= 0 || i3 >= i) ? i : i3;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getOptimizerWrapWidth() {
|
|
|
|
int i;
|
|
|
|
int i2 = this.mWidth;
|
|
|
|
if (this.mListDimensionBehaviors[0] != DimensionBehaviour.MATCH_CONSTRAINT) {
|
|
|
|
return i2;
|
|
|
|
}
|
|
|
|
if (this.mMatchConstraintDefaultWidth == 1) {
|
|
|
|
i = Math.max(this.mMatchConstraintMinWidth, i2);
|
|
|
|
} else {
|
|
|
|
i = this.mMatchConstraintMinWidth;
|
|
|
|
if (i > 0) {
|
|
|
|
this.mWidth = i;
|
|
|
|
} else {
|
|
|
|
i = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int i3 = this.mMatchConstraintMaxWidth;
|
|
|
|
return (i3 <= 0 || i3 >= i) ? i : i3;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConstraintWidget getParent() {
|
|
|
|
return this.mParent;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConstraintWidget getPreviousChainMember(int i) {
|
|
|
|
ConstraintAnchor constraintAnchor;
|
|
|
|
ConstraintAnchor constraintAnchor2;
|
|
|
|
if (i == 0) {
|
|
|
|
ConstraintAnchor constraintAnchor3 = this.mLeft;
|
|
|
|
ConstraintAnchor constraintAnchor4 = constraintAnchor3.mTarget;
|
|
|
|
if (constraintAnchor4 == null || constraintAnchor4.mTarget != constraintAnchor3) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return constraintAnchor4.mOwner;
|
|
|
|
} else if (i == 1 && (constraintAnchor2 = (constraintAnchor = this.mTop).mTarget) != null && constraintAnchor2.mTarget == constraintAnchor) {
|
|
|
|
return constraintAnchor2.mOwner;
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getRelativePositioning(int i) {
|
|
|
|
if (i == 0) {
|
|
|
|
return this.mRelX;
|
|
|
|
}
|
|
|
|
if (i == 1) {
|
|
|
|
return this.mRelY;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getRight() {
|
|
|
|
return getX() + this.mWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getRootX() {
|
|
|
|
return this.mX + this.mOffsetX;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getRootY() {
|
|
|
|
return this.mY + this.mOffsetY;
|
|
|
|
}
|
|
|
|
|
|
|
|
public WidgetRun getRun(int i) {
|
|
|
|
if (i == 0) {
|
|
|
|
return this.horizontalRun;
|
|
|
|
}
|
|
|
|
if (i == 1) {
|
|
|
|
return this.verticalRun;
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 getVerticalMargin() {
|
|
|
|
int i = 0;
|
|
|
|
if (this.mLeft != null) {
|
|
|
|
i = 0 + this.mTop.mMargin;
|
|
|
|
}
|
|
|
|
return this.mRight != null ? i + this.mBottom.mMargin : i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getVisibility() {
|
|
|
|
return this.mVisibility;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getWidth() {
|
|
|
|
if (this.mVisibility == 8) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return this.mWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getX() {
|
|
|
|
ConstraintWidget constraintWidget = this.mParent;
|
|
|
|
return (constraintWidget == null || !(constraintWidget instanceof ConstraintWidgetContainer)) ? this.mX : ((ConstraintWidgetContainer) constraintWidget).mPaddingLeft + this.mX;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getY() {
|
|
|
|
ConstraintWidget constraintWidget = this.mParent;
|
|
|
|
return (constraintWidget == null || !(constraintWidget instanceof ConstraintWidgetContainer)) ? this.mY : ((ConstraintWidgetContainer) constraintWidget).mPaddingTop + this.mY;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean hasBaseline() {
|
|
|
|
return this.hasBaseline;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean hasDanglingDimension(int i) {
|
|
|
|
if (i == 0) {
|
|
|
|
return (this.mLeft.mTarget != null ? 1 : 0) + (this.mRight.mTarget != null ? 1 : 0) < 2;
|
|
|
|
}
|
|
|
|
return ((this.mTop.mTarget != null ? 1 : 0) + (this.mBottom.mTarget != null ? 1 : 0)) + (this.mBaseline.mTarget != null ? 1 : 0) < 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean hasDependencies() {
|
|
|
|
int size = this.mAnchors.size();
|
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
|
if (this.mAnchors.get(i).hasDependents()) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void immediateConnect(ConstraintAnchor.Type type, ConstraintWidget constraintWidget, ConstraintAnchor.Type type2, int i, int i2) {
|
|
|
|
getAnchor(type).connect(constraintWidget.getAnchor(type2), i, i2, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
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 isInPlaceholder() {
|
|
|
|
return this.inPlaceholder;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 isInVirtualLayout() {
|
|
|
|
return this.mInVirtuaLayout;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isMeasureRequested() {
|
|
|
|
return this.mMeasureRequested && this.mVisibility != 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isResolvedHorizontally() {
|
|
|
|
return this.resolvedHorizontal || (this.mLeft.hasFinalValue() && this.mRight.hasFinalValue());
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isResolvedVertically() {
|
|
|
|
return this.resolvedVertical || (this.mTop.hasFinalValue() && this.mBottom.hasFinalValue());
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isRoot() {
|
|
|
|
return this.mParent == null;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 boolean oppositeDimensionDependsOn(int i) {
|
|
|
|
char c2 = i == 0 ? (char) 1 : 0;
|
|
|
|
DimensionBehaviour[] dimensionBehaviourArr = this.mListDimensionBehaviors;
|
|
|
|
DimensionBehaviour dimensionBehaviour = dimensionBehaviourArr[i];
|
|
|
|
DimensionBehaviour dimensionBehaviour2 = dimensionBehaviourArr[c2];
|
|
|
|
DimensionBehaviour dimensionBehaviour3 = DimensionBehaviour.MATCH_CONSTRAINT;
|
|
|
|
return dimensionBehaviour == dimensionBehaviour3 && dimensionBehaviour2 == dimensionBehaviour3;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean oppositeDimensionsTied() {
|
|
|
|
DimensionBehaviour[] dimensionBehaviourArr = this.mListDimensionBehaviors;
|
|
|
|
DimensionBehaviour dimensionBehaviour = dimensionBehaviourArr[0];
|
|
|
|
DimensionBehaviour dimensionBehaviour2 = DimensionBehaviour.MATCH_CONSTRAINT;
|
|
|
|
return dimensionBehaviour == dimensionBehaviour2 && dimensionBehaviourArr[1] == dimensionBehaviour2;
|
|
|
|
}
|
|
|
|
|
|
|
|
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.mOffsetX = 0;
|
|
|
|
this.mOffsetY = 0;
|
|
|
|
this.mBaselineDistance = 0;
|
|
|
|
this.mMinWidth = 0;
|
|
|
|
this.mMinHeight = 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.mResolvedHasRatio = false;
|
|
|
|
this.mResolvedDimensionRatioSide = -1;
|
|
|
|
this.mResolvedDimensionRatio = 1.0f;
|
|
|
|
this.mGroupsToSolver = false;
|
|
|
|
boolean[] zArr = this.isTerminalWidget;
|
|
|
|
zArr[0] = true;
|
|
|
|
zArr[1] = true;
|
|
|
|
this.mInVirtuaLayout = false;
|
|
|
|
boolean[] zArr2 = this.mIsInBarrier;
|
|
|
|
zArr2[0] = false;
|
|
|
|
zArr2[1] = false;
|
|
|
|
this.mMeasureRequested = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void resetAllConstraints() {
|
|
|
|
resetAnchors();
|
|
|
|
setVerticalBiasPercent(DEFAULT_BIAS);
|
|
|
|
setHorizontalBiasPercent(DEFAULT_BIAS);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void resetAnchor(ConstraintAnchor constraintAnchor) {
|
|
|
|
if (getParent() == null || !(getParent() instanceof ConstraintWidgetContainer) || !((ConstraintWidgetContainer) getParent()).handlesInternalConstraints()) {
|
|
|
|
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() {
|
|
|
|
ConstraintWidget parent = getParent();
|
|
|
|
if (parent == null || !(parent instanceof ConstraintWidgetContainer) || !((ConstraintWidgetContainer) getParent()).handlesInternalConstraints()) {
|
|
|
|
int size = this.mAnchors.size();
|
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
|
this.mAnchors.get(i).reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void resetFinalResolution() {
|
|
|
|
this.resolvedHorizontal = false;
|
|
|
|
this.resolvedVertical = false;
|
|
|
|
int size = this.mAnchors.size();
|
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
|
this.mAnchors.get(i).resetFinalResolution();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
this.hasBaseline = i > 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
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");
|
|
|
|
SolverVariable createObjectVariable5 = linearSystem.createObjectVariable(this.mBaseline);
|
|
|
|
createObjectVariable5.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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDimensionRatio(float f, int i) {
|
|
|
|
this.mDimensionRatio = f;
|
|
|
|
this.mDimensionRatioSide = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:38:0x0089 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:42:? A[RETURN, SYNTHETIC] */
|
|
|
|
public void setDimensionRatio(String str) {
|
|
|
|
float f;
|
|
|
|
if (str == null || str.length() == 0) {
|
|
|
|
this.mDimensionRatio = 0.0f;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
int i = -1;
|
|
|
|
int length = str.length();
|
|
|
|
int indexOf = str.indexOf(44);
|
|
|
|
int i2 = 0;
|
|
|
|
if (indexOf > 0 && indexOf < length - 1) {
|
|
|
|
String substring = str.substring(0, indexOf);
|
2021-08-09 22:51:56 +00:00
|
|
|
if (substring.equalsIgnoreCase(ExifInterface.LONGITUDE_WEST)) {
|
2021-07-24 02:37:17 +00:00
|
|
|
i = 0;
|
|
|
|
} else if (substring.equalsIgnoreCase("H")) {
|
|
|
|
i = 1;
|
|
|
|
}
|
|
|
|
i2 = indexOf + 1;
|
|
|
|
}
|
|
|
|
int indexOf2 = str.indexOf(58);
|
|
|
|
if (indexOf2 < 0 || indexOf2 >= length - 1) {
|
|
|
|
String substring2 = str.substring(i2);
|
|
|
|
if (substring2.length() > 0) {
|
|
|
|
f = Float.parseFloat(substring2);
|
|
|
|
if (f > 0.0f) {
|
|
|
|
this.mDimensionRatio = f;
|
|
|
|
this.mDimensionRatioSide = i;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
String substring3 = str.substring(i2, indexOf2);
|
|
|
|
String substring4 = str.substring(indexOf2 + 1);
|
|
|
|
if (substring3.length() > 0 && substring4.length() > 0) {
|
|
|
|
try {
|
|
|
|
float parseFloat = Float.parseFloat(substring3);
|
|
|
|
float parseFloat2 = Float.parseFloat(substring4);
|
|
|
|
if (parseFloat > 0.0f && parseFloat2 > 0.0f) {
|
|
|
|
f = i == 1 ? Math.abs(parseFloat2 / parseFloat) : Math.abs(parseFloat / parseFloat2);
|
|
|
|
if (f > 0.0f) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (NumberFormatException unused) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
f = 0.0f;
|
|
|
|
if (f > 0.0f) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setFinalBaseline(int i) {
|
|
|
|
if (this.hasBaseline) {
|
|
|
|
int i2 = i - this.mBaselineDistance;
|
|
|
|
int i3 = this.mHeight + i2;
|
|
|
|
this.mY = i2;
|
|
|
|
this.mTop.setFinalValue(i2);
|
|
|
|
this.mBottom.setFinalValue(i3);
|
|
|
|
this.mBaseline.setFinalValue(i);
|
|
|
|
this.resolvedVertical = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setFinalFrame(int i, int i2, int i3, int i4, int i5, int i6) {
|
|
|
|
setFrame(i, i2, i3, i4);
|
|
|
|
setBaselineDistance(i5);
|
|
|
|
if (i6 == 0) {
|
|
|
|
this.resolvedHorizontal = true;
|
|
|
|
this.resolvedVertical = false;
|
|
|
|
} else if (i6 == 1) {
|
|
|
|
this.resolvedHorizontal = false;
|
|
|
|
this.resolvedVertical = true;
|
|
|
|
} else if (i6 == 2) {
|
|
|
|
this.resolvedHorizontal = true;
|
|
|
|
this.resolvedVertical = true;
|
|
|
|
} else {
|
|
|
|
this.resolvedHorizontal = false;
|
|
|
|
this.resolvedVertical = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setFinalHorizontal(int i, int i2) {
|
|
|
|
this.mLeft.setFinalValue(i);
|
|
|
|
this.mRight.setFinalValue(i2);
|
|
|
|
this.mX = i;
|
|
|
|
this.mWidth = i2 - i;
|
|
|
|
this.resolvedHorizontal = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setFinalLeft(int i) {
|
|
|
|
this.mLeft.setFinalValue(i);
|
|
|
|
this.mX = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setFinalTop(int i) {
|
|
|
|
this.mTop.setFinalValue(i);
|
|
|
|
this.mY = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setFinalVertical(int i, int i2) {
|
|
|
|
this.mTop.setFinalValue(i);
|
|
|
|
this.mBottom.setFinalValue(i2);
|
|
|
|
this.mY = i;
|
|
|
|
this.mHeight = i2 - i;
|
|
|
|
if (this.hasBaseline) {
|
|
|
|
this.mBaseline.setFinalValue(i + this.mBaselineDistance);
|
|
|
|
}
|
|
|
|
this.resolvedVertical = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setFrame(int i, int i2, int i3) {
|
|
|
|
if (i3 == 0) {
|
|
|
|
setHorizontalDimension(i, i2);
|
|
|
|
} else if (i3 == 1) {
|
|
|
|
setVerticalDimension(i, 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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setGoneMargin(ConstraintAnchor.Type type, int i) {
|
|
|
|
int ordinal = type.ordinal();
|
|
|
|
if (ordinal == 1) {
|
|
|
|
this.mLeft.mGoneMargin = i;
|
|
|
|
} else if (ordinal == 2) {
|
|
|
|
this.mTop.mGoneMargin = i;
|
|
|
|
} else if (ordinal == 3) {
|
|
|
|
this.mRight.mGoneMargin = i;
|
|
|
|
} else if (ordinal == 4) {
|
|
|
|
this.mBottom.mGoneMargin = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setHasBaseline(boolean z2) {
|
|
|
|
this.hasBaseline = z2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setHeight(int i) {
|
|
|
|
this.mHeight = i;
|
|
|
|
int i2 = this.mMinHeight;
|
|
|
|
if (i < i2) {
|
|
|
|
this.mHeight = i2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setHeightWrapContent(boolean z2) {
|
|
|
|
this.mIsHeightWrapContent = z2;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setHorizontalMatchStyle(int i, int i2, int i3, float f) {
|
|
|
|
this.mMatchConstraintDefaultWidth = i;
|
|
|
|
this.mMatchConstraintMinWidth = i2;
|
|
|
|
if (i3 == Integer.MAX_VALUE) {
|
|
|
|
i3 = 0;
|
|
|
|
}
|
|
|
|
this.mMatchConstraintMaxWidth = i3;
|
|
|
|
this.mMatchConstraintPercentWidth = f;
|
|
|
|
if (f > 0.0f && f < 1.0f && i == 0) {
|
|
|
|
this.mMatchConstraintDefaultWidth = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setHorizontalWeight(float f) {
|
|
|
|
this.mWeight[0] = f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setInBarrier(int i, boolean z2) {
|
|
|
|
this.mIsInBarrier[i] = z2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setInPlaceholder(boolean z2) {
|
|
|
|
this.inPlaceholder = z2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setInVirtualLayout(boolean z2) {
|
|
|
|
this.mInVirtuaLayout = z2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setLastMeasureSpec(int i, int i2) {
|
|
|
|
this.mLastHorizontalMeasureSpec = i;
|
|
|
|
this.mLastVerticalMeasureSpec = i2;
|
|
|
|
setMeasureRequested(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
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 setMeasureRequested(boolean z2) {
|
|
|
|
this.mMeasureRequested = z2;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setVerticalMatchStyle(int i, int i2, int i3, float f) {
|
|
|
|
this.mMatchConstraintDefaultHeight = i;
|
|
|
|
this.mMatchConstraintMinHeight = i2;
|
|
|
|
if (i3 == Integer.MAX_VALUE) {
|
|
|
|
i3 = 0;
|
|
|
|
}
|
|
|
|
this.mMatchConstraintMaxHeight = i3;
|
|
|
|
this.mMatchConstraintPercentHeight = f;
|
|
|
|
if (f > 0.0f && f < 1.0f && i == 0) {
|
|
|
|
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 z2) {
|
|
|
|
this.mIsWidthWrapContent = z2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setX(int i) {
|
|
|
|
this.mX = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setY(int i) {
|
|
|
|
this.mY = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setupDimensionRatio(boolean z2, boolean z3, boolean z4, boolean z5) {
|
|
|
|
if (this.mResolvedDimensionRatioSide == -1) {
|
|
|
|
if (z4 && !z5) {
|
|
|
|
this.mResolvedDimensionRatioSide = 0;
|
|
|
|
} else if (!z4 && z5) {
|
|
|
|
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) {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
String str = "";
|
2021-11-05 06:48:17 +00:00
|
|
|
sb.append(this.mType != null ? a.H(a.R("type: "), this.mType, " ") : str);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (this.mDebugName != null) {
|
2021-11-05 06:48:17 +00:00
|
|
|
str = a.H(a.R("id: "), this.mDebugName, " ");
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
sb.append(str);
|
|
|
|
sb.append("(");
|
|
|
|
sb.append(this.mX);
|
|
|
|
sb.append(", ");
|
|
|
|
sb.append(this.mY);
|
|
|
|
sb.append(") - (");
|
|
|
|
sb.append(this.mWidth);
|
|
|
|
sb.append(" x ");
|
2021-11-05 06:48:17 +00:00
|
|
|
return a.A(sb, this.mHeight, ")");
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void updateFromRuns(boolean z2, boolean z3) {
|
|
|
|
int i;
|
|
|
|
int i2;
|
|
|
|
boolean isResolved = z2 & this.horizontalRun.isResolved();
|
|
|
|
boolean isResolved2 = z3 & this.verticalRun.isResolved();
|
|
|
|
HorizontalWidgetRun horizontalWidgetRun = this.horizontalRun;
|
|
|
|
int i3 = horizontalWidgetRun.start.value;
|
|
|
|
VerticalWidgetRun verticalWidgetRun = this.verticalRun;
|
|
|
|
int i4 = verticalWidgetRun.start.value;
|
|
|
|
int i5 = horizontalWidgetRun.end.value;
|
|
|
|
int i6 = verticalWidgetRun.end.value;
|
|
|
|
int i7 = i6 - i4;
|
|
|
|
if (i5 - i3 < 0 || i7 < 0 || i3 == Integer.MIN_VALUE || i3 == Integer.MAX_VALUE || i4 == Integer.MIN_VALUE || i4 == Integer.MAX_VALUE || i5 == Integer.MIN_VALUE || i5 == Integer.MAX_VALUE || i6 == Integer.MIN_VALUE || i6 == Integer.MAX_VALUE) {
|
|
|
|
i5 = 0;
|
|
|
|
i3 = 0;
|
|
|
|
i6 = 0;
|
|
|
|
i4 = 0;
|
|
|
|
}
|
|
|
|
int i8 = i5 - i3;
|
|
|
|
int i9 = i6 - i4;
|
|
|
|
if (isResolved) {
|
|
|
|
this.mX = i3;
|
|
|
|
}
|
|
|
|
if (isResolved2) {
|
|
|
|
this.mY = i4;
|
|
|
|
}
|
|
|
|
if (this.mVisibility == 8) {
|
|
|
|
this.mWidth = 0;
|
|
|
|
this.mHeight = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (isResolved) {
|
|
|
|
if (this.mListDimensionBehaviors[0] == DimensionBehaviour.FIXED && i8 < (i2 = this.mWidth)) {
|
|
|
|
i8 = i2;
|
|
|
|
}
|
|
|
|
this.mWidth = i8;
|
|
|
|
int i10 = this.mMinWidth;
|
|
|
|
if (i8 < i10) {
|
|
|
|
this.mWidth = i10;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isResolved2) {
|
|
|
|
if (this.mListDimensionBehaviors[1] == DimensionBehaviour.FIXED && i9 < (i = this.mHeight)) {
|
|
|
|
i9 = i;
|
|
|
|
}
|
|
|
|
this.mHeight = i9;
|
|
|
|
int i11 = this.mMinHeight;
|
|
|
|
if (i9 < i11) {
|
|
|
|
this.mHeight = i11;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void updateFromSolver(LinearSystem linearSystem, boolean z2) {
|
|
|
|
VerticalWidgetRun verticalWidgetRun;
|
|
|
|
HorizontalWidgetRun horizontalWidgetRun;
|
|
|
|
int objectVariableValue = linearSystem.getObjectVariableValue(this.mLeft);
|
|
|
|
int objectVariableValue2 = linearSystem.getObjectVariableValue(this.mTop);
|
|
|
|
int objectVariableValue3 = linearSystem.getObjectVariableValue(this.mRight);
|
|
|
|
int objectVariableValue4 = linearSystem.getObjectVariableValue(this.mBottom);
|
|
|
|
if (z2 && (horizontalWidgetRun = this.horizontalRun) != null) {
|
|
|
|
DependencyNode dependencyNode = horizontalWidgetRun.start;
|
|
|
|
if (dependencyNode.resolved) {
|
|
|
|
DependencyNode dependencyNode2 = horizontalWidgetRun.end;
|
|
|
|
if (dependencyNode2.resolved) {
|
|
|
|
objectVariableValue = dependencyNode.value;
|
|
|
|
objectVariableValue3 = dependencyNode2.value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (z2 && (verticalWidgetRun = this.verticalRun) != null) {
|
|
|
|
DependencyNode dependencyNode3 = verticalWidgetRun.start;
|
|
|
|
if (dependencyNode3.resolved) {
|
|
|
|
DependencyNode dependencyNode4 = verticalWidgetRun.end;
|
|
|
|
if (dependencyNode4.resolved) {
|
|
|
|
objectVariableValue2 = dependencyNode3.value;
|
|
|
|
objectVariableValue4 = dependencyNode4.value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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) {
|
|
|
|
objectVariableValue4 = 0;
|
|
|
|
objectVariableValue = 0;
|
|
|
|
objectVariableValue2 = 0;
|
|
|
|
objectVariableValue3 = 0;
|
|
|
|
}
|
|
|
|
setFrame(objectVariableValue, objectVariableValue2, objectVariableValue3, objectVariableValue4);
|
|
|
|
}
|
|
|
|
}
|