<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
value class DpSize internal constructor(@PublishedApi internal val packedValue: Long)
```


A two-dimensional Size using `Dp` for units


## Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
val width: Dp
```


The horizontal aspect of the Size in `Dp`



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val height: Dp
```


The vertical aspect of the Size in `Dp`



## Functions



<h2 id="copy-width-height">copy</h2>

```kotlin
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




<hr class="docs-overload-divider">


<h2 id="minus-other">minus</h2>

```kotlin
operator fun minus(other: DpSize) =
        DpSize(packFloats((width - other.width).value, (height - other.height).value))
```


Subtract a `DpSize` from another one.




<hr class="docs-overload-divider">


<h2 id="plus-other">plus</h2>

```kotlin
operator fun plus(other: DpSize) =
        DpSize(packFloats((width + other.width).value, (height + other.height).value))
```


Add a `DpSize` to another one.




<hr class="docs-overload-divider">


<h2 id="component1">component1</h2>

```kotlin
inline operator fun component1(): Dp
```



<hr class="docs-overload-divider">


<h2 id="component2">component2</h2>

```kotlin
inline operator fun component2(): Dp
```



<hr class="docs-overload-divider">


<h2 id="times-other">times</h2>

```kotlin
operator fun times(other: Int): DpSize
```



<hr class="docs-overload-divider">


<h2 id="times-other-2">times</h2>

```kotlin
operator fun times(other: Float): DpSize
```



<hr class="docs-overload-divider">


<h2 id="div-other">div</h2>

```kotlin
operator fun div(other: Int): DpSize
```



<hr class="docs-overload-divider">


<h2 id="div-other-2">div</h2>

```kotlin
operator fun div(other: Float): DpSize
```

## Companion Object

#### Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
val Zero = DpSize(0x0L)
```


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



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val Unspecified = DpSize(0x7fc00000_7fc00000L)
```


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.