Class WidgetContainer
- java.lang.Object
-
- androidx.constraintlayout.core.widgets.ConstraintWidget
-
- androidx.constraintlayout.core.widgets.WidgetContainer
-
- Direct Known Subclasses:
ConstraintWidgetContainer
public class WidgetContainer extends ConstraintWidget
A container of ConstraintWidget
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class androidx.constraintlayout.core.widgets.ConstraintWidget
ConstraintWidget.DimensionBehaviour
-
-
Field Summary
Fields Modifier and Type Field Description java.util.ArrayList<ConstraintWidget>mChildren-
Fields inherited from class androidx.constraintlayout.core.widgets.ConstraintWidget
ANCHOR_BASELINE, ANCHOR_BOTTOM, ANCHOR_LEFT, ANCHOR_RIGHT, ANCHOR_TOP, BOTH, CHAIN_PACKED, CHAIN_SPREAD, CHAIN_SPREAD_INSIDE, DEFAULT_BIAS, DIRECT, frame, GONE, HORIZONTAL, horizontalChainRun, horizontalGroup, INVISIBLE, isTerminalWidget, mAnchors, MATCH_CONSTRAINT_PERCENT, MATCH_CONSTRAINT_RATIO, MATCH_CONSTRAINT_RATIO_RESOLVED, MATCH_CONSTRAINT_SPREAD, MATCH_CONSTRAINT_WRAP, mBaseline, mBottom, mCenter, mCircleConstraintAngle, mDimensionRatio, mDimensionRatioSide, measured, mHorizontalResolution, mHorizontalRun, mIsHeightWrapContent, mIsWidthWrapContent, mLeft, mListAnchors, mListDimensionBehaviors, mListNextMatchConstraintsWidget, mMatchConstraintDefaultHeight, mMatchConstraintDefaultWidth, mMatchConstraintMaxHeight, mMatchConstraintMaxWidth, mMatchConstraintMinHeight, mMatchConstraintMinWidth, mMatchConstraintPercentHeight, mMatchConstraintPercentWidth, mMinHeight, mMinWidth, mNextChainWidget, mOffsetX, mOffsetY, mParent, mResolvedMatchConstraintDefault, mRight, mTop, mVerticalResolution, mVerticalRun, mWeight, mX, mY, run, SOLVER, stringId, UNKNOWN, VERTICAL, verticalChainRun, verticalGroup, VISIBLE, WRAP_BEHAVIOR_HORIZONTAL_ONLY, WRAP_BEHAVIOR_INCLUDED, WRAP_BEHAVIOR_SKIPPED, WRAP_BEHAVIOR_VERTICAL_ONLY
-
-
Constructor Summary
Constructors Constructor Description WidgetContainer()Default constructorWidgetContainer(int width, int height)ConstructorWidgetContainer(int x, int y, int width, int height)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(ConstraintWidget widget)Add a child widgetvoidadd(ConstraintWidget... widgets)Add multiple child widgets.java.util.ArrayList<ConstraintWidget>getChildren()Access the childrenConstraintWidgetContainergetRootConstraintContainer()Return the top-level ConstraintWidgetContainervoidlayout()Function implemented by ConstraintWidgetContainervoidremove(ConstraintWidget widget)Remove a child widgetvoidremoveAllChildren()voidreset()voidresetSolverVariables(Cache cache)Reset the solver variables of the anchorsvoidsetOffset(int x, int y)Set the offset of this widget relative to the root widget.-
Methods inherited from class androidx.constraintlayout.core.widgets.ConstraintWidget
addChildrenToSolverByDependency, addToSolver, allowedInBarrier, connect, connect, connect, connectCircularConstraint, copy, createObjectVariables, ensureMeasureRequested, ensureWidgetRuns, getAnchor, getAnchors, getBaselineDistance, getBiasPercent, getBottom, getCompanionWidget, getContainerItemSkip, getDebugName, getDimensionBehaviour, getDimensionRatio, getDimensionRatioSide, getHasBaseline, getHeight, getHorizontalBiasPercent, getHorizontalChainControlWidget, getHorizontalChainStyle, getHorizontalDimensionBehaviour, getHorizontalMargin, getLastHorizontalMeasureSpec, getLastVerticalMeasureSpec, getLeft, getLength, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getNextChainMember, getOptimizerWrapHeight, getOptimizerWrapWidth, getParent, getPreviousChainMember, getRight, getRootX, getRootY, getRun, getSceneString, getTop, getType, getVerticalBiasPercent, getVerticalChainControlWidget, getVerticalChainStyle, getVerticalDimensionBehaviour, getVerticalMargin, getVisibility, getWidth, getWrapBehaviorInParent, getX, getY, hasBaseline, hasDanglingDimension, hasDependencies, hasDimensionOverride, hasResolvedTargets, immediateConnect, isAnimated, isHeightWrapContent, isHorizontalSolvingPassDone, isInBarrier, isInHorizontalChain, isInPlaceholder, isInVerticalChain, isInVirtualLayout, isMeasureRequested, isResolvedHorizontally, isResolvedVertically, isRoot, isSpreadHeight, isSpreadWidth, isVerticalSolvingPassDone, isWidthWrapContent, markHorizontalSolvingPassDone, markVerticalSolvingPassDone, oppositeDimensionDependsOn, oppositeDimensionsTied, resetAllConstraints, resetAnchor, resetAnchors, resetFinalResolution, resetSolvingPassFlag, serialize, setAnimated, setBaselineDistance, setCompanionWidget, setContainerItemSkip, setDebugName, setDebugSolverName, setDimension, setDimensionRatio, setDimensionRatio, setFinalBaseline, setFinalFrame, setFinalHorizontal, setFinalLeft, setFinalTop, setFinalVertical, setFrame, setFrame, setGoneMargin, setHasBaseline, setHeight, setHeightWrapContent, setHorizontalBiasPercent, setHorizontalChainStyle, setHorizontalDimension, setHorizontalDimensionBehaviour, setHorizontalMatchStyle, setHorizontalWeight, setInBarrier, setInPlaceholder, setInVirtualLayout, setLastMeasureSpec, setLength, setMaxHeight, setMaxWidth, setMeasureRequested, setMinHeight, setMinWidth, setOrigin, setParent, setType, setupDimensionRatio, setVerticalBiasPercent, setVerticalChainStyle, setVerticalDimension, setVerticalDimensionBehaviour, setVerticalMatchStyle, setVerticalWeight, setVisibility, setWidth, setWidthWrapContent, setWrapBehaviorInParent, setX, setY, toString, updateFromRuns, updateFromSolver
-
-
-
-
Field Detail
-
mChildren
public java.util.ArrayList<ConstraintWidget> mChildren
-
-
Constructor Detail
-
WidgetContainer
public WidgetContainer()
Default constructor
-
WidgetContainer
public WidgetContainer(int x, int y, int width, int height)Constructor- Parameters:
x- x positiony- y positionwidth- width of the layoutheight- height of the layout
-
WidgetContainer
public WidgetContainer(int width, int height)Constructor- Parameters:
width- width of the layoutheight- height of the layout
-
-
Method Detail
-
reset
public void reset()
- Overrides:
resetin classConstraintWidget
-
add
public void add(ConstraintWidget widget)
Add a child widget- Parameters:
widget- to add
-
add
public void add(ConstraintWidget... widgets)
Add multiple child widgets.- Parameters:
widgets- to add
-
remove
public void remove(ConstraintWidget widget)
Remove a child widget- Parameters:
widget- to remove
-
getChildren
public java.util.ArrayList<ConstraintWidget> getChildren()
Access the children- Returns:
- the array of children
-
getRootConstraintContainer
public ConstraintWidgetContainer getRootConstraintContainer()
Return the top-level ConstraintWidgetContainer- Returns:
- top-level ConstraintWidgetContainer
-
setOffset
public void setOffset(int x, int y)Set the offset of this widget relative to the root widget. We then set the offset of our children as well.- Overrides:
setOffsetin classConstraintWidget- Parameters:
x- horizontal offsety- vertical offset
-
layout
public void layout()
Function implemented by ConstraintWidgetContainer
-
resetSolverVariables
public void resetSolverVariables(Cache cache)
Description copied from class:ConstraintWidgetReset the solver variables of the anchors- Overrides:
resetSolverVariablesin classConstraintWidget
-
removeAllChildren
public void removeAllChildren()
-
-