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

NavigationRailItemColors

public final class NavigationRailItemColors


Represents the colors of the various elements of a navigation item.

Summary

Public constructors

NavigationRailItemColors(
    @NonNull Color selectedIconColor,
    @NonNull Color selectedTextColor,
    @NonNull Color selectedIndicatorColor,
    @NonNull Color unselectedIconColor,
    @NonNull Color unselectedTextColor,
    @NonNull Color disabledIconColor,
    @NonNull Color disabledTextColor
)

create an instance with arbitrary colors.

Public methods

final @NonNull NavigationRailItemColors
copy(
    @NonNull Color selectedIconColor,
    @NonNull Color selectedTextColor,
    @NonNull Color selectedIndicatorColor,
    @NonNull Color unselectedIconColor,
    @NonNull Color unselectedTextColor,
    @NonNull Color disabledIconColor,
    @NonNull Color disabledTextColor
)

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

boolean
equals(Object other)
final @NonNull Color

the color to use for the icon when the item is disabled.

final @NonNull Color

the color to use for the text label when the item is disabled.

final @NonNull Color

the color to use for the icon when the item is selected.

final @NonNull Color

the color to use for the indicator when the item is selected.

final @NonNull Color

the color to use for the text label when the item is selected.

final @NonNull Color

the color to use for the icon when the item is unselected.

final @NonNull Color

the color to use for the text label when the item is unselected.

int

Public constructors

public NavigationRailItemColors(
    @NonNull Color selectedIconColor,
    @NonNull Color selectedTextColor,
    @NonNull Color selectedIndicatorColor,
    @NonNull Color unselectedIconColor,
    @NonNull Color unselectedTextColor,
    @NonNull Color disabledIconColor,
    @NonNull Color disabledTextColor
)

create an instance with arbitrary colors.

Parameters
@NonNull Color selectedIconColor

the color to use for the icon when the item is selected.

@NonNull Color selectedTextColor

the color to use for the text label when the item is selected.

@NonNull Color selectedIndicatorColor

the color to use for the indicator when the item is selected.

@NonNull Color unselectedIconColor

the color to use for the icon when the item is unselected.

@NonNull Color unselectedTextColor

the color to use for the text label when the item is unselected.

@NonNull Color disabledIconColor

the color to use for the icon when the item is disabled.

@NonNull Color disabledTextColor

the color to use for the text label when the item is disabled.

Public methods

copy

public final @NonNull NavigationRailItemColors copy(
    @NonNull Color selectedIconColor,
    @NonNull Color selectedTextColor,
    @NonNull Color selectedIndicatorColor,
    @NonNull Color unselectedIconColor,
    @NonNull Color unselectedTextColor,
    @NonNull Color disabledIconColor,
    @NonNull Color disabledTextColor
)

Returns a copy of this NavigationRailItemColors, 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)

getDisabledIconColor

public final @NonNull Color getDisabledIconColor()

the color to use for the icon when the item is disabled.

getDisabledTextColor

public final @NonNull Color getDisabledTextColor()

the color to use for the text label when the item is disabled.

getSelectedIconColor

public final @NonNull Color getSelectedIconColor()

the color to use for the icon when the item is selected.

getSelectedIndicatorColor

public final @NonNull Color getSelectedIndicatorColor()

the color to use for the indicator when the item is selected.

getSelectedTextColor

public final @NonNull Color getSelectedTextColor()

the color to use for the text label when the item is selected.

getUnselectedIconColor

public final @NonNull Color getUnselectedIconColor()

the color to use for the icon when the item is unselected.

getUnselectedTextColor

public final @NonNull Color getUnselectedTextColor()

the color to use for the text label when the item is unselected.

hashCode

public int hashCode()