class State

Known direct subclasses
State

The state of the ConstraintLayout solver.


Represents a full state of a ConstraintLayout

Summary

Nested types

Constants

const Int!

Public constructors

Public functions

Unit
BarrierReference!
barrier(key: Any!, direction: State.Direction!)
Unit

Baseline is needed for this object

AlignHorizontallyReference!
centerHorizontally(references: Array<Any!>!)
AlignVerticallyReference!
centerVertically(references: Array<Any!>!)
ConstraintReference!
Int

Implements a conversion function for values, returning int.

ConstraintReference!

Create a new reference given a key.

Unit
FlowReference!
getFlow(key: Any!, vertical: Boolean)

Gets a reference to a Flow object.

GridReference
getGrid(key: Any, gridType: String)

Get a Grid reference

FlowReference!

Get a HorizontalFlowReference

FlowReference!
getHorizontalFlow(references: Array<Any!>!)

Get a HorizontalFlowReference and add it to references

ArrayList<String!>!
FlowReference!

Get a VerticalFlowReference

FlowReference!
getVerticalFlow(references: Array<Any!>!)

Get a VerticalFlowReference and add it to references

GuidelineReference!
guideline(key: Any!, orientation: Int)
State!
height(dimension: Dimension!)
HelperReference!
helper(key: Any!, type: State.Helper!)
HorizontalChainReference!
HorizontalChainReference!
horizontalChain(references: Array<Any!>!)
GuidelineReference!
Boolean
isBaselineNeeded(constraintWidget: ConstraintWidget!)

Does this constraintWidget need a baseline

Boolean

This function is deprecated.

For consistency, use isRtl instead.

Boolean

Returns true if layout direction is right to left.

Unit
map(key: Any!, view: Any!)
Unit

Clear the state

Boolean
Boolean
Unit

Set the function that converts dp to Pixels

State!
setHeight(dimension: Dimension!)
Unit
setLtr(isLtr: Boolean)

This function is deprecated.

For consistency, use setRtl instead.

Unit
setRtl(isRtl: Boolean)

Set whether the layout direction is right to left (Rtl).

Unit
setTag(key: String!, tag: String!)
State!
setWidth(dimension: Dimension!)
VerticalChainReference!
VerticalChainReference!
verticalChain(references: Array<Any!>!)
GuidelineReference!
State!
width(dimension: Dimension!)

Public properties

ConstraintReference!

Constants

PARENT

Added in 1.1.0-alpha13
const val PARENTInt!

Public constructors

State

Added in 1.1.0-alpha13
State()

Public functions

apply

Added in 1.1.0-alpha13
fun apply(container: ConstraintWidgetContainer!): Unit

barrier

Added in 1.1.0-alpha13
fun barrier(key: Any!, direction: State.Direction!): BarrierReference!

baselineNeededFor

Added in 1.1.0-alpha13
fun baselineNeededFor(id: Any!): Unit

Baseline is needed for this object

centerHorizontally

fun centerHorizontally(references: Array<Any!>!): AlignHorizontallyReference!

centerVertically

fun centerVertically(references: Array<Any!>!): AlignVerticallyReference!

constraints

Added in 1.1.0-alpha13
fun constraints(key: Any!): ConstraintReference!

convertDimension

Added in 1.1.0-alpha13
fun convertDimension(value: Any!): Int

Implements a conversion function for values, returning int. This can be used in case values (e.g. margins) are represented via an object, not directly an int.

Parameters
value: Any!

the object to convert from

createConstraintReference

Added in 1.1.0-alpha13
fun createConstraintReference(key: Any!): ConstraintReference!

Create a new reference given a key.

directMapping

Added in 1.1.0-alpha13
fun directMapping(): Unit

getFlow

Added in 1.1.0-alpha13
fun getFlow(key: Any!, vertical: Boolean): FlowReference!

Gets a reference to a Flow object. Creating it if needed.

Parameters
key: Any!

id of the reference

vertical: Boolean

is it a vertical or horizontal flow

Returns
FlowReference!

a FlowReference

getGrid

Added in 1.1.0-alpha13
fun getGrid(key: Any, gridType: String): GridReference

Get a Grid reference

Parameters
key: Any

name of the reference object

gridType: String

type of Grid pattern - Grid, Row, or Column

Returns
GridReference

a GridReference object

getHorizontalFlow

Added in 1.1.0-alpha13
fun getHorizontalFlow(): FlowReference!

Get a HorizontalFlowReference

Returns
FlowReference!

a HorizontalFlowReference

getHorizontalFlow

fun getHorizontalFlow(references: Array<Any!>!): FlowReference!

Get a HorizontalFlowReference and add it to references

Parameters
references: Array<Any!>!

references where we the HorizontalFlowReference

Returns
FlowReference!

a HorizontalFlowReference

getIdsForTag

Added in 1.1.0-alpha13
fun getIdsForTag(tag: String!): ArrayList<String!>!

getVerticalFlow

Added in 1.1.0-alpha13
fun getVerticalFlow(): FlowReference!

Get a VerticalFlowReference

Returns
FlowReference!

a VerticalFlowReference

getVerticalFlow

fun getVerticalFlow(references: Array<Any!>!): FlowReference!

Get a VerticalFlowReference and add it to references

Parameters
references: Array<Any!>!

where we add the VerticalFlowReference

Returns
FlowReference!

a VerticalFlowReference

guideline

Added in 1.1.0-alpha13
fun guideline(key: Any!, orientation: Int): GuidelineReference!

height

Added in 1.1.0-alpha13
fun height(dimension: Dimension!): State!

helper

Added in 1.1.0-alpha13
fun helper(key: Any!, type: State.Helper!): HelperReference!

horizontalChain

Added in 1.1.0-alpha13
fun horizontalChain(): HorizontalChainReference!

horizontalChain

fun horizontalChain(references: Array<Any!>!): HorizontalChainReference!

horizontalGuideline

Added in 1.1.0-alpha13
fun horizontalGuideline(key: Any!): GuidelineReference!

isBaselineNeeded

Added in 1.1.0-alpha13
fun isBaselineNeeded(constraintWidget: ConstraintWidget!): Boolean

Does this constraintWidget need a baseline

Returns
Boolean

true if the constraintWidget needs a baseline

isLtr

Added in 1.1.0-alpha13
Deprecated in 1.1.0-alpha13
fun isLtr(): Boolean

Returns true if layout direction is left to right. False for right to left.

isRtl

Added in 1.1.0-alpha13
fun isRtl(): Boolean

Returns true if layout direction is right to left. False for left to right.

map

Added in 1.1.0-alpha13
fun map(key: Any!, view: Any!): Unit

reset

Added in 1.1.0-alpha13
fun reset(): Unit

Clear the state

sameFixedHeight

Added in 1.1.0-alpha13
fun sameFixedHeight(height: Int): Boolean

sameFixedWidth

Added in 1.1.0-alpha13
fun sameFixedWidth(width: Int): Boolean

setDpToPixel

Added in 1.1.0-alpha13
fun setDpToPixel(dpToPixel: CorePixelDp!): Unit

Set the function that converts dp to Pixels

setHeight

Added in 1.1.0-alpha13
fun setHeight(dimension: Dimension!): State!

setLtr

Added in 1.1.0-alpha13
Deprecated in 1.1.0-alpha13
fun setLtr(isLtr: Boolean): Unit

Set whether the layout direction is left to right (Ltr).

setRtl

Added in 1.1.0-alpha13
fun setRtl(isRtl: Boolean): Unit

Set whether the layout direction is right to left (Rtl).

setTag

Added in 1.1.0-alpha13
fun setTag(key: String!, tag: String!): Unit

setWidth

Added in 1.1.0-alpha13
fun setWidth(dimension: Dimension!): State!

verticalChain

Added in 1.1.0-alpha13
fun verticalChain(): VerticalChainReference!

verticalChain

fun verticalChain(references: Array<Any!>!): VerticalChainReference!

verticalGuideline

Added in 1.1.0-alpha13
fun verticalGuideline(key: Any!): GuidelineReference!

width

Added in 1.1.0-alpha13
fun width(dimension: Dimension!): State!

Public properties

mParent

Added in 1.1.0-alpha13
val mParentConstraintReference!

Protected properties

mHelperReferences

Added in 1.1.0-alpha13
protected val mHelperReferencesHashMap<Any!, HelperReference!>!

mReferences

Added in 1.1.0-alpha13
protected val mReferencesHashMap<Any!, Reference!>!