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

LayoutModifier

interface LayoutModifier : Modifier.Element
androidx.ui.core.LayoutModifier

A Modifier.Element that changes the way a UI component is measured and laid out.

Summary

Public methods

open IntPx
Density.maxIntrinsicHeightOf(measurable: Measurable, width: IntPx, layoutDirection: LayoutDirection)

Determines the modified maximum intrinsic height of measurable.

open IntPx
Density.maxIntrinsicWidthOf(measurable: Measurable, height: IntPx, layoutDirection: LayoutDirection)

Determines the modified maximum intrinsic width of measurable.

open IntPx
Density.minIntrinsicHeightOf(measurable: Measurable, width: IntPx, layoutDirection: LayoutDirection)

Determines the modified minimum intrinsic height of measurable.

open IntPx
Density.minIntrinsicWidthOf(measurable: Measurable, height: IntPx, layoutDirection: LayoutDirection)

Determines the modified minimum intrinsic width of measurable.

open IntPx?
Density.modifyAlignmentLine(line: AlignmentLine, value: IntPx?, layoutDirection: LayoutDirection)

Returns the modified position of line given its unmodified value.

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

Modifies constraints for performing measurement of the modified layout element.

open LayoutDirection

Modifies the layout direction to be used for measurement and layout by the modified element.

open IntPxPosition
Density.modifyPosition(childSize: IntPxSize, containerSize: IntPxSize, layoutDirection: LayoutDirection)

Returns the position of a modified child of size childSize within a container of size containerSize.

open IntPxSize
Density.modifySize(constraints: Constraints, layoutDirection: LayoutDirection, childSize: IntPxSize)

Returns the container size of a modified layout element given the original container measurement constraints and the measured childSize.

Inherited functions

Public methods

maxIntrinsicHeightOf

open fun Density.maxIntrinsicHeightOf(
    measurable: Measurable,
    width: IntPx,
    layoutDirection: LayoutDirection
): IntPx

Determines the modified maximum intrinsic height of measurable. See Measurable.maxIntrinsicHeight.

maxIntrinsicWidthOf

open fun Density.maxIntrinsicWidthOf(
    measurable: Measurable,
    height: IntPx,
    layoutDirection: LayoutDirection
): IntPx

Determines the modified maximum intrinsic width of measurable. See Measurable.maxIntrinsicWidth.

minIntrinsicHeightOf

open fun Density.minIntrinsicHeightOf(
    measurable: Measurable,
    width: IntPx,
    layoutDirection: LayoutDirection
): IntPx

Determines the modified minimum intrinsic height of measurable. See Measurable.minIntrinsicHeight.

minIntrinsicWidthOf

open fun Density.minIntrinsicWidthOf(
    measurable: Measurable,
    height: IntPx,
    layoutDirection: LayoutDirection
): IntPx

Determines the modified minimum intrinsic width of measurable. See Measurable.minIntrinsicWidth.

modifyAlignmentLine

open fun Density.modifyAlignmentLine(
    line: AlignmentLine,
    value: IntPx?,
    layoutDirection: LayoutDirection
): IntPx?

Returns the modified position of line given its unmodified value.

modifyConstraints

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

Modifies constraints for performing measurement of the modified layout element.

modifyLayoutDirection

open fun Density.modifyLayoutDirection(layoutDirection: LayoutDirection): LayoutDirection

Modifies the layout direction to be used for measurement and layout by the modified element.

modifyPosition

open fun Density.modifyPosition(
    childSize: IntPxSize,
    containerSize: IntPxSize,
    layoutDirection: LayoutDirection
): IntPxPosition

Returns the position of a modified child of size childSize within a container of size containerSize.

modifySize

open fun Density.modifySize(
    constraints: Constraints,
    layoutDirection: LayoutDirection,
    childSize: IntPxSize
): IntPxSize

Returns the container size of a modified layout element given the original container measurement constraints and the measured childSize.