class Constraint


Provides the API for creating a Constraint Object for use in the Core ConstraintLayout &MotionLayout system

Summary

Constants

const Constraint!

Public constructors

Public functions

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!

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!

get left anchor

Array<String!>!

get referenceIds

Constraint.HAnchor!

get right anchor

Constraint.HAnchor!

get start anchor

Constraint.VAnchor!

get top anchor

Float

get verticalBias

Constraint.ChainMode!

get verticalChainStyle

Float

get verticalWeight

Int

get width

Constraint.Behaviour!

get widthDefault

Int

get widthMax

Int

get widthMin

Float

get widthPercent

Boolean

is constrainedHeight

Boolean

is constrainedWidth

Unit

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

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

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

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

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

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

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
setHeight(height: Int)

set height

Unit

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

set horizontalChainStyle

Unit
setHorizontalWeight(horizontalWeight: Float)

set horizontalWeight

Unit
setReferenceIds(referenceIds: Array<String!>!)

set referenceIds

Unit
setVerticalBias(verticalBias: Float)

set verticalBias

Unit

set verticalChainStyle

Unit
setVerticalWeight(verticalWeight: Float)

set verticalWeight

Unit
setWidth(width: Int)

set width

Unit

set widthDefault

Unit
setWidthMax(widthMax: Int)

set widthMax

Unit
setWidthMin(widthMin: Int)

set widthMin

Unit
setWidthPercent(widthPercent: Float)

set widthPercent

String!

Protected functions

Unit
append(builder: StringBuilder!, name: String!, value: Float)

Constants

PARENT

Added in 1.1.0-alpha13
const val PARENTConstraint!

Public constructors

Constraint

Added in 1.1.0-alpha13
Constraint(id: String!)

Public functions

convertStringArrayToString

Added in 1.1.0-alpha13
fun convertStringArrayToString(str: Array<String!>!): String!

convert a String array into a String representation

Parameters
str: Array<String!>!

String array to be converted

Returns
String!

a String representation of the input array.

getBaseline

Added in 1.1.0-alpha13
fun getBaseline(): Constraint.VAnchor!

get baseline anchor

Returns
Constraint.VAnchor!

baseline anchor

getBottom

Added in 1.1.0-alpha13
fun getBottom(): Constraint.VAnchor!

get bottom anchor

Returns
Constraint.VAnchor!

bottom anchor

getCircleAngle

Added in 1.1.0-alpha13
fun getCircleAngle(): Float

get circleAngle

Returns
Float

circleAngle

getCircleConstraint

Added in 1.1.0-alpha13
fun getCircleConstraint(): String!

get circleConstraint

Returns
String!

circleConstraint

getCircleRadius

Added in 1.1.0-alpha13
fun getCircleRadius(): Int

get circleRadius

Returns
Int

circleRadius

getDimensionRatio

Added in 1.1.0-alpha13
fun getDimensionRatio(): String!

get dimensionRatio

Returns
String!

dimensionRatio

getEditorAbsoluteX

Added in 1.1.0-alpha13
fun getEditorAbsoluteX(): Int

get editorAbsoluteX

Returns
Int

editorAbsoluteX

getEditorAbsoluteY

Added in 1.1.0-alpha13
fun getEditorAbsoluteY(): Int

get editorAbsoluteY

Returns
Int

editorAbsoluteY

getEnd

Added in 1.1.0-alpha13
fun getEnd(): Constraint.HAnchor!

get end anchor

Returns
Constraint.HAnchor!

end anchor

getHeight

Added in 1.1.0-alpha13
fun getHeight(): Int

get height

Returns
Int

height

getHeightDefault

Added in 1.1.0-alpha13
fun getHeightDefault(): Constraint.Behaviour!

get heightDefault

Returns
Constraint.Behaviour!

heightDefault

getHeightMax

Added in 1.1.0-alpha13
fun getHeightMax(): Int

get heightMax

Returns
Int

heightMax

getHeightMin

Added in 1.1.0-alpha13
fun getHeightMin(): Int

get heightMin

Returns
Int

heightMin

getHeightPercent

Added in 1.1.0-alpha13
fun getHeightPercent(): Float

get heightPercent

Returns
Float

heightPercent

getHorizontalBias

Added in 1.1.0-alpha13
fun getHorizontalBias(): Float

get horizontalBias

Returns
Float

horizontalBias

getHorizontalChainStyle

Added in 1.1.0-alpha13
fun getHorizontalChainStyle(): Constraint.ChainMode!

get horizontalChainStyle

Returns
Constraint.ChainMode!

horizontalChainStyle

getHorizontalWeight

Added in 1.1.0-alpha13
fun getHorizontalWeight(): Float

get horizontalWeight

Returns
Float

horizontalWeight

getLeft

Added in 1.1.0-alpha13
fun getLeft(): Constraint.HAnchor!

get left anchor

Returns
Constraint.HAnchor!

left anchor

getReferenceIds

Added in 1.1.0-alpha13
fun getReferenceIds(): Array<String!>!

get referenceIds

Returns
Array<String!>!

referenceIds

getRight

Added in 1.1.0-alpha13
fun getRight(): Constraint.HAnchor!

get right anchor

Returns
Constraint.HAnchor!

right anchor

getStart

Added in 1.1.0-alpha13
fun getStart(): Constraint.HAnchor!

get start anchor

Returns
Constraint.HAnchor!

start anchor

getTop

Added in 1.1.0-alpha13
fun getTop(): Constraint.VAnchor!

get top anchor

Returns
Constraint.VAnchor!

top anchor

getVerticalBias

Added in 1.1.0-alpha13
fun getVerticalBias(): Float

get verticalBias

Returns
Float

verticalBias

getVerticalChainStyle

Added in 1.1.0-alpha13
fun getVerticalChainStyle(): Constraint.ChainMode!

get verticalChainStyle

Returns
Constraint.ChainMode!

verticalChainStyle

getVerticalWeight

Added in 1.1.0-alpha13
fun getVerticalWeight(): Float

get verticalWeight

Returns
Float

verticalWeight

getWidth

Added in 1.1.0-alpha13
fun getWidth(): Int

get width

Returns
Int

width

getWidthDefault

Added in 1.1.0-alpha13
fun getWidthDefault(): Constraint.Behaviour!

get widthDefault

Returns
Constraint.Behaviour!

widthDefault

getWidthMax

Added in 1.1.0-alpha13
fun getWidthMax(): Int

get widthMax

Returns
Int

widthMax

getWidthMin

Added in 1.1.0-alpha13
fun getWidthMin(): Int

get widthMin

Returns
Int

widthMin

getWidthPercent

Added in 1.1.0-alpha13
fun getWidthPercent(): Float

get widthPercent

Returns
Float

isConstrainedHeight

Added in 1.1.0-alpha13
fun isConstrainedHeight(): Boolean

is constrainedHeight

Returns
Boolean

true if height constrained

isConstrainedWidth

Added in 1.1.0-alpha13
fun isConstrainedWidth(): Boolean

is constrainedWidth

Returns
Boolean

true if width constrained

linkToBaseline

Added in 1.1.0-alpha13
fun linkToBaseline(anchor: Constraint.VAnchor!): Unit

Connect anchor to Baseline

Parameters
anchor: Constraint.VAnchor!

anchor to be connected

linkToBaseline

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
fun linkToBottom(anchor: Constraint.VAnchor!): Unit

Connect anchor to Bottom

Parameters
anchor: Constraint.VAnchor!

anchor to be connected

linkToBottom

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
fun linkToEnd(anchor: Constraint.HAnchor!): Unit

Connect anchor to End

Parameters
anchor: Constraint.HAnchor!

anchor to be connected

linkToEnd

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
fun linkToLeft(anchor: Constraint.HAnchor!): Unit

Connect anchor to Left

Parameters
anchor: Constraint.HAnchor!

anchor to be connected

linkToLeft

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
fun linkToRight(anchor: Constraint.HAnchor!): Unit

Connect anchor to Right

Parameters
anchor: Constraint.HAnchor!

anchor to be connected

linkToRight

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
fun linkToStart(anchor: Constraint.HAnchor!): Unit

Connect anchor to Start

Parameters
anchor: Constraint.HAnchor!

anchor to be connected

linkToStart

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
fun linkToTop(anchor: Constraint.VAnchor!): Unit

Connect anchor to Top

Parameters
anchor: Constraint.VAnchor!

anchor to be connected

linkToTop

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
fun setCircleAngle(circleAngle: Float): Unit

set circleAngle

Parameters
circleAngle: Float

setCircleConstraint

Added in 1.1.0-alpha13
fun setCircleConstraint(circleConstraint: String!): Unit

set circleConstraint

Parameters
circleConstraint: String!

setCircleRadius

Added in 1.1.0-alpha13
fun setCircleRadius(circleRadius: Int): Unit

set circleRadius

Parameters
circleRadius: Int

setConstrainedHeight

Added in 1.1.0-alpha13
fun setConstrainedHeight(constrainedHeight: Boolean): Unit

set constrainedHeight

Parameters
constrainedHeight: Boolean

setConstrainedWidth

Added in 1.1.0-alpha13
fun setConstrainedWidth(constrainedWidth: Boolean): Unit

set constrainedWidth

Parameters
constrainedWidth: Boolean

setDimensionRatio

Added in 1.1.0-alpha13
fun setDimensionRatio(dimensionRatio: String!): Unit

set dimensionRatio

Parameters
dimensionRatio: String!

setEditorAbsoluteX

Added in 1.1.0-alpha13
fun setEditorAbsoluteX(editorAbsoluteX: Int): Unit

set editorAbsoluteX

Parameters
editorAbsoluteX: Int

setEditorAbsoluteY

Added in 1.1.0-alpha13
fun setEditorAbsoluteY(editorAbsoluteY: Int): Unit

set editorAbsoluteY

Parameters
editorAbsoluteY: Int

setHeight

Added in 1.1.0-alpha13
fun setHeight(height: Int): Unit

set height

Parameters
height: Int

setHeightDefault

Added in 1.1.0-alpha13
fun setHeightDefault(heightDefault: Constraint.Behaviour!): Unit

set heightDefault

Parameters
heightDefault: Constraint.Behaviour!

setHeightMax

Added in 1.1.0-alpha13
fun setHeightMax(heightMax: Int): Unit

set heightMax

Parameters
heightMax: Int

setHeightMin

Added in 1.1.0-alpha13
fun setHeightMin(heightMin: Int): Unit

set heightMin

Parameters
heightMin: Int

setHeightPercent

Added in 1.1.0-alpha13
fun setHeightPercent(heightPercent: Float): Unit

set heightPercent

Parameters
heightPercent: Float

setHorizontalBias

Added in 1.1.0-alpha13
fun setHorizontalBias(horizontalBias: Float): Unit

set horizontalBias

Parameters
horizontalBias: Float

setHorizontalChainStyle

Added in 1.1.0-alpha13
fun setHorizontalChainStyle(horizontalChainStyle: Constraint.ChainMode!): Unit

set horizontalChainStyle

Parameters
horizontalChainStyle: Constraint.ChainMode!

setHorizontalWeight

Added in 1.1.0-alpha13
fun setHorizontalWeight(horizontalWeight: Float): Unit

set horizontalWeight

Parameters
horizontalWeight: Float

setReferenceIds

Added in 1.1.0-alpha13
fun setReferenceIds(referenceIds: Array<String!>!): Unit

set referenceIds

Parameters
referenceIds: Array<String!>!

setVerticalBias

Added in 1.1.0-alpha13
fun setVerticalBias(verticalBias: Float): Unit

set verticalBias

Parameters
verticalBias: Float

setVerticalChainStyle

Added in 1.1.0-alpha13
fun setVerticalChainStyle(verticalChainStyle: Constraint.ChainMode!): Unit

set verticalChainStyle

Parameters
verticalChainStyle: Constraint.ChainMode!

setVerticalWeight

Added in 1.1.0-alpha13
fun setVerticalWeight(verticalWeight: Float): Unit

set verticalWeight

Parameters
verticalWeight: Float

setWidth

Added in 1.1.0-alpha13
fun setWidth(width: Int): Unit

set width

Parameters
width: Int

setWidthDefault

Added in 1.1.0-alpha13
fun setWidthDefault(widthDefault: Constraint.Behaviour!): Unit

set widthDefault

Parameters
widthDefault: Constraint.Behaviour!

setWidthMax

Added in 1.1.0-alpha13
fun setWidthMax(widthMax: Int): Unit

set widthMax

Parameters
widthMax: Int

setWidthMin

Added in 1.1.0-alpha13
fun setWidthMin(widthMin: Int): Unit

set widthMin

Parameters
widthMin: Int

setWidthPercent

Added in 1.1.0-alpha13
fun setWidthPercent(widthPercent: Float): Unit

set widthPercent

Parameters
widthPercent: Float

toString

fun toString(): String!

Protected functions

append

Added in 1.1.0-alpha13
protected fun append(builder: StringBuilder!, name: String!, value: Float): Unit