DimensionBuilders

public final class DimensionBuilders


Builders for dimensions for layout elements.

Summary

Nested types

DimensionBuilders.ContainerDimension

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

DimensionBuilders.ContainerDimension.Builder

Builder to create ContainerDimension objects.

DimensionBuilders.DegreesProp

A type for angular dimensions, measured in degrees.

DimensionBuilders.DegreesProp.Builder

Builder for DegreesProp

DimensionBuilders.DpProp

A type for linear dimensions, measured in dp.

DimensionBuilders.DpProp.Builder

Builder for DpProp.

DimensionBuilders.EmProp

A type for font spacing, measured in em.

DimensionBuilders.EmProp.Builder

Builder for EmProp

DimensionBuilders.ExpandedDimensionProp

A type for a dimension that fills all the space it can (i.e.

DimensionBuilders.ExpandedDimensionProp.Builder

Builder for ExpandedDimensionProp.

DimensionBuilders.ImageDimension

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

DimensionBuilders.ImageDimension.Builder

Builder to create ImageDimension objects.

DimensionBuilders.ProportionalDimensionProp

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.

DimensionBuilders.ProportionalDimensionProp.Builder

Builder for ProportionalDimensionProp.

DimensionBuilders.SpProp

A type for font sizes, measured in sp.

DimensionBuilders.SpProp.Builder

Builder for SpProp

DimensionBuilders.SpacerDimension

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

DimensionBuilders.SpacerDimension.Builder

Builder to create SpacerDimension objects.

DimensionBuilders.WrappedDimensionProp

A type for a dimension that sizes itself to the size of its children (i.e.

DimensionBuilders.WrappedDimensionProp.Builder

Builder for WrappedDimensionProp.

Public methods

static @NonNull DimensionBuilders.DegreesProp
degrees(@NonNull float valueDegrees)

Shortcut for building an DegreesProp using a measurement in degrees.

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

Shortcut for building a DpProp using a measurement in DP.

static @NonNull DimensionBuilders.EmProp
em(@NonNull 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 = "") @NonNull 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

@NonNull
public static DimensionBuilders.DegreesProp degrees(@NonNull float valueDegrees)

Shortcut for building an DegreesProp using a measurement in degrees.

dp

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

Shortcut for building a DpProp using a measurement in DP.

em

@NonNull
public static DimensionBuilders.EmProp em(@NonNull int valueEm)

Shortcut for building a EmProp using a measurement in EM.

expand

@NonNull
public static DimensionBuilders.ExpandedDimensionProp expand()

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

sp

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

Shortcut for building a SpProp using a measurement in SP.

wrap

@NonNull
public static DimensionBuilders.WrappedDimensionProp wrap()

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