Google is committed to advancing racial equity for Black communities. See how.

Position

@Immutable inline class Position
kotlin.Any
   ↳ androidx.compose.ui.unit.Position

A two-dimensional position using Dp for units

Summary

Public constructors
<init>(packedValue: Long)

A two-dimensional position using Dp for units

Public methods
Position
copy(x: Dp = this.x, y: Dp = this.y)

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

operator Position
minus(other: Position)

Subtract a Position from another one.

operator Position
plus(other: Position)

Add a Position to another one.

String

Extension functions
From androidx.compose.ui.unit
Dp

The magnitude of the offset represented by this Position.

Properties
Dp

The horizontal aspect of the position in Dp

Dp

The vertical aspect of the position in Dp

Public constructors

<init>

Position(packedValue: Long)

A two-dimensional position using Dp for units

Public methods

copy

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

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

minus

@Stable inline operator fun minus(other: Position): Position

Subtract a Position from another one.

plus

@Stable inline operator fun plus(other: Position): Position

Add a Position to another one.

toString

@Stable fun toString(): String

Properties

x

@Stable val x: Dp

The horizontal aspect of the position in Dp

y

@Stable val y: Dp

The vertical aspect of the position in Dp