The second Android 11 Developer Preview is now available, test it out and share your feedback.

Max

@Stable data class Max : LayoutModifier
kotlin.Any
   ↳ androidx.ui.layout.LayoutSize.Max

Modifies the size of a Compose UI layout element to be at most maxWidth wide and maxHeight tall if permitted by its parent.

This modifies the incoming Constraints provided by a layout element's parent. If the incoming constraints do not allow the modified size, the incoming constraints from the parent will restrict the final size.

Summary

Public constructors

<init>(maxSize: Dp)

Modifies a Compose UI layout element to have a square maximum size of maxSize.

<init>(maxWidth: Dp, maxHeight: Dp)

Modifies the size of a Compose UI layout element to be at most maxWidth wide and maxHeight tall if permitted by its parent.

Properties

Dp

Dp

Public constructors

<init>

Max(maxSize: Dp)

Modifies a Compose UI layout element to have a square maximum size of maxSize.

<init>

Max(
    maxWidth: Dp,
    maxHeight: Dp)

Modifies the size of a Compose UI layout element to be at most maxWidth wide and maxHeight tall if permitted by its parent.

This modifies the incoming Constraints provided by a layout element's parent. If the incoming constraints do not allow the modified size, the incoming constraints from the parent will restrict the final size.

Properties

maxHeight

val maxHeight: Dp

maxWidth

val maxWidth: Dp