Size
@Immutable inline class Size
kotlin.Any | |
↳ | androidx.compose.ui.geometry.Size |
Holds a 2D floating-point size.
You can think of this as an Offset from the origin.
Summary
Public constructors | |
---|---|
Holds a 2D floating-point size. |
Public methods | |
---|---|
operator Float | |
operator Float | |
Size |
Returns a copy of this Size instance optionally overriding the width or height parameter |
operator Size |
Division operator. |
Boolean |
isEmpty() Whether this size encloses a non-zero area. |
operator Size |
Multiplication operator. |
String |
toString() |
Extension functions | ||||
---|---|---|---|---|
From androidx.compose.ui.layout
|
||||
From androidx.compose.ui.geometry
|
Properties | |
---|---|
Float | |
Float | |
Float | |
Float |
Companion properties | |
---|---|
Size | |
Size |
An empty size, one with a zero width and a zero height. |
Extension properties | ||||||
---|---|---|---|---|---|---|
From androidx.compose.ui.geometry
|
Public constructors
<init>
Size(packedValue: Long)
Holds a 2D floating-point size.
You can think of this as an Offset from the origin.
Public methods
component1
@Stable inline operator fun component1(): Float
component2
@Stable inline operator fun component2(): Float
copy
fun copy(
width: Float = this.width,
height: Float = this.height
): Size
Returns a copy of this Size instance optionally overriding the width or height parameter
div
@Stable operator fun div(operand: Float): Size
Division operator.
Returns a Size whose dimensions are the dimensions of the left-hand-side operand (a Size) divided by the scalar right-hand-side operand (a Float).
isEmpty
@Stable fun isEmpty(): Boolean
Whether this size encloses a non-zero area.
Negative areas are considered empty.
times
@Stable operator fun times(operand: Float): Size
Multiplication operator.
Returns a Size whose dimensions are the dimensions of the left-hand-side operand (a Size) multiplied by the scalar right-hand-side operand (a Float).
toString
fun toString(): String
Properties
height
@Stable val height: Float
maxDimension
@Stable val maxDimension: Float
minDimension
@Stable val minDimension: Float
width
@Stable val width: Float
Companion properties
Unspecified
@Stable val Unspecified: Size
A size whose width and height are unspecified. This is a sentinel value used to initialize a non-null parameter. Access to width or height on an unspecified size is not allowed