{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

Arrangement.Horizontal

public interface Arrangement.Horizontal

Known direct subclasses
Arrangement.HorizontalOrVertical

Used to specify the horizontal arrangement of the layout's children in horizontal layouts like Row, or the vertical arrangement of the layout's children in vertical layouts like Column.


Used to specify the horizontal arrangement of the layout's children in layouts like Row.

Summary

Public methods

abstract void
arrange(
    @NonNull Density receiver,
    int totalSize,
    @NonNull int[] sizes,
    @NonNull LayoutDirection layoutDirection,
    @NonNull int[] outPositions
)

Horizontally places the layout children.

default @NonNull Dp

Spacing that should be added between any two adjacent layout children.

Public methods

arrange

abstract void arrange(
    @NonNull Density receiver,
    int totalSize,
    @NonNull int[] sizes,
    @NonNull LayoutDirection layoutDirection,
    @NonNull int[] outPositions
)

Horizontally places the layout children.

Parameters
int totalSize

Available space that can be occupied by the children, in pixels.

@NonNull int[] sizes

An array of sizes of all children, in pixels.

@NonNull LayoutDirection layoutDirection

A layout direction, left-to-right or right-to-left, of the parent layout that should be taken into account when determining positions of the children.

@NonNull int[] outPositions

An array of the size of sizes that returns the calculated positions relative to the left, in pixels.

getSpacing

default @NonNull Dp getSpacing()

Spacing that should be added between any two adjacent layout children.