The second Android 11 Developer Preview is now available, test it out and share your feedback.

ConstraintSetBuilderScope

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

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

Summary

Nested classes

The style of a horizontal or vertical chain.

Anchor corresponding to the baseline of a ConstraintLayout child.

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.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.

Properties

ConstraintSetBuilderScope.ConstrainedLayoutReference

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

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.

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.

Properties

parent

val parent: ConstraintSetBuilderScope.ConstrainedLayoutReference

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