Insets

class Insets(val start: Dp = 0f.dp, val top: Dp = 0f.dp, val end: Dp = 0f.dp, val bottom: Dp = 0f.dp)

Stores inset sizes for the sides of a rectangle. Used for margins and padding.

Parameters

start

the start inset’s size.

top

the top inset’s size.

end

the end inset’s size.

bottom

the bottom inset’s size.

Constructors

Link copied to clipboard
constructor(horizontal: Dp = 0f.dp, vertical: Dp = 0f.dp)

Creates an Insets instance with start = end and top = bottom.

constructor(all: Dp = 0f.dp)

Creates an Insets instance with a common size for all four insets.

constructor(start: Dp = 0f.dp, top: Dp = 0f.dp, end: Dp = 0f.dp, bottom: Dp = 0f.dp)

Types

Link copied to clipboard
object Companion

Houses an Insets singleton.

Properties

Link copied to clipboard
val bottom: Dp
Link copied to clipboard
val end: Dp
Link copied to clipboard

The sum of start and end.

Link copied to clipboard
val start: Dp
Link copied to clipboard
val top: Dp
Link copied to clipboard

The sum of top and bottom.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Returns the left inset’s size.

Link copied to clipboard

Returns the right inset’s size.

Link copied to clipboard
open override fun hashCode(): Int