Class Barrier
- java.lang.Object
-
- androidx.constraintlayout.core.widgets.ConstraintWidget
-
- androidx.constraintlayout.core.widgets.HelperWidget
-
- androidx.constraintlayout.core.widgets.Barrier
-
- All Implemented Interfaces:
Helper
public class Barrier extends HelperWidget
A Barrier takes multiple widgets
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class androidx.constraintlayout.core.widgets.ConstraintWidget
ConstraintWidget.DimensionBehaviour
-
-
Field Summary
Fields Modifier and Type Field Description static intBOTTOMstatic intLEFTstatic intRIGHTstatic intTOP-
Fields inherited from class androidx.constraintlayout.core.widgets.HelperWidget
mWidgets, mWidgetsCount
-
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, 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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddToSolver(LinearSystem system, boolean optimize)Add this widget to the solverbooleanallowedInBarrier()Returns true if this widget should be used in a barrierbooleanallowsGoneWidget()Deprecated.This method should be calledgetAllowsGoneWidgetsuch thatallowsGoneWidgetcan be accessed as a property from Kotlin; {@see https://android.github .io/kotlin-guides/interop.html#property-prefixes}.booleanallSolved()voidcopy(ConstraintWidget src, java.util.HashMap<ConstraintWidget,ConstraintWidget> map)booleangetAllowsGoneWidget()Find if this barrier supports gone widgets.intgetBarrierType()intgetMargin()intgetOrientation()booleanisResolvedHorizontally()booleanisResolvedVertically()protected voidmarkWidgets()voidsetAllowsGoneWidget(boolean allowsGoneWidget)voidsetBarrierType(int barrierType)voidsetMargin(int margin)java.lang.StringtoString()Returns a string representation of the ConstraintWidget-
Methods inherited from class androidx.constraintlayout.core.widgets.HelperWidget
add, addDependents, findGroupInDependents, removeAllIds, updateConstraints
-
Methods inherited from class androidx.constraintlayout.core.widgets.ConstraintWidget
addChildrenToSolverByDependency, connect, connect, connect, connectCircularConstraint, 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, isRoot, isSpreadHeight, isSpreadWidth, isVerticalSolvingPassDone, isWidthWrapContent, markHorizontalSolvingPassDone, markVerticalSolvingPassDone, oppositeDimensionDependsOn, oppositeDimensionsTied, reset, resetAllConstraints, resetAnchor, resetAnchors, resetFinalResolution, resetSolverVariables, 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, setOffset, setOrigin, setParent, setType, setupDimensionRatio, setVerticalBiasPercent, setVerticalChainStyle, setVerticalDimension, setVerticalDimensionBehaviour, setVerticalMatchStyle, setVerticalWeight, setVisibility, setWidth, setWidthWrapContent, setWrapBehaviorInParent, setX, setY, updateFromRuns, updateFromSolver
-
-
-
-
Field Detail
-
LEFT
public static final int LEFT
- See Also:
- Constant Field Values
-
RIGHT
public static final int RIGHT
- See Also:
- Constant Field Values
-
TOP
public static final int TOP
- See Also:
- Constant Field Values
-
BOTTOM
public static final int BOTTOM
- See Also:
- Constant Field Values
-
-
Method Detail
-
allowedInBarrier
public boolean allowedInBarrier()
Description copied from class:ConstraintWidgetReturns true if this widget should be used in a barrier- Overrides:
allowedInBarrierin classConstraintWidget
-
getBarrierType
public int getBarrierType()
-
setBarrierType
public void setBarrierType(int barrierType)
-
setAllowsGoneWidget
public void setAllowsGoneWidget(boolean allowsGoneWidget)
-
allowsGoneWidget
@Deprecated public boolean allowsGoneWidget()
Deprecated.This method should be calledgetAllowsGoneWidgetsuch thatallowsGoneWidgetcan be accessed as a property from Kotlin; {@see https://android.github .io/kotlin-guides/interop.html#property-prefixes}. UsegetAllowsGoneWidget()instead.Find if this barrier supports gone widgets.- Returns:
- true if this barrier supports gone widgets, otherwise false
-
getAllowsGoneWidget
public boolean getAllowsGoneWidget()
Find if this barrier supports gone widgets.- Returns:
- true if this barrier supports gone widgets, otherwise false
-
isResolvedHorizontally
public boolean isResolvedHorizontally()
- Overrides:
isResolvedHorizontallyin classConstraintWidget
-
isResolvedVertically
public boolean isResolvedVertically()
- Overrides:
isResolvedVerticallyin classConstraintWidget
-
copy
public void copy(ConstraintWidget src, java.util.HashMap<ConstraintWidget,ConstraintWidget> map)
- Overrides:
copyin classHelperWidget
-
toString
public java.lang.String toString()
Description copied from class:ConstraintWidgetReturns a string representation of the ConstraintWidget- Overrides:
toStringin classConstraintWidget- Returns:
- string representation of the widget
-
markWidgets
protected void markWidgets()
-
addToSolver
public void addToSolver(LinearSystem system, boolean optimize)
Add this widget to the solver- Overrides:
addToSolverin classConstraintWidget- Parameters:
system- the solver we want to add the widget tooptimize- true ifOptimizer.OPTIMIZATION_GRAPHis on
-
setMargin
public void setMargin(int margin)
-
getMargin
public int getMargin()
-
getOrientation
public int getOrientation()
-
allSolved
public boolean allSolved()
-
-