6월 3일의 ⁠#Android11: 베타 버전 출시 행사에 참여하세요.

DpConstraints

@Immutable data class DpConstraints
kotlin.Any
   ↳ androidx.ui.layout.DpConstraints

Similar to Constraints, but with constraint values expressed in Dp.

Summary

Public constructors

<init>(minWidth: Dp = 0.dp, maxWidth: Dp = Dp.Infinity, minHeight: Dp = 0.dp, maxHeight: Dp = Dp.Infinity)

Similar to Constraints, but with constraint values expressed in Dp.

Companion functions

DpConstraints
fixed(width: Dp, height: Dp)

Creates constraints tight in both dimensions.

DpConstraints
fixedHeight(height: Dp)

Creates constraints with tight height and loose width.

DpConstraints
fixedWidth(width: Dp)

Creates constraints with tight width and loose height.

Extension functions

From androidx.ui.layout
DpConstraints
DpConstraints.enforce(otherConstraints: DpConstraints)

Returns the result of coercing the current constraints in a different set of constraints.

DpConstraints
DpConstraints.offset(horizontal: Dp = 0.dp, vertical: Dp = 0.dp)

Returns the DpConstraints obtained by offsetting the current instance with the given values.

Properties

Dp

Dp

Dp

Dp

Extension properties

From androidx.ui.layout
Boolean

Whether or not the upper bound on the maximum height.

Boolean

Whether or not the upper bound on the maximum width.

Boolean

Whether there is exactly one height value that satisfies the constraints.

Boolean

Whether there is exactly one width value that satisfies the constraints.

Boolean

Whether the area of a component respecting these constraints will definitely be 0.

Boolean

Whether there is any size that satisfies the current constraints.

Public constructors

<init>

DpConstraints(
    minWidth: Dp = 0.dp,
    maxWidth: Dp = Dp.Infinity,
    minHeight: Dp = 0.dp,
    maxHeight: Dp = Dp.Infinity)

Similar to Constraints, but with constraint values expressed in Dp.

Properties

maxHeight

val maxHeight: Dp

maxWidth

val maxWidth: Dp

minHeight

val minHeight: Dp

minWidth

val minWidth: Dp

Companion functions

fixed

fun fixed(
    width: Dp,
    height: Dp
): DpConstraints

Creates constraints tight in both dimensions.

fixedHeight

fun fixedHeight(height: Dp): DpConstraints

Creates constraints with tight height and loose width.

fixedWidth

fun fixedWidth(width: Dp): DpConstraints

Creates constraints with tight width and loose height.