DimensionBuilders

Added in 1.0.0
Deprecated in 1.2.0

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

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

public final class DimensionBuilders.SpProp

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 methods

static @NonNull DimensionBuilders.DegreesProp
degrees(float valueDegrees)

Shortcut for building an DegreesProp using a measurement in degrees.

static @NonNull DimensionBuilders.DpProp
dp(@Dimension(unit = 0) float valueDp)

Shortcut for building a DpProp using a measurement in DP.

static @NonNull DimensionBuilders.EmProp
em(float valueEm)

Shortcut for building a EmProp using a measurement in EM.

static @NonNull DimensionBuilders.EmProp
em(int valueEm)

Shortcut for building a EmProp using a measurement in EM.

static @NonNull DimensionBuilders.ExpandedDimensionProp

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

static @NonNull DimensionBuilders.SpProp
sp(@Dimension(unit = 2) float valueSp)

Shortcut for building a SpProp using a measurement in SP.

static @NonNull DimensionBuilders.WrappedDimensionProp

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

Public methods

degrees

Added in 1.0.0
Deprecated in 1.2.0
public static @NonNull DimensionBuilders.DegreesProp degrees(float valueDegrees)

Shortcut for building an DegreesProp using a measurement in degrees.

dp

Added in 1.0.0
Deprecated in 1.2.0
public static @NonNull DimensionBuilders.DpProp dp(@Dimension(unit = 0) float valueDp)

Shortcut for building a DpProp using a measurement in DP.

em

Added in 1.1.0
Deprecated in 1.2.0
public static @NonNull DimensionBuilders.EmProp em(float valueEm)

Shortcut for building a EmProp using a measurement in EM.

em

Added in 1.0.0
Deprecated in 1.2.0
public static @NonNull DimensionBuilders.EmProp em(int valueEm)

Shortcut for building a EmProp using a measurement in EM.

expand

Added in 1.0.0
Deprecated in 1.2.0
public static @NonNull DimensionBuilders.ExpandedDimensionProp expand()

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
public static @NonNull DimensionBuilders.SpProp sp(@Dimension(unit = 2) float valueSp)

Shortcut for building a SpProp using a measurement in SP.

wrap

Added in 1.0.0
Deprecated in 1.2.0
public static @NonNull DimensionBuilders.WrappedDimensionProp wrap()

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