Constraint
class Constraint
Provides the API for creating a Constraint Object for use in the Core ConstraintLayout &MotionLayout system
Summary
Nested types |
|---|
inner class Constraint.Anchor |
enum Constraint.Behaviour |
enum Constraint.ChainMode |
inner class Constraint.HAnchor : Constraint.Anchor |
enum Constraint.HSide |
enum Constraint.Side |
inner class Constraint.VAnchor : Constraint.Anchor |
enum Constraint.VSide |
Constants |
|
|---|---|
const Constraint! |
Public constructors |
|---|
Constraint(id: String!) |
Public functions |
|
|---|---|
String! |
convertStringArrayToString(str: Array<String!>!)convert a String array into a String representation |
Constraint.VAnchor! |
get baseline anchor |
Constraint.VAnchor! |
get bottom anchor |
Float |
get circleAngle |
String! |
get circleConstraint |
Int |
get circleRadius |
String! |
get dimensionRatio |
Int |
get editorAbsoluteX |
Int |
get editorAbsoluteY |
Constraint.HAnchor! |
getEnd()get end anchor |
Int |
get height |
Constraint.Behaviour! |
get heightDefault |
Int |
get heightMax |
Int |
get heightMin |
Float |
get heightPercent |
Float |
get horizontalBias |
Constraint.ChainMode! |
get horizontalChainStyle |
Float |
get horizontalWeight |
Constraint.HAnchor! |
getLeft()get left anchor |
Array<String!>! |
get referenceIds |
Constraint.HAnchor! |
getRight()get right anchor |
Constraint.HAnchor! |
getStart()get start anchor |
Constraint.VAnchor! |
getTop()get top anchor |
Float |
get verticalBias |
Constraint.ChainMode! |
get verticalChainStyle |
Float |
get verticalWeight |
Int |
getWidth()get width |
Constraint.Behaviour! |
get widthDefault |
Int |
get widthMax |
Int |
get widthMin |
Float |
get widthPercent |
Boolean |
is constrainedHeight |
Boolean |
is constrainedWidth |
Unit |
linkToBaseline(anchor: Constraint.VAnchor!)Connect anchor to Baseline |
Unit |
linkToBaseline(anchor: Constraint.VAnchor!, margin: Int)Connect anchor to Baseline |
Unit |
linkToBaseline(anchor: Constraint.VAnchor!, margin: Int, goneMargin: Int)Connect anchor to Baseline |
Unit |
linkToBottom(anchor: Constraint.VAnchor!)Connect anchor to Bottom |
Unit |
linkToBottom(anchor: Constraint.VAnchor!, margin: Int)Connect anchor to Bottom |
Unit |
linkToBottom(anchor: Constraint.VAnchor!, margin: Int, goneMargin: Int)Connect anchor to Bottom |
Unit |
linkToEnd(anchor: Constraint.HAnchor!)Connect anchor to End |
Unit |
linkToEnd(anchor: Constraint.HAnchor!, margin: Int)Connect anchor to End |
Unit |
linkToEnd(anchor: Constraint.HAnchor!, margin: Int, goneMargin: Int)Connect anchor to End |
Unit |
linkToLeft(anchor: Constraint.HAnchor!)Connect anchor to Left |
Unit |
linkToLeft(anchor: Constraint.HAnchor!, margin: Int)Connect anchor to Left |
Unit |
linkToLeft(anchor: Constraint.HAnchor!, margin: Int, goneMargin: Int)Connect anchor to Left |
Unit |
linkToRight(anchor: Constraint.HAnchor!)Connect anchor to Right |
Unit |
linkToRight(anchor: Constraint.HAnchor!, margin: Int)Connect anchor to Right |
Unit |
linkToRight(anchor: Constraint.HAnchor!, margin: Int, goneMargin: Int)Connect anchor to Right |
Unit |
linkToStart(anchor: Constraint.HAnchor!)Connect anchor to Start |
Unit |
linkToStart(anchor: Constraint.HAnchor!, margin: Int)Connect anchor to Start |
Unit |
linkToStart(anchor: Constraint.HAnchor!, margin: Int, goneMargin: Int)Connect anchor to Start |
Unit |
linkToTop(anchor: Constraint.VAnchor!)Connect anchor to Top |
Unit |
linkToTop(anchor: Constraint.VAnchor!, margin: Int)Connect anchor to Top |
Unit |
linkToTop(anchor: Constraint.VAnchor!, margin: Int, goneMargin: Int)Connect anchor to Top |
Unit |
setCircleAngle(circleAngle: Float)set circleAngle |
Unit |
setCircleConstraint(circleConstraint: String!)set circleConstraint |
Unit |
setCircleRadius(circleRadius: Int)set circleRadius |
Unit |
setConstrainedHeight(constrainedHeight: Boolean)set constrainedHeight |
Unit |
setConstrainedWidth(constrainedWidth: Boolean)set constrainedWidth |
Unit |
setDimensionRatio(dimensionRatio: String!)set dimensionRatio |
Unit |
setEditorAbsoluteX(editorAbsoluteX: Int)set editorAbsoluteX |
Unit |
setEditorAbsoluteY(editorAbsoluteY: Int)set editorAbsoluteY |
Unit |
set height |
Unit |
setHeightDefault(heightDefault: Constraint.Behaviour!)set heightDefault |
Unit |
setHeightMax(heightMax: Int)set heightMax |
Unit |
setHeightMin(heightMin: Int)set heightMin |
Unit |
setHeightPercent(heightPercent: Float)set heightPercent |
Unit |
setHorizontalBias(horizontalBias: Float)set horizontalBias |
Unit |
setHorizontalChainStyle(horizontalChainStyle: Constraint.ChainMode!)set horizontalChainStyle |
Unit |
setHorizontalWeight(horizontalWeight: Float)set horizontalWeight |
Unit |
setReferenceIds(referenceIds: Array<String!>!)set referenceIds |
Unit |
setVerticalBias(verticalBias: Float)set verticalBias |
Unit |
setVerticalChainStyle(verticalChainStyle: Constraint.ChainMode!)set verticalChainStyle |
Unit |
setVerticalWeight(verticalWeight: Float)set verticalWeight |
Unit |
set width |
Unit |
setWidthDefault(widthDefault: Constraint.Behaviour!)set widthDefault |
Unit |
setWidthMax(widthMax: Int)set widthMax |
Unit |
setWidthMin(widthMin: Int)set widthMin |
Unit |
setWidthPercent(widthPercent: Float)set widthPercent |
String! |
toString() |
Protected functions |
|
|---|---|
Unit |
append(builder: StringBuilder!, name: String!, value: Float) |
Constants
Public constructors
Public functions
convertStringArrayToString
fun convertStringArrayToString(str: Array<String!>!): String!
convert a String array into a String representation
| Returns | |
|---|---|
String! |
a String representation of the input array. |
getBaseline
fun getBaseline(): Constraint.VAnchor!
get baseline anchor
| Returns | |
|---|---|
Constraint.VAnchor! |
baseline anchor |
getBottom
fun getBottom(): Constraint.VAnchor!
get bottom anchor
| Returns | |
|---|---|
Constraint.VAnchor! |
bottom anchor |
getCircleConstraint
fun getCircleConstraint(): String!
get circleConstraint
| Returns | |
|---|---|
String! |
circleConstraint |
getDimensionRatio
fun getDimensionRatio(): String!
get dimensionRatio
| Returns | |
|---|---|
String! |
dimensionRatio |
getEditorAbsoluteX
fun getEditorAbsoluteX(): Int
get editorAbsoluteX
| Returns | |
|---|---|
Int |
editorAbsoluteX |
getEditorAbsoluteY
fun getEditorAbsoluteY(): Int
get editorAbsoluteY
| Returns | |
|---|---|
Int |
editorAbsoluteY |
getEnd
fun getEnd(): Constraint.HAnchor!
get end anchor
| Returns | |
|---|---|
Constraint.HAnchor! |
end anchor |
getHeightDefault
fun getHeightDefault(): Constraint.Behaviour!
get heightDefault
| Returns | |
|---|---|
Constraint.Behaviour! |
heightDefault |
getHeightPercent
fun getHeightPercent(): Float
get heightPercent
| Returns | |
|---|---|
Float |
heightPercent |
getHorizontalBias
fun getHorizontalBias(): Float
get horizontalBias
| Returns | |
|---|---|
Float |
horizontalBias |
getHorizontalChainStyle
fun getHorizontalChainStyle(): Constraint.ChainMode!
get horizontalChainStyle
| Returns | |
|---|---|
Constraint.ChainMode! |
horizontalChainStyle |
getHorizontalWeight
fun getHorizontalWeight(): Float
get horizontalWeight
| Returns | |
|---|---|
Float |
horizontalWeight |
getLeft
fun getLeft(): Constraint.HAnchor!
get left anchor
| Returns | |
|---|---|
Constraint.HAnchor! |
left anchor |
getRight
fun getRight(): Constraint.HAnchor!
get right anchor
| Returns | |
|---|---|
Constraint.HAnchor! |
right anchor |
getStart
fun getStart(): Constraint.HAnchor!
get start anchor
| Returns | |
|---|---|
Constraint.HAnchor! |
start anchor |
getTop
fun getTop(): Constraint.VAnchor!
get top anchor
| Returns | |
|---|---|
Constraint.VAnchor! |
top anchor |
getVerticalBias
fun getVerticalBias(): Float
get verticalBias
| Returns | |
|---|---|
Float |
verticalBias |
getVerticalChainStyle
fun getVerticalChainStyle(): Constraint.ChainMode!
get verticalChainStyle
| Returns | |
|---|---|
Constraint.ChainMode! |
verticalChainStyle |
getVerticalWeight
fun getVerticalWeight(): Float
get verticalWeight
| Returns | |
|---|---|
Float |
verticalWeight |
getWidthDefault
fun getWidthDefault(): Constraint.Behaviour!
get widthDefault
| Returns | |
|---|---|
Constraint.Behaviour! |
widthDefault |
isConstrainedHeight
fun isConstrainedHeight(): Boolean
is constrainedHeight
| Returns | |
|---|---|
Boolean |
true if height constrained |
isConstrainedWidth
fun isConstrainedWidth(): Boolean
is constrainedWidth
| Returns | |
|---|---|
Boolean |
true if width constrained |
linkToBaseline
fun linkToBaseline(anchor: Constraint.VAnchor!): Unit
Connect anchor to Baseline
| Parameters | |
|---|---|
anchor: Constraint.VAnchor! |
anchor to be connected |
linkToBaseline
fun linkToBaseline(anchor: Constraint.VAnchor!, margin: Int): Unit
Connect anchor to Baseline
| Parameters | |
|---|---|
anchor: Constraint.VAnchor! |
anchor to be connected |
margin: Int |
value of the margin |
linkToBaseline
fun linkToBaseline(anchor: Constraint.VAnchor!, margin: Int, goneMargin: Int): Unit
Connect anchor to Baseline
| Parameters | |
|---|---|
anchor: Constraint.VAnchor! |
anchor to be connected |
margin: Int |
value of the margin |
goneMargin: Int |
value of the goneMargin |
linkToBottom
fun linkToBottom(anchor: Constraint.VAnchor!): Unit
Connect anchor to Bottom
| Parameters | |
|---|---|
anchor: Constraint.VAnchor! |
anchor to be connected |
linkToBottom
fun linkToBottom(anchor: Constraint.VAnchor!, margin: Int): Unit
Connect anchor to Bottom
| Parameters | |
|---|---|
anchor: Constraint.VAnchor! |
anchor to be connected |
margin: Int |
value of the margin |
linkToBottom
fun linkToBottom(anchor: Constraint.VAnchor!, margin: Int, goneMargin: Int): Unit
Connect anchor to Bottom
| Parameters | |
|---|---|
anchor: Constraint.VAnchor! |
anchor to be connected |
margin: Int |
value of the margin |
goneMargin: Int |
value of the goneMargin |
linkToEnd
fun linkToEnd(anchor: Constraint.HAnchor!): Unit
Connect anchor to End
| Parameters | |
|---|---|
anchor: Constraint.HAnchor! |
anchor to be connected |
linkToEnd
fun linkToEnd(anchor: Constraint.HAnchor!, margin: Int): Unit
Connect anchor to End
| Parameters | |
|---|---|
anchor: Constraint.HAnchor! |
anchor to be connected |
margin: Int |
value of the margin |
linkToEnd
fun linkToEnd(anchor: Constraint.HAnchor!, margin: Int, goneMargin: Int): Unit
Connect anchor to End
| Parameters | |
|---|---|
anchor: Constraint.HAnchor! |
anchor to be connected |
margin: Int |
value of the margin |
goneMargin: Int |
value of the goneMargin |
linkToLeft
fun linkToLeft(anchor: Constraint.HAnchor!): Unit
Connect anchor to Left
| Parameters | |
|---|---|
anchor: Constraint.HAnchor! |
anchor to be connected |
linkToLeft
fun linkToLeft(anchor: Constraint.HAnchor!, margin: Int): Unit
Connect anchor to Left
| Parameters | |
|---|---|
anchor: Constraint.HAnchor! |
anchor to be connected |
margin: Int |
value of the margin |
linkToLeft
fun linkToLeft(anchor: Constraint.HAnchor!, margin: Int, goneMargin: Int): Unit
Connect anchor to Left
| Parameters | |
|---|---|
anchor: Constraint.HAnchor! |
anchor to be connected |
margin: Int |
value of the margin |
goneMargin: Int |
value of the goneMargin |
linkToRight
fun linkToRight(anchor: Constraint.HAnchor!): Unit
Connect anchor to Right
| Parameters | |
|---|---|
anchor: Constraint.HAnchor! |
anchor to be connected |
linkToRight
fun linkToRight(anchor: Constraint.HAnchor!, margin: Int): Unit
Connect anchor to Right
| Parameters | |
|---|---|
anchor: Constraint.HAnchor! |
anchor to be connected |
margin: Int |
value of the margin |
linkToRight
fun linkToRight(anchor: Constraint.HAnchor!, margin: Int, goneMargin: Int): Unit
Connect anchor to Right
| Parameters | |
|---|---|
anchor: Constraint.HAnchor! |
anchor to be connected |
margin: Int |
value of the margin |
goneMargin: Int |
value of the goneMargin |
linkToStart
fun linkToStart(anchor: Constraint.HAnchor!): Unit
Connect anchor to Start
| Parameters | |
|---|---|
anchor: Constraint.HAnchor! |
anchor to be connected |
linkToStart
fun linkToStart(anchor: Constraint.HAnchor!, margin: Int): Unit
Connect anchor to Start
| Parameters | |
|---|---|
anchor: Constraint.HAnchor! |
anchor to be connected |
margin: Int |
value of the margin |
linkToStart
fun linkToStart(anchor: Constraint.HAnchor!, margin: Int, goneMargin: Int): Unit
Connect anchor to Start
| Parameters | |
|---|---|
anchor: Constraint.HAnchor! |
anchor to be connected |
margin: Int |
value of the margin |
goneMargin: Int |
value of the goneMargin |
linkToTop
fun linkToTop(anchor: Constraint.VAnchor!): Unit
Connect anchor to Top
| Parameters | |
|---|---|
anchor: Constraint.VAnchor! |
anchor to be connected |
linkToTop
fun linkToTop(anchor: Constraint.VAnchor!, margin: Int): Unit
Connect anchor to Top
| Parameters | |
|---|---|
anchor: Constraint.VAnchor! |
anchor to be connected |
margin: Int |
value of the margin |
linkToTop
fun linkToTop(anchor: Constraint.VAnchor!, margin: Int, goneMargin: Int): Unit
Connect anchor to Top
| Parameters | |
|---|---|
anchor: Constraint.VAnchor! |
anchor to be connected |
margin: Int |
value of the margin |
goneMargin: Int |
value of the goneMargin |
setCircleAngle
fun setCircleAngle(circleAngle: Float): Unit
set circleAngle
| Parameters | |
|---|---|
circleAngle: Float |
setCircleConstraint
fun setCircleConstraint(circleConstraint: String!): Unit
set circleConstraint
| Parameters | |
|---|---|
circleConstraint: String! |
setCircleRadius
fun setCircleRadius(circleRadius: Int): Unit
set circleRadius
| Parameters | |
|---|---|
circleRadius: Int |
setConstrainedHeight
fun setConstrainedHeight(constrainedHeight: Boolean): Unit
set constrainedHeight
| Parameters | |
|---|---|
constrainedHeight: Boolean |
setConstrainedWidth
fun setConstrainedWidth(constrainedWidth: Boolean): Unit
set constrainedWidth
| Parameters | |
|---|---|
constrainedWidth: Boolean |
setDimensionRatio
fun setDimensionRatio(dimensionRatio: String!): Unit
set dimensionRatio
| Parameters | |
|---|---|
dimensionRatio: String! |
setEditorAbsoluteX
fun setEditorAbsoluteX(editorAbsoluteX: Int): Unit
set editorAbsoluteX
| Parameters | |
|---|---|
editorAbsoluteX: Int |
setEditorAbsoluteY
fun setEditorAbsoluteY(editorAbsoluteY: Int): Unit
set editorAbsoluteY
| Parameters | |
|---|---|
editorAbsoluteY: Int |
setHeightDefault
fun setHeightDefault(heightDefault: Constraint.Behaviour!): Unit
set heightDefault
| Parameters | |
|---|---|
heightDefault: Constraint.Behaviour! |
setHeightMax
fun setHeightMax(heightMax: Int): Unit
set heightMax
| Parameters | |
|---|---|
heightMax: Int |
setHeightMin
fun setHeightMin(heightMin: Int): Unit
set heightMin
| Parameters | |
|---|---|
heightMin: Int |
setHeightPercent
fun setHeightPercent(heightPercent: Float): Unit
set heightPercent
| Parameters | |
|---|---|
heightPercent: Float |
setHorizontalBias
fun setHorizontalBias(horizontalBias: Float): Unit
set horizontalBias
| Parameters | |
|---|---|
horizontalBias: Float |
setHorizontalChainStyle
fun setHorizontalChainStyle(horizontalChainStyle: Constraint.ChainMode!): Unit
set horizontalChainStyle
| Parameters | |
|---|---|
horizontalChainStyle: Constraint.ChainMode! |
setHorizontalWeight
fun setHorizontalWeight(horizontalWeight: Float): Unit
set horizontalWeight
| Parameters | |
|---|---|
horizontalWeight: Float |
setReferenceIds
fun setReferenceIds(referenceIds: Array<String!>!): Unit
set referenceIds
setVerticalBias
fun setVerticalBias(verticalBias: Float): Unit
set verticalBias
| Parameters | |
|---|---|
verticalBias: Float |
setVerticalChainStyle
fun setVerticalChainStyle(verticalChainStyle: Constraint.ChainMode!): Unit
set verticalChainStyle
| Parameters | |
|---|---|
verticalChainStyle: Constraint.ChainMode! |
setVerticalWeight
fun setVerticalWeight(verticalWeight: Float): Unit
set verticalWeight
| Parameters | |
|---|---|
verticalWeight: Float |
setWidthDefault
fun setWidthDefault(widthDefault: Constraint.Behaviour!): Unit
set widthDefault
| Parameters | |
|---|---|
widthDefault: Constraint.Behaviour! |
setWidthMax
fun setWidthMax(widthMax: Int): Unit
set widthMax
| Parameters | |
|---|---|
widthMax: Int |
setWidthMin
fun setWidthMin(widthMin: Int): Unit
set widthMin
| Parameters | |
|---|---|
widthMin: Int |
setWidthPercent
fun setWidthPercent(widthPercent: Float): Unit
set widthPercent
| Parameters | |
|---|---|
widthPercent: Float |