Size
@Immutable inline class Size
kotlin.Any  
↳  androidx.ui.geometry.Size 
Holds a 2D floatingpoint size.
You can think of this as an Offset from the origin.
Summary
Public constructors  

Holds a 2D floatingpoint size. 
Public methods  

Offset 
bottomCenter(origin: Offset) The offset to the center of the bottom edge of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size. 
Offset 
bottomLeft(origin: Offset) The offset to the intersection of the bottom and left edges of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size. 
Offset 
bottomRight(origin: Offset) The offset to the intersection of the bottom and right edges of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size. 
Offset 
The offset to the point halfway between the left and right and the top and bottom edges of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size. 
Offset 
centerLeft(origin: Offset) The offset to the center of the left edge of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size. 
Offset 
centerRight(origin: Offset) The offset to the center of the right edge of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size. 
Boolean 
Whether the point specified by the given offset (which is assumed to be relative to the top left of the size) lies between the left and right and the top and bottom edges of a rectangle of this size. 
Size 
Returns a copy of this Size instance optionally overriding the width or height parameter 
operator Size 
Division operator. 
Size  
Boolean 
isEmpty() Whether this size encloses a nonzero area. 
operator Size 
Binary subtraction operator for Size. 
operator Offset  
operator Size  
operator Size 
Modulo (remainder) operator. 
operator Size 
Multiplication operator. 
String 
toString() 
Offset 
The offset to the center of the top edge of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size. 
Offset 
The offset to the intersection of the top and left edges of the rectangle described by the given Offset (which is interpreted as the topleft corner) and this Size. 
Offset 
The offset to the intersection of the top and right edges of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size. 
Size 
Integer (truncating) division operator. 
Companion functions  

Size 
Creates an instance of Size that has the same values as another. 
Size 
fromHeight(height: Float) 
Size 
fromRadius(radius: Float) Creates a square Size whose width and height are twice the given dimension. 
Size  
Size 
Creates a square Size whose width and height are the given dimension. 
Extension functions  

From androidx.ui.unit


From androidx.ui.geometry

Properties  

Float  
Float  
Float  
Float 
Companion properties  

Size  
Size 
An empty size, one with a zero width and a zero height. 
Public constructors
<init>
Size(packedValue: Long)
Holds a 2D floatingpoint size.
You can think of this as an Offset from the origin.
Public methods
bottomCenter
@Stable fun bottomCenter(origin: Offset): Offset
The offset to the center of the bottom edge of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size.
See also Rect.bottomLeft.
bottomLeft
@Stable fun bottomLeft(origin: Offset): Offset
The offset to the intersection of the bottom and left edges of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size.
See also Rect.bottomLeft.
bottomRight
@Stable fun bottomRight(origin: Offset): Offset
The offset to the intersection of the bottom and right edges of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size.
See also Rect.bottomRight.
center
@Stable fun center(origin: Offset = Offset.Zero): Offset
The offset to the point halfway between the left and right and the top and bottom edges of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size.
See also Rect.center.
centerLeft
@Stable fun centerLeft(origin: Offset): Offset
The offset to the center of the left edge of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size.
See also Rect.centerLeft.
centerRight
@Stable fun centerRight(origin: Offset): Offset
The offset to the center of the right edge of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size.
See also Rect.centerLeft.
contains
@Stable fun contains(offset: Offset): Boolean
Whether the point specified by the given offset (which is assumed to be relative to the top left of the size) lies between the left and right and the top and bottom edges of a rectangle of this size.
Rectangles include their top and left edges but exclude their bottom and right edges.
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 lefthandside operand (a Size) divided by the scalar righthandside operand (a Float).
isEmpty
@Stable fun isEmpty(): Boolean
Whether this size encloses a nonzero area.
Negative areas are considered empty.
minus
@Stable operator fun minus(other: Offset): Size
Binary subtraction operator for Size.
Subtracting a Size from a Size returns the Offset that describes how
much bigger the lefthandside operand is than the righthandside
operand. Adding that resulting Offset to the Size that was the
righthandside operand would return a Size equal to the Size that was
the lefthandside operand. (i.e. if sizeA  sizeB > offsetA
, then
offsetA + sizeB > sizeA
)
Subtracting an Offset from a Size returns the Size that is smaller than the Size operand by the difference given by the Offset operand. In other words, the returned Size has a width consisting of the width of the lefthandside operand minus the Offset.x dimension of the righthandside operand, and a height consisting of the height of the lefthandside operand minus the Offset.y dimension of the righthandside operand.
plus
@Stable operator fun plus(other: Offset): Size
Binary addition operator for adding an Offset to a Size.
Returns a Size whose width is the sum of the width of the lefthandside operand, a Size, and the Offset.x dimension of the righthandside operand, an Offset, and whose height is the sum of the height of the lefthandside operand and the Offset.y dimension of the righthandside operand.
rem
@Stable operator fun rem(operand: Float): Size
Modulo (remainder) operator.
Returns a Size whose dimensions are the remainder of dividing the lefthandside operand (a Size) by the scalar righthandside operand (a Float).
times
@Stable operator fun times(operand: Float): Size
Multiplication operator.
Returns a Size whose dimensions are the dimensions of the lefthandside operand (a Size) multiplied by the scalar righthandside operand (a Float).
toString
fun toString(): String
topCenter
@Stable fun topCenter(origin: Offset): Offset
The offset to the center of the top edge of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size.
See also Rect.topCenter.
topLeft
@Stable fun topLeft(origin: Offset): Offset
The offset to the intersection of the top and left edges of the rectangle described by the given Offset (which is interpreted as the topleft corner) and this Size.
See also Rect.topLeft.
topRight
@Stable fun topRight(origin: Offset): Offset
The offset to the intersection of the top and right edges of the rectangle described by the given offset (which is interpreted as the topleft corner) and this size.
See also Rect.topRight.
truncDiv
@Stable fun truncDiv(operand: Float): Size
Integer (truncating) division operator.
Returns a Size whose dimensions are the dimensions of the lefthandside operand (a Size) divided by the scalar righthandside operand (a Float), rounded towards zero.
Properties
height
@Stable val height: Float
maxDimension
@Stable val maxDimension: Float
minDimension
@Stable val minDimension: Float
width
@Stable val width: Float
Companion functions
copy
funcopy(source: Size): Size
Deprecated.
Creates an instance of Size that has the same values as another.
fromRadius
fun fromRadius(radius: Float): Size
Creates a square Size whose width and height are twice the given dimension.
This is a square that contains a circle with the given radius.
See also:
 new Size.square, which creates a square with the given dimension.
square
fun square(dimension: Float): Size
Creates a square Size whose width and height are the given dimension.
See also:
 new Size.fromRadius, which is more convenient when the available size is the radius of a circle.
Companion properties
UnspecifiedSize
@Stable val UnspecifiedSize: Size
A size whose width and height are infinite.
See also:
 isInfinite, which checks whether either dimension is infinite.
 isFinite, which checks whether both dimensions are finite.