DpOffset


A two-dimensional offset using Dp for units

Summary

Nested types

Public companion properties

DpOffset

Represents an offset whose x and y are unspecified.

Cmn
DpOffset

A DpOffset with 0 DP x and 0 DP y values.

Cmn

Public functions

DpOffset
copy(x: Dp, y: Dp)

Returns a copy of this DpOffset instance optionally overriding the x or y parameter

Cmn
inline operator DpOffset
minus(other: DpOffset)

Subtract a DpOffset from another one.

Cmn
inline operator DpOffset
plus(other: DpOffset)

Add a DpOffset to another one.

Cmn
open String
Cmn

Public properties

Dp

The horizontal aspect of the offset in Dp

Cmn
Dp

The vertical aspect of the offset in Dp

Cmn

Extension functions

inline DpOffset

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

Cmn

Extension properties

Boolean

false when this is DpOffset.Unspecified.

Cmn
Boolean

true when this is DpOffset.Unspecified.

Cmn

Public companion properties

Unspecified

val UnspecifiedDpOffset

Represents an offset whose x and y are unspecified. This is usually a replacement for null when a primitive value is desired. Access to x or y on an unspecified offset is not allowed.

Zero

val ZeroDpOffset

A DpOffset with 0 DP x and 0 DP y values.

Public functions

copy

fun copy(x: Dp = this.x, y: Dp = this.y): DpOffset

Returns a copy of this DpOffset instance optionally overriding the x or y parameter

minus

inline operator fun minus(other: DpOffset): DpOffset

Subtract a DpOffset from another one.

plus

inline operator fun plus(other: DpOffset): DpOffset

Add a DpOffset to another one.

toString

open fun toString(): String

Public properties

x

val xDp

The horizontal aspect of the offset in Dp

y

val yDp

The vertical aspect of the offset in Dp

Extension functions

takeOrElse

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

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

Extension properties

isSpecified

val DpOffset.isSpecifiedBoolean

false when this is DpOffset.Unspecified.

isUnspecified

val DpOffset.isUnspecifiedBoolean

true when this is DpOffset.Unspecified.