Class

DpSize

A two-dimensional Size using Dp for units

Source set: Common
public class DpSize internal constructor(@PublishedApi internal val packedValue: Long)

A two-dimensional Size using Dp for units

Properties

width

Source set: Common
public val width: Dp

The horizontal aspect of the Size in Dp

height

Source set: Common
public val height: Dp

The vertical aspect of the Size in Dp

Functions

copy

Source set: Common
public 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

minus

Source set: Common
public operator fun minus(other: DpSize): DpSize

Subtract a DpSize from another one.

plus

Source set: Common
public operator fun plus(other: DpSize): DpSize

Add a DpSize to another one.

component1

Source set: Common
@Stable public inline operator fun component1(): Dp

component2

Source set: Common
@Stable public inline operator fun component2(): Dp

times

Source set: Common
public operator fun times(other: Int): DpSize

times

Source set: Common
public operator fun times(other: Float): DpSize

div

Source set: Common
public operator fun div(other: Int): DpSize

div

Source set: Common
public operator fun div(other: Float): DpSize

Members

Companion

Source set: Common
public companion object

Properties

Zero

Source set: Common
public val Zero: DpSize

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

Unspecified

Source set: Common
public val Unspecified: DpSize

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.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: