PxInverse

@Immutable inline class PxInverse : Comparable<PxInverse>
kotlin.Any
   ↳ androidx.ui.core.PxInverse

Holds a unit of an inverse dimensions, such as 1.px / (2.value * 3.px). PxSquared, PxCubed, and PxInverse are used primarily for Px calculations to ensure resulting units are as expected. Many times, Px 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.px / (2.value * 3.px).

Public methods

operator Int

Support comparing PxInverse with comparison operators.

operator PxInverse
div(other: Float)

Divide a PxInverse by a scalar.

operator PxInverse
minus(dimension: PxInverse)

Subtract a PxInverse from another one.

operator PxInverse
plus(dimension: PxInverse)

Add two PxInverse together.

operator PxInverse
times(other: Float)

Multiply by a scalar to get a PxInverse result.

operator Float
times(other: Px)

Multiply by a Px to get a scalar result.

operator Px
times(other: PxSquared)

Multiply by a PxSquared to get a Px result.

operator PxSquared
times(other: PxCubed)

Multiply by a PxCubed to get a PxSquared result.

String

Properties

Float

Public constructors

<init>

PxInverse(value: Float)

Holds a unit of an inverse dimensions, such as 1.px / (2.value * 3.px). PxSquared, PxCubed, and PxInverse are used primarily for Px calculations to ensure resulting units are as expected. Many times, Px 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

inline operator fun compareTo(other: PxInverse): Int

Support comparing PxInverse with comparison operators.

div

inline operator fun div(other: Float): PxInverse

Divide a PxInverse by a scalar.

minus

inline operator fun minus(dimension: PxInverse): PxInverse

Subtract a PxInverse from another one.

plus

inline operator fun plus(dimension: PxInverse): PxInverse

Add two PxInverse together.

times

inline operator fun times(other: Float): PxInverse

Multiply by a scalar to get a PxInverse result.

times

inline operator fun times(other: Px): Float

Multiply by a Px to get a scalar result.

times

inline operator fun times(other: PxSquared): Px

Multiply by a PxSquared to get a Px result.

times

inline operator fun times(other: PxCubed): PxSquared

Multiply by a PxCubed to get a PxSquared result.

toString

fun toString(): String

Properties

value

val value: Float