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

TabRowDefaults

public static class TabRowDefaults


Contains default implementations and values used for TabRow.

Summary

Public fields

static @NonNull TabRowDefaults

Public methods

final void
@Composable
Indicator(
    @NonNull Modifier modifier,
    @NonNull Dp height,
    @NonNull Color color
)

This method is deprecated. Use SecondaryIndicator instead.

final void
@Composable
PrimaryIndicator(
    @NonNull Modifier modifier,
    @NonNull Dp width,
    @NonNull Dp height,
    @NonNull Color color,
    @NonNull Shape shape
)

Primary indicator, which will be positioned at the bottom of the TabRow, on top of the divider.

final void
@Composable
SecondaryIndicator(
    @NonNull Modifier modifier,
    @NonNull Dp height,
    @NonNull Color color
)

Secondary indicator, which will be positioned at the bottom of the TabRow, on top of the divider.

final @NonNull Color

Default container color of a tab row.

final @NonNull Color

Default content color of a tab row.

final @NonNull Color

Default container color of a PrimaryTabRow.

final @NonNull Color

Default content color of a PrimaryTabRow.

final @NonNull Dp

The default padding from the starting edge before a tab in a ScrollableTabRow.

final @NonNull Color

Default container color of a SecondaryTabRow.

final @NonNull Color

Default content color of a SecondaryTabRow.

final @NonNull Modifier
tabIndicatorOffset(
    @NonNull Modifier receiver,
    @NonNull TabPosition currentTabPosition
)

Modifier that takes up all the available width inside the TabRow, and then animates the offset of the indicator it is applied to, depending on the currentTabPosition.

Public fields

INSTANCE

public static @NonNull TabRowDefaults INSTANCE

Public methods

Indicator

@Composable
public final void Indicator(
    @NonNull Modifier modifier,
    @NonNull Dp height,
    @NonNull Color color
)

Default indicator, which will be positioned at the bottom of the TabRow, on top of the divider.

Parameters
@NonNull Modifier modifier

modifier for the indicator's layout

@NonNull Dp height

height of the indicator

@NonNull Color color

color of the indicator

PrimaryIndicator

@Composable
public final void PrimaryIndicator(
    @NonNull Modifier modifier,
    @NonNull Dp width,
    @NonNull Dp height,
    @NonNull Color color,
    @NonNull Shape shape
)

Primary indicator, which will be positioned at the bottom of the TabRow, on top of the divider.

Parameters
@NonNull Modifier modifier

modifier for the indicator's layout

@NonNull Dp width

width of the indicator

@NonNull Dp height

height of the indicator

@NonNull Color color

color of the indicator

@NonNull Shape shape

shape of the indicator

SecondaryIndicator

@Composable
public final void SecondaryIndicator(
    @NonNull Modifier modifier,
    @NonNull Dp height,
    @NonNull Color color
)

Secondary indicator, which will be positioned at the bottom of the TabRow, on top of the divider.

Parameters
@NonNull Modifier modifier

modifier for the indicator's layout

@NonNull Dp height

height of the indicator

@NonNull Color color

color of the indicator

getContainerColor

@Composable
public final @NonNull Color getContainerColor()

Default container color of a tab row.

getContentColor

@Composable
public final @NonNull Color getContentColor()

Default content color of a tab row.

getPrimaryContainerColor

@Composable
public final @NonNull Color getPrimaryContainerColor()

Default container color of a PrimaryTabRow.

getPrimaryContentColor

@Composable
public final @NonNull Color getPrimaryContentColor()

Default content color of a PrimaryTabRow.

getScrollableTabRowEdgeStartPadding

public final @NonNull Dp getScrollableTabRowEdgeStartPadding()

The default padding from the starting edge before a tab in a ScrollableTabRow.

getSecondaryContainerColor

@Composable
public final @NonNull Color getSecondaryContainerColor()

Default container color of a SecondaryTabRow.

getSecondaryContentColor

@Composable
public final @NonNull Color getSecondaryContentColor()

Default content color of a SecondaryTabRow.

tabIndicatorOffset

public final @NonNull Modifier tabIndicatorOffset(
    @NonNull Modifier receiver,
    @NonNull TabPosition currentTabPosition
)

Modifier that takes up all the available width inside the TabRow, and then animates the offset of the indicator it is applied to, depending on the currentTabPosition.

Parameters
@NonNull TabPosition currentTabPosition

TabPosition of the currently selected tab. This is used to calculate the offset of the indicator this modifier is applied to, as well as its width.