DpSize


A two-dimensional Size using Dp for units

Summary

Public companion properties

DpSize

A size whose width and height are unspecified.

Cmn
DpSize

A DpSize with 0 DP width and 0 DP height values.

Cmn

Public functions

inline operator Dp
Cmn
inline operator Dp
Cmn
DpSize
copy(width: Dp, height: Dp)

Returns a copy of this DpSize instance optionally overriding the width or height parameter

Cmn
operator DpSize
div(other: Float)
Cmn
operator DpSize
div(other: Int)
Cmn
operator DpSize
minus(other: DpSize)

Subtract a DpSize from another one.

Cmn
operator DpSize
plus(other: DpSize)

Add a DpSize to another one.

Cmn
operator DpSize
times(other: Float)
Cmn
operator DpSize
times(other: Int)
Cmn
open String
Cmn

Public properties

Dp

The vertical aspect of the Size in Dp

Cmn
Dp

The horizontal aspect of the Size in Dp

Cmn

Extension functions

inline DpSize
DpSize.takeOrElse(block: () -> DpSize)

If this DpSize isSpecified then this is returned, otherwise block is executed and its result is returned.

Cmn

Extension properties

DpOffset

Returns the DpOffset of the center of the rect from the point of 0, 0 with this DpSize.

Cmn
Boolean

false when this is DpSize.Unspecified.

Cmn
Boolean

true when this is DpSize.Unspecified.

Cmn

Public companion properties

Unspecified

val UnspecifiedDpSize

A size whose width and height are unspecified. This is usually a replacement for null when a primitive value is desired. Access to width or height on an unspecified size is not allowed.

Zero

val ZeroDpSize

A DpSize with 0 DP width and 0 DP height values.

Public functions

component1

inline operator fun component1(): Dp

component2

inline operator fun component2(): Dp

copy

fun copy(width: Dp = this.width, height: Dp = this.height): DpSize

Returns a copy of this DpSize instance optionally overriding the width or height parameter

div

operator fun div(other: Float): DpSize

div

operator fun div(other: Int): DpSize

minus

operator fun minus(other: DpSize): DpSize

Subtract a DpSize from another one.

plus

operator fun plus(other: DpSize): DpSize

Add a DpSize to another one.

times

operator fun times(other: Float): DpSize

times

operator fun times(other: Int): DpSize

toString

open fun toString(): String

Public properties

height

val heightDp

The vertical aspect of the Size in Dp

width

val widthDp

The horizontal aspect of the Size in Dp

Extension functions

takeOrElse

inline fun DpSize.takeOrElse(block: () -> DpSize): DpSize

If this DpSize isSpecified then this is returned, otherwise block is executed and its result is returned.

Extension properties

val DpSize.centerDpOffset

Returns the DpOffset of the center of the rect from the point of 0, 0 with this DpSize.

isSpecified

val DpSize.isSpecifiedBoolean

false when this is DpSize.Unspecified.

isUnspecified

val DpSize.isUnspecifiedBoolean

true when this is DpSize.Unspecified.