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

Fill

@Stable object Fill : LayoutModifier
kotlin.Any
   ↳ androidx.ui.layout.LayoutHeight.Fill

Modifies the height of a Compose UI layout element to fill all available space.

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.

Example usage:

import androidx.ui.foundation.Box
import androidx.ui.foundation.ColoredRect

Box(LayoutHeight.Fill, backgroundColor = Color.Red, gravity = ContentGravity.Center) {
    ColoredRect(color = Color.Magenta, width = 100.dp, height = 100.dp)
}

Summary

Public methods

Constraints
Density.modifyConstraints(constraints: Constraints, layoutDirection: LayoutDirection)

Modifies constraints for performing measurement of the modified layout element.

Inherited functions

Public methods

modifyConstraints

fun Density.modifyConstraints(
    constraints: Constraints,
    layoutDirection: LayoutDirection
): Constraints

Modifies constraints for performing measurement of the modified layout element.