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

DpInverse

`@Immutable inline class DpInverse : Comparable<DpInverse>`
 kotlin.Any ↳ androidx.compose.ui.unit.DpInverse

Holds a unit of an inverse dimensions, such as `1.dp / (2.value * 3.dp)`. DpSquared, DpCubed, and DpInverse are used primarily for Dp calculations to ensure resulting units are as expected. Many times, Dp calculations use scalars to determine the final dimension during calculation: val width = oldWidth * stretchAmount Other times, it is useful to do intermediate calculations with Dimensions directly: val width = oldWidth * newTotalWidth / oldTotalWidth

Summary

Public constructors
`<init>(value: Float)`

Holds a unit of an inverse dimensions, such as `1.dp / (2.value * 3.dp)`.

Public methods
operator Int
`compareTo(other: DpInverse)`

Support comparing DpInverse with comparison operators.

operator DpInverse
`div(other: Float)`

Divide a DpInverse by a scalar.

operator DpInverse
`minus(dimension: DpInverse)`

Subtract a DpInverse from another one.

operator DpInverse
`plus(dimension: DpInverse)`

operator DpInverse
`times(other: Float)`

Multiply by a scalar to get a DpInverse result.

operator Float
`times(other: Dp)`

Multiply by a Dp to get a scalar result.

operator Dp
`times(other: DpSquared)`

Multiply by a DpSquared to get a Dp result.

operator DpSquared
`times(other: DpCubed)`

Multiply by a DpCubed to get a DpSquared result.

String
`toString()`

Inherited extension functions
From androidx.core.util
 infix Range `T.rangeTo(that: T)` Creates a range from this Comparable value to that.
Properties
Float
`value`

Public constructors

<init>

`DpInverse(value: Float)`

Holds a unit of an inverse dimensions, such as `1.dp / (2.value * 3.dp)`. DpSquared, DpCubed, and DpInverse are used primarily for Dp calculations to ensure resulting units are as expected. Many times, Dp calculations use scalars to determine the final dimension during calculation: val width = oldWidth * stretchAmount Other times, it is useful to do intermediate calculations with Dimensions directly: val width = oldWidth * newTotalWidth / oldTotalWidth

Public methods

compareTo

`@Stable operator fun compareTo(other: DpInverse): Int`

Support comparing DpInverse with comparison operators.

div

`@Stable inline operator fun div(other: Float): DpInverse`

Divide a DpInverse by a scalar.

minus

`@Stable inline operator fun minus(dimension: DpInverse): DpInverse`

Subtract a DpInverse from another one.

plus

`@Stable inline operator fun plus(dimension: DpInverse): DpInverse`

times

`@Stable inline operator fun times(other: Float): DpInverse`

Multiply by a scalar to get a DpInverse result.

times

`@Stable inline operator fun times(other: Dp): Float`

Multiply by a Dp to get a scalar result.

times

`@Stable inline operator fun times(other: DpSquared): Dp`

Multiply by a DpSquared to get a Dp result.

times

`@Stable inline operator fun times(other: DpCubed): DpSquared`

Multiply by a DpCubed to get a DpSquared result.

toString

`@Stable fun toString(): String`

Properties

value

`val value: Float`