DimensionBuilders


class DimensionBuilders


Builders for dimensions for layout elements.

Summary

Nested types

A type for specifying layout constraints when using DegreesProp on a data bindable layout element.

Builder for AngularLayoutConstraint.

Provide a position representation proportional to the bounding box width/height.

Builder for BoundingBoxRatio.

@RequiresSchemaVersion(major = 1, minor = 0)
interface DimensionBuilders.ContainerDimension

Interface defining a dimension that can be applied to a container.

@RequiresSchemaVersion(major = 1, minor = 0)
class DimensionBuilders.DegreesProp

A type for angular dimensions, measured in degrees.

Builder for DegreesProp

A type for linear dimensions, measured in dp.

Builder for DpProp.

@RequiresSchemaVersion(major = 1, minor = 0)
class DimensionBuilders.EmProp

A type for font spacing, measured in em.

Builder for EmProp

A type for a dimension that fills all the space it can (i.e. MATCH_PARENT in Android parlance).

Builder for ExpandedDimensionProp.

Interface defining a dimension that can be applied to a element.

A type for specifying horizontal layout constraints when using DpProp on a data bindable layout element.

Builder for HorizontalLayoutConstraint.

@RequiresSchemaVersion(major = 1, minor = 0)
interface DimensionBuilders.ImageDimension

Interface defining a dimension that can be applied to an image.

@RequiresSchemaVersion(major = 1, minor = 400)
interface DimensionBuilders.PivotDimension

Interface defining a dimension that can be applied to a pivot location for scale and rotate transformations.

A type for a dimension that scales itself proportionally to another dimension such that the aspect ratio defined by the given width and height values is preserved.

Builder for ProportionalDimensionProp.

@RequiresSchemaVersion(major = 1, minor = 0)
class DimensionBuilders.SpProp

A type for font sizes, measured in sp.

Builder for SpProp

@RequiresSchemaVersion(major = 1, minor = 0)
interface DimensionBuilders.SpacerDimension

Interface defining a dimension that can be applied to a spacer.

A type for specifying vertical layout constraints when using DpProp on a data bindable layout element.

Builder for VerticalLayoutConstraint.

A type for a dimension that sizes itself to the size of its children (i.e. WRAP_CONTENT in Android parlance).

Builder for WrappedDimensionProp.

Public functions

java-static DimensionBuilders.DegreesProp
@RequiresSchemaVersion(major = 1, minor = 0)
degrees(valueDegrees: Float)

Shortcut for building an DegreesProp using a measurement in degrees.

java-static DimensionBuilders.DpProp
@RequiresSchemaVersion(major = 1, minor = 0)
dp(valueDp: @Dimension(unit = 0) Float)

Shortcut for building a DpProp using a measurement in DP.

java-static DimensionBuilders.EmProp
@RequiresSchemaVersion(major = 1, minor = 0)
em(valueEm: Float)

Shortcut for building a EmProp using a measurement in EM.

java-static DimensionBuilders.EmProp
@RequiresSchemaVersion(major = 1, minor = 0)
em(valueEm: Int)

Shortcut for building a EmProp using a measurement in EM.

java-static DimensionBuilders.ExpandedDimensionProp
@RequiresSchemaVersion(major = 1, minor = 0)
expand()

Shortcut for building an ExpandedDimensionProp that will expand to the size of its parent.

java-static DimensionBuilders.SpProp
@RequiresSchemaVersion(major = 1, minor = 0)
sp(valueSp: @Dimension(unit = 2) Float)

Shortcut for building a SpProp using a measurement in SP.

java-static DimensionBuilders.ExpandedDimensionProp
@RequiresSchemaVersion(major = 1, minor = 300)
weight(weight: @FloatRange(from = 0.0) Float)

Shortcut for building an ExpandedDimensionProp with weight (a dimensionless scalar value).

java-static DimensionBuilders.WrappedDimensionProp
@RequiresSchemaVersion(major = 1, minor = 0)
wrap()

Shortcut for building an WrappedDimensionProp that will shrink to the size of its children.

Public functions

degrees

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
java-static fun degrees(valueDegrees: Float): DimensionBuilders.DegreesProp

Shortcut for building an DegreesProp using a measurement in degrees.

dp

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
java-static fun dp(valueDp: @Dimension(unit = 0) Float): DimensionBuilders.DpProp

Shortcut for building a DpProp using a measurement in DP.

em

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
java-static fun em(valueEm: Float): DimensionBuilders.EmProp

Shortcut for building a EmProp using a measurement in EM.

em

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
java-static fun em(valueEm: Int): DimensionBuilders.EmProp

Shortcut for building a EmProp using a measurement in EM.

expand

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
java-static fun expand(): DimensionBuilders.ExpandedDimensionProp

Shortcut for building an ExpandedDimensionProp that will expand to the size of its parent.

sp

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
java-static fun sp(valueSp: @Dimension(unit = 2) Float): DimensionBuilders.SpProp

Shortcut for building a SpProp using a measurement in SP.

weight

Added in 1.1.0
@RequiresSchemaVersion(major = 1, minor = 300)
java-static fun weight(weight: @FloatRange(from = 0.0) Float): DimensionBuilders.ExpandedDimensionProp

Shortcut for building an ExpandedDimensionProp with weight (a dimensionless scalar value).

This will only affect the width of children of a or the height of children of a , otherwise it will expand to the size of its parent. Where applicable, the remaining space in the width or height left from the children with fixed or wrapped dimension will be proportionally split across children with expand dimension, meaning that the width or height of the element is proportional to the sum of the weights of its weighted siblings. For the siblings that don't have weight set, but they are expanded, defaults to 1.

wrap

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
java-static fun wrap(): DimensionBuilders.WrappedDimensionProp

Shortcut for building an WrappedDimensionProp that will shrink to the size of its children.