DimensionBuilders
class DimensionBuilders
Builders for dimensions for layout elements.
Summary
Nested types |
|---|
@RequiresSchemaVersion(major = 1, minor = 500)Interface defining the length of an arc element. |
@RequiresSchemaVersion(major = 1, minor = 200)A type for specifying layout constraints when using |
|
Builder for |
@RequiresSchemaVersion(major = 1, minor = 400)Provide a position representation proportional to the bounding box width/height. |
|
Builder for |
@RequiresSchemaVersion(major = 1, minor = 0)Interface defining a dimension that can be applied to a container. |
@RequiresSchemaVersion(major = 1, minor = 0)A type for angular dimensions, measured in degrees. |
|
Builder for |
@RequiresSchemaVersion(major = 1, minor = 0)A type for linear dimensions, measured in dp. |
|
Builder for |
@RequiresSchemaVersion(major = 1, minor = 0)A type for font spacing, measured in em. |
|
Builder for |
@RequiresSchemaVersion(major = 1, minor = 0)A type for a dimension that fills all the space it can (i.e. MATCH_PARENT in Android parlance). |
|
Builder for |
@RequiresSchemaVersion(major = 1, minor = 0)Interface defining a dimension that can be applied to a |
@RequiresSchemaVersion(major = 1, minor = 200)A type for specifying horizontal layout constraints when using |
class DimensionBuilders.HorizontalLayoutConstraint.Builder : DimensionBuilders.DpPropLayoutConstraint.BuilderBuilder for |
@RequiresSchemaVersion(major = 1, minor = 0)Interface defining a dimension that can be applied to an image. |
@RequiresSchemaVersion(major = 1, minor = 500)Interface defining a dimension that represents an offset relative to the element's position. |
@RequiresSchemaVersion(major = 1, minor = 400)Interface defining a dimension that can be applied to a pivot location for scale and rotate transformations. |
@RequiresSchemaVersion(major = 1, minor = 0)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 |
@RequiresSchemaVersion(major = 1, minor = 0)A type for font sizes, measured in sp. |
|
Builder for |
@RequiresSchemaVersion(major = 1, minor = 0)Interface defining a dimension that can be applied to a spacer. |
@RequiresSchemaVersion(major = 1, minor = 200)A type for specifying vertical layout constraints when using |
class DimensionBuilders.VerticalLayoutConstraint.Builder : DimensionBuilders.DpPropLayoutConstraint.BuilderBuilder for |
@RequiresSchemaVersion(major = 1, minor = 0)A type for a dimension that sizes itself to the size of its children (i.e. WRAP_CONTENT in Android parlance). |
|
Builder for |
Public functions |
|
|---|---|
java-static DimensionBuilders.DegreesProp |
@RequiresSchemaVersion(major = 1, minor = 0)Shortcut for building an |
java-static DimensionBuilders.DpProp |
@RequiresSchemaVersion(major = 1, minor = 0)Shortcut for building a |
java-static DimensionBuilders.EmProp |
@RequiresSchemaVersion(major = 1, minor = 0)Shortcut for building a |
java-static DimensionBuilders.EmProp |
@RequiresSchemaVersion(major = 1, minor = 0)Shortcut for building a |
java-static DimensionBuilders.ExpandedDimensionProp |
@RequiresSchemaVersion(major = 1, minor = 0)Shortcut for building an |
java-static DimensionBuilders.SpProp |
@RequiresSchemaVersion(major = 1, minor = 0)Shortcut for building a |
java-static DimensionBuilders.ExpandedDimensionProp |
@RequiresSchemaVersion(major = 1, minor = 300)Shortcut for building an |
java-static DimensionBuilders.WrappedDimensionProp |
@RequiresSchemaVersion(major = 1, minor = 0)Shortcut for building an |
Public functions
degrees
@RequiresSchemaVersion(major = 1, minor = 0)
java-static fun degrees(valueDegrees: Float): DimensionBuilders.DegreesProp
Shortcut for building an DegreesProp using a measurement in degrees.
dp
@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
@RequiresSchemaVersion(major = 1, minor = 0)
java-static fun em(valueEm: Float): DimensionBuilders.EmProp
Shortcut for building a EmProp using a measurement in EM.
em
@RequiresSchemaVersion(major = 1, minor = 0)
java-static fun em(valueEm: Int): DimensionBuilders.EmProp
Shortcut for building a EmProp using a measurement in EM.
expand
@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
@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
@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 androidx.wear.protolayout.LayoutElementBuilders.Row or the height of children of a androidx.wear.protolayout.LayoutElementBuilders.Column, 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
@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.