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


sealed class AlignmentLine
   ↳ androidx.ui.core.AlignmentLine

Defines an offset line that can be used by parent layouts to align and position their children. When a layout provides a value for a particular AlignmentLine, this can be read by the parents of the layout after measuring, using the Placeable.get operator on the corresponding Placeable instance. Based on the position of the AlignmentLine, the parents can then decide the positioning of the children.

Note that when a layout provides a value for an AlignmentLine, this will be automatically inherited by the layout's parent, which will offset the value by the position of the child within itself. This way, nested layout hierarchies are able to preserve the AlignmentLines defined for deeply nested children, making it possible for non-direct parents to use these for positioning and alignment. When a layout inherits multiple values for the same AlignmentLine from different children, the position of the line within the layout will be computed by merging the children values using the provided merger. If a layout provides a value for an AlignmentLine, this will always be the position of the line, regardless of the values provided by children for the same line.

AlignmentLines cannot be created directly, please create VerticalAlignmentLine or HorizontalAlignmentLine instances instead.

//Unresolved: androidx.ui.core.samples.AlignmentLineSample


Extension functions

From androidx.ui.core
AlignmentLine.merge(position1: IntPx, position2: IntPx)

Merges two values of the current alignment line.