IntPx

@Immutable data class IntPx : Comparable<IntPx>
kotlin.Any
   ↳ androidx.ui.core.IntPx

Dimension value represented in whole pixels (px). Layout and constraints operate on Int pixels. Operations with an Infinity IntPx result in Infinity.

Summary

Public constructors

<init>(value: Int)

Dimension value represented in whole pixels (px).

Public methods

operator Int
compareTo(other: IntPx)

Support comparing Dimensions with comparison operators.

operator Int
compareTo(other: Px)

Compares this IntPx to another Px

operator IntPx
div(other: Float)

Divide a IntPx by a scalar and return the rounded result as an IntPx.

operator IntPx
div(other: Double)

Divide a IntPx by a scalar and return the rounded result as an IntPx.

operator IntPx
div(other: Int)

Divide a IntPx by a scalar and return the rounded result as an IntPx.

operator IntPx
minus(other: IntPx)

Subtract a IntPx from another one.

operator IntPx
plus(other: IntPx)

Add two IntPxs together.

operator IntPx
rem(other: Int)

Returns the remainder of the IntPx when dividing by an integer.

operator IntPx
times(other: Float)

Multiply a IntPx by a scalar and round the result to an IntPx.

operator IntPx
times(other: Double)

Multiply a IntPx by a scalar and round the result to an IntPx

operator IntPx
times(other: Int)

Multiply a IntPx by a scalar and result in an IntPx

String

operator IntPx

This is the same as multiplying the IntPx by -1.

Extension functions

From androidx.ui.core
IntPx
IntPx.coerceAtLeast(minimumValue: IntPx)

Ensures that this value is not less than the specified minimumValue.

IntPx
IntPx.coerceAtMost(maximumValue: IntPx)

Ensures that this value is not greater than the specified maximumValue.

IntPx
IntPx.coerceIn(minimumValue: IntPx, maximumValue: IntPx)

Ensures that this value lies in the specified range minimumValue.

Boolean

Return whether true when it is finite or false when it is IntPx.Infinity

Px

Properties

Int

Companion properties

IntPx

An IntPx that indicates that there is no bound in the dimension.

IntPx

Zero IntPx dimension.

Public constructors

<init>

IntPx(value: Int)

Dimension value represented in whole pixels (px). Layout and constraints operate on Int pixels. Operations with an Infinity IntPx result in Infinity.

Public methods

compareTo

inline operator fun compareTo(other: IntPx): Int

Support comparing Dimensions with comparison operators.

compareTo

inline operator fun compareTo(other: Px): Int

Compares this IntPx to another Px

div

operator fun div(other: Float): IntPx

Divide a IntPx by a scalar and return the rounded result as an IntPx. Any operation on an IntPx.Infinity results in IntPx.Infinity

div

operator fun div(other: Double): IntPx

Divide a IntPx by a scalar and return the rounded result as an IntPx. Any operation on an IntPx.Infinity results in IntPx.Infinity

div

operator fun div(other: Int): IntPx

Divide a IntPx by a scalar and return the rounded result as an IntPx. Any operation on an IntPx.Infinity results in IntPx.Infinity

minus

operator fun minus(other: IntPx): IntPx

Subtract a IntPx from another one. Any operation on an IntPx.Infinity results in IntPx.Infinity

plus

operator fun plus(other: IntPx): IntPx

Add two IntPxs together. Any operation on an IntPx.Infinity results in IntPx.Infinity

rem

inline operator fun rem(other: Int): IntPx

Returns the remainder of the IntPx when dividing by an integer.

times

operator fun times(other: Float): IntPx

Multiply a IntPx by a scalar and round the result to an IntPx. Any operation on an IntPx.Infinity results in IntPx.Infinity

times

operator fun times(other: Double): IntPx

Multiply a IntPx by a scalar and round the result to an IntPx

times

operator fun times(other: Int): IntPx

Multiply a IntPx by a scalar and result in an IntPx

toString

fun toString(): String

unaryMinus

operator fun unaryMinus(): IntPx

This is the same as multiplying the IntPx by -1. Any operation on an IntPx.Infinity results in IntPx.Infinity

Properties

value

val value: Int

Companion properties

Infinity

val Infinity: IntPx

An IntPx that indicates that there is no bound in the dimension. This is commonly used in Constraints.maxHeight and Constraints.maxWidth to indicate that the particular dimension is not regulated and measurement should choose the best option without any constraint.

Zero

val Zero: IntPx

Zero IntPx dimension. Same as 0.ipx.