Class Guideline
- java.lang.Object
-
- androidx.constraintlayout.core.widgets.ConstraintWidget
-
- androidx.constraintlayout.core.widgets.Guideline
-
public class Guideline extends ConstraintWidget
Guideline
-
-
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 intHORIZONTALprotected booleanmGuidelineUseRtlprotected intmRelativeBeginprotected intmRelativeEndprotected floatmRelativePercentstatic intRELATIVE_BEGINstatic intRELATIVE_ENDstatic intRELATIVE_PERCENTstatic intRELATIVE_UNKNOWNstatic intVERTICAL-
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, 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, verticalChainRun, verticalGroup, VISIBLE, WRAP_BEHAVIOR_HORIZONTAL_ONLY, WRAP_BEHAVIOR_INCLUDED, WRAP_BEHAVIOR_SKIPPED, WRAP_BEHAVIOR_VERTICAL_ONLY
-
-
Constructor Summary
Constructors Constructor Description Guideline()
-
Method Summary
All Methods Instance Methods Concrete 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 barriervoidcopy(ConstraintWidget src, java.util.HashMap<ConstraintWidget,ConstraintWidget> map)voidcyclePosition()ConstraintAnchorgetAnchor()ConstraintAnchorgetAnchor(ConstraintAnchor.Type anchorType)Given a type of anchor, returns the corresponding anchor.intgetMinimumPosition()Get the Minimum PositionintgetOrientation()get the orientation VERTICAL or HORIZONTALintgetRelativeBegin()intgetRelativeBehaviour()intgetRelativeEnd()floatgetRelativePercent()java.lang.StringgetType()Specify the xml type for the containerbooleanisPercent()booleanisResolvedHorizontally()booleanisResolvedVertically()voidsetFinalValue(int position)voidsetGuideBegin(int value)voidsetGuideEnd(int value)voidsetGuidePercent(float value)voidsetGuidePercent(int value)voidsetMinimumPosition(int minimum)set the minimum positionvoidsetOrientation(int orientation)voidupdateFromSolver(LinearSystem system, boolean optimize)Update the widget from the values generated by the solver-
Methods inherited from class androidx.constraintlayout.core.widgets.ConstraintWidget
addChildrenToSolverByDependency, connect, connect, connect, connectCircularConstraint, createObjectVariables, ensureMeasureRequested, ensureWidgetRuns, 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, 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, toString, updateFromRuns
-
-
-
-
Field Detail
-
HORIZONTAL
public static final int HORIZONTAL
- See Also:
- Constant Field Values
-
VERTICAL
public static final int VERTICAL
- See Also:
- Constant Field Values
-
RELATIVE_PERCENT
public static final int RELATIVE_PERCENT
- See Also:
- Constant Field Values
-
RELATIVE_BEGIN
public static final int RELATIVE_BEGIN
- See Also:
- Constant Field Values
-
RELATIVE_END
public static final int RELATIVE_END
- See Also:
- Constant Field Values
-
RELATIVE_UNKNOWN
public static final int RELATIVE_UNKNOWN
- See Also:
- Constant Field Values
-
mRelativePercent
protected float mRelativePercent
-
mRelativeBegin
protected int mRelativeBegin
-
mRelativeEnd
protected int mRelativeEnd
-
mGuidelineUseRtl
protected boolean mGuidelineUseRtl
-
-
Method Detail
-
copy
public void copy(ConstraintWidget src, java.util.HashMap<ConstraintWidget,ConstraintWidget> map)
- Overrides:
copyin classConstraintWidget
-
allowedInBarrier
public boolean allowedInBarrier()
Description copied from class:ConstraintWidgetReturns true if this widget should be used in a barrier- Overrides:
allowedInBarrierin classConstraintWidget
-
getRelativeBehaviour
public int getRelativeBehaviour()
-
setOrientation
public void setOrientation(int orientation)
-
getAnchor
public ConstraintAnchor getAnchor()
-
getType
public java.lang.String getType()
Specify the xml type for the container- Overrides:
getTypein classConstraintWidget- Returns:
- type (null if not set)
-
getOrientation
public int getOrientation()
get the orientation VERTICAL or HORIZONTAL- Returns:
- orientation
-
setMinimumPosition
public void setMinimumPosition(int minimum)
set the minimum position- Parameters:
minimum-
-
getMinimumPosition
public int getMinimumPosition()
Get the Minimum Position- Returns:
- the Minimum Position
-
getAnchor
public ConstraintAnchor getAnchor(ConstraintAnchor.Type anchorType)
Description copied from class:ConstraintWidgetGiven a type of anchor, returns the corresponding anchor.- Overrides:
getAnchorin classConstraintWidget- Parameters:
anchorType- type of the anchor (LEFT, TOP, RIGHT, BOTTOM, BASELINE, CENTER_X, CENTER_Y)- Returns:
- the matching anchor
-
setGuidePercent
public void setGuidePercent(int value)
-
setGuidePercent
public void setGuidePercent(float value)
-
setGuideBegin
public void setGuideBegin(int value)
-
setGuideEnd
public void setGuideEnd(int value)
-
getRelativePercent
public float getRelativePercent()
-
getRelativeBegin
public int getRelativeBegin()
-
getRelativeEnd
public int getRelativeEnd()
-
setFinalValue
public void setFinalValue(int position)
-
isResolvedHorizontally
public boolean isResolvedHorizontally()
- Overrides:
isResolvedHorizontallyin classConstraintWidget
-
isResolvedVertically
public boolean isResolvedVertically()
- Overrides:
isResolvedVerticallyin classConstraintWidget
-
addToSolver
public void addToSolver(LinearSystem system, boolean optimize)
Description copied from class:ConstraintWidgetAdd this widget to the solver- Overrides:
addToSolverin classConstraintWidget- Parameters:
system- the solver we want to add the widget tooptimize- true ifOptimizer.OPTIMIZATION_GRAPHis on
-
updateFromSolver
public void updateFromSolver(LinearSystem system, boolean optimize)
Description copied from class:ConstraintWidgetUpdate the widget from the values generated by the solver- Overrides:
updateFromSolverin classConstraintWidget- Parameters:
system- the solver we get the values from.optimize- true ifOptimizer.OPTIMIZATION_GRAPHis on
-
cyclePosition
public void cyclePosition()
-
isPercent
public boolean isPercent()
-
-