ColumnScope

class ColumnScope : FlexScope
kotlin.Any
   ↳ androidx.ui.layout.FlexScope
   ↳ androidx.ui.layout.ColumnScope

A ColumnScope provides a scope for the children of a Column.

Summary

Public methods

ParentDataModifier

A layout modifier within a Column that positions its target component horizontally according to the specified VerticalAlignmentLine, such that the position of the alignment line coincides with the alignment lines of all other siblings having their gravity set to LayoutGravity.RelativeToSiblings.

Inherited functions

Inherited extension functions

From androidx.compose
operator T

IMPORTANT: This global operator is TEMPORARY, and should be removed whenever an answer for contextual composers is reached.

Properties

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.

Public methods

RelativeToSiblings

fun LayoutGravity.RelativeToSiblings(alignmentLine: VerticalAlignmentLine): ParentDataModifier

A layout modifier within a Column that positions its target component horizontally according to the specified VerticalAlignmentLine, such that the position of the alignment line coincides with the alignment lines of all other siblings having their gravity set to LayoutGravity.RelativeToSiblings. Within a Column, all components with LayoutGravity.RelativeToSiblings will align horizontally using the specified AlignmentLines or values obtained from alignmentLineBlocks, forming a sibling group. At least one element of the sibling group will be placed as it had LayoutGravity.Start in Column, and the alignment of the other siblings will be then determined such that the alignment lines coincide. Note that if the target component is the only one with the RelativeToSiblings modifier specified, then the component will be positioned using LayoutGravity.Start.

Example usage:

import androidx.ui.layout.Column

Column {
    // Center of the first rectangle is aligned to the right edge of the second rectangle and
    // left edge of the third one.
    SizedRectangle(
        LayoutGravity.RelativeToSiblings { it.width * 0.5 },
        color = Color.Blue,
        width = 80.dp,
        height = 40.dp
    )
    SizedRectangleWithLines(
        LayoutGravity.RelativeToSiblings(End),
        color = Color.Magenta,
        width = 80.dp,
        height = 40.dp
    )
    SizedRectangleWithLines(
        LayoutGravity.RelativeToSiblings(Start),
        color = Color.Red,
        width = 80.dp,
        height = 40.dp
    )
}

Properties

Center

val LayoutGravity.Center: ParentDataModifier

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

End

val LayoutGravity.End: 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.

Start

val LayoutGravity.Start: 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.