Class

Alignment

A class used to specify the position of a sized box inside an available space.

Source set: Android
public class Alignment(public val horizontal: Horizontal, public val vertical: Vertical)

A class used to specify the position of a sized box inside an available space. This is often used to specify how a parent layout should place its children.

Functions

equals

Source set: Android
override fun equals(other: Any?): Boolean

hashCode

Source set: Android
override fun hashCode(): Int

toString

Source set: Android
override fun toString(): String

Members

Horizontal

Source set: Android
public class Horizontal private constructor(private val value: Int)

Specifies how a parent should lay its children out horizontally, if the child has a width smaller than the parent.

Members

Companion

Source set: Android
public companion object

Properties

Start

Source set: Android
public val Start: Horizontal = Horizontal(0)

CenterHorizontally

Source set: Android
public val CenterHorizontally: Horizontal = Horizontal(1)

End

Source set: Android
public val End: Horizontal = Horizontal(2)

Vertical

Source set: Android
public class Vertical private constructor(private val value: Int)

Specifies how a parent should lay its children out vertically, if the child has a height smaller than the parent.

Members

Companion

Source set: Android
public companion object

Properties

Top

Source set: Android
public val Top: Vertical = Vertical(0)

CenterVertically

Source set: Android
public val CenterVertically: Vertical = Vertical(1)

Bottom

Source set: Android
public val Bottom: Vertical = Vertical(2)

Companion

Source set: Android
public companion object

Common Alignment options used in layouts.

Properties

TopStart

Source set: Android
public val TopStart: Alignment = Alignment(Horizontal.Start, Vertical.Top)

TopCenter

Source set: Android
public val TopCenter: Alignment = Alignment(Horizontal.CenterHorizontally, Vertical.Top)

TopEnd

Source set: Android
public val TopEnd: Alignment = Alignment(Horizontal.End, Vertical.Top)

CenterStart

Source set: Android
public val CenterStart: Alignment = Alignment(Horizontal.Start, Vertical.CenterVertically)

Center

Source set: Android
public val Center: Alignment =
            Alignment(Horizontal.CenterHorizontally, Vertical.CenterVertically)

CenterEnd

Source set: Android
public val CenterEnd: Alignment = Alignment(Horizontal.End, Vertical.CenterVertically)

BottomStart

Source set: Android
public val BottomStart: Alignment = Alignment(Horizontal.Start, Vertical.Bottom)

BottomCenter

Source set: Android
public val BottomCenter: Alignment =
            Alignment(Horizontal.CenterHorizontally, Vertical.Bottom)

BottomEnd

Source set: Android
public val BottomEnd: Alignment = Alignment(Horizontal.End, Vertical.Bottom)

Top

Source set: Android
public val Top: Vertical = Vertical.Top

CenterVertically

Source set: Android
public val CenterVertically: Vertical = Vertical.CenterVertically

Bottom

Source set: Android
public val Bottom: Vertical = Vertical.Bottom

Start

Source set: Android
public val Start: Horizontal = Horizontal.Start

CenterHorizontally

Source set: Android
public val CenterHorizontally: Horizontal = Horizontal.CenterHorizontally

End

Source set: Android
public val End: Horizontal = Horizontal.End
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: