Insets

class Insets(val startDp: Float = 0.0f, val topDp: Float = 0.0f, val endDp: Float = 0.0f, val bottomDp: Float = 0.0f)

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

Parameters

startDp

the start inset’s size (in dp).

topDp

the top inset’s size (in dp).

endDp

the end inset’s size (in dp).

bottomDp

the bottom inset’s size (in dp).

Constructors

Link copied to clipboard
constructor(horizontalDp: Float = 0.0f, verticalDp: Float = 0.0f)

Creates an Insets instance with startDp = endDp and topDp = bottomDp.

constructor(allDp: Float = 0.0f)

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

constructor(startDp: Float = 0.0f, topDp: Float = 0.0f, endDp: Float = 0.0f, bottomDp: Float = 0.0f)

Types

Link copied to clipboard
object Companion

Houses an Insets singleton.

Properties

Link copied to clipboard
val bottomDp: Float = 0.0f
Link copied to clipboard
val endDp: Float = 0.0f
Link copied to clipboard

The sum of startDp and endDp.

Link copied to clipboard
val startDp: Float = 0.0f
Link copied to clipboard
val topDp: Float = 0.0f
Link copied to clipboard

The sum of topDp and bottomDp.

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