androidx.compose.ui.unit
DpSize
Value class · from org.jetbrains.compose.ui:ui-unit:1.12.2
No hand-written docs yet.
A two-dimensional Size using Dp for units
value class DpSize
How to get one
Create it
Ready-made values and functions that return it
Density:toDpSize()IconButtonDefaults:extraSmallContainerSize(),smallContainerSize(),mediumContainerSize(),largeContainerSize(),extraLargeContainerSize()TooltipDefaults:caretSizesize
Used by
Parameters that take a DpSize.
DpSize.minus(other)DpSize.plus(other)requiredSize(size)size(size)SliderDefaults.Thumb(thumbSize)TooltipDefaults.caretShape(caretSize)VerticalDragHandleDefaults.sizes(size, pressedSize, draggedSize)
Properties
width
val width: Dp
The horizontal aspect of the Size in Dp
height
val height: Dp
The vertical aspect of the Size in Dp
Zero
val Zero: DpSize
A DpSize with 0 DP width and 0 DP height values.
Unspecified
val Unspecified: DpSize
A size whose width and height are unspecified. This is usually a replacement for null when a primitive value is desired. Access to width or height on an unspecified size is not allowed.
Functions
copy
fun copy(
width: Dp = this.width,
height: Dp = this.height,
): DpSize
Returns a copy of this DpSize instance optionally overriding the width or height parameter
minus
fun minus(other: DpSize): DpSize
Subtract a DpSize from another one.
plus
fun plus(other: DpSize): DpSize
Add a DpSize to another one.
component1
fun component1(): Dp
component2
fun component2(): Dp
times
fun times(other: Int): DpSize
fun times(other: Float): DpSize
div
fun div(other: Int): DpSize
fun div(other: Float): DpSize
Library docs
A two-dimensional Size using Dp for units