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

PaddingValues

public interface PaddingValues

Known direct subclasses
PaddingValues.Absolute

Describes an absolute (RTL unaware) padding to be applied along the edges inside a box.


Describes a padding to be applied along the edges inside a box. See the PaddingValues factories and Absolute for convenient ways to build PaddingValues.

Summary

Nested types

public final class PaddingValues.Absolute implements PaddingValues

Describes an absolute (RTL unaware) padding to be applied along the edges inside a box.

Public methods

abstract @NonNull Dp

The padding to be applied along the bottom edge inside a box.

abstract @NonNull Dp

The padding to be applied along the left edge inside a box.

abstract @NonNull Dp

The padding to be applied along the right edge inside a box.

abstract @NonNull Dp

The padding to be applied along the top edge inside a box.

Extension functions

default final @NonNull Dp
PaddingKt.calculateEndPadding(
    @NonNull PaddingValues receiver,
    @NonNull LayoutDirection layoutDirection
)

The padding to be applied along the end edge inside a box: along the right edge if the layout direction is LTR, or along the left edge for RTL.

default final @NonNull Dp
PaddingKt.calculateStartPadding(
    @NonNull PaddingValues receiver,
    @NonNull LayoutDirection layoutDirection
)

The padding to be applied along the start edge inside a box: along the left edge if the layout direction is LTR, or along the right edge for RTL.

Public methods

calculateBottomPadding

abstract @NonNull Dp calculateBottomPadding()

The padding to be applied along the bottom edge inside a box.

calculateLeftPadding

abstract @NonNull Dp calculateLeftPadding(@NonNull LayoutDirection layoutDirection)

The padding to be applied along the left edge inside a box.

calculateRightPadding

abstract @NonNull Dp calculateRightPadding(@NonNull LayoutDirection layoutDirection)

The padding to be applied along the right edge inside a box.

calculateTopPadding

abstract @NonNull Dp calculateTopPadding()

The padding to be applied along the top edge inside a box.

Extension functions

PaddingKt.calculateEndPadding

default final @NonNull Dp PaddingKt.calculateEndPadding(
    @NonNull PaddingValues receiver,
    @NonNull LayoutDirection layoutDirection
)

The padding to be applied along the end edge inside a box: along the right edge if the layout direction is LTR, or along the left edge for RTL.

PaddingKt.calculateStartPadding

default final @NonNull Dp PaddingKt.calculateStartPadding(
    @NonNull PaddingValues receiver,
    @NonNull LayoutDirection layoutDirection
)

The padding to be applied along the start edge inside a box: along the left edge if the layout direction is LTR, or along the right edge for RTL.