DpOffset
-
Cmn
value class DpOffset
A two-dimensional offset using Dp for units.
To create a DpOffset, call the top-level function that accepts an x/y pair of coordinates:
val offset = DpOffset(x, y)
The primary constructor of DpOffset is intended to be used with the packedValue property to allow storing offsets in arrays or collections of primitives without boxing.
Summary
Nested types |
|---|
object DpOffset.Companion |
Public functions |
||
|---|---|---|
DpOffset |
Returns a copy of this |
Cmn
|
operator DpOffset |
Subtract a |
Cmn
|
operator DpOffset |
Add a |
Cmn
|
open String |
toString() |
Cmn
|
Public properties |
||
|---|---|---|
Long |
Cmn
|
|
Dp |
The horizontal aspect of the offset in |
Cmn
|
Dp |
The vertical aspect of the offset in |
Cmn
|
Extension functions |
||
|---|---|---|
inline DpOffset |
DpOffset.takeOrElse(block: () -> DpOffset)If this |
Cmn
|
Extension properties |
||
|---|---|---|
Boolean |
|
Cmn
|
Boolean |
|
Cmn
|
Public properties
packedValue
val packedValue: Long
Long value encoding the x and y components of the DpOffset. Encoded values can be obtained by using the packedValue property of existing DpOffset instances.
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.