DimensionBuilders

Added in 1.0.0
Deprecated in 1.2.0

class DimensionBuilders


Builders for dimensions for layout elements.

Summary

Nested types

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

Builder to create ContainerDimension objects.

A type for angular dimensions, measured in degrees.

Builder for DegreesProp

A type for linear dimensions, measured in dp.

Builder for DpProp.

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

Builder to create ImageDimension objects.

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.

A type for font sizes, measured in sp.

Builder for SpProp

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

Builder to create SpacerDimension objects.

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
degrees(valueDegrees: Float)

Shortcut for building an DegreesProp using a measurement in degrees.

java-static DimensionBuilders.DpProp
dp(valueDp: @Dimension(unit = 0) Float)

Shortcut for building a DpProp using a measurement in DP.

java-static DimensionBuilders.EmProp
em(valueEm: Float)

Shortcut for building a EmProp using a measurement in EM.

java-static DimensionBuilders.EmProp
em(valueEm: Int)

Shortcut for building a EmProp using a measurement in EM.

java-static DimensionBuilders.ExpandedDimensionProp

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

java-static DimensionBuilders.SpProp
sp(valueSp: @Dimension(unit = 2) Float)

Shortcut for building a SpProp using a measurement in SP.

java-static DimensionBuilders.WrappedDimensionProp

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

Public functions

degrees

Added in 1.0.0
Deprecated in 1.2.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
Deprecated in 1.2.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.1.0
Deprecated in 1.2.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
Deprecated in 1.2.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
Deprecated in 1.2.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
Deprecated in 1.2.0
java-static fun sp(valueSp: @Dimension(unit = 2) Float): DimensionBuilders.SpProp

Shortcut for building a SpProp using a measurement in SP.

wrap

Added in 1.0.0
Deprecated in 1.2.0
java-static fun wrap(): DimensionBuilders.WrappedDimensionProp

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