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

LayoutGravity

object LayoutGravity
kotlin.Any
   ↳ androidx.ui.layout.LayoutGravity

Provides scope-dependent alignment options for children layouts where the alignment is handled by the parent layout rather than the child itself. Different layout models allow different LayoutGravity options. For example, Row provides Top and Bottom, while Column provides Start and End. Unlike LayoutAlign, layout children with LayoutGravity are aligned only after the size of the parent is known, therefore not affecting the size of the parent in order to achieve their own alignment.

Example usage:


//Unresolved: androidx.ui.layout.samples.SimpleGravityInRow

//Unresolved: androidx.ui.layout.samples.SimpleGravityInColumn

Summary

Extension properties

From androidx.ui.layout.RowScope
ParentDataModifier

A layout modifier within a Row that positions target component vertically such that its bottom edge is aligned to the bottom edge of the Row.

ParentDataModifier

A layout modifier within a Row that positions target component vertically such that its center is in the middle of the Row.

ParentDataModifier

A layout modifier within a Row that positions its target component vertically such that its top edge is aligned to the top edge of the Row.

From androidx.ui.layout.StackScope
ParentDataModifier

A layout modifier that defines that child should be positioned bottom-center inside the Stack.

ParentDataModifier

A layout modifier that defines that child should be positioned bottom-end inside the Stack.

ParentDataModifier

A layout modifier that defines that child should be positioned bottom-start inside the Stack.

ParentDataModifier

A layout modifier that defines that child should be positioned in the center of the Stack.

ParentDataModifier

A layout modifier that defines that child should be positioned center-end inside the Stack.

ParentDataModifier

A layout modifier that defines that child should be positioned center-start inside the Stack.

ParentDataModifier

A layout modifier within a Stack that makes the target component to occupy the whole space occupied by the Stack.

ParentDataModifier

A layout modifier that defines that child should be positioned top-center inside the Stack.

ParentDataModifier

A layout modifier that defines that child should be positioned top-end inside the Stack.

ParentDataModifier

A layout modifier that defines that child should be positioned top-start inside the Stack.

From androidx.ui.layout.ColumnScope
ParentDataModifier

A layout modifier within a Column that positions its target component horizontally such that its center is in the middle of the Column.

ParentDataModifier

A layout modifier within a Column that positions its target component horizontally such that its end edge is aligned to the end edge of the Column.

ParentDataModifier

A layout modifier within a Column that positions its target component horizontally such that its start edge is aligned to the start edge of the Column.