MutableDimensions

data class MutableDimensions(var startDp: Float, var topDp: Float, var endDp: Float, var bottomDp: Float) : Dimensions

An implementation of Dimensions whose every property is mutable.

Constructors

Link copied to clipboard
constructor(horizontalDp: Float, verticalDp: Float)
constructor(startDp: Float, topDp: Float, endDp: Float, bottomDp: Float)

Properties

Link copied to clipboard
open override var bottomDp: Float

The value for the bottom edge in the dp unit.

Link copied to clipboard
open override var endDp: Float

The value for the end edge in the dp unit.

Link copied to clipboard

The sum of startDp and endDp.

Link copied to clipboard
open override var startDp: Float

The value for the start edge in the dp unit.

Link copied to clipboard
open override var topDp: Float

The value for the top edge in the dp unit.

Link copied to clipboard

The sum of topDp and bottomDp.

Functions

Link copied to clipboard
fun clear()

Sets all coordinates to 0.

Link copied to clipboard

Updates these MutableDimensions to match the provided Dimensions.

Sets a common value for each coordinate.

fun set(startDp: Float = 0.0f, topDp: Float = 0.0f, endDp: Float = 0.0f, bottomDp: Float = 0.0f): MutableDimensions

Updates the coordinates to the provided values.

Link copied to clipboard

Evenly distributes the provided measurement between startDp and endDp.

Link copied to clipboard

Evenly distributes the provided measurement between topDp and bottomDp.