Google is committed to advancing racial equity for Black communities. See how.

Dimension

interface Dimension
androidx.ui.layout.Dimension

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

Summary

Nested classes
abstract

A Dimension that can be assigned both min and max bounds.

abstract

A Dimension that can be assigned a max bound.

abstract

A Dimension that can be assigned a min bound.

Companion functions
Dimension
percent(percent: Float)

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

Dimension.Coercible

Creates a Dimension representing a suggested dp size.

Dimension
value(dp: Dp)

Creates a Dimension representing a fixed dp size.

Companion properties
Dimension

A Dimension that spreads to match constraints.

Dimension.Coercible

A Dimension with suggested wrap content behavior.

Dimension

A Dimension with fixed wrap content behavior.

Companion functions

percent

fun percent(percent: Float): Dimension

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

preferredValue

fun preferredValue(dp: Dp): 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), value should be used instead.

value

fun value(dp: Dp): Dimension

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

Companion properties

fillToConstraints

val fillToConstraints: Dimension

A Dimension that spreads to match constraints. Links should be specified from both sides corresponding to this dimension, in order for this to work.

preferredWrapContent

val preferredWrapContent: 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), wrapContent should be used instead.

wrapContent

val wrapContent: Dimension

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