Join us for ⁠#Android11: The Beta Launch Show on June 3!

ConstraintSetBuilderScope

class ConstraintSetBuilderScope
kotlin.Any
   ↳ androidx.ui.layout.ConstraintSetBuilderScope

Builder scope for a ConstraintSet. The scope should not be created directly - the ConstraintSet class constructor should be used instead.

Summary

Nested classes

The style of a horizontal or vertical chain.

Anchor corresponding to the baseline of a ConstraintLayout child.

inner

abstract

Represents a dimension that can be assigned to the width or height of a ConstraintLayoutConstrainedLayoutReference.

sealed

Defines an horizontal anchor which can be used for defining constraints.

Represents a horizontal chain.

sealed

Defines a vertical anchor which can be used for defining constraints.

Represents a vertical chain.

Public methods

ConstraintSetBuilderScope.HorizontalAnchor.BarrierAnchor

Creates and returns a bottom barrier, containing the specified elements.

ConstraintSetBuilderScope.HorizontalAnchor.GuidelineAnchor

Creates a guideline at a specific offset from the bottom of the ConstraintLayout.

ConstraintSetBuilderScope.HorizontalAnchor.GuidelineAnchor

Creates a guideline at a height percentage from the bottom of the ConstraintLayout.

ConstraintSetBuilderScope.VerticalAnchor.GuidelineAnchor

Creates a guideline at a specific offset from the left of the ConstraintLayout.

ConstraintSetBuilderScope.VerticalAnchor.GuidelineAnchor

Creates a guideline at a width percentage from the left of the ConstraintLayout.

ConstraintSetBuilderScope.VerticalAnchor.GuidelineAnchor

Creates a guideline at a specific offset from the right of the ConstraintLayout.

ConstraintSetBuilderScope.VerticalAnchor.GuidelineAnchor

Creates a guideline at a width percentage from the right of the ConstraintLayout.

ConstraintSetBuilderScope.HorizontalAnchor.GuidelineAnchor

Creates a guideline at a specific offset from the top of the ConstraintLayout.

ConstraintSetBuilderScope.HorizontalAnchor.GuidelineAnchor

Creates a guideline at a height percentage from the top of the ConstraintLayout.

ConstraintSetBuilderScope.HorizontalChain

Creates a horizontal chain including the referenced layouts.

ConstraintSetBuilderScope.VerticalAnchor.BarrierAnchor

Creates and returns a left barrier, containing the specified elements.

ConstraintSetBuilderScope.VerticalAnchor.BarrierAnchor

Creates and returns a right barrier, containing the specified elements.

ConstraintSetBuilderScope.HorizontalAnchor.BarrierAnchor

Creates and returns a top barrier, containing the specified elements.

ConstraintSetBuilderScope.VerticalChain

Creates a vertical chain including the referenced layouts.

ConstraintSetBuilderScope.Dimension.MinCoercible

Sets the upper bound of the current Dimension to a fixed dp value.

ConstraintSetBuilderScope.Dimension

Sets the upper bound of the current Dimension to a fixed dp value.

ConstraintSetBuilderScope.Dimension.MaxCoercible

Sets the lower bound of the current Dimension to a fixed dp value.

ConstraintSetBuilderScope.Dimension

Sets the lower bound of the current Dimension to a fixed dp value.

ConstraintSetBuilderScope.Dimension
percent(percent: Float)

A Dimension that is a percent of the parent in the corresponding direction.

ConstraintSetBuilderScope.ConstrainedLayoutReference
tag(tag: Any)

Creates a reference corresponding to the constraint layout children with a specific tag, which can be used to define the constraints to be imposed to those children.

ConstraintSetBuilderScope.Dimension.Coercible
value(dp: Dp)

Creates a Dimension representing a suggested dp size.

ConstraintSetBuilderScope.Dimension

Creates a Dimension representing a fixed dp size.

Properties

ConstraintSetBuilderScope.Dimension.MinCoercible

Sets the upper bound of the current Dimension to be the Wrap size of the child.

ConstraintSetBuilderScope.Dimension

Sets the upper bound of the current Dimension to be the Wrap size of the child.

ConstraintSetBuilderScope.Dimension.MaxCoercible

Sets the lower bound of the current Dimension to be the Wrap size of the child.

ConstraintSetBuilderScope.Dimension

Sets the lower bound of the current Dimension to be the Wrap size of the child.

ConstraintSetBuilderScope.ConstrainedLayoutReference

Reference to the ConstraintLayout itself, which can be used to specify constraints between itself and its children.

ConstraintSetBuilderScope.Dimension

A Dimension that spreads to match constraints.

ConstraintSetBuilderScope.Dimension.Coercible

A Dimension with suggested wrap content behavior.

ConstraintSetBuilderScope.Dimension

A Dimension with fixed wrap content behavior.

Public methods

createBottomBarrier

fun createBottomBarrier(vararg elements: ConstraintSetBuilderScope.ConstrainedLayoutReference): ConstraintSetBuilderScope.HorizontalAnchor.BarrierAnchor

Creates and returns a bottom barrier, containing the specified elements.

createGuidelineFromBottom

fun createGuidelineFromBottom(offset: Dp): ConstraintSetBuilderScope.HorizontalAnchor.GuidelineAnchor

Creates a guideline at a specific offset from the bottom of the ConstraintLayout.

createGuidelineFromBottom

fun createGuidelineFromBottom(percent: Float): ConstraintSetBuilderScope.HorizontalAnchor.GuidelineAnchor

Creates a guideline at a height percentage from the bottom of the ConstraintLayout.

createGuidelineFromLeft

fun createGuidelineFromLeft(offset: Dp): ConstraintSetBuilderScope.VerticalAnchor.GuidelineAnchor

Creates a guideline at a specific offset from the left of the ConstraintLayout.

createGuidelineFromLeft

fun createGuidelineFromLeft(percent: Float): ConstraintSetBuilderScope.VerticalAnchor.GuidelineAnchor

Creates a guideline at a width percentage from the left of the ConstraintLayout.

createGuidelineFromRight

fun createGuidelineFromRight(offset: Dp): ConstraintSetBuilderScope.VerticalAnchor.GuidelineAnchor

Creates a guideline at a specific offset from the right of the ConstraintLayout.

createGuidelineFromRight

fun createGuidelineFromRight(percent: Float): ConstraintSetBuilderScope.VerticalAnchor.GuidelineAnchor

Creates a guideline at a width percentage from the right of the ConstraintLayout.

createGuidelineFromTop

fun createGuidelineFromTop(offset: Dp): ConstraintSetBuilderScope.HorizontalAnchor.GuidelineAnchor

Creates a guideline at a specific offset from the top of the ConstraintLayout.

createGuidelineFromTop

fun createGuidelineFromTop(percent: Float): ConstraintSetBuilderScope.HorizontalAnchor.GuidelineAnchor

Creates a guideline at a height percentage from the top of the ConstraintLayout.

createHorizontalChain

fun createHorizontalChain(
    vararg elements: ConstraintSetBuilderScope.ConstrainedLayoutReference,
    chainStyle: ConstraintSetBuilderScope.ChainStyle = ChainStyle.Spread
): ConstraintSetBuilderScope.HorizontalChain

Creates a horizontal chain including the referenced layouts.

createLeftBarrier

fun createLeftBarrier(vararg elements: ConstraintSetBuilderScope.ConstrainedLayoutReference): ConstraintSetBuilderScope.VerticalAnchor.BarrierAnchor

Creates and returns a left barrier, containing the specified elements.

createRightBarrier

fun createRightBarrier(vararg elements: ConstraintSetBuilderScope.ConstrainedLayoutReference): ConstraintSetBuilderScope.VerticalAnchor.BarrierAnchor

Creates and returns a right barrier, containing the specified elements.

createTopBarrier

fun createTopBarrier(vararg elements: ConstraintSetBuilderScope.ConstrainedLayoutReference): ConstraintSetBuilderScope.HorizontalAnchor.BarrierAnchor

Creates and returns a top barrier, containing the specified elements.

createVerticalChain

fun createVerticalChain(
    vararg elements: ConstraintSetBuilderScope.ConstrainedLayoutReference,
    chainStyle: ConstraintSetBuilderScope.ChainStyle = ChainStyle.Spread
): ConstraintSetBuilderScope.VerticalChain

Creates a vertical chain including the referenced layouts.

max

fun ConstraintSetBuilderScope.Dimension.Coercible.max(dp: Dp): ConstraintSetBuilderScope.Dimension.MinCoercible

Sets the upper bound of the current Dimension to a fixed dp value.

max

fun ConstraintSetBuilderScope.Dimension.MaxCoercible.max(dp: Dp): ConstraintSetBuilderScope.Dimension

Sets the upper bound of the current Dimension to a fixed dp value.

min

fun ConstraintSetBuilderScope.Dimension.Coercible.min(dp: Dp): ConstraintSetBuilderScope.Dimension.MaxCoercible

Sets the lower bound of the current Dimension to a fixed dp value.

min

fun ConstraintSetBuilderScope.Dimension.MinCoercible.min(dp: Dp): ConstraintSetBuilderScope.Dimension

Sets the lower bound of the current Dimension to a fixed dp value.

percent

fun percent(percent: Float): ConstraintSetBuilderScope.Dimension

A Dimension that is a percent of the parent in the corresponding direction.

tag

fun tag(tag: Any): ConstraintSetBuilderScope.ConstrainedLayoutReference

Creates a reference corresponding to the constraint layout children with a specific tag, which can be used to define the constraints to be imposed to those children.

value

fun value(dp: Dp): ConstraintSetBuilderScope.Dimension.Coercible

Creates a Dimension representing a suggested dp size. The requested size will be respected unless the constraints in the ConstraintSet do not allow it. The min and max bounds will be respected regardless of the constraints in the ConstraintSet. To make the value fixed (respected regardless the ConstraintSet), valueFixed should be used instead.

valueFixed

fun valueFixed(dp: Dp): ConstraintSetBuilderScope.Dimension

Creates a Dimension representing a fixed dp size. The size will not change according to the constraints in the ConstraintSet.

Properties

maxWrap

val ConstraintSetBuilderScope.Dimension.Coercible.maxWrap: ConstraintSetBuilderScope.Dimension.MinCoercible

Sets the upper bound of the current Dimension to be the Wrap size of the child.

maxWrap

val ConstraintSetBuilderScope.Dimension.MaxCoercible.maxWrap: ConstraintSetBuilderScope.Dimension

Sets the upper bound of the current Dimension to be the Wrap size of the child.

minWrap

val ConstraintSetBuilderScope.Dimension.Coercible.minWrap: ConstraintSetBuilderScope.Dimension.MaxCoercible

Sets the lower bound of the current Dimension to be the Wrap size of the child.

minWrap

val ConstraintSetBuilderScope.Dimension.MinCoercible.minWrap: ConstraintSetBuilderScope.Dimension

Sets the lower bound of the current Dimension to be the Wrap size of the child.

parent

val parent: ConstraintSetBuilderScope.ConstrainedLayoutReference

Reference to the ConstraintLayout itself, which can be used to specify constraints between itself and its children.

spread

val spread: ConstraintSetBuilderScope.Dimension

A Dimension that spreads to match constraints.

wrap

val wrap: ConstraintSetBuilderScope.Dimension.Coercible

A Dimension with suggested wrap content behavior. The wrap content size will be respected unless the constraints in the ConstraintSet do not allow it. To make the value fixed (respected regardless the ConstraintSet), wrapFixed should be used instead.

wrapFixed

val wrapFixed: ConstraintSetBuilderScope.Dimension

A Dimension with fixed wrap content behavior. The size will not change according to the constraints in the ConstraintSet.