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

TopAppBarColors

@ExperimentalMaterial3Api
public final class TopAppBarColors


Represents the colors used by a top app bar in different states. This implementation animates the container color according to the top app bar scroll state. It does not animate the leading, headline, or trailing colors.

Summary

Public constructors

TopAppBarColors(
    @NonNull Color containerColor,
    @NonNull Color scrolledContainerColor,
    @NonNull Color navigationIconContentColor,
    @NonNull Color titleContentColor,
    @NonNull Color actionIconContentColor
)

create an instance with arbitrary colors, see TopAppBarColors for a factory method using the default material3 spec

Public methods

final @NonNull TopAppBarColors
copy(
    @NonNull Color containerColor,
    @NonNull Color scrolledContainerColor,
    @NonNull Color navigationIconContentColor,
    @NonNull Color titleContentColor,
    @NonNull Color actionIconContentColor
)

Returns a copy of this TopAppBarColors, optionally overriding some of the values.

boolean
equals(Object other)
final @NonNull Color

the content color used for actions

final @NonNull Color

the color used for the background of this BottomAppBar.

final @NonNull Color

the content color used for the navigation icon

final @NonNull Color

the container color when content is scrolled behind it

final @NonNull Color

the content color used for the title

int

Public constructors

TopAppBarColors

public TopAppBarColors(
    @NonNull Color containerColor,
    @NonNull Color scrolledContainerColor,
    @NonNull Color navigationIconContentColor,
    @NonNull Color titleContentColor,
    @NonNull Color actionIconContentColor
)

create an instance with arbitrary colors, see TopAppBarColors for a factory method using the default material3 spec

Parameters
@NonNull Color containerColor

the color used for the background of this BottomAppBar. Use Color.Transparent to have no color.

@NonNull Color scrolledContainerColor

the container color when content is scrolled behind it

@NonNull Color navigationIconContentColor

the content color used for the navigation icon

@NonNull Color titleContentColor

the content color used for the title

@NonNull Color actionIconContentColor

the content color used for actions

Public methods

copy

public final @NonNull TopAppBarColors copy(
    @NonNull Color containerColor,
    @NonNull Color scrolledContainerColor,
    @NonNull Color navigationIconContentColor,
    @NonNull Color titleContentColor,
    @NonNull Color actionIconContentColor
)

Returns a copy of this TopAppBarColors, optionally overriding some of the values. This uses the Color.Unspecified to mean “use the value from the source”

equals

public boolean equals(Object other)

getActionIconContentColor

public final @NonNull Color getActionIconContentColor()

the content color used for actions

getContainerColor

public final @NonNull Color getContainerColor()

the color used for the background of this BottomAppBar. Use Color.Transparent to have no color.

getNavigationIconContentColor

public final @NonNull Color getNavigationIconContentColor()

the content color used for the navigation icon

getScrolledContainerColor

public final @NonNull Color getScrolledContainerColor()

the container color when content is scrolled behind it

getTitleContentColor

public final @NonNull Color getTitleContentColor()

the content color used for the title

hashCode

public int hashCode()